All Classes Namespaces Functions Variables Typedefs Enumerations Pages
nurbsdisk.h
1 /*
2  OpenMBV - Open Multi Body Viewer.
3  Copyright (C) 2009 Markus Friedrich
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */
19 
20 #ifndef _OPENMBV_NURBSDISK_H_
21 #define _OPENMBV_NURBSDISK_H_
22 
23 #include <openmbvcppinterface/dynamiccoloredbody.h>
24 #include <hdf5serie/vectorserie.h>
25 #include <vector>
26 #include <assert.h>
27 #include <stdexcept>
28 
29 namespace OpenMBV {
30 
40  class NurbsDisk : public DynamicColoredBody {
41  friend class ObjectFactory;
42  public:
44  std::string getClassName() { return "NurbsDisk"; }
45 
46 
48  void setLocalFrame(bool f) { localFrameStr=(f==true)?"true":"false"; }
49 
50  bool getLocalFrame() { return localFrameStr=="true"?true:false; }
51 
53  void setScaleFactor(const double scale) {
54  scaleFactor=scale;
55  }
56 
57  double getScaleFactor() { return scaleFactor; }
58 
60  void setDrawDegree(int drawDegree_) {
61  drawDegree=drawDegree_;
62  }
63 
64  int getDrawDegree() { return drawDegree; }
65 
67  void setRadii(double Ri_, double Ro_) {
68  Ri=Ri_;
69  Ro=Ro_;
70  }
71 
73  void setRi(double Ri_) {
74  Ri=Ri_;
75  }
76 
78  void setRo(double Ro_) {
79  Ro=Ro_;
80  }
81 
82  double getRi() { return Ri; }
83  double getRo() { return Ro; }
84 
88  void setKnotVecAzimuthal(const std::vector<double> &KnotVecAzimuthal_) {
89  KnotVecAzimuthal=KnotVecAzimuthal_;
90  }
91 
92  std::vector<double> getKnotVecAzimuthal() { return KnotVecAzimuthal; }
93 
97  void setKnotVecRadial(const std::vector<double> &KnotVecRadial_) {
98  KnotVecRadial=KnotVecRadial_;
99  }
100 
101  std::vector<double> getKnotVecRadial() { return KnotVecRadial; }
102 
104  void setElementNumberAzimuthal(int ElementNumberAzimuthal_) {
105  ElementNumberAzimuthal=ElementNumberAzimuthal_;
106  }
107 
108  int getElementNumberAzimuthal() { return ElementNumberAzimuthal; }
109 
111  void setElementNumberRadial(int ElementNumberRadial_) {
112  ElementNumberRadial=ElementNumberRadial_;
113  }
114 
115  int getElementNumberRadial() { return ElementNumberRadial; }
116 
118  void setInterpolationDegreeRadial(int InterpolationDegreeRadial_) {
119  InterpolationDegreeRadial=InterpolationDegreeRadial_;
120  }
121 
122  int getInterpolationDegreeRadial() { return InterpolationDegreeRadial; }
123 
125  void setInterpolationDegreeAzimuthal(int InterpolationDegreeAzimuthal_) {
126  InterpolationDegreeAzimuthal=InterpolationDegreeAzimuthal_;
127  }
128 
129  int getInterpolationDegreeAzimuthal() { return InterpolationDegreeAzimuthal; }
131  void setDiskNormal(float *DiskNormal_) {
132  DiskNormal=DiskNormal_;
133  }
134 
135  float* getDiskNormal() { return DiskNormal; }
136 
138  void setDiskPoint(float *DiskPoint_) {
139  DiskPoint=DiskPoint_;
140  }
141 
142  float* getDiskPoint() { return DiskPoint; }
143 
145  template<typename T>
146  void append(const T& row) {
147  if(data==0) throw std::runtime_error("can not append data to an environment object");
148  data->append(row);
149  }
150 
151  int getRows() { return data?data->getRows():-1; }
152  std::vector<double> getRow(int i) {
153  int NodeDofs = (getElementNumberRadial() + 1) * (getElementNumberAzimuthal() + getInterpolationDegreeAzimuthal());
154  return data?data->getRow(i):std::vector<double>(7+3*NodeDofs+3*getElementNumberAzimuthal()*drawDegree*2);
155  }
156 
158  virtual void initializeUsingXML(xercesc::DOMElement *element);
159 
161  xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *parent);
162  protected:
163  NurbsDisk();
164  virtual ~NurbsDisk();
165 
168 
172  std::string localFrameStr;
173 
175  double scaleFactor;
176 
179 
181  double Ri, Ro;
182 
184  int ElementNumberAzimuthal, ElementNumberRadial;
185 
187  int InterpolationDegreeAzimuthal, InterpolationDegreeRadial;
188 
190  std::vector<double> KnotVecAzimuthal, KnotVecRadial;
191 
193  float *DiskNormal;
194 
196  float *DiskPoint;
197 
199  void createHDF5File();
200  void openHDF5File();
201  };
202 
203 }
204 
205 #endif /* _OPENMBV_NURBSDISK_H_ */
206 
int InterpolationDegreeAzimuthal
Definition: nurbsdisk.h:187
int drawDegree
Definition: nurbsdisk.h:178
void setLocalFrame(bool f)
Definition: nurbsdisk.h:48
void setRi(double Ri_)
Definition: nurbsdisk.h:73
Class for all bodies with a NURBS surface and a primitive closure.
Definition: nurbsdisk.h:40
Definition: objectfactory.h:40
double scaleFactor
Definition: nurbsdisk.h:175
void createHDF5File()
Definition: nurbsdisk.cc:74
void setElementNumberAzimuthal(int ElementNumberAzimuthal_)
Definition: nurbsdisk.h:104
void setDiskNormal(float *DiskNormal_)
Definition: nurbsdisk.h:131
std::string getClassName()
Definition: nurbsdisk.h:44
void setKnotVecAzimuthal(const std::vector< double > &KnotVecAzimuthal_)
Definition: nurbsdisk.h:88
void setDiskPoint(float *DiskPoint_)
Definition: nurbsdisk.h:138
void setInterpolationDegreeRadial(int InterpolationDegreeRadial_)
Definition: nurbsdisk.h:118
void setRadii(double Ri_, double Ro_)
Definition: nurbsdisk.h:67
void setKnotVecRadial(const std::vector< double > &KnotVecRadial_)
Definition: nurbsdisk.h:97
void setInterpolationDegreeAzimuthal(int InterpolationDegreeAzimuthal_)
Definition: nurbsdisk.h:125
std::vector< double > KnotVecAzimuthal
Definition: nurbsdisk.h:190
Definition: dynamiccoloredbody.h:28
float * DiskNormal
Definition: nurbsdisk.h:193
virtual void initializeUsingXML(xercesc::DOMElement *element)
Definition: nurbsdisk.cc:123
H5::VectorSerie< double > * data
Definition: nurbsdisk.h:167
void setRo(double Ro_)
Definition: nurbsdisk.h:78
float * DiskPoint
Definition: nurbsdisk.h:196
void append(const T &row)
Definition: nurbsdisk.h:146
int getRows()
Definition: nurbsdisk.h:151
void getRow(const int row, size_t size, T data[])
void setDrawDegree(int drawDegree_)
Definition: nurbsdisk.h:60
void setScaleFactor(const double scale)
Definition: nurbsdisk.h:53
void append(const T data[], size_t size)
double Ri
Definition: nurbsdisk.h:181
std::vector< double > getRow(int i)
Definition: nurbsdisk.h:152
void setElementNumberRadial(int ElementNumberRadial_)
Definition: nurbsdisk.h:111
int ElementNumberAzimuthal
Definition: nurbsdisk.h:184
std::string localFrameStr
String that contains, whether reference Frame should be drawn (=&quot;True&quot;) or not (=&quot;False&quot;) ...
Definition: nurbsdisk.h:172
xercesc::DOMElement * writeXMLFile(xercesc::DOMNode *parent)
Definition: nurbsdisk.cc:53

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML