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  bool isParmColorRamp(exint idx) const override
224  {
225  switch (idx)
226  {
227 
228  }
229  return false;
230  }
231 
232  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
233  { doGetParmValue(idx, instance, value); }
234  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
235  { doGetParmValue(idx, instance, value); }
236  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
237  { doGetParmValue(idx, instance, value); }
238  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
239  { doGetParmValue(idx, instance, value); }
240  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
241  { doGetParmValue(idx, instance, value); }
242  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
243  { doGetParmValue(idx, instance, value); }
244  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
245  { doGetParmValue(idx, instance, value); }
246  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
247  { doGetParmValue(idx, instance, value); }
248  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
249  { doGetParmValue(idx, instance, value); }
250  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
251  { doGetParmValue(idx, instance, value); }
252  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
253  { doGetParmValue(idx, instance, value); }
254 
255  template <typename T>
256  void
257  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
258  {
259  if (idx.size() < 1)
260  return;
261  UT_ASSERT(idx.size() == instance.size()+1);
262  if (idx.size() != instance.size()+1)
263  return;
264  switch (idx[0])
265  {
266  case 0:
267  coerceValue(myType, clampMinValue(0, clampMaxValue(6, value ) ));
268  break;
269  case 1:
270  coerceValue(mySurfType, clampMinValue(0, clampMaxValue(6, value ) ));
271  break;
272  case 2:
273  coerceValue(myConsolidatePoints, ( ( value ) ));
274  break;
275  case 3:
276  coerceValue(mySize, ( ( value ) ));
277  break;
278  case 4:
279  coerceValue(myCenter, ( ( value ) ));
280  break;
281  case 5:
282  coerceValue(myRotate, ( ( value ) ));
283  break;
284  case 6:
285  coerceValue(myScale, ( ( value ) ));
286  break;
287  case 7:
288  coerceValue(myDivRate, clampMinValue(1, ( value ) ));
289  break;
290  case 8:
291  coerceValue(myOrder, clampMinValue(2, clampMaxValue(11, value ) ));
292  break;
293  case 9:
294  coerceValue(myDoDivs, ( ( value ) ));
295  break;
296  case 10:
297  coerceValue(myDivs, clampMinValue(1, ( value ) ));
298  break;
299  case 11:
300  coerceValue(myRebar, ( ( value ) ));
301  break;
302  case 12:
303  coerceValue(myOrientedBoundingBox, ( ( value ) ));
304  break;
305  case 13:
306  coerceValue(myVertexNormals, ( ( value ) ));
307  break;
308 
309  }
310  }
311 
312  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
313  { doSetParmValue(idx, instance, value); }
314  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
315  { doSetParmValue(idx, instance, value); }
316  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
317  { doSetParmValue(idx, instance, value); }
318  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
319  { doSetParmValue(idx, instance, value); }
320  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
321  { doSetParmValue(idx, instance, value); }
322  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
323  { doSetParmValue(idx, instance, value); }
324  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
325  { doSetParmValue(idx, instance, value); }
326  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
327  { doSetParmValue(idx, instance, value); }
328  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
329  { doSetParmValue(idx, instance, value); }
330  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
331  { doSetParmValue(idx, instance, value); }
332  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
333  { doSetParmValue(idx, instance, value); }
334 
335  exint getNestNumParms(TempIndex idx) const override
336  {
337  if (idx.size() == 0)
338  return 14;
339  switch (idx[0])
340  {
341 
342  }
343  // Invalid
344  return 0;
345  }
346 
347  const char *getNestParmName(TempIndex fieldnum) const override
348  {
349  if (fieldnum.size() < 1)
350  return 0;
351  switch (fieldnum[0])
352  {
353  case 0:
354  return "type";
355  case 1:
356  return "surftype";
357  case 2:
358  return "consolidatepts";
359  case 3:
360  return "size";
361  case 4:
362  return "t";
363  case 5:
364  return "r";
365  case 6:
366  return "scale";
367  case 7:
368  return "divrate";
369  case 8:
370  return "orderrate";
371  case 9:
372  return "dodivs";
373  case 10:
374  return "divs";
375  case 11:
376  return "rebar";
377  case 12:
378  return "orientedbbox";
379  case 13:
380  return "vertexnormals";
381 
382  }
383  return 0;
384  }
385 
386  ParmType getNestParmType(TempIndex fieldnum) const override
387  {
388  if (fieldnum.size() < 1)
389  return PARM_UNSUPPORTED;
390  switch (fieldnum[0])
391  {
392  case 0:
393  return PARM_INTEGER;
394  case 1:
395  return PARM_INTEGER;
396  case 2:
397  return PARM_INTEGER;
398  case 3:
399  return PARM_VECTOR3;
400  case 4:
401  return PARM_VECTOR3;
402  case 5:
403  return PARM_VECTOR3;
404  case 6:
405  return PARM_FLOAT;
406  case 7:
407  return PARM_VECTOR3;
408  case 8:
409  return PARM_VECTOR3;
410  case 9:
411  return PARM_INTEGER;
412  case 10:
413  return PARM_VECTOR3;
414  case 11:
415  return PARM_INTEGER;
416  case 12:
417  return PARM_INTEGER;
418  case 13:
419  return PARM_INTEGER;
420 
421  }
422  return PARM_UNSUPPORTED;
423  }
424 
425  // Boiler plate to load individual types.
426  static void loadData(UT_IStream &is, int64 &v)
427  { is.bread(&v, 1); }
428  static void loadData(UT_IStream &is, bool &v)
429  { int64 iv; is.bread(&iv, 1); v = iv; }
430  static void loadData(UT_IStream &is, fpreal64 &v)
431  { is.bread<fpreal64>(&v, 1); }
432  static void loadData(UT_IStream &is, UT_Vector2D &v)
433  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
434  static void loadData(UT_IStream &is, UT_Vector3D &v)
435  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
436  is.bread<fpreal64>(&v.z(), 1); }
437  static void loadData(UT_IStream &is, UT_Vector4D &v)
438  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
439  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
440  static void loadData(UT_IStream &is, UT_Matrix2D &v)
441  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
442  static void loadData(UT_IStream &is, UT_Matrix3D &v)
443  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
444  static void loadData(UT_IStream &is, UT_Matrix4D &v)
445  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
446  static void loadData(UT_IStream &is, UT_Vector2I &v)
447  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
448  static void loadData(UT_IStream &is, UT_Vector3I &v)
449  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
450  is.bread<int64>(&v.z(), 1); }
451  static void loadData(UT_IStream &is, UT_Vector4I &v)
452  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
453  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
455  { is.bread(v); }
457  { UT_StringHolder rampdata;
458  loadData(is, rampdata);
459  if (rampdata.isstring())
460  {
461  v.reset(new UT_Ramp());
462  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
463  v->load(istr);
464  }
465  else v.reset();
466  }
469  loadData(is, data);
470  if (data.isstring())
471  {
472  // Find the data type.
473  const char *colon = UT_StringWrap(data).findChar(':');
474  if (colon)
475  {
476  int typelen = colon - data.buffer();
478  type.strncpy(data.buffer(), typelen);
479  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
480 
481  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
482  }
483  }
484  else v.reset();
485  }
486 
487  static void saveData(std::ostream &os, int64 v)
488  { UTwrite(os, &v); }
489  static void saveData(std::ostream &os, bool v)
490  { int64 iv = v; UTwrite(os, &iv); }
491  static void saveData(std::ostream &os, fpreal64 v)
492  { UTwrite<fpreal64>(os, &v); }
493  static void saveData(std::ostream &os, UT_Vector2D v)
494  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
495  static void saveData(std::ostream &os, UT_Vector3D v)
496  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
497  UTwrite<fpreal64>(os, &v.z()); }
498  static void saveData(std::ostream &os, UT_Vector4D v)
499  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
500  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
501  static void saveData(std::ostream &os, UT_Matrix2D v)
503  static void saveData(std::ostream &os, UT_Matrix3D v)
505  static void saveData(std::ostream &os, UT_Matrix4D v)
507  static void saveData(std::ostream &os, UT_StringHolder s)
508  { UT_StringWrap(s).saveBinary(os); }
509  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
511  UT_OStringStream ostr;
512  if (s) s->save(ostr);
513  result = ostr.str();
514  saveData(os, result);
515  }
516  static void saveData(std::ostream &os, PRM_DataItemHandle s)
518  UT_OStringStream ostr;
519  if (s)
520  {
521  ostr << s->getDataTypeToken();
522  ostr << ":";
523  s->saveBinary(ostr);
524  }
525  result = ostr.str();
526  saveData(os, result);
527  }
528 
529 
530  void save(std::ostream &os) const
531  {
532  int32 v = version();
533  UTwrite(os, &v);
534  saveData(os, myType);
535  saveData(os, mySurfType);
536  saveData(os, myConsolidatePoints);
537  saveData(os, mySize);
538  saveData(os, myCenter);
539  saveData(os, myRotate);
540  saveData(os, myScale);
541  saveData(os, myDivRate);
542  saveData(os, myOrder);
543  saveData(os, myDoDivs);
544  saveData(os, myDivs);
545  saveData(os, myRebar);
546  saveData(os, myOrientedBoundingBox);
547  saveData(os, myVertexNormals);
548 
549  }
550 
551  bool load(UT_IStream &is)
552  {
553  int32 v;
554  is.bread(&v, 1);
555  if (version() != v)
556  {
557  // Fail incompatible versions
558  return false;
559  }
560  loadData(is, myType);
561  loadData(is, mySurfType);
562  loadData(is, myConsolidatePoints);
563  loadData(is, mySize);
564  loadData(is, myCenter);
565  loadData(is, myRotate);
566  loadData(is, myScale);
567  loadData(is, myDivRate);
568  loadData(is, myOrder);
569  loadData(is, myDoDivs);
570  loadData(is, myDivs);
571  loadData(is, myRebar);
572  loadData(is, myOrientedBoundingBox);
573  loadData(is, myVertexNormals);
574 
575  return true;
576  }
577 
578  Type getType() const { return Type(myType); }
579  void setType(Type val) { myType = int64(val); }
580  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
581  {
582  SOP_Node *thissop = cookparms.getNode();
583  if (!thissop) return getType();
584  int64 result;
585  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
586  return Type(result);
587  }
588  SurfType getSurfType() const { return SurfType(mySurfType); }
589  void setSurfType(SurfType val) { mySurfType = int64(val); }
591  {
592  SOP_Node *thissop = cookparms.getNode();
593  if (!thissop) return getSurfType();
594  int64 result;
595  OP_Utils::evalOpParm(result, thissop, "surftype", cookparms.getCookTime(), 0);
596  return SurfType(result);
597  }
598  bool getConsolidatePoints() const { return myConsolidatePoints; }
599  void setConsolidatePoints(bool val) { myConsolidatePoints = val; }
600  bool opConsolidatePoints(const SOP_NodeVerb::CookParms &cookparms) const
601  {
602  SOP_Node *thissop = cookparms.getNode();
603  if (!thissop) return getConsolidatePoints();
604  bool result;
605  OP_Utils::evalOpParm(result, thissop, "consolidatepts", cookparms.getCookTime(), 0);
606  return result;
607  }
608  UT_Vector3D getSize() const { return mySize; }
609  void setSize(UT_Vector3D val) { mySize = val; }
611  {
612  SOP_Node *thissop = cookparms.getNode();
613  if (!thissop) return getSize();
615  OP_Utils::evalOpParm(result, thissop, "size", cookparms.getCookTime(), 0);
616  return result;
617  }
618  UT_Vector3D getCenter() const { return myCenter; }
619  void setCenter(UT_Vector3D val) { myCenter = val; }
621  {
622  SOP_Node *thissop = cookparms.getNode();
623  if (!thissop) return getCenter();
625  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
626  return result;
627  }
628  UT_Vector3D getRotate() const { return myRotate; }
629  void setRotate(UT_Vector3D val) { myRotate = val; }
631  {
632  SOP_Node *thissop = cookparms.getNode();
633  if (!thissop) return getRotate();
635  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
636  return result;
637  }
638  fpreal64 getScale() const { return myScale; }
639  void setScale(fpreal64 val) { myScale = val; }
640  fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
641  {
642  SOP_Node *thissop = cookparms.getNode();
643  if (!thissop) return getScale();
645  OP_Utils::evalOpParm(result, thissop, "scale", cookparms.getCookTime(), 0);
646  return result;
647  }
648  UT_Vector3I getDivRate() const { return myDivRate; }
649  void setDivRate(UT_Vector3I val) { myDivRate = val; }
651  {
652  SOP_Node *thissop = cookparms.getNode();
653  if (!thissop) return getDivRate();
655  OP_Utils::evalOpParm(result, thissop, "divrate", cookparms.getCookTime(), 0);
656  return result;
657  }
658  UT_Vector3I getOrder() const { return myOrder; }
661  {
662  SOP_Node *thissop = cookparms.getNode();
663  if (!thissop) return getOrder();
665  OP_Utils::evalOpParm(result, thissop, "orderrate", cookparms.getCookTime(), 0);
666  return result;
667  }
668  bool getDoDivs() const { return myDoDivs; }
669  void setDoDivs(bool val) { myDoDivs = val; }
670  bool opDoDivs(const SOP_NodeVerb::CookParms &cookparms) const
671  {
672  SOP_Node *thissop = cookparms.getNode();
673  if (!thissop) return getDoDivs();
674  bool result;
675  OP_Utils::evalOpParm(result, thissop, "dodivs", cookparms.getCookTime(), 0);
676  return result;
677  }
678  UT_Vector3I getDivs() const { return myDivs; }
679  void setDivs(UT_Vector3I val) { myDivs = val; }
681  {
682  SOP_Node *thissop = cookparms.getNode();
683  if (!thissop) return getDivs();
685  OP_Utils::evalOpParm(result, thissop, "divs", cookparms.getCookTime(), 0);
686  return result;
687  }
688  bool getRebar() const { return myRebar; }
689  void setRebar(bool val) { myRebar = val; }
690  bool opRebar(const SOP_NodeVerb::CookParms &cookparms) const
691  {
692  SOP_Node *thissop = cookparms.getNode();
693  if (!thissop) return getRebar();
694  bool result;
695  OP_Utils::evalOpParm(result, thissop, "rebar", cookparms.getCookTime(), 0);
696  return result;
697  }
698  bool getOrientedBoundingBox() const { return myOrientedBoundingBox; }
699  void setOrientedBoundingBox(bool val) { myOrientedBoundingBox = val; }
700  bool opOrientedBoundingBox(const SOP_NodeVerb::CookParms &cookparms) const
701  {
702  SOP_Node *thissop = cookparms.getNode();
703  if (!thissop) return getOrientedBoundingBox();
704  bool result;
705  OP_Utils::evalOpParm(result, thissop, "orientedbbox", cookparms.getCookTime(), 0);
706  return result;
707  }
708  bool getVertexNormals() const { return myVertexNormals; }
709  void setVertexNormals(bool val) { myVertexNormals = val; }
710  bool opVertexNormals(const SOP_NodeVerb::CookParms &cookparms) const
711  {
712  SOP_Node *thissop = cookparms.getNode();
713  if (!thissop) return getVertexNormals();
714  bool result;
715  OP_Utils::evalOpParm(result, thissop, "vertexnormals", cookparms.getCookTime(), 0);
716  return result;
717  }
718 
719 private:
720  int64 myType;
721  int64 mySurfType;
722  bool myConsolidatePoints;
723  UT_Vector3D mySize;
724  UT_Vector3D myCenter;
725  UT_Vector3D myRotate;
726  fpreal64 myScale;
727  UT_Vector3I myDivRate;
729  bool myDoDivs;
730  UT_Vector3I myDivs;
731  bool myRebar;
732  bool myOrientedBoundingBox;
733  bool myVertexNormals;
734 
735 };
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:315
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:308
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:301
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:88
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)
bool isParmColorRamp(exint idx) const override
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)