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 <OP/OP_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 
131  if (baseGetSignature() != src.baseGetSignature()) return false;
132 
133  return true;
134  }
135  bool operator!=(const SOP_BoxParms &src) const
136  {
137  return !operator==(src);
138  }
141 
142 
143 
144  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
145  {
146  myType = 0;
147  if (true)
148  graph->evalOpParm(myType, nodeidx, "type", time, graph->isDirect()?nullptr:depnode);
149  mySurfType = 4;
150  if (true)
151  graph->evalOpParm(mySurfType, nodeidx, "surftype", time, graph->isDirect()?nullptr:depnode);
152  myConsolidatePoints = true;
153  if (true)
154  graph->evalOpParm(myConsolidatePoints, nodeidx, "consolidatepts", time, graph->isDirect()?nullptr:depnode);
155  mySize = UT_Vector3D(1,1,1);
156  if (true)
157  graph->evalOpParm(mySize, nodeidx, "size", time, graph->isDirect()?nullptr:depnode);
158  myCenter = UT_Vector3D(0,0,0);
159  if (true)
160  graph->evalOpParm(myCenter, nodeidx, "t", time, graph->isDirect()?nullptr:depnode);
161  myRotate = UT_Vector3D(0,0,0);
162  if (true)
163  graph->evalOpParm(myRotate, nodeidx, "r", time, graph->isDirect()?nullptr:depnode);
164  myScale = 1;
165  if (true)
166  graph->evalOpParm(myScale, nodeidx, "scale", time, graph->isDirect()?nullptr:depnode);
167  myDivRate = UT_Vector3I(4,4,4);
168  if (true)
169  graph->evalOpParm(myDivRate, nodeidx, "divrate", time, graph->isDirect()?nullptr:depnode);
170  myOrder = UT_Vector3I(4,4,4);
171  if (true)
172  graph->evalOpParm(myOrder, nodeidx, "orderrate", time, graph->isDirect()?nullptr:depnode);
173  myDoDivs = false;
174  if (true)
175  graph->evalOpParm(myDoDivs, nodeidx, "dodivs", time, graph->isDirect()?nullptr:depnode);
176  myDivs = UT_Vector3I(3,3,3);
177  if (true)
178  graph->evalOpParm(myDivs, nodeidx, "divs", time, graph->isDirect()?nullptr:depnode);
179  myRebar = false;
180  if (true)
181  graph->evalOpParm(myRebar, nodeidx, "rebar", time, graph->isDirect()?nullptr:depnode);
182  myOrientedBoundingBox = false;
183  if (true)
184  graph->evalOpParm(myOrientedBoundingBox, nodeidx, "orientedbbox", time, graph->isDirect()?nullptr:depnode);
185  myVertexNormals = false;
186  if (true)
187  graph->evalOpParm(myVertexNormals, nodeidx, "vertexnormals", time, graph->isDirect()?nullptr:depnode);
188 
189  }
190 
191 
192  void loadFromOpSubclass(const LoadParms &loadparms) override
193  {
194  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
195  }
196 
197 
198  void copyFrom(const OP_NodeParms *src) override
199  {
200  *this = *((const SOP_BoxParms *)src);
201  }
202 
203  template <typename T>
204  void
205  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
206  {
207  if (idx.size() < 1)
208  return;
209  UT_ASSERT(idx.size() == instance.size()+1);
210  if (idx.size() != instance.size()+1)
211  return;
212  switch (idx[0])
213  {
214  case 0:
215  coerceValue(value, myType);
216  break;
217  case 1:
218  coerceValue(value, mySurfType);
219  break;
220  case 2:
221  coerceValue(value, myConsolidatePoints);
222  break;
223  case 3:
224  coerceValue(value, mySize);
225  break;
226  case 4:
227  coerceValue(value, myCenter);
228  break;
229  case 5:
230  coerceValue(value, myRotate);
231  break;
232  case 6:
233  coerceValue(value, myScale);
234  break;
235  case 7:
236  coerceValue(value, myDivRate);
237  break;
238  case 8:
239  coerceValue(value, myOrder);
240  break;
241  case 9:
242  coerceValue(value, myDoDivs);
243  break;
244  case 10:
245  coerceValue(value, myDivs);
246  break;
247  case 11:
248  coerceValue(value, myRebar);
249  break;
250  case 12:
251  coerceValue(value, myOrientedBoundingBox);
252  break;
253  case 13:
254  coerceValue(value, myVertexNormals);
255  break;
256 
257  }
258  }
259 
260  bool isParmColorRamp(exint idx) const override
261  {
262  switch (idx)
263  {
264 
265  }
266  return false;
267  }
268 
269  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
270  { doGetParmValue(idx, instance, value); }
271  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
272  { doGetParmValue(idx, instance, value); }
273  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
274  { doGetParmValue(idx, instance, value); }
275  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
276  { doGetParmValue(idx, instance, value); }
277  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
278  { doGetParmValue(idx, instance, value); }
279  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
280  { doGetParmValue(idx, instance, value); }
281  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
282  { doGetParmValue(idx, instance, value); }
283  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
284  { doGetParmValue(idx, instance, value); }
285  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
286  { doGetParmValue(idx, instance, value); }
287  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
288  { doGetParmValue(idx, instance, value); }
289  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
290  { doGetParmValue(idx, instance, value); }
291 
292  template <typename T>
293  void
294  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
295  {
296  if (idx.size() < 1)
297  return;
298  UT_ASSERT(idx.size() == instance.size()+1);
299  if (idx.size() != instance.size()+1)
300  return;
301  switch (idx[0])
302  {
303  case 0:
304  coerceValue(myType, clampMinValue(0, clampMaxValue(6, value ) ));
305  break;
306  case 1:
307  coerceValue(mySurfType, clampMinValue(0, clampMaxValue(6, value ) ));
308  break;
309  case 2:
310  coerceValue(myConsolidatePoints, ( ( value ) ));
311  break;
312  case 3:
313  coerceValue(mySize, ( ( value ) ));
314  break;
315  case 4:
316  coerceValue(myCenter, ( ( value ) ));
317  break;
318  case 5:
319  coerceValue(myRotate, ( ( value ) ));
320  break;
321  case 6:
322  coerceValue(myScale, ( ( value ) ));
323  break;
324  case 7:
325  coerceValue(myDivRate, clampMinValue(1, ( value ) ));
326  break;
327  case 8:
328  coerceValue(myOrder, clampMinValue(2, clampMaxValue(11, value ) ));
329  break;
330  case 9:
331  coerceValue(myDoDivs, ( ( value ) ));
332  break;
333  case 10:
334  coerceValue(myDivs, clampMinValue(1, ( value ) ));
335  break;
336  case 11:
337  coerceValue(myRebar, ( ( value ) ));
338  break;
339  case 12:
340  coerceValue(myOrientedBoundingBox, ( ( value ) ));
341  break;
342  case 13:
343  coerceValue(myVertexNormals, ( ( value ) ));
344  break;
345 
346  }
347  }
348 
349  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
350  { doSetParmValue(idx, instance, value); }
351  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
352  { doSetParmValue(idx, instance, value); }
353  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
354  { doSetParmValue(idx, instance, value); }
355  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
356  { doSetParmValue(idx, instance, value); }
357  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
358  { doSetParmValue(idx, instance, value); }
359  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
360  { doSetParmValue(idx, instance, value); }
361  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
362  { doSetParmValue(idx, instance, value); }
363  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
364  { doSetParmValue(idx, instance, value); }
365  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
366  { doSetParmValue(idx, instance, value); }
367  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
368  { doSetParmValue(idx, instance, value); }
369  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
370  { doSetParmValue(idx, instance, value); }
371 
372  exint getNestNumParms(TempIndex idx) const override
373  {
374  if (idx.size() == 0)
375  return 14;
376  switch (idx[0])
377  {
378 
379  }
380  // Invalid
381  return 0;
382  }
383 
384  const char *getNestParmName(TempIndex fieldnum) const override
385  {
386  if (fieldnum.size() < 1)
387  return 0;
388  switch (fieldnum[0])
389  {
390  case 0:
391  return "type";
392  case 1:
393  return "surftype";
394  case 2:
395  return "consolidatepts";
396  case 3:
397  return "size";
398  case 4:
399  return "t";
400  case 5:
401  return "r";
402  case 6:
403  return "scale";
404  case 7:
405  return "divrate";
406  case 8:
407  return "orderrate";
408  case 9:
409  return "dodivs";
410  case 10:
411  return "divs";
412  case 11:
413  return "rebar";
414  case 12:
415  return "orientedbbox";
416  case 13:
417  return "vertexnormals";
418 
419  }
420  return 0;
421  }
422 
423  ParmType getNestParmType(TempIndex fieldnum) const override
424  {
425  if (fieldnum.size() < 1)
426  return PARM_UNSUPPORTED;
427  switch (fieldnum[0])
428  {
429  case 0:
430  return PARM_INTEGER;
431  case 1:
432  return PARM_INTEGER;
433  case 2:
434  return PARM_INTEGER;
435  case 3:
436  return PARM_VECTOR3;
437  case 4:
438  return PARM_VECTOR3;
439  case 5:
440  return PARM_VECTOR3;
441  case 6:
442  return PARM_FLOAT;
443  case 7:
444  return PARM_VECTOR3;
445  case 8:
446  return PARM_VECTOR3;
447  case 9:
448  return PARM_INTEGER;
449  case 10:
450  return PARM_VECTOR3;
451  case 11:
452  return PARM_INTEGER;
453  case 12:
454  return PARM_INTEGER;
455  case 13:
456  return PARM_INTEGER;
457 
458  }
459  return PARM_UNSUPPORTED;
460  }
461 
462  // Boiler plate to load individual types.
463  static void loadData(UT_IStream &is, int64 &v)
464  { is.bread(&v, 1); }
465  static void loadData(UT_IStream &is, bool &v)
466  { int64 iv; is.bread(&iv, 1); v = iv; }
467  static void loadData(UT_IStream &is, fpreal64 &v)
468  { is.bread<fpreal64>(&v, 1); }
469  static void loadData(UT_IStream &is, UT_Vector2D &v)
470  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
471  static void loadData(UT_IStream &is, UT_Vector3D &v)
472  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
473  is.bread<fpreal64>(&v.z(), 1); }
474  static void loadData(UT_IStream &is, UT_Vector4D &v)
475  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
476  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
477  static void loadData(UT_IStream &is, UT_Matrix2D &v)
478  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
479  static void loadData(UT_IStream &is, UT_Matrix3D &v)
480  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
481  static void loadData(UT_IStream &is, UT_Matrix4D &v)
482  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
483  static void loadData(UT_IStream &is, UT_Vector2I &v)
484  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
485  static void loadData(UT_IStream &is, UT_Vector3I &v)
486  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
487  is.bread<int64>(&v.z(), 1); }
488  static void loadData(UT_IStream &is, UT_Vector4I &v)
489  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
490  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
492  { is.bread(v); }
494  { UT_StringHolder rampdata;
495  loadData(is, rampdata);
496  if (rampdata.isstring())
497  {
498  v.reset(new UT_Ramp());
499  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
500  v->load(istr);
501  }
502  else v.reset();
503  }
506  loadData(is, data);
507  if (data.isstring())
508  {
509  // Find the data type.
510  const char *colon = UT_StringWrap(data).findChar(':');
511  if (colon)
512  {
513  int typelen = colon - data.buffer();
515  type.strncpy(data.buffer(), typelen);
516  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
517 
518  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
519  }
520  }
521  else v.reset();
522  }
523 
524  static void saveData(std::ostream &os, int64 v)
525  { UTwrite(os, &v); }
526  static void saveData(std::ostream &os, bool v)
527  { int64 iv = v; UTwrite(os, &iv); }
528  static void saveData(std::ostream &os, fpreal64 v)
529  { UTwrite<fpreal64>(os, &v); }
530  static void saveData(std::ostream &os, UT_Vector2D v)
531  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
532  static void saveData(std::ostream &os, UT_Vector3D v)
533  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
534  UTwrite<fpreal64>(os, &v.z()); }
535  static void saveData(std::ostream &os, UT_Vector4D v)
536  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
537  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
538  static void saveData(std::ostream &os, UT_Matrix2D v)
540  static void saveData(std::ostream &os, UT_Matrix3D v)
542  static void saveData(std::ostream &os, UT_Matrix4D v)
544  static void saveData(std::ostream &os, UT_StringHolder s)
545  { UT_StringWrap(s).saveBinary(os); }
546  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
548  UT_OStringStream ostr;
549  if (s) s->save(ostr);
550  result = ostr.str();
551  saveData(os, result);
552  }
553  static void saveData(std::ostream &os, PRM_DataItemHandle s)
555  UT_OStringStream ostr;
556  if (s)
557  {
558  ostr << s->getDataTypeToken();
559  ostr << ":";
560  s->saveBinary(ostr);
561  }
562  result = ostr.str();
563  saveData(os, result);
564  }
565 
566 
567  void save(std::ostream &os) const
568  {
569  int32 v = version();
570  UTwrite(os, &v);
571  saveData(os, myType);
572  saveData(os, mySurfType);
573  saveData(os, myConsolidatePoints);
574  saveData(os, mySize);
575  saveData(os, myCenter);
576  saveData(os, myRotate);
577  saveData(os, myScale);
578  saveData(os, myDivRate);
579  saveData(os, myOrder);
580  saveData(os, myDoDivs);
581  saveData(os, myDivs);
582  saveData(os, myRebar);
583  saveData(os, myOrientedBoundingBox);
584  saveData(os, myVertexNormals);
585 
586  }
587 
588  bool load(UT_IStream &is)
589  {
590  int32 v;
591  is.bread(&v, 1);
592  if (version() != v)
593  {
594  // Fail incompatible versions
595  return false;
596  }
597  loadData(is, myType);
598  loadData(is, mySurfType);
599  loadData(is, myConsolidatePoints);
600  loadData(is, mySize);
601  loadData(is, myCenter);
602  loadData(is, myRotate);
603  loadData(is, myScale);
604  loadData(is, myDivRate);
605  loadData(is, myOrder);
606  loadData(is, myDoDivs);
607  loadData(is, myDivs);
608  loadData(is, myRebar);
609  loadData(is, myOrientedBoundingBox);
610  loadData(is, myVertexNormals);
611 
612  return true;
613  }
614 
615  Type getType() const { return Type(myType); }
616  void setType(Type val) { myType = int64(val); }
617  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
618  {
619  SOP_Node *thissop = cookparms.getNode();
620  if (!thissop) return getType();
621  int64 result;
622  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
623  return Type(result);
624  }
625  SurfType getSurfType() const { return SurfType(mySurfType); }
626  void setSurfType(SurfType val) { mySurfType = int64(val); }
628  {
629  SOP_Node *thissop = cookparms.getNode();
630  if (!thissop) return getSurfType();
631  int64 result;
632  OP_Utils::evalOpParm(result, thissop, "surftype", cookparms.getCookTime(), 0);
633  return SurfType(result);
634  }
635  bool getConsolidatePoints() const { return myConsolidatePoints; }
636  void setConsolidatePoints(bool val) { myConsolidatePoints = val; }
637  bool opConsolidatePoints(const SOP_NodeVerb::CookParms &cookparms) const
638  {
639  SOP_Node *thissop = cookparms.getNode();
640  if (!thissop) return getConsolidatePoints();
641  bool result;
642  OP_Utils::evalOpParm(result, thissop, "consolidatepts", cookparms.getCookTime(), 0);
643  return result;
644  }
645  UT_Vector3D getSize() const { return mySize; }
646  void setSize(UT_Vector3D val) { mySize = val; }
648  {
649  SOP_Node *thissop = cookparms.getNode();
650  if (!thissop) return getSize();
652  OP_Utils::evalOpParm(result, thissop, "size", cookparms.getCookTime(), 0);
653  return result;
654  }
655  UT_Vector3D getCenter() const { return myCenter; }
656  void setCenter(UT_Vector3D val) { myCenter = val; }
658  {
659  SOP_Node *thissop = cookparms.getNode();
660  if (!thissop) return getCenter();
662  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
663  return result;
664  }
665  UT_Vector3D getRotate() const { return myRotate; }
666  void setRotate(UT_Vector3D val) { myRotate = val; }
668  {
669  SOP_Node *thissop = cookparms.getNode();
670  if (!thissop) return getRotate();
672  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
673  return result;
674  }
675  fpreal64 getScale() const { return myScale; }
676  void setScale(fpreal64 val) { myScale = val; }
677  fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
678  {
679  SOP_Node *thissop = cookparms.getNode();
680  if (!thissop) return getScale();
682  OP_Utils::evalOpParm(result, thissop, "scale", cookparms.getCookTime(), 0);
683  return result;
684  }
685  UT_Vector3I getDivRate() const { return myDivRate; }
686  void setDivRate(UT_Vector3I val) { myDivRate = val; }
688  {
689  SOP_Node *thissop = cookparms.getNode();
690  if (!thissop) return getDivRate();
692  OP_Utils::evalOpParm(result, thissop, "divrate", cookparms.getCookTime(), 0);
693  return result;
694  }
695  UT_Vector3I getOrder() const { return myOrder; }
698  {
699  SOP_Node *thissop = cookparms.getNode();
700  if (!thissop) return getOrder();
702  OP_Utils::evalOpParm(result, thissop, "orderrate", cookparms.getCookTime(), 0);
703  return result;
704  }
705  bool getDoDivs() const { return myDoDivs; }
706  void setDoDivs(bool val) { myDoDivs = val; }
707  bool opDoDivs(const SOP_NodeVerb::CookParms &cookparms) const
708  {
709  SOP_Node *thissop = cookparms.getNode();
710  if (!thissop) return getDoDivs();
711  bool result;
712  OP_Utils::evalOpParm(result, thissop, "dodivs", cookparms.getCookTime(), 0);
713  return result;
714  }
715  UT_Vector3I getDivs() const { return myDivs; }
716  void setDivs(UT_Vector3I val) { myDivs = val; }
718  {
719  SOP_Node *thissop = cookparms.getNode();
720  if (!thissop) return getDivs();
722  OP_Utils::evalOpParm(result, thissop, "divs", cookparms.getCookTime(), 0);
723  return result;
724  }
725  bool getRebar() const { return myRebar; }
726  void setRebar(bool val) { myRebar = val; }
727  bool opRebar(const SOP_NodeVerb::CookParms &cookparms) const
728  {
729  SOP_Node *thissop = cookparms.getNode();
730  if (!thissop) return getRebar();
731  bool result;
732  OP_Utils::evalOpParm(result, thissop, "rebar", cookparms.getCookTime(), 0);
733  return result;
734  }
735  bool getOrientedBoundingBox() const { return myOrientedBoundingBox; }
736  void setOrientedBoundingBox(bool val) { myOrientedBoundingBox = val; }
737  bool opOrientedBoundingBox(const SOP_NodeVerb::CookParms &cookparms) const
738  {
739  SOP_Node *thissop = cookparms.getNode();
740  if (!thissop) return getOrientedBoundingBox();
741  bool result;
742  OP_Utils::evalOpParm(result, thissop, "orientedbbox", cookparms.getCookTime(), 0);
743  return result;
744  }
745  bool getVertexNormals() const { return myVertexNormals; }
746  void setVertexNormals(bool val) { myVertexNormals = val; }
747  bool opVertexNormals(const SOP_NodeVerb::CookParms &cookparms) const
748  {
749  SOP_Node *thissop = cookparms.getNode();
750  if (!thissop) return getVertexNormals();
751  bool result;
752  OP_Utils::evalOpParm(result, thissop, "vertexnormals", cookparms.getCookTime(), 0);
753  return result;
754  }
755 
756 private:
757  int64 myType;
758  int64 mySurfType;
759  bool myConsolidatePoints;
760  UT_Vector3D mySize;
761  UT_Vector3D myCenter;
762  UT_Vector3D myRotate;
763  fpreal64 myScale;
764  UT_Vector3I myDivRate;
766  bool myDoDivs;
767  UT_Vector3I myDivs;
768  bool myRebar;
769  bool myOrientedBoundingBox;
770  bool myVertexNormals;
771 
772 };
SurfType opSurfType(const SOP_NodeVerb::CookParms &cookparms) const
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
type
Definition: core.h:556
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:63
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)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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:303
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:278
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:96
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
void setDivs(UT_Vector3I val)
bool isParmColorRamp(exint idx) const override
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
UT_Vector3I opDivRate(const SOP_NodeVerb::CookParms &cookparms) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
UT_Vector3I opDivs(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
Definition: SOP_Box.proto.h:37
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)