HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SOP_Solidify-2.0.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_NodeVerb.h>
7 #include <OP/OP_Utils.h>
8 #include <PRM/PRM_Parm.h>
9 #include <UT/UT_IStream.h>
10 #include <UT/UT_NTStreamUtil.h>
11 #include <UT/UT_Ramp.h>
12 #include <UT/UT_SharedPtr.h>
13 #include <UT/UT_StringHolder.h>
14 #include <UT/UT_StringStream.h>
15 #include <UT/UT_VectorTypes.h>
16 #include <SYS/SYS_Types.h>
17 
18 using namespace UT::Literal;
19 
20 class DEP_MicroNode;
21 
23 {
24 public:
25  static int version() { return 1; }
26 
28  {
29  myTetGroup = ""_sh;
30  myPolyGroup = ""_sh;
31  myKeepPolygons = false;
32  mySolidBdry = 0;
33  myOutputSolidity = false;
34  mySolidityAttrib = "solidity"_sh;
35 
36  }
37 
38  explicit SOP_Solidify_2_0Parms(const SOP_Solidify_2_0Parms &) = default;
39 
41 
43  {
44  if (myTetGroup != src.myTetGroup) return false;
45  if (myPolyGroup != src.myPolyGroup) return false;
46  if (myKeepPolygons != src.myKeepPolygons) return false;
47  if (mySolidBdry != src.mySolidBdry) return false;
48  if (myOutputSolidity != src.myOutputSolidity) return false;
49  if (mySolidityAttrib != src.mySolidityAttrib) return false;
50 
51  return true;
52  }
53 
54 
55 
56  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
57  {
58  if (true)
59  OP_Utils::evalOpParm(myTetGroup, node, "tetgroup", time, 0);
60  else myTetGroup = ""_sh;
61  if (true)
62  OP_Utils::evalOpParm(myPolyGroup, node, "polygroup", time, 0);
63  else myPolyGroup = ""_sh;
64  if (true)
65  OP_Utils::evalOpParm(myKeepPolygons, node, "keeppolygons", time, 0);
66  else myKeepPolygons = false;
67  if (true)
68  OP_Utils::evalOpParm(mySolidBdry, node, "solidbdry", time, 0);
69  else mySolidBdry = 0;
70  if (true)
71  OP_Utils::evalOpParm(myOutputSolidity, node, "outputsolidity", time, 0);
72  else myOutputSolidity = false;
73  if (true && ( (!(((getOutputSolidity()==0)))) ) )
74  OP_Utils::evalOpParm(mySolidityAttrib, node, "solidityattrib", time, 0);
75  else mySolidityAttrib = "solidity"_sh;
76 
77  }
78 
79 
80  virtual void loadFromOpSubclass(const LoadParms &loadparms)
81  {
82  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
83  }
84 
85 
86  virtual void copyFrom(const SOP_NodeParms *src)
87  {
88  *this = *((const SOP_Solidify_2_0Parms *)src);
89  }
90 
91  template <typename T>
92  void
93  doGetParmValue(exint idx, T &value) const
94  {
95  switch (idx)
96  {
97  case 0:
98  coerceValue(value, myTetGroup);
99  break;
100  case 1:
101  coerceValue(value, myPolyGroup);
102  break;
103  case 2:
104  coerceValue(value, myKeepPolygons);
105  break;
106  case 3:
107  coerceValue(value, mySolidBdry);
108  break;
109  case 4:
110  coerceValue(value, myOutputSolidity);
111  break;
112  case 5:
113  coerceValue(value, mySolidityAttrib);
114  break;
115 
116  }
117  }
118 
119  void getParmValue(exint idx, exint &value) const
120  { doGetParmValue(idx, value); }
121  void getParmValue(exint idx, fpreal &value) const
122  { doGetParmValue(idx, value); }
124  { doGetParmValue(idx, value); }
126  { doGetParmValue(idx, value); }
128  { doGetParmValue(idx, value); }
130  { doGetParmValue(idx, value); }
132  { doGetParmValue(idx, value); }
134  { doGetParmValue(idx, value); }
136  { doGetParmValue(idx, value); }
138  { doGetParmValue(idx, value); }
140  { doGetParmValue(idx, value); }
141 
142  template <typename T>
143  void
144  doSetParmValue(exint idx, const T &value)
145  {
146  switch (idx)
147  {
148  case 0:
149  coerceValue(myTetGroup, value);
150  break;
151  case 1:
152  coerceValue(myPolyGroup, value);
153  break;
154  case 2:
155  coerceValue(myKeepPolygons, value);
156  break;
157  case 3:
158  coerceValue(mySolidBdry, value);
159  break;
160  case 4:
161  coerceValue(myOutputSolidity, value);
162  break;
163  case 5:
164  coerceValue(mySolidityAttrib, value);
165  break;
166 
167  }
168  }
169 
170  void setParmValue(exint idx, const exint &value)
171  { doSetParmValue(idx, value); }
172  void setParmValue(exint idx, const fpreal &value)
173  { doSetParmValue(idx, value); }
174  void setParmValue(exint idx, const UT_Vector2D &value)
175  { doSetParmValue(idx, value); }
176  void setParmValue(exint idx, const UT_Vector3D &value)
177  { doSetParmValue(idx, value); }
178  void setParmValue(exint idx, const UT_Vector4D &value)
179  { doSetParmValue(idx, value); }
180  void setParmValue(exint idx, const UT_Matrix2D &value)
181  { doSetParmValue(idx, value); }
182  void setParmValue(exint idx, const UT_Matrix3D &value)
183  { doSetParmValue(idx, value); }
184  void setParmValue(exint idx, const UT_Matrix4D &value)
185  { doSetParmValue(idx, value); }
187  { doSetParmValue(idx, value); }
189  { doSetParmValue(idx, value); }
191  { doSetParmValue(idx, value); }
192 
193  virtual exint getNumParms() const
194  {
195  return 6;
196  }
197 
198  virtual const char *getParmName(exint fieldnum) const
199  {
200  switch (fieldnum)
201  {
202  case 0:
203  return "tetgroup";
204  case 1:
205  return "polygroup";
206  case 2:
207  return "keeppolygons";
208  case 3:
209  return "solidbdry";
210  case 4:
211  return "outputsolidity";
212  case 5:
213  return "solidityattrib";
214 
215  }
216  return 0;
217  }
218 
219  virtual ParmType getParmType(exint fieldnum) const
220  {
221  switch (fieldnum)
222  {
223  case 0:
224  return PARM_STRING;
225  case 1:
226  return PARM_STRING;
227  case 2:
228  return PARM_INTEGER;
229  case 3:
230  return PARM_FLOAT;
231  case 4:
232  return PARM_INTEGER;
233  case 5:
234  return PARM_STRING;
235 
236  }
237  return PARM_UNSUPPORTED;
238  }
239 
240  // Boiler plate to load individual types.
241  static void loadData(UT_IStream &is, int64 &v)
242  { is.bread(&v, 1); }
243  static void loadData(UT_IStream &is, bool &v)
244  { int64 iv; is.bread(&iv, 1); v = iv; }
245  static void loadData(UT_IStream &is, fpreal64 &v)
246  { is.bread<fpreal64>(&v, 1); }
247  static void loadData(UT_IStream &is, UT_Vector2D &v)
248  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
249  static void loadData(UT_IStream &is, UT_Vector3D &v)
250  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
251  is.bread<fpreal64>(&v.z(), 1); }
252  static void loadData(UT_IStream &is, UT_Vector4D &v)
253  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
254  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
255  static void loadData(UT_IStream &is, UT_Matrix2D &v)
256  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
257  static void loadData(UT_IStream &is, UT_Matrix3D &v)
258  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
259  static void loadData(UT_IStream &is, UT_Matrix4D &v)
260  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
261  static void loadData(UT_IStream &is, UT_Vector2I &v)
262  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
263  static void loadData(UT_IStream &is, UT_Vector3I &v)
264  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
265  is.bread<int64>(&v.z(), 1); }
266  static void loadData(UT_IStream &is, UT_Vector4I &v)
267  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
268  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
270  { is.bread(v); }
272  { UT_StringHolder rampdata;
273  loadData(is, rampdata);
274  if (rampdata.isstring())
275  {
276  v.reset(new UT_Ramp());
277  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
278  v->load(istr);
279  }
280  else v.reset();
281  }
284  loadData(is, data);
285  if (data.isstring())
286  {
287  // Find the data type.
288  char *colon = UT_StringWrap(data).findChar(':');
289  if (colon)
290  {
291  int typelen = colon - data.buffer();
293  type.strncpy(data.buffer(), typelen);
294  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
295 
296  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
297  }
298  }
299  else v.reset();
300  }
301 
302  static void saveData(std::ostream &os, int64 v)
303  { UTwrite(os, &v); }
304  static void saveData(std::ostream &os, bool v)
305  { int64 iv = v; UTwrite(os, &iv); }
306  static void saveData(std::ostream &os, fpreal64 v)
307  { UTwrite<fpreal64>(os, &v); }
308  static void saveData(std::ostream &os, UT_Vector2D v)
309  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
310  static void saveData(std::ostream &os, UT_Vector3D v)
311  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
312  UTwrite<fpreal64>(os, &v.z()); }
313  static void saveData(std::ostream &os, UT_Vector4D v)
314  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
315  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
316  static void saveData(std::ostream &os, UT_Matrix2D v)
318  static void saveData(std::ostream &os, UT_Matrix3D v)
320  static void saveData(std::ostream &os, UT_Matrix4D v)
322  static void saveData(std::ostream &os, UT_StringHolder s)
323  { UT_StringWrap(s).saveBinary(os); }
324  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
325  { UT_StringHolder result;
326  UT_OStringStream ostr;
327  if (s) s->save(ostr);
328  result = ostr.str();
329  saveData(os, result);
330  }
331  static void saveData(std::ostream &os, PRM_DataItemHandle s)
332  { UT_StringHolder result;
333  UT_OStringStream ostr;
334  if (s)
335  {
336  ostr << s->getDataTypeToken();
337  ostr << ":";
338  s->saveBinary(ostr);
339  }
340  result = ostr.str();
341  saveData(os, result);
342  }
343 
344 
345  void save(std::ostream &os) const
346  {
347  int32 v = version();
348  UTwrite(os, &v);
349  saveData(os, myTetGroup);
350  saveData(os, myPolyGroup);
351  saveData(os, myKeepPolygons);
352  saveData(os, mySolidBdry);
353  saveData(os, myOutputSolidity);
354  saveData(os, mySolidityAttrib);
355 
356  }
357 
358  bool load(UT_IStream &is)
359  {
360  int32 v;
361  is.bread(&v, 1);
362  if (version() != v)
363  {
364  // Fail incompatible versions
365  return false;
366  }
367  loadData(is, myTetGroup);
368  loadData(is, myPolyGroup);
369  loadData(is, myKeepPolygons);
370  loadData(is, mySolidBdry);
371  loadData(is, myOutputSolidity);
372  loadData(is, mySolidityAttrib);
373 
374  return true;
375  }
376 
377  const UT_StringHolder & getTetGroup() const { return myTetGroup; }
378  void setTetGroup(const UT_StringHolder & val) { myTetGroup = val; }
380  {
381  SOP_Node *thissop = cookparms.getNode();
382  if (!thissop) return getTetGroup();
383  UT_StringHolder result;
384  OP_Utils::evalOpParm(result, thissop, "tetgroup", cookparms.getCookTime(), 0);
385  return result;
386  }
387  const UT_StringHolder & getPolyGroup() const { return myPolyGroup; }
388  void setPolyGroup(const UT_StringHolder & val) { myPolyGroup = val; }
390  {
391  SOP_Node *thissop = cookparms.getNode();
392  if (!thissop) return getPolyGroup();
393  UT_StringHolder result;
394  OP_Utils::evalOpParm(result, thissop, "polygroup", cookparms.getCookTime(), 0);
395  return result;
396  }
397  bool getKeepPolygons() const { return myKeepPolygons; }
398  void setKeepPolygons(bool val) { myKeepPolygons = val; }
399  bool opKeepPolygons(const SOP_NodeVerb::CookParms &cookparms) const
400  {
401  SOP_Node *thissop = cookparms.getNode();
402  if (!thissop) return getKeepPolygons();
403  bool result;
404  OP_Utils::evalOpParm(result, thissop, "keeppolygons", cookparms.getCookTime(), 0);
405  return result;
406  }
407  fpreal64 getSolidBdry() const { return mySolidBdry; }
408  void setSolidBdry(fpreal64 val) { mySolidBdry = val; }
410  {
411  SOP_Node *thissop = cookparms.getNode();
412  if (!thissop) return getSolidBdry();
413  fpreal64 result;
414  OP_Utils::evalOpParm(result, thissop, "solidbdry", cookparms.getCookTime(), 0);
415  return result;
416  }
417  bool getOutputSolidity() const { return myOutputSolidity; }
418  void setOutputSolidity(bool val) { myOutputSolidity = val; }
419  bool opOutputSolidity(const SOP_NodeVerb::CookParms &cookparms) const
420  {
421  SOP_Node *thissop = cookparms.getNode();
422  if (!thissop) return getOutputSolidity();
423  bool result;
424  OP_Utils::evalOpParm(result, thissop, "outputsolidity", cookparms.getCookTime(), 0);
425  return result;
426  }
427  const UT_StringHolder & getSolidityAttrib() const { return mySolidityAttrib; }
428  void setSolidityAttrib(const UT_StringHolder & val) { mySolidityAttrib = val; }
430  {
431  SOP_Node *thissop = cookparms.getNode();
432  if (!thissop) return getSolidityAttrib();
433  UT_StringHolder result;
434  OP_Utils::evalOpParm(result, thissop, "solidityattrib", cookparms.getCookTime(), 0);
435  return result;
436  }
437 
438 private:
439  UT_StringHolder myTetGroup;
440  UT_StringHolder myPolyGroup;
441  bool myKeepPolygons;
442  fpreal64 mySolidBdry;
443  bool myOutputSolidity;
444  UT_StringHolder mySolidityAttrib;
445 
446 };
void setParmValue(exint idx, const UT_Vector2D &value)
fpreal64 opSolidBdry(const SOP_NodeVerb::CookParms &cookparms) const
void doSetParmValue(exint idx, const T &value)
void setPolyGroup(const UT_StringHolder &val)
void getParmValue(exint idx, UT_Vector2D &value) const
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:492
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
T & z(void)
Definition: UT_Vector4.h:372
void getParmValue(exint idx, PRM_DataItemHandle &value) const
exint bread(int32 *buffer, exint asize=1)
fpreal getTime() const
Definition: OP_Context.h:34
const UT_StringHolder & getPolyGroup() const
const GLdouble * v
Definition: glcorearb.h:836
void setParmValue(exint idx, const UT_Vector3D &value)
void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
virtual ParmType getParmType(exint fieldnum) const
void getParmValue(exint idx, exint &value) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
T & x(void)
Definition: UT_Vector2.h:284
void setParmValue(exint idx, const UT_Matrix4D &value)
static void loadData(UT_IStream &is, UT_Vector2I &v)
An output stream object that owns its own string buffer storage.
const UT_StringHolder & getTetGroup() const
bool opOutputSolidity(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix2D v)
const UT_WorkBuffer & str() const
Returns a read-only reference to the underlying UT_WorkBuffer.
virtual exint getNumParms() const
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:581
static void saveData(std::ostream &os, UT_Vector4D v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setParmValue(exint idx, const fpreal &value)
fpreal64 getSolidBdry() const
void setParmValue(exint idx, const exint &value)
virtual const char * getParmName(exint fieldnum) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_StringHolder opPolyGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const UT_Vector4D &value)
bool operator==(const SOP_Solidify_2_0Parms &src) const
void setSolidityAttrib(const UT_StringHolder &val)
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:585
long long int64
Definition: SYS_Types.h:106
static void saveData(std::ostream &os, fpreal64 v)
void setParmValue(exint idx, const UT_Matrix2D &value)
void setTetGroup(const UT_StringHolder &val)
void doGetParmValue(exint idx, T &value) const
static void saveData(std::ostream &os, UT_Matrix3D v)
exint length() const
char * findChar(int c) const
Find first occurrance of character. Returns NULL upon failure.
Definition: UT_String.h:550
SYS_FORCE_INLINE const char * buffer() const
int64 exint
Definition: SYS_Types.h:115
const OP_Node * node() const
Definition: SOP_NodeVerb.h:104
static void loadData(UT_IStream &is, UT_Matrix4D &v)
double fpreal64
Definition: SYS_Types.h:191
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
virtual void copyFrom(const SOP_NodeParms *src)
void getParmValue(exint idx, UT_Vector4D &value) const
GLboolean * data
Definition: glcorearb.h:130
void setParmValue(exint idx, const PRM_DataItemHandle &value)
int int32
Definition: SYS_Types.h:34
T & y(void)
Definition: UT_Vector4.h:370
void getParmValue(exint idx, UT_Matrix2D &value) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
void getParmValue(exint idx, fpreal &value) const
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:111
bool opKeepPolygons(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getSolidityAttrib() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:583
GLsizei const GLfloat * value
Definition: glcorearb.h:823
void getParmValue(exint idx, UT_Matrix3D &value) const
double fpreal
Definition: SYS_Types.h:269
void strncpy(const char *src, exint maxlen)
void getParmValue(exint idx, UT_Vector3D &value) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_StringHolder s)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
static void loadData(UT_IStream &is, int64 &v)
GLuint GLfloat * val
Definition: glcorearb.h:1607
void setParmValue(exint idx, const UT_StringHolder &value)
#define SOP_API
Definition: SOP_API.h:10
void getParmValue(exint idx, UT_Matrix4D &value) const
const char * buffer() const
static void saveData(std::ostream &os, UT_Vector2D v)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:499
T & x(void)
Definition: UT_Vector4.h:368
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool load(UT_IStream &is)
T & y(void)
Definition: UT_Vector2.h:286
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
virtual void loadFromOpSubclass(const LoadParms &loadparms)
void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
GLboolean r
Definition: glcorearb.h:1221
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void saveData(std::ostream &os, UT_Vector3D v)
UT_StringHolder opSolidityAttrib(const SOP_NodeVerb::CookParms &cookparms) const
T & w(void)
Definition: UT_Vector4.h:374
void save(std::ostream &os) const
void setSolidBdry(fpreal64 val)
void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
const OP_Context & context() const
Definition: SOP_NodeVerb.h:109
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, bool &v)
UT_StringHolder opTetGroup(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE bool isstring() const
void setParmValue(exint idx, const UT_Matrix3D &value)
static void saveData(std::ostream &os, bool v)
static void saveData(std::ostream &os, UT_Matrix4D v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void getParmValue(exint idx, UT_StringHolder &value) const
static void saveData(std::ostream &os, int64 v)
GLenum src
Definition: glcorearb.h:1792
static void loadData(UT_IStream &is, UT_Vector2D &v)