HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Box.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_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <SOP/SOP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_BoxEnums
24 {
25  enum class Type
26  {
27  POLY = 0,
28  POLYMESH,
29  MESH,
30  NURBS,
31  BEZIER,
32  POINTS,
33  PRIM
34  };
35  enum class SurfType
36  {
37  ROWS = 0,
38  COLS,
39  ROWCOL,
40  TRIANGLES,
41  QUADS,
44  };
45 }
46 
47 
49 {
50 public:
51  static int version() { return 1; }
52 
54  {
55  myType = 0;
56  mySurfType = 4;
57  myConsolidatePoints = true;
58  mySize = UT_Vector3D(1,1,1);
59  myCenter = UT_Vector3D(0,0,0);
60  myRotate = UT_Vector3D(0,0,0);
61  myScale = 1;
62  myDivRate = UT_Vector3I(4,4,4);
63  myOrder = UT_Vector3I(4,4,4);
64  myDoDivs = false;
65  myDivs = UT_Vector3I(3,3,3);
66  myRebar = false;
67  myOrientedBoundingBox = false;
68  myVertexNormals = false;
69 
70  }
71 
72  explicit SOP_BoxParms(const SOP_BoxParms &) = default;
73  SOP_BoxParms &operator=(const SOP_BoxParms &) = default;
74  SOP_BoxParms(SOP_BoxParms &&) noexcept = default;
75  SOP_BoxParms &operator=(SOP_BoxParms &&) noexcept = default;
76 
77  ~SOP_BoxParms() override {}
78 
79  bool operator==(const SOP_BoxParms &src) const
80  {
81  if (myType != src.myType) return false;
82  if (mySurfType != src.mySurfType) return false;
83  if (myConsolidatePoints != src.myConsolidatePoints) return false;
84  if (mySize != src.mySize) return false;
85  if (myCenter != src.myCenter) return false;
86  if (myRotate != src.myRotate) return false;
87  if (myScale != src.myScale) return false;
88  if (myDivRate != src.myDivRate) return false;
89  if (myOrder != src.myOrder) return false;
90  if (myDoDivs != src.myDoDivs) return false;
91  if (myDivs != src.myDivs) return false;
92  if (myRebar != src.myRebar) return false;
93  if (myOrientedBoundingBox != src.myOrientedBoundingBox) return false;
94  if (myVertexNormals != src.myVertexNormals) return false;
95 
96  return true;
97  }
98  bool operator!=(const SOP_BoxParms &src) const
99  {
100  return !operator==(src);
101  }
104 
105 
106 
107  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
108  {
109  myType = 0;
110  if (true)
111  graph->evalOpParm(myType, nodeidx, "type", time, 0);
112  mySurfType = 4;
113  if (true)
114  graph->evalOpParm(mySurfType, nodeidx, "surftype", time, 0);
115  myConsolidatePoints = true;
116  if (true)
117  graph->evalOpParm(myConsolidatePoints, nodeidx, "consolidatepts", time, 0);
118  mySize = UT_Vector3D(1,1,1);
119  if (true)
120  graph->evalOpParm(mySize, nodeidx, "size", time, 0);
121  myCenter = UT_Vector3D(0,0,0);
122  if (true)
123  graph->evalOpParm(myCenter, nodeidx, "t", time, 0);
124  myRotate = UT_Vector3D(0,0,0);
125  if (true)
126  graph->evalOpParm(myRotate, nodeidx, "r", time, 0);
127  myScale = 1;
128  if (true)
129  graph->evalOpParm(myScale, nodeidx, "scale", time, 0);
130  myDivRate = UT_Vector3I(4,4,4);
131  if (true)
132  graph->evalOpParm(myDivRate, nodeidx, "divrate", time, 0);
133  myOrder = UT_Vector3I(4,4,4);
134  if (true)
135  graph->evalOpParm(myOrder, nodeidx, "orderrate", time, 0);
136  myDoDivs = false;
137  if (true)
138  graph->evalOpParm(myDoDivs, nodeidx, "dodivs", time, 0);
139  myDivs = UT_Vector3I(3,3,3);
140  if (true)
141  graph->evalOpParm(myDivs, nodeidx, "divs", time, 0);
142  myRebar = false;
143  if (true)
144  graph->evalOpParm(myRebar, nodeidx, "rebar", time, 0);
145  myOrientedBoundingBox = false;
146  if (true)
147  graph->evalOpParm(myOrientedBoundingBox, nodeidx, "orientedbbox", time, 0);
148  myVertexNormals = false;
149  if (true)
150  graph->evalOpParm(myVertexNormals, nodeidx, "vertexnormals", time, 0);
151 
152  }
153 
154 
155  void loadFromOpSubclass(const LoadParms &loadparms) override
156  {
157  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
158  }
159 
160 
161  void copyFrom(const OP_NodeParms *src) override
162  {
163  *this = *((const SOP_BoxParms *)src);
164  }
165 
166  template <typename T>
167  void
168  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
169  {
170  if (idx.size() < 1)
171  return;
172  UT_ASSERT(idx.size() == instance.size()+1);
173  if (idx.size() != instance.size()+1)
174  return;
175  switch (idx[0])
176  {
177  case 0:
178  coerceValue(value, myType);
179  break;
180  case 1:
181  coerceValue(value, mySurfType);
182  break;
183  case 2:
184  coerceValue(value, myConsolidatePoints);
185  break;
186  case 3:
187  coerceValue(value, mySize);
188  break;
189  case 4:
190  coerceValue(value, myCenter);
191  break;
192  case 5:
193  coerceValue(value, myRotate);
194  break;
195  case 6:
196  coerceValue(value, myScale);
197  break;
198  case 7:
199  coerceValue(value, myDivRate);
200  break;
201  case 8:
202  coerceValue(value, myOrder);
203  break;
204  case 9:
205  coerceValue(value, myDoDivs);
206  break;
207  case 10:
208  coerceValue(value, myDivs);
209  break;
210  case 11:
211  coerceValue(value, myRebar);
212  break;
213  case 12:
214  coerceValue(value, myOrientedBoundingBox);
215  break;
216  case 13:
217  coerceValue(value, myVertexNormals);
218  break;
219 
220  }
221  }
222 
223  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
224  { doGetParmValue(idx, instance, value); }
225  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
226  { doGetParmValue(idx, instance, value); }
227  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
228  { doGetParmValue(idx, instance, value); }
229  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
230  { doGetParmValue(idx, instance, value); }
231  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
232  { doGetParmValue(idx, instance, value); }
233  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
234  { doGetParmValue(idx, instance, value); }
235  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
236  { doGetParmValue(idx, instance, value); }
237  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
238  { doGetParmValue(idx, instance, value); }
239  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
240  { doGetParmValue(idx, instance, value); }
241  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
242  { doGetParmValue(idx, instance, value); }
243  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
244  { doGetParmValue(idx, instance, value); }
245 
246  template <typename T>
247  void
248  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
249  {
250  if (idx.size() < 1)
251  return;
252  UT_ASSERT(idx.size() == instance.size()+1);
253  if (idx.size() != instance.size()+1)
254  return;
255  switch (idx[0])
256  {
257  case 0:
258  coerceValue(myType, clampMinValue(0, clampMaxValue(6, value ) ));
259  break;
260  case 1:
261  coerceValue(mySurfType, clampMinValue(0, clampMaxValue(6, value ) ));
262  break;
263  case 2:
264  coerceValue(myConsolidatePoints, ( ( value ) ));
265  break;
266  case 3:
267  coerceValue(mySize, ( ( value ) ));
268  break;
269  case 4:
270  coerceValue(myCenter, ( ( value ) ));
271  break;
272  case 5:
273  coerceValue(myRotate, ( ( value ) ));
274  break;
275  case 6:
276  coerceValue(myScale, ( ( value ) ));
277  break;
278  case 7:
279  coerceValue(myDivRate, clampMinValue(1, ( value ) ));
280  break;
281  case 8:
282  coerceValue(myOrder, clampMinValue(2, clampMaxValue(11, value ) ));
283  break;
284  case 9:
285  coerceValue(myDoDivs, ( ( value ) ));
286  break;
287  case 10:
288  coerceValue(myDivs, clampMinValue(1, ( value ) ));
289  break;
290  case 11:
291  coerceValue(myRebar, ( ( value ) ));
292  break;
293  case 12:
294  coerceValue(myOrientedBoundingBox, ( ( value ) ));
295  break;
296  case 13:
297  coerceValue(myVertexNormals, ( ( value ) ));
298  break;
299 
300  }
301  }
302 
303  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
304  { doSetParmValue(idx, instance, value); }
305  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
306  { doSetParmValue(idx, instance, value); }
307  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
308  { doSetParmValue(idx, instance, value); }
309  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
310  { doSetParmValue(idx, instance, value); }
311  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
312  { doSetParmValue(idx, instance, value); }
313  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
314  { doSetParmValue(idx, instance, value); }
315  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
316  { doSetParmValue(idx, instance, value); }
317  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
318  { doSetParmValue(idx, instance, value); }
319  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
320  { doSetParmValue(idx, instance, value); }
321  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
322  { doSetParmValue(idx, instance, value); }
323  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
324  { doSetParmValue(idx, instance, value); }
325 
326  exint getNestNumParms(TempIndex idx) const override
327  {
328  if (idx.size() == 0)
329  return 14;
330  switch (idx[0])
331  {
332 
333  }
334  // Invalid
335  return 0;
336  }
337 
338  const char *getNestParmName(TempIndex fieldnum) const override
339  {
340  if (fieldnum.size() < 1)
341  return 0;
342  switch (fieldnum[0])
343  {
344  case 0:
345  return "type";
346  case 1:
347  return "surftype";
348  case 2:
349  return "consolidatepts";
350  case 3:
351  return "size";
352  case 4:
353  return "t";
354  case 5:
355  return "r";
356  case 6:
357  return "scale";
358  case 7:
359  return "divrate";
360  case 8:
361  return "orderrate";
362  case 9:
363  return "dodivs";
364  case 10:
365  return "divs";
366  case 11:
367  return "rebar";
368  case 12:
369  return "orientedbbox";
370  case 13:
371  return "vertexnormals";
372 
373  }
374  return 0;
375  }
376 
377  ParmType getNestParmType(TempIndex fieldnum) const override
378  {
379  if (fieldnum.size() < 1)
380  return PARM_UNSUPPORTED;
381  switch (fieldnum[0])
382  {
383  case 0:
384  return PARM_INTEGER;
385  case 1:
386  return PARM_INTEGER;
387  case 2:
388  return PARM_INTEGER;
389  case 3:
390  return PARM_VECTOR3;
391  case 4:
392  return PARM_VECTOR3;
393  case 5:
394  return PARM_VECTOR3;
395  case 6:
396  return PARM_FLOAT;
397  case 7:
398  return PARM_VECTOR3;
399  case 8:
400  return PARM_VECTOR3;
401  case 9:
402  return PARM_INTEGER;
403  case 10:
404  return PARM_VECTOR3;
405  case 11:
406  return PARM_INTEGER;
407  case 12:
408  return PARM_INTEGER;
409  case 13:
410  return PARM_INTEGER;
411 
412  }
413  return PARM_UNSUPPORTED;
414  }
415 
416  // Boiler plate to load individual types.
417  static void loadData(UT_IStream &is, int64 &v)
418  { is.bread(&v, 1); }
419  static void loadData(UT_IStream &is, bool &v)
420  { int64 iv; is.bread(&iv, 1); v = iv; }
421  static void loadData(UT_IStream &is, fpreal64 &v)
422  { is.bread<fpreal64>(&v, 1); }
423  static void loadData(UT_IStream &is, UT_Vector2D &v)
424  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
425  static void loadData(UT_IStream &is, UT_Vector3D &v)
426  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
427  is.bread<fpreal64>(&v.z(), 1); }
428  static void loadData(UT_IStream &is, UT_Vector4D &v)
429  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
430  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
431  static void loadData(UT_IStream &is, UT_Matrix2D &v)
432  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
433  static void loadData(UT_IStream &is, UT_Matrix3D &v)
434  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
435  static void loadData(UT_IStream &is, UT_Matrix4D &v)
436  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
437  static void loadData(UT_IStream &is, UT_Vector2I &v)
438  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
439  static void loadData(UT_IStream &is, UT_Vector3I &v)
440  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
441  is.bread<int64>(&v.z(), 1); }
442  static void loadData(UT_IStream &is, UT_Vector4I &v)
443  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
444  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
446  { is.bread(v); }
448  { UT_StringHolder rampdata;
449  loadData(is, rampdata);
450  if (rampdata.isstring())
451  {
452  v.reset(new UT_Ramp());
453  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
454  v->load(istr);
455  }
456  else v.reset();
457  }
460  loadData(is, data);
461  if (data.isstring())
462  {
463  // Find the data type.
464  const char *colon = UT_StringWrap(data).findChar(':');
465  if (colon)
466  {
467  int typelen = colon - data.buffer();
469  type.strncpy(data.buffer(), typelen);
470  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
471 
472  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
473  }
474  }
475  else v.reset();
476  }
477 
478  static void saveData(std::ostream &os, int64 v)
479  { UTwrite(os, &v); }
480  static void saveData(std::ostream &os, bool v)
481  { int64 iv = v; UTwrite(os, &iv); }
482  static void saveData(std::ostream &os, fpreal64 v)
483  { UTwrite<fpreal64>(os, &v); }
484  static void saveData(std::ostream &os, UT_Vector2D v)
485  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
486  static void saveData(std::ostream &os, UT_Vector3D v)
487  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
488  UTwrite<fpreal64>(os, &v.z()); }
489  static void saveData(std::ostream &os, UT_Vector4D v)
490  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
491  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
492  static void saveData(std::ostream &os, UT_Matrix2D v)
494  static void saveData(std::ostream &os, UT_Matrix3D v)
496  static void saveData(std::ostream &os, UT_Matrix4D v)
498  static void saveData(std::ostream &os, UT_StringHolder s)
499  { UT_StringWrap(s).saveBinary(os); }
500  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
502  UT_OStringStream ostr;
503  if (s) s->save(ostr);
504  result = ostr.str();
505  saveData(os, result);
506  }
507  static void saveData(std::ostream &os, PRM_DataItemHandle s)
509  UT_OStringStream ostr;
510  if (s)
511  {
512  ostr << s->getDataTypeToken();
513  ostr << ":";
514  s->saveBinary(ostr);
515  }
516  result = ostr.str();
517  saveData(os, result);
518  }
519 
520 
521  void save(std::ostream &os) const
522  {
523  int32 v = version();
524  UTwrite(os, &v);
525  saveData(os, myType);
526  saveData(os, mySurfType);
527  saveData(os, myConsolidatePoints);
528  saveData(os, mySize);
529  saveData(os, myCenter);
530  saveData(os, myRotate);
531  saveData(os, myScale);
532  saveData(os, myDivRate);
533  saveData(os, myOrder);
534  saveData(os, myDoDivs);
535  saveData(os, myDivs);
536  saveData(os, myRebar);
537  saveData(os, myOrientedBoundingBox);
538  saveData(os, myVertexNormals);
539 
540  }
541 
542  bool load(UT_IStream &is)
543  {
544  int32 v;
545  is.bread(&v, 1);
546  if (version() != v)
547  {
548  // Fail incompatible versions
549  return false;
550  }
551  loadData(is, myType);
552  loadData(is, mySurfType);
553  loadData(is, myConsolidatePoints);
554  loadData(is, mySize);
555  loadData(is, myCenter);
556  loadData(is, myRotate);
557  loadData(is, myScale);
558  loadData(is, myDivRate);
559  loadData(is, myOrder);
560  loadData(is, myDoDivs);
561  loadData(is, myDivs);
562  loadData(is, myRebar);
563  loadData(is, myOrientedBoundingBox);
564  loadData(is, myVertexNormals);
565 
566  return true;
567  }
568 
569  Type getType() const { return Type(myType); }
570  void setType(Type val) { myType = int64(val); }
571  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
572  {
573  SOP_Node *thissop = cookparms.getNode();
574  if (!thissop) return getType();
575  int64 result;
576  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
577  return Type(result);
578  }
579  SurfType getSurfType() const { return SurfType(mySurfType); }
580  void setSurfType(SurfType val) { mySurfType = int64(val); }
582  {
583  SOP_Node *thissop = cookparms.getNode();
584  if (!thissop) return getSurfType();
585  int64 result;
586  OP_Utils::evalOpParm(result, thissop, "surftype", cookparms.getCookTime(), 0);
587  return SurfType(result);
588  }
589  bool getConsolidatePoints() const { return myConsolidatePoints; }
590  void setConsolidatePoints(bool val) { myConsolidatePoints = val; }
591  bool opConsolidatePoints(const SOP_NodeVerb::CookParms &cookparms) const
592  {
593  SOP_Node *thissop = cookparms.getNode();
594  if (!thissop) return getConsolidatePoints();
595  bool result;
596  OP_Utils::evalOpParm(result, thissop, "consolidatepts", cookparms.getCookTime(), 0);
597  return result;
598  }
599  UT_Vector3D getSize() const { return mySize; }
600  void setSize(UT_Vector3D val) { mySize = val; }
602  {
603  SOP_Node *thissop = cookparms.getNode();
604  if (!thissop) return getSize();
606  OP_Utils::evalOpParm(result, thissop, "size", cookparms.getCookTime(), 0);
607  return result;
608  }
609  UT_Vector3D getCenter() const { return myCenter; }
610  void setCenter(UT_Vector3D val) { myCenter = val; }
612  {
613  SOP_Node *thissop = cookparms.getNode();
614  if (!thissop) return getCenter();
616  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
617  return result;
618  }
619  UT_Vector3D getRotate() const { return myRotate; }
620  void setRotate(UT_Vector3D val) { myRotate = val; }
622  {
623  SOP_Node *thissop = cookparms.getNode();
624  if (!thissop) return getRotate();
626  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
627  return result;
628  }
629  fpreal64 getScale() const { return myScale; }
630  void setScale(fpreal64 val) { myScale = val; }
631  fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
632  {
633  SOP_Node *thissop = cookparms.getNode();
634  if (!thissop) return getScale();
636  OP_Utils::evalOpParm(result, thissop, "scale", cookparms.getCookTime(), 0);
637  return result;
638  }
639  UT_Vector3I getDivRate() const { return myDivRate; }
640  void setDivRate(UT_Vector3I val) { myDivRate = val; }
642  {
643  SOP_Node *thissop = cookparms.getNode();
644  if (!thissop) return getDivRate();
646  OP_Utils::evalOpParm(result, thissop, "divrate", cookparms.getCookTime(), 0);
647  return result;
648  }
649  UT_Vector3I getOrder() const { return myOrder; }
652  {
653  SOP_Node *thissop = cookparms.getNode();
654  if (!thissop) return getOrder();
656  OP_Utils::evalOpParm(result, thissop, "orderrate", cookparms.getCookTime(), 0);
657  return result;
658  }
659  bool getDoDivs() const { return myDoDivs; }
660  void setDoDivs(bool val) { myDoDivs = val; }
661  bool opDoDivs(const SOP_NodeVerb::CookParms &cookparms) const
662  {
663  SOP_Node *thissop = cookparms.getNode();
664  if (!thissop) return getDoDivs();
665  bool result;
666  OP_Utils::evalOpParm(result, thissop, "dodivs", cookparms.getCookTime(), 0);
667  return result;
668  }
669  UT_Vector3I getDivs() const { return myDivs; }
670  void setDivs(UT_Vector3I val) { myDivs = val; }
672  {
673  SOP_Node *thissop = cookparms.getNode();
674  if (!thissop) return getDivs();
676  OP_Utils::evalOpParm(result, thissop, "divs", cookparms.getCookTime(), 0);
677  return result;
678  }
679  bool getRebar() const { return myRebar; }
680  void setRebar(bool val) { myRebar = val; }
681  bool opRebar(const SOP_NodeVerb::CookParms &cookparms) const
682  {
683  SOP_Node *thissop = cookparms.getNode();
684  if (!thissop) return getRebar();
685  bool result;
686  OP_Utils::evalOpParm(result, thissop, "rebar", cookparms.getCookTime(), 0);
687  return result;
688  }
689  bool getOrientedBoundingBox() const { return myOrientedBoundingBox; }
690  void setOrientedBoundingBox(bool val) { myOrientedBoundingBox = val; }
691  bool opOrientedBoundingBox(const SOP_NodeVerb::CookParms &cookparms) const
692  {
693  SOP_Node *thissop = cookparms.getNode();
694  if (!thissop) return getOrientedBoundingBox();
695  bool result;
696  OP_Utils::evalOpParm(result, thissop, "orientedbbox", cookparms.getCookTime(), 0);
697  return result;
698  }
699  bool getVertexNormals() const { return myVertexNormals; }
700  void setVertexNormals(bool val) { myVertexNormals = val; }
701  bool opVertexNormals(const SOP_NodeVerb::CookParms &cookparms) const
702  {
703  SOP_Node *thissop = cookparms.getNode();
704  if (!thissop) return getVertexNormals();
705  bool result;
706  OP_Utils::evalOpParm(result, thissop, "vertexnormals", cookparms.getCookTime(), 0);
707  return result;
708  }
709 
710 private:
711  int64 myType;
712  int64 mySurfType;
713  bool myConsolidatePoints;
714  UT_Vector3D mySize;
715  UT_Vector3D myCenter;
716  UT_Vector3D myRotate;
717  fpreal64 myScale;
718  UT_Vector3I myDivRate;
720  bool myDoDivs;
721  UT_Vector3I myDivs;
722  bool myRebar;
723  bool myOrientedBoundingBox;
724  bool myVertexNormals;
725 
726 };
SurfType opSurfType(const SOP_NodeVerb::CookParms &cookparms) const
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, UT_StringHolder s)
void setCenter(UT_Vector3D val)
bool opRebar(const SOP_NodeVerb::CookParms &cookparms) const
bool opVertexNormals(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3I getDivRate() const
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
UT_Vector3D getSize() const
exint getNestNumParms(TempIndex idx) const override
void save(std::ostream &os) const
fpreal64 getScale() const
bool getOrientedBoundingBox() const
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:311
int myOrder
Definition: GT_CurveEval.h:263
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const char * getNestParmName(TempIndex fieldnum) const override
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
bool operator==(const SOP_BoxParms &src) const
Definition: SOP_Box.proto.h:79
UT_Vector3D opRotate(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool operator!=(const SOP_BoxParms &src) const
Definition: SOP_Box.proto.h:98
Type getType() const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
bool getDoDivs() const
GLdouble s
Definition: glad.h:3009
UT_Vector3D getCenter() const
void setSurfType(SurfType val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, int64 v)
**But if you need a result
Definition: thread.h:613
UT_Vector3T< int64 > UT_Vector3I
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:305
static void loadData(UT_IStream &is, UT_Vector2I &v)
SurfType getSurfType() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static void loadData(UT_IStream &is, UT_Vector2D &v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void copyFrom(const OP_NodeParms *src) override
void setSize(UT_Vector3D val)
static void loadData(UT_IStream &is, int64 &v)
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool load(UT_IStream &is)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, fpreal64 v)
bool getVertexNormals() const
exint length() const
bool getConsolidatePoints() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setRebar(bool val)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static int version()
Definition: SOP_Box.proto.h:51
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
long long int64
Definition: SYS_Types.h:116
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
UT_Vector3T< fpreal64 > UT_Vector3D
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setDoDivs(bool val)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D opSize(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setScale(fpreal64 val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setVertexNormals(bool val)
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool opOrientedBoundingBox(const SOP_NodeVerb::CookParms &cookparms) const
bool getRebar() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setConsolidatePoints(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
bool opConsolidatePoints(const SOP_NodeVerb::CookParms &cookparms) const
void setType(Type val)
UT_Vector3D getRotate() const
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:299
void setOrientedBoundingBox(bool val)
UT_Vector3D opCenter(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows.
Definition: Mat.h:633
void setDivRate(UT_Vector3I val)
#define SOP_API
Definition: SOP_API.h:10
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
UT_Vector3I getOrder() const
void setOrder(UT_Vector3I val)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
void setDivs(UT_Vector3I val)
const char * findChar(int c) const
Definition: UT_String.h:1385
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
UT_Vector3I getDivs() const
GLboolean r
Definition: glcorearb.h:1222
bool opDoDivs(const SOP_NodeVerb::CookParms &cookparms) const
void setRotate(UT_Vector3D val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
UT_Vector3I opDivRate(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3I opDivs(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1793
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
UT_Vector3I opOrder(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)