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 
37  getToken(Type enum_value)
38  {
39  using namespace UT::Literal;
40  switch (enum_value) {
41  case Type::POLY: return "poly"_sh;
42  case Type::POLYMESH: return "polymesh"_sh;
43  case Type::MESH: return "mesh"_sh;
44  case Type::NURBS: return "nurbs"_sh;
45  case Type::BEZIER: return "bezier"_sh;
46  case Type::POINTS: return "points"_sh;
47  case Type::PRIM: return "prim"_sh;
48  default: UT_ASSERT(false); return ""_sh;
49  }
50  }
51 
52  enum class SurfType
53  {
54  ROWS = 0,
55  COLS,
56  ROWCOL,
57  TRIANGLES,
58  QUADS,
61  };
62 
64  getToken(SurfType enum_value)
65  {
66  using namespace UT::Literal;
67  switch (enum_value) {
68  case SurfType::ROWS: return "rows"_sh;
69  case SurfType::COLS: return "cols"_sh;
70  case SurfType::ROWCOL: return "rowcol"_sh;
71  case SurfType::TRIANGLES: return "triangles"_sh;
72  case SurfType::QUADS: return "quads"_sh;
73  case SurfType::ALTTRIANGLES: return "alttriangles"_sh;
74  case SurfType::REVTRIANGLES: return "revtriangles"_sh;
75  default: UT_ASSERT(false); return ""_sh;
76  }
77  }
78 
79 }
80 
81 
83 {
84 public:
85  static int version() { return 1; }
86 
88  {
89  myType = 0;
90  mySurfType = 4;
91  myConsolidatePoints = true;
92  mySize = UT_Vector3D(1,1,1);
93  myCenter = UT_Vector3D(0,0,0);
94  myRotate = UT_Vector3D(0,0,0);
95  myScale = 1;
96  myDivRate = UT_Vector3I(4,4,4);
97  myOrder = UT_Vector3I(4,4,4);
98  myDoDivs = false;
99  myDivs = UT_Vector3I(3,3,3);
100  myRebar = false;
101  myOrientedBoundingBox = false;
102  myVertexNormals = false;
103 
104  }
105 
106  explicit SOP_BoxParms(const SOP_BoxParms &) = default;
107  SOP_BoxParms &operator=(const SOP_BoxParms &) = default;
108  SOP_BoxParms(SOP_BoxParms &&) noexcept = default;
109  SOP_BoxParms &operator=(SOP_BoxParms &&) noexcept = default;
110 
111  ~SOP_BoxParms() override {}
112 
113  bool operator==(const SOP_BoxParms &src) const
114  {
115  if (myType != src.myType) return false;
116  if (mySurfType != src.mySurfType) return false;
117  if (myConsolidatePoints != src.myConsolidatePoints) return false;
118  if (mySize != src.mySize) return false;
119  if (myCenter != src.myCenter) return false;
120  if (myRotate != src.myRotate) return false;
121  if (myScale != src.myScale) return false;
122  if (myDivRate != src.myDivRate) return false;
123  if (myOrder != src.myOrder) return false;
124  if (myDoDivs != src.myDoDivs) return false;
125  if (myDivs != src.myDivs) return false;
126  if (myRebar != src.myRebar) return false;
127  if (myOrientedBoundingBox != src.myOrientedBoundingBox) return false;
128  if (myVertexNormals != src.myVertexNormals) return false;
129 
130  return true;
131  }
132  bool operator!=(const SOP_BoxParms &src) const
133  {
134  return !operator==(src);
135  }
138 
139 
140 
141  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
142  {
143  myType = 0;
144  if (true)
145  graph->evalOpParm(myType, nodeidx, "type", time, 0);
146  mySurfType = 4;
147  if (true)
148  graph->evalOpParm(mySurfType, nodeidx, "surftype", time, 0);
149  myConsolidatePoints = true;
150  if (true)
151  graph->evalOpParm(myConsolidatePoints, nodeidx, "consolidatepts", time, 0);
152  mySize = UT_Vector3D(1,1,1);
153  if (true)
154  graph->evalOpParm(mySize, nodeidx, "size", time, 0);
155  myCenter = UT_Vector3D(0,0,0);
156  if (true)
157  graph->evalOpParm(myCenter, nodeidx, "t", time, 0);
158  myRotate = UT_Vector3D(0,0,0);
159  if (true)
160  graph->evalOpParm(myRotate, nodeidx, "r", time, 0);
161  myScale = 1;
162  if (true)
163  graph->evalOpParm(myScale, nodeidx, "scale", time, 0);
164  myDivRate = UT_Vector3I(4,4,4);
165  if (true)
166  graph->evalOpParm(myDivRate, nodeidx, "divrate", time, 0);
167  myOrder = UT_Vector3I(4,4,4);
168  if (true)
169  graph->evalOpParm(myOrder, nodeidx, "orderrate", time, 0);
170  myDoDivs = false;
171  if (true)
172  graph->evalOpParm(myDoDivs, nodeidx, "dodivs", time, 0);
173  myDivs = UT_Vector3I(3,3,3);
174  if (true)
175  graph->evalOpParm(myDivs, nodeidx, "divs", time, 0);
176  myRebar = false;
177  if (true)
178  graph->evalOpParm(myRebar, nodeidx, "rebar", time, 0);
179  myOrientedBoundingBox = false;
180  if (true)
181  graph->evalOpParm(myOrientedBoundingBox, nodeidx, "orientedbbox", time, 0);
182  myVertexNormals = false;
183  if (true)
184  graph->evalOpParm(myVertexNormals, nodeidx, "vertexnormals", time, 0);
185 
186  }
187 
188 
189  void loadFromOpSubclass(const LoadParms &loadparms) override
190  {
191  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
192  }
193 
194 
195  void copyFrom(const OP_NodeParms *src) override
196  {
197  *this = *((const SOP_BoxParms *)src);
198  }
199 
200  template <typename T>
201  void
202  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
203  {
204  if (idx.size() < 1)
205  return;
206  UT_ASSERT(idx.size() == instance.size()+1);
207  if (idx.size() != instance.size()+1)
208  return;
209  switch (idx[0])
210  {
211  case 0:
212  coerceValue(value, myType);
213  break;
214  case 1:
215  coerceValue(value, mySurfType);
216  break;
217  case 2:
218  coerceValue(value, myConsolidatePoints);
219  break;
220  case 3:
221  coerceValue(value, mySize);
222  break;
223  case 4:
224  coerceValue(value, myCenter);
225  break;
226  case 5:
227  coerceValue(value, myRotate);
228  break;
229  case 6:
230  coerceValue(value, myScale);
231  break;
232  case 7:
233  coerceValue(value, myDivRate);
234  break;
235  case 8:
236  coerceValue(value, myOrder);
237  break;
238  case 9:
239  coerceValue(value, myDoDivs);
240  break;
241  case 10:
242  coerceValue(value, myDivs);
243  break;
244  case 11:
245  coerceValue(value, myRebar);
246  break;
247  case 12:
248  coerceValue(value, myOrientedBoundingBox);
249  break;
250  case 13:
251  coerceValue(value, myVertexNormals);
252  break;
253 
254  }
255  }
256 
257  bool isParmColorRamp(exint idx) const override
258  {
259  switch (idx)
260  {
261 
262  }
263  return false;
264  }
265 
266  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
267  { doGetParmValue(idx, instance, value); }
268  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
269  { doGetParmValue(idx, instance, value); }
270  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
271  { doGetParmValue(idx, instance, value); }
272  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
273  { doGetParmValue(idx, instance, value); }
274  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
275  { doGetParmValue(idx, instance, value); }
276  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
277  { doGetParmValue(idx, instance, value); }
278  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
279  { doGetParmValue(idx, instance, value); }
280  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
281  { doGetParmValue(idx, instance, value); }
282  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
283  { doGetParmValue(idx, instance, value); }
284  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
285  { doGetParmValue(idx, instance, value); }
286  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
287  { doGetParmValue(idx, instance, value); }
288 
289  template <typename T>
290  void
291  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
292  {
293  if (idx.size() < 1)
294  return;
295  UT_ASSERT(idx.size() == instance.size()+1);
296  if (idx.size() != instance.size()+1)
297  return;
298  switch (idx[0])
299  {
300  case 0:
301  coerceValue(myType, clampMinValue(0, clampMaxValue(6, value ) ));
302  break;
303  case 1:
304  coerceValue(mySurfType, clampMinValue(0, clampMaxValue(6, value ) ));
305  break;
306  case 2:
307  coerceValue(myConsolidatePoints, ( ( value ) ));
308  break;
309  case 3:
310  coerceValue(mySize, ( ( value ) ));
311  break;
312  case 4:
313  coerceValue(myCenter, ( ( value ) ));
314  break;
315  case 5:
316  coerceValue(myRotate, ( ( value ) ));
317  break;
318  case 6:
319  coerceValue(myScale, ( ( value ) ));
320  break;
321  case 7:
322  coerceValue(myDivRate, clampMinValue(1, ( value ) ));
323  break;
324  case 8:
325  coerceValue(myOrder, clampMinValue(2, clampMaxValue(11, value ) ));
326  break;
327  case 9:
328  coerceValue(myDoDivs, ( ( value ) ));
329  break;
330  case 10:
331  coerceValue(myDivs, clampMinValue(1, ( value ) ));
332  break;
333  case 11:
334  coerceValue(myRebar, ( ( value ) ));
335  break;
336  case 12:
337  coerceValue(myOrientedBoundingBox, ( ( value ) ));
338  break;
339  case 13:
340  coerceValue(myVertexNormals, ( ( value ) ));
341  break;
342 
343  }
344  }
345 
346  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
347  { doSetParmValue(idx, instance, value); }
348  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
349  { doSetParmValue(idx, instance, value); }
350  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
351  { doSetParmValue(idx, instance, value); }
352  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
353  { doSetParmValue(idx, instance, value); }
354  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
355  { doSetParmValue(idx, instance, value); }
356  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
357  { doSetParmValue(idx, instance, value); }
358  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
359  { doSetParmValue(idx, instance, value); }
360  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
361  { doSetParmValue(idx, instance, value); }
362  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
363  { doSetParmValue(idx, instance, value); }
364  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
365  { doSetParmValue(idx, instance, value); }
366  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
367  { doSetParmValue(idx, instance, value); }
368 
369  exint getNestNumParms(TempIndex idx) const override
370  {
371  if (idx.size() == 0)
372  return 14;
373  switch (idx[0])
374  {
375 
376  }
377  // Invalid
378  return 0;
379  }
380 
381  const char *getNestParmName(TempIndex fieldnum) const override
382  {
383  if (fieldnum.size() < 1)
384  return 0;
385  switch (fieldnum[0])
386  {
387  case 0:
388  return "type";
389  case 1:
390  return "surftype";
391  case 2:
392  return "consolidatepts";
393  case 3:
394  return "size";
395  case 4:
396  return "t";
397  case 5:
398  return "r";
399  case 6:
400  return "scale";
401  case 7:
402  return "divrate";
403  case 8:
404  return "orderrate";
405  case 9:
406  return "dodivs";
407  case 10:
408  return "divs";
409  case 11:
410  return "rebar";
411  case 12:
412  return "orientedbbox";
413  case 13:
414  return "vertexnormals";
415 
416  }
417  return 0;
418  }
419 
420  ParmType getNestParmType(TempIndex fieldnum) const override
421  {
422  if (fieldnum.size() < 1)
423  return PARM_UNSUPPORTED;
424  switch (fieldnum[0])
425  {
426  case 0:
427  return PARM_INTEGER;
428  case 1:
429  return PARM_INTEGER;
430  case 2:
431  return PARM_INTEGER;
432  case 3:
433  return PARM_VECTOR3;
434  case 4:
435  return PARM_VECTOR3;
436  case 5:
437  return PARM_VECTOR3;
438  case 6:
439  return PARM_FLOAT;
440  case 7:
441  return PARM_VECTOR3;
442  case 8:
443  return PARM_VECTOR3;
444  case 9:
445  return PARM_INTEGER;
446  case 10:
447  return PARM_VECTOR3;
448  case 11:
449  return PARM_INTEGER;
450  case 12:
451  return PARM_INTEGER;
452  case 13:
453  return PARM_INTEGER;
454 
455  }
456  return PARM_UNSUPPORTED;
457  }
458 
459  // Boiler plate to load individual types.
460  static void loadData(UT_IStream &is, int64 &v)
461  { is.bread(&v, 1); }
462  static void loadData(UT_IStream &is, bool &v)
463  { int64 iv; is.bread(&iv, 1); v = iv; }
464  static void loadData(UT_IStream &is, fpreal64 &v)
465  { is.bread<fpreal64>(&v, 1); }
466  static void loadData(UT_IStream &is, UT_Vector2D &v)
467  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
468  static void loadData(UT_IStream &is, UT_Vector3D &v)
469  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
470  is.bread<fpreal64>(&v.z(), 1); }
471  static void loadData(UT_IStream &is, UT_Vector4D &v)
472  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
473  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
474  static void loadData(UT_IStream &is, UT_Matrix2D &v)
475  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
476  static void loadData(UT_IStream &is, UT_Matrix3D &v)
477  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
478  static void loadData(UT_IStream &is, UT_Matrix4D &v)
479  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
480  static void loadData(UT_IStream &is, UT_Vector2I &v)
481  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
482  static void loadData(UT_IStream &is, UT_Vector3I &v)
483  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
484  is.bread<int64>(&v.z(), 1); }
485  static void loadData(UT_IStream &is, UT_Vector4I &v)
486  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
487  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
489  { is.bread(v); }
491  { UT_StringHolder rampdata;
492  loadData(is, rampdata);
493  if (rampdata.isstring())
494  {
495  v.reset(new UT_Ramp());
496  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
497  v->load(istr);
498  }
499  else v.reset();
500  }
503  loadData(is, data);
504  if (data.isstring())
505  {
506  // Find the data type.
507  const char *colon = UT_StringWrap(data).findChar(':');
508  if (colon)
509  {
510  int typelen = colon - data.buffer();
512  type.strncpy(data.buffer(), typelen);
513  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
514 
515  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
516  }
517  }
518  else v.reset();
519  }
520 
521  static void saveData(std::ostream &os, int64 v)
522  { UTwrite(os, &v); }
523  static void saveData(std::ostream &os, bool v)
524  { int64 iv = v; UTwrite(os, &iv); }
525  static void saveData(std::ostream &os, fpreal64 v)
526  { UTwrite<fpreal64>(os, &v); }
527  static void saveData(std::ostream &os, UT_Vector2D v)
528  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
529  static void saveData(std::ostream &os, UT_Vector3D v)
530  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
531  UTwrite<fpreal64>(os, &v.z()); }
532  static void saveData(std::ostream &os, UT_Vector4D v)
533  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
534  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
535  static void saveData(std::ostream &os, UT_Matrix2D v)
537  static void saveData(std::ostream &os, UT_Matrix3D v)
539  static void saveData(std::ostream &os, UT_Matrix4D v)
541  static void saveData(std::ostream &os, UT_StringHolder s)
542  { UT_StringWrap(s).saveBinary(os); }
543  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
545  UT_OStringStream ostr;
546  if (s) s->save(ostr);
547  result = ostr.str();
548  saveData(os, result);
549  }
550  static void saveData(std::ostream &os, PRM_DataItemHandle s)
552  UT_OStringStream ostr;
553  if (s)
554  {
555  ostr << s->getDataTypeToken();
556  ostr << ":";
557  s->saveBinary(ostr);
558  }
559  result = ostr.str();
560  saveData(os, result);
561  }
562 
563 
564  void save(std::ostream &os) const
565  {
566  int32 v = version();
567  UTwrite(os, &v);
568  saveData(os, myType);
569  saveData(os, mySurfType);
570  saveData(os, myConsolidatePoints);
571  saveData(os, mySize);
572  saveData(os, myCenter);
573  saveData(os, myRotate);
574  saveData(os, myScale);
575  saveData(os, myDivRate);
576  saveData(os, myOrder);
577  saveData(os, myDoDivs);
578  saveData(os, myDivs);
579  saveData(os, myRebar);
580  saveData(os, myOrientedBoundingBox);
581  saveData(os, myVertexNormals);
582 
583  }
584 
585  bool load(UT_IStream &is)
586  {
587  int32 v;
588  is.bread(&v, 1);
589  if (version() != v)
590  {
591  // Fail incompatible versions
592  return false;
593  }
594  loadData(is, myType);
595  loadData(is, mySurfType);
596  loadData(is, myConsolidatePoints);
597  loadData(is, mySize);
598  loadData(is, myCenter);
599  loadData(is, myRotate);
600  loadData(is, myScale);
601  loadData(is, myDivRate);
602  loadData(is, myOrder);
603  loadData(is, myDoDivs);
604  loadData(is, myDivs);
605  loadData(is, myRebar);
606  loadData(is, myOrientedBoundingBox);
607  loadData(is, myVertexNormals);
608 
609  return true;
610  }
611 
612  Type getType() const { return Type(myType); }
613  void setType(Type val) { myType = int64(val); }
614  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
615  {
616  SOP_Node *thissop = cookparms.getNode();
617  if (!thissop) return getType();
618  int64 result;
619  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
620  return Type(result);
621  }
622  SurfType getSurfType() const { return SurfType(mySurfType); }
623  void setSurfType(SurfType val) { mySurfType = int64(val); }
625  {
626  SOP_Node *thissop = cookparms.getNode();
627  if (!thissop) return getSurfType();
628  int64 result;
629  OP_Utils::evalOpParm(result, thissop, "surftype", cookparms.getCookTime(), 0);
630  return SurfType(result);
631  }
632  bool getConsolidatePoints() const { return myConsolidatePoints; }
633  void setConsolidatePoints(bool val) { myConsolidatePoints = val; }
634  bool opConsolidatePoints(const SOP_NodeVerb::CookParms &cookparms) const
635  {
636  SOP_Node *thissop = cookparms.getNode();
637  if (!thissop) return getConsolidatePoints();
638  bool result;
639  OP_Utils::evalOpParm(result, thissop, "consolidatepts", cookparms.getCookTime(), 0);
640  return result;
641  }
642  UT_Vector3D getSize() const { return mySize; }
643  void setSize(UT_Vector3D val) { mySize = val; }
645  {
646  SOP_Node *thissop = cookparms.getNode();
647  if (!thissop) return getSize();
649  OP_Utils::evalOpParm(result, thissop, "size", cookparms.getCookTime(), 0);
650  return result;
651  }
652  UT_Vector3D getCenter() const { return myCenter; }
653  void setCenter(UT_Vector3D val) { myCenter = val; }
655  {
656  SOP_Node *thissop = cookparms.getNode();
657  if (!thissop) return getCenter();
659  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
660  return result;
661  }
662  UT_Vector3D getRotate() const { return myRotate; }
663  void setRotate(UT_Vector3D val) { myRotate = val; }
665  {
666  SOP_Node *thissop = cookparms.getNode();
667  if (!thissop) return getRotate();
669  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
670  return result;
671  }
672  fpreal64 getScale() const { return myScale; }
673  void setScale(fpreal64 val) { myScale = val; }
674  fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
675  {
676  SOP_Node *thissop = cookparms.getNode();
677  if (!thissop) return getScale();
679  OP_Utils::evalOpParm(result, thissop, "scale", cookparms.getCookTime(), 0);
680  return result;
681  }
682  UT_Vector3I getDivRate() const { return myDivRate; }
683  void setDivRate(UT_Vector3I val) { myDivRate = val; }
685  {
686  SOP_Node *thissop = cookparms.getNode();
687  if (!thissop) return getDivRate();
689  OP_Utils::evalOpParm(result, thissop, "divrate", cookparms.getCookTime(), 0);
690  return result;
691  }
692  UT_Vector3I getOrder() const { return myOrder; }
695  {
696  SOP_Node *thissop = cookparms.getNode();
697  if (!thissop) return getOrder();
699  OP_Utils::evalOpParm(result, thissop, "orderrate", cookparms.getCookTime(), 0);
700  return result;
701  }
702  bool getDoDivs() const { return myDoDivs; }
703  void setDoDivs(bool val) { myDoDivs = val; }
704  bool opDoDivs(const SOP_NodeVerb::CookParms &cookparms) const
705  {
706  SOP_Node *thissop = cookparms.getNode();
707  if (!thissop) return getDoDivs();
708  bool result;
709  OP_Utils::evalOpParm(result, thissop, "dodivs", cookparms.getCookTime(), 0);
710  return result;
711  }
712  UT_Vector3I getDivs() const { return myDivs; }
713  void setDivs(UT_Vector3I val) { myDivs = val; }
715  {
716  SOP_Node *thissop = cookparms.getNode();
717  if (!thissop) return getDivs();
719  OP_Utils::evalOpParm(result, thissop, "divs", cookparms.getCookTime(), 0);
720  return result;
721  }
722  bool getRebar() const { return myRebar; }
723  void setRebar(bool val) { myRebar = val; }
724  bool opRebar(const SOP_NodeVerb::CookParms &cookparms) const
725  {
726  SOP_Node *thissop = cookparms.getNode();
727  if (!thissop) return getRebar();
728  bool result;
729  OP_Utils::evalOpParm(result, thissop, "rebar", cookparms.getCookTime(), 0);
730  return result;
731  }
732  bool getOrientedBoundingBox() const { return myOrientedBoundingBox; }
733  void setOrientedBoundingBox(bool val) { myOrientedBoundingBox = val; }
734  bool opOrientedBoundingBox(const SOP_NodeVerb::CookParms &cookparms) const
735  {
736  SOP_Node *thissop = cookparms.getNode();
737  if (!thissop) return getOrientedBoundingBox();
738  bool result;
739  OP_Utils::evalOpParm(result, thissop, "orientedbbox", cookparms.getCookTime(), 0);
740  return result;
741  }
742  bool getVertexNormals() const { return myVertexNormals; }
743  void setVertexNormals(bool val) { myVertexNormals = val; }
744  bool opVertexNormals(const SOP_NodeVerb::CookParms &cookparms) const
745  {
746  SOP_Node *thissop = cookparms.getNode();
747  if (!thissop) return getVertexNormals();
748  bool result;
749  OP_Utils::evalOpParm(result, thissop, "vertexnormals", cookparms.getCookTime(), 0);
750  return result;
751  }
752 
753 private:
754  int64 myType;
755  int64 mySurfType;
756  bool myConsolidatePoints;
757  UT_Vector3D mySize;
758  UT_Vector3D myCenter;
759  UT_Vector3D myRotate;
760  fpreal64 myScale;
761  UT_Vector3I myDivRate;
763  bool myDoDivs;
764  UT_Vector3I myDivs;
765  bool myRebar;
766  bool myOrientedBoundingBox;
767  bool myVertexNormals;
768 
769 };
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
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
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
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
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
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
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:85
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 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)
LeafData & operator=(const LeafData &)=delete
static void saveData(std::ostream &os, UT_Matrix2D v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
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:1395
#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
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
Definition: SOP_Box.proto.h:37
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
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
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)