HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  }
54  {
55  return !operator==(src);
56  }
57 
58 
59 
60  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
61  {
62  if (true)
63  OP_Utils::evalOpParm(myTetGroup, node, "tetgroup", time, 0);
64  else myTetGroup = ""_sh;
65  if (true)
66  OP_Utils::evalOpParm(myPolyGroup, node, "polygroup", time, 0);
67  else myPolyGroup = ""_sh;
68  if (true)
69  OP_Utils::evalOpParm(myKeepPolygons, node, "keeppolygons", time, 0);
70  else myKeepPolygons = false;
71  if (true)
72  OP_Utils::evalOpParm(mySolidBdry, node, "solidbdry", time, 0);
73  else mySolidBdry = 0;
74  if (true)
75  OP_Utils::evalOpParm(myOutputSolidity, node, "outputsolidity", time, 0);
76  else myOutputSolidity = false;
77  if (true && ( (!(((getOutputSolidity()==0)))) ) )
78  OP_Utils::evalOpParm(mySolidityAttrib, node, "solidityattrib", time, 0);
79  else mySolidityAttrib = "solidity"_sh;
80 
81  }
82 
83 
84  virtual void loadFromOpSubclass(const LoadParms &loadparms)
85  {
86  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
87  }
88 
89 
90  virtual void copyFrom(const SOP_NodeParms *src)
91  {
92  *this = *((const SOP_Solidify_2_0Parms *)src);
93  }
94 
95  template <typename T>
96  void
97  doGetParmValue(exint idx, T &value) const
98  {
99  switch (idx)
100  {
101  case 0:
102  coerceValue(value, myTetGroup);
103  break;
104  case 1:
105  coerceValue(value, myPolyGroup);
106  break;
107  case 2:
108  coerceValue(value, myKeepPolygons);
109  break;
110  case 3:
111  coerceValue(value, mySolidBdry);
112  break;
113  case 4:
114  coerceValue(value, myOutputSolidity);
115  break;
116  case 5:
117  coerceValue(value, mySolidityAttrib);
118  break;
119 
120  }
121  }
122 
123  void getParmValue(exint idx, exint &value) const
124  { doGetParmValue(idx, value); }
125  void getParmValue(exint idx, fpreal &value) const
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); }
142  { doGetParmValue(idx, value); }
144  { doGetParmValue(idx, value); }
145 
146  template <typename T>
147  void
148  doSetParmValue(exint idx, const T &value)
149  {
150  switch (idx)
151  {
152  case 0:
153  coerceValue(myTetGroup, value);
154  break;
155  case 1:
156  coerceValue(myPolyGroup, value);
157  break;
158  case 2:
159  coerceValue(myKeepPolygons, value);
160  break;
161  case 3:
162  coerceValue(mySolidBdry, value);
163  break;
164  case 4:
165  coerceValue(myOutputSolidity, value);
166  break;
167  case 5:
168  coerceValue(mySolidityAttrib, value);
169  break;
170 
171  }
172  }
173 
174  void setParmValue(exint idx, const exint &value)
175  { doSetParmValue(idx, value); }
176  void setParmValue(exint idx, const fpreal &value)
177  { doSetParmValue(idx, value); }
178  void setParmValue(exint idx, const UT_Vector2D &value)
179  { doSetParmValue(idx, value); }
180  void setParmValue(exint idx, const UT_Vector3D &value)
181  { doSetParmValue(idx, value); }
182  void setParmValue(exint idx, const UT_Vector4D &value)
183  { doSetParmValue(idx, value); }
184  void setParmValue(exint idx, const UT_Matrix2D &value)
185  { doSetParmValue(idx, value); }
186  void setParmValue(exint idx, const UT_Matrix3D &value)
187  { doSetParmValue(idx, value); }
188  void setParmValue(exint idx, const UT_Matrix4D &value)
189  { doSetParmValue(idx, value); }
191  { doSetParmValue(idx, value); }
193  { doSetParmValue(idx, value); }
195  { doSetParmValue(idx, value); }
196 
197  virtual exint getNumParms() const
198  {
199  return 6;
200  }
201 
202  virtual const char *getParmName(exint fieldnum) const
203  {
204  switch (fieldnum)
205  {
206  case 0:
207  return "tetgroup";
208  case 1:
209  return "polygroup";
210  case 2:
211  return "keeppolygons";
212  case 3:
213  return "solidbdry";
214  case 4:
215  return "outputsolidity";
216  case 5:
217  return "solidityattrib";
218 
219  }
220  return 0;
221  }
222 
223  virtual ParmType getParmType(exint fieldnum) const
224  {
225  switch (fieldnum)
226  {
227  case 0:
228  return PARM_STRING;
229  case 1:
230  return PARM_STRING;
231  case 2:
232  return PARM_INTEGER;
233  case 3:
234  return PARM_FLOAT;
235  case 4:
236  return PARM_INTEGER;
237  case 5:
238  return PARM_STRING;
239 
240  }
241  return PARM_UNSUPPORTED;
242  }
243 
244  // Boiler plate to load individual types.
245  static void loadData(UT_IStream &is, int64 &v)
246  { is.bread(&v, 1); }
247  static void loadData(UT_IStream &is, bool &v)
248  { int64 iv; is.bread(&iv, 1); v = iv; }
249  static void loadData(UT_IStream &is, fpreal64 &v)
250  { is.bread<fpreal64>(&v, 1); }
251  static void loadData(UT_IStream &is, UT_Vector2D &v)
252  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
253  static void loadData(UT_IStream &is, UT_Vector3D &v)
254  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
255  is.bread<fpreal64>(&v.z(), 1); }
256  static void loadData(UT_IStream &is, UT_Vector4D &v)
257  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
258  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
259  static void loadData(UT_IStream &is, UT_Matrix2D &v)
260  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
261  static void loadData(UT_IStream &is, UT_Matrix3D &v)
262  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
263  static void loadData(UT_IStream &is, UT_Matrix4D &v)
264  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
265  static void loadData(UT_IStream &is, UT_Vector2I &v)
266  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
267  static void loadData(UT_IStream &is, UT_Vector3I &v)
268  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
269  is.bread<int64>(&v.z(), 1); }
270  static void loadData(UT_IStream &is, UT_Vector4I &v)
271  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
272  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
274  { is.bread(v); }
276  { UT_StringHolder rampdata;
277  loadData(is, rampdata);
278  if (rampdata.isstring())
279  {
280  v.reset(new UT_Ramp());
281  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
282  v->load(istr);
283  }
284  else v.reset();
285  }
288  loadData(is, data);
289  if (data.isstring())
290  {
291  // Find the data type.
292  char *colon = UT_StringWrap(data).findChar(':');
293  if (colon)
294  {
295  int typelen = colon - data.buffer();
297  type.strncpy(data.buffer(), typelen);
298  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
299 
300  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
301  }
302  }
303  else v.reset();
304  }
305 
306  static void saveData(std::ostream &os, int64 v)
307  { UTwrite(os, &v); }
308  static void saveData(std::ostream &os, bool v)
309  { int64 iv = v; UTwrite(os, &iv); }
310  static void saveData(std::ostream &os, fpreal64 v)
311  { UTwrite<fpreal64>(os, &v); }
312  static void saveData(std::ostream &os, UT_Vector2D v)
313  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
314  static void saveData(std::ostream &os, UT_Vector3D v)
315  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
316  UTwrite<fpreal64>(os, &v.z()); }
317  static void saveData(std::ostream &os, UT_Vector4D v)
318  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
319  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
320  static void saveData(std::ostream &os, UT_Matrix2D v)
322  static void saveData(std::ostream &os, UT_Matrix3D v)
324  static void saveData(std::ostream &os, UT_Matrix4D v)
326  static void saveData(std::ostream &os, UT_StringHolder s)
327  { UT_StringWrap(s).saveBinary(os); }
328  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
329  { UT_StringHolder result;
330  UT_OStringStream ostr;
331  if (s) s->save(ostr);
332  result = ostr.str();
333  saveData(os, result);
334  }
335  static void saveData(std::ostream &os, PRM_DataItemHandle s)
336  { UT_StringHolder result;
337  UT_OStringStream ostr;
338  if (s)
339  {
340  ostr << s->getDataTypeToken();
341  ostr << ":";
342  s->saveBinary(ostr);
343  }
344  result = ostr.str();
345  saveData(os, result);
346  }
347 
348 
349  void save(std::ostream &os) const
350  {
351  int32 v = version();
352  UTwrite(os, &v);
353  saveData(os, myTetGroup);
354  saveData(os, myPolyGroup);
355  saveData(os, myKeepPolygons);
356  saveData(os, mySolidBdry);
357  saveData(os, myOutputSolidity);
358  saveData(os, mySolidityAttrib);
359 
360  }
361 
362  bool load(UT_IStream &is)
363  {
364  int32 v;
365  is.bread(&v, 1);
366  if (version() != v)
367  {
368  // Fail incompatible versions
369  return false;
370  }
371  loadData(is, myTetGroup);
372  loadData(is, myPolyGroup);
373  loadData(is, myKeepPolygons);
374  loadData(is, mySolidBdry);
375  loadData(is, myOutputSolidity);
376  loadData(is, mySolidityAttrib);
377 
378  return true;
379  }
380 
381  const UT_StringHolder & getTetGroup() const { return myTetGroup; }
382  void setTetGroup(const UT_StringHolder & val) { myTetGroup = val; }
384  {
385  SOP_Node *thissop = cookparms.getNode();
386  if (!thissop) return getTetGroup();
387  UT_StringHolder result;
388  OP_Utils::evalOpParm(result, thissop, "tetgroup", cookparms.getCookTime(), 0);
389  return result;
390  }
391  const UT_StringHolder & getPolyGroup() const { return myPolyGroup; }
392  void setPolyGroup(const UT_StringHolder & val) { myPolyGroup = val; }
394  {
395  SOP_Node *thissop = cookparms.getNode();
396  if (!thissop) return getPolyGroup();
397  UT_StringHolder result;
398  OP_Utils::evalOpParm(result, thissop, "polygroup", cookparms.getCookTime(), 0);
399  return result;
400  }
401  bool getKeepPolygons() const { return myKeepPolygons; }
402  void setKeepPolygons(bool val) { myKeepPolygons = val; }
403  bool opKeepPolygons(const SOP_NodeVerb::CookParms &cookparms) const
404  {
405  SOP_Node *thissop = cookparms.getNode();
406  if (!thissop) return getKeepPolygons();
407  bool result;
408  OP_Utils::evalOpParm(result, thissop, "keeppolygons", cookparms.getCookTime(), 0);
409  return result;
410  }
411  fpreal64 getSolidBdry() const { return mySolidBdry; }
412  void setSolidBdry(fpreal64 val) { mySolidBdry = val; }
414  {
415  SOP_Node *thissop = cookparms.getNode();
416  if (!thissop) return getSolidBdry();
417  fpreal64 result;
418  OP_Utils::evalOpParm(result, thissop, "solidbdry", cookparms.getCookTime(), 0);
419  return result;
420  }
421  bool getOutputSolidity() const { return myOutputSolidity; }
422  void setOutputSolidity(bool val) { myOutputSolidity = val; }
423  bool opOutputSolidity(const SOP_NodeVerb::CookParms &cookparms) const
424  {
425  SOP_Node *thissop = cookparms.getNode();
426  if (!thissop) return getOutputSolidity();
427  bool result;
428  OP_Utils::evalOpParm(result, thissop, "outputsolidity", cookparms.getCookTime(), 0);
429  return result;
430  }
431  const UT_StringHolder & getSolidityAttrib() const { return mySolidityAttrib; }
432  void setSolidityAttrib(const UT_StringHolder & val) { mySolidityAttrib = val; }
434  {
435  SOP_Node *thissop = cookparms.getNode();
436  if (!thissop) return getSolidityAttrib();
437  UT_StringHolder result;
438  OP_Utils::evalOpParm(result, thissop, "solidityattrib", cookparms.getCookTime(), 0);
439  return result;
440  }
441 
442 private:
443  UT_StringHolder myTetGroup;
444  UT_StringHolder myPolyGroup;
445  bool myKeepPolygons;
446  fpreal64 mySolidBdry;
447  bool myOutputSolidity;
448  UT_StringHolder mySolidityAttrib;
449 
450 };
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:494
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
T & z(void)
Definition: UT_Vector4.h:379
void getParmValue(exint idx, PRM_DataItemHandle &value) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
fpreal getTime() const
Definition: OP_Context.h:60
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)
SYS_FORCE_INLINE const char * buffer() const
T & x(void)
Definition: UT_Vector2.h:285
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:498
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:502
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
long long int64
Definition: SYS_Types.h:107
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
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
int64 exint
Definition: SYS_Types.h:116
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:192
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:35
T & y(void)
Definition: UT_Vector4.h:377
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
GT_API const UT_StringHolder version
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:500
GLsizei const GLfloat * value
Definition: glcorearb.h:823
void getParmValue(exint idx, UT_Matrix3D &value) const
double fpreal
Definition: SYS_Types.h:270
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
bool operator!=(const SOP_Solidify_2_0Parms &src) const
void setParmValue(exint idx, const UT_StringHolder &value)
#define SOP_API
Definition: SOP_API.h:10
void getParmValue(exint idx, UT_Matrix4D &value) 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:501
T & x(void)
Definition: UT_Vector4.h:375
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool load(UT_IStream &is)
T & y(void)
Definition: UT_Vector2.h:287
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:381
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:88
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)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
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)