HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Control.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_ControlEnums
24 {
25  enum class DisplayIcon
26  {
27  ICON = 0,
28  AXIS,
30  };
31  enum class ControlType
32  {
33  NULL_ = 0,
34  CIRCLES,
35  BOX,
36  PLANES,
38  NULLANDBOX,
40  CUSTOM
41  };
42  enum class Orientation
43  {
44  XYZ = 0,
45  X,
46  Y,
47  Z,
48  XY,
49  XZ,
50  YZ
51  };
52 }
53 
54 
56 {
57 public:
58  static int version() { return 1; }
59  struct SnapPoints
60  {
62 
63 
65  {
66  snappos = UT_Vector3D(0,0,0);
67 
68  }
69 
70  bool operator==(const SnapPoints &src) const
71  {
72  if (snappos != src.snappos) return false;
73 
74  return true;
75  }
76  bool operator!=(const SnapPoints &src) const
77  {
78  return !operator==(src);
79  }
80 
81  };
82 
84  {
86 
87  buf.strcat("[ ");
88  for (int i = 0; i < list.entries(); i++)
89  {
90  if (i)
91  buf.strcat(", ");
92  buf.strcat("( ");
93  buf.append("");
94  buf.appendSprintf("(%f, %f, %f)", list(i).snappos.x(), list(i).snappos.y(), list(i).snappos.z());
95 
96  buf.strcat(" )");
97  }
98  buf.strcat(" ]");
99 
101  return result;
102  }
103 
105  {
106  myUseColor = true;
107  myColor = UT_Vector3D(1,1,1);
108  mySize = UT_Vector3D(1,1,1);
109  myCenter = UT_Vector3D(0,0,0);
110  myRotate = UT_Vector3D(0,0,0);
111  myUniformScale = 1;
112  myDisplayIcon = 0;
113  myControlType = 0;
114  myOrientation = 0;
115  myShadedMode = false;
116  myPacked = true;
117  mySnapPoints.setSize(0);
118 
119  }
120 
121  explicit SOP_ControlParms(const SOP_ControlParms &) = default;
122  SOP_ControlParms &operator=(const SOP_ControlParms &) = default;
123  SOP_ControlParms(SOP_ControlParms &&) noexcept = default;
124  SOP_ControlParms &operator=(SOP_ControlParms &&) noexcept = default;
125 
126  ~SOP_ControlParms() override {}
127 
128  bool operator==(const SOP_ControlParms &src) const
129  {
130  if (myUseColor != src.myUseColor) return false;
131  if (myColor != src.myColor) return false;
132  if (mySize != src.mySize) return false;
133  if (myCenter != src.myCenter) return false;
134  if (myRotate != src.myRotate) return false;
135  if (myUniformScale != src.myUniformScale) return false;
136  if (myDisplayIcon != src.myDisplayIcon) return false;
137  if (myControlType != src.myControlType) return false;
138  if (myOrientation != src.myOrientation) return false;
139  if (myShadedMode != src.myShadedMode) return false;
140  if (myPacked != src.myPacked) return false;
141  if (mySnapPoints != src.mySnapPoints) return false;
142 
143  return true;
144  }
145  bool operator!=(const SOP_ControlParms &src) const
146  {
147  return !operator==(src);
148  }
152 
153 
154 
155  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
156  {
157  myUseColor = true;
158  if (true)
159  graph->evalOpParm(myUseColor, nodeidx, "usecolor", time, 0);
160  myColor = UT_Vector3D(1,1,1);
161  if (true)
162  graph->evalOpParm(myColor, nodeidx, "color", time, 0);
163  mySize = UT_Vector3D(1,1,1);
164  if (true)
165  graph->evalOpParm(mySize, nodeidx, "size", time, 0);
166  myCenter = UT_Vector3D(0,0,0);
167  if (true)
168  graph->evalOpParm(myCenter, nodeidx, "t", time, 0);
169  myRotate = UT_Vector3D(0,0,0);
170  if (true)
171  graph->evalOpParm(myRotate, nodeidx, "r", time, 0);
172  myUniformScale = 1;
173  if (true)
174  graph->evalOpParm(myUniformScale, nodeidx, "scale", time, 0);
175  myDisplayIcon = 0;
176  if (true)
177  graph->evalOpParm(myDisplayIcon, nodeidx, "displayicon", time, 0);
178  myControlType = 0;
179  if (true && ( (true&&!(((int64(getDisplayIcon())==1)))) ) )
180  graph->evalOpParm(myControlType, nodeidx, "controltype", time, 0);
181  myOrientation = 0;
182  if (true && ( (true&&!(((int64(getDisplayIcon())==1))||((int64(getDisplayIcon())!=1)&&(int64(getControlType())!=1)&&(int64(getControlType())!=3)&&(int64(getControlType())!=4)&&(int64(getControlType())!=6)))) ) )
183  graph->evalOpParm(myOrientation, nodeidx, "orientation", time, 0);
184  myShadedMode = false;
185  if (true)
186  graph->evalOpParm(myShadedMode, nodeidx, "shadedmode", time, 0);
187  myPacked = true;
188  if (true)
189  graph->evalOpParm(myPacked, nodeidx, "packed", time, 0);
190  if (true)
191  {
192  int64 length = 0;
193  graph->evalOpParm(length, nodeidx, "numsnappoints", time, 0);
194  if (length < 0) length = 0;
195  mySnapPoints.setSize(length);
196  for (exint i = 0; i < length; i++)
197  {
198  int parmidx[1];
199  int offsets[1];
200  parmidx[0] = i+1;
201  offsets[0] = 1;
202  auto && _curentry = mySnapPoints(i);
203  (void) _curentry;
204  _curentry.snappos = UT_Vector3D(0,0,0);
205  if (true)
206  graph->evalOpParmInst(_curentry.snappos, nodeidx, "snappos#", parmidx, offsets, time, 0, 2-1);
207 
208  }
209  }
210  else
211  mySnapPoints.clear();
212 
213  }
214 
215 
216  void loadFromOpSubclass(const LoadParms &loadparms) override
217  {
218  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
219  }
220 
221 
222  void copyFrom(const OP_NodeParms *src) override
223  {
224  *this = *((const SOP_ControlParms *)src);
225  }
226 
227  template <typename T>
228  void
229  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
230  {
231  if (idx.size() < 1)
232  return;
233  UT_ASSERT(idx.size() == instance.size()+1);
234  if (idx.size() != instance.size()+1)
235  return;
236  switch (idx[0])
237  {
238  case 0:
239  coerceValue(value, myUseColor);
240  break;
241  case 1:
242  coerceValue(value, myColor);
243  break;
244  case 2:
245  coerceValue(value, mySize);
246  break;
247  case 3:
248  coerceValue(value, myCenter);
249  break;
250  case 4:
251  coerceValue(value, myRotate);
252  break;
253  case 5:
254  coerceValue(value, myUniformScale);
255  break;
256  case 6:
257  coerceValue(value, myDisplayIcon);
258  break;
259  case 7:
260  coerceValue(value, myControlType);
261  break;
262  case 8:
263  coerceValue(value, myOrientation);
264  break;
265  case 9:
266  coerceValue(value, myShadedMode);
267  break;
268  case 10:
269  coerceValue(value, myPacked);
270  break;
271  case 11:
272  if (idx.size() == 1)
273  coerceValue(value, mySnapPoints.entries());
274  else if (instance[0] < mySnapPoints.entries())
275  {
276  auto && _data = mySnapPoints(instance[0]);
277  switch (idx[1])
278  {
279  case 0:
280  coerceValue(value, _data.snappos);
281  break;
282 
283  }
284  }
285  break;
286 
287  }
288  }
289 
290  bool isParmColorRamp(exint idx) const override
291  {
292  switch (idx)
293  {
294 
295  }
296  return false;
297  }
298 
299  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
300  { doGetParmValue(idx, instance, value); }
301  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
302  { doGetParmValue(idx, instance, value); }
303  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
304  { doGetParmValue(idx, instance, value); }
305  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
306  { doGetParmValue(idx, instance, value); }
307  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
308  { doGetParmValue(idx, instance, value); }
309  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
310  { doGetParmValue(idx, instance, value); }
311  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
312  { doGetParmValue(idx, instance, value); }
313  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
314  { doGetParmValue(idx, instance, value); }
315  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
316  { doGetParmValue(idx, instance, value); }
317  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
318  { doGetParmValue(idx, instance, value); }
319  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
320  { doGetParmValue(idx, instance, value); }
321 
322  template <typename T>
323  void
324  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
325  {
326  if (idx.size() < 1)
327  return;
328  UT_ASSERT(idx.size() == instance.size()+1);
329  if (idx.size() != instance.size()+1)
330  return;
331  switch (idx[0])
332  {
333  case 0:
334  coerceValue(myUseColor, ( ( value ) ));
335  break;
336  case 1:
337  coerceValue(myColor, ( ( value ) ));
338  break;
339  case 2:
340  coerceValue(mySize, ( ( value ) ));
341  break;
342  case 3:
343  coerceValue(myCenter, ( ( value ) ));
344  break;
345  case 4:
346  coerceValue(myRotate, ( ( value ) ));
347  break;
348  case 5:
349  coerceValue(myUniformScale, ( ( value ) ));
350  break;
351  case 6:
352  coerceValue(myDisplayIcon, clampMinValue(0, clampMaxValue(2, value ) ));
353  break;
354  case 7:
355  coerceValue(myControlType, clampMinValue(0, clampMaxValue(7, value ) ));
356  break;
357  case 8:
358  coerceValue(myOrientation, clampMinValue(0, clampMaxValue(6, value ) ));
359  break;
360  case 9:
361  coerceValue(myShadedMode, ( ( value ) ));
362  break;
363  case 10:
364  coerceValue(myPacked, ( ( value ) ));
365  break;
366  case 11:
367  if (idx.size() == 1)
368  {
369  exint newsize;
370  coerceValue(newsize, value);
371  if (newsize < 0) newsize = 0;
372  mySnapPoints.setSize(newsize);
373  }
374  else
375  {
376  if (instance[0] < 0)
377  return;
378  mySnapPoints.setSizeIfNeeded(instance[0]+1);
379  auto && _data = mySnapPoints(instance[0]);
380  switch (idx[1])
381  {
382  case 0:
383  coerceValue(_data.snappos, value);
384  break;
385 
386  }
387  }
388  break;
389 
390  }
391  }
392 
393  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
394  { doSetParmValue(idx, instance, value); }
395  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
396  { doSetParmValue(idx, instance, value); }
397  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
398  { doSetParmValue(idx, instance, value); }
399  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
400  { doSetParmValue(idx, instance, value); }
401  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
402  { doSetParmValue(idx, instance, value); }
403  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
404  { doSetParmValue(idx, instance, value); }
405  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
406  { doSetParmValue(idx, instance, value); }
407  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
408  { doSetParmValue(idx, instance, value); }
409  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
410  { doSetParmValue(idx, instance, value); }
411  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
412  { doSetParmValue(idx, instance, value); }
413  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
414  { doSetParmValue(idx, instance, value); }
415 
416  exint getNestNumParms(TempIndex idx) const override
417  {
418  if (idx.size() == 0)
419  return 12;
420  switch (idx[0])
421  {
422  case 11:
423  return 1;
424 
425  }
426  // Invalid
427  return 0;
428  }
429 
430  const char *getNestParmName(TempIndex fieldnum) const override
431  {
432  if (fieldnum.size() < 1)
433  return 0;
434  switch (fieldnum[0])
435  {
436  case 0:
437  return "usecolor";
438  case 1:
439  return "color";
440  case 2:
441  return "size";
442  case 3:
443  return "t";
444  case 4:
445  return "r";
446  case 5:
447  return "scale";
448  case 6:
449  return "displayicon";
450  case 7:
451  return "controltype";
452  case 8:
453  return "orientation";
454  case 9:
455  return "shadedmode";
456  case 10:
457  return "packed";
458  case 11:
459  if (fieldnum.size() == 1)
460  return "numsnappoints";
461  switch (fieldnum[1])
462  {
463  case 0:
464  return "snappos#";
465 
466  }
467  return 0;
468 
469  }
470  return 0;
471  }
472 
473  ParmType getNestParmType(TempIndex fieldnum) const override
474  {
475  if (fieldnum.size() < 1)
476  return PARM_UNSUPPORTED;
477  switch (fieldnum[0])
478  {
479  case 0:
480  return PARM_INTEGER;
481  case 1:
482  return PARM_VECTOR3;
483  case 2:
484  return PARM_VECTOR3;
485  case 3:
486  return PARM_VECTOR3;
487  case 4:
488  return PARM_VECTOR3;
489  case 5:
490  return PARM_FLOAT;
491  case 6:
492  return PARM_INTEGER;
493  case 7:
494  return PARM_INTEGER;
495  case 8:
496  return PARM_INTEGER;
497  case 9:
498  return PARM_INTEGER;
499  case 10:
500  return PARM_INTEGER;
501  case 11:
502  if (fieldnum.size() == 1)
503  return PARM_MULTIPARM;
504  switch (fieldnum[1])
505  {
506  case 0:
507  return PARM_VECTOR3;
508 
509  }
510  return PARM_UNSUPPORTED;
511 
512  }
513  return PARM_UNSUPPORTED;
514  }
515 
516  // Boiler plate to load individual types.
517  static void loadData(UT_IStream &is, int64 &v)
518  { is.bread(&v, 1); }
519  static void loadData(UT_IStream &is, bool &v)
520  { int64 iv; is.bread(&iv, 1); v = iv; }
521  static void loadData(UT_IStream &is, fpreal64 &v)
522  { is.bread<fpreal64>(&v, 1); }
523  static void loadData(UT_IStream &is, UT_Vector2D &v)
524  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
525  static void loadData(UT_IStream &is, UT_Vector3D &v)
526  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
527  is.bread<fpreal64>(&v.z(), 1); }
528  static void loadData(UT_IStream &is, UT_Vector4D &v)
529  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
530  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
531  static void loadData(UT_IStream &is, UT_Matrix2D &v)
532  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
533  static void loadData(UT_IStream &is, UT_Matrix3D &v)
534  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
535  static void loadData(UT_IStream &is, UT_Matrix4D &v)
536  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
537  static void loadData(UT_IStream &is, UT_Vector2I &v)
538  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
539  static void loadData(UT_IStream &is, UT_Vector3I &v)
540  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
541  is.bread<int64>(&v.z(), 1); }
542  static void loadData(UT_IStream &is, UT_Vector4I &v)
543  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
544  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
546  { is.bread(v); }
548  { UT_StringHolder rampdata;
549  loadData(is, rampdata);
550  if (rampdata.isstring())
551  {
552  v.reset(new UT_Ramp());
553  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
554  v->load(istr);
555  }
556  else v.reset();
557  }
560  loadData(is, data);
561  if (data.isstring())
562  {
563  // Find the data type.
564  const char *colon = UT_StringWrap(data).findChar(':');
565  if (colon)
566  {
567  int typelen = colon - data.buffer();
569  type.strncpy(data.buffer(), typelen);
570  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
571 
572  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
573  }
574  }
575  else v.reset();
576  }
577 
578  static void saveData(std::ostream &os, int64 v)
579  { UTwrite(os, &v); }
580  static void saveData(std::ostream &os, bool v)
581  { int64 iv = v; UTwrite(os, &iv); }
582  static void saveData(std::ostream &os, fpreal64 v)
583  { UTwrite<fpreal64>(os, &v); }
584  static void saveData(std::ostream &os, UT_Vector2D v)
585  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
586  static void saveData(std::ostream &os, UT_Vector3D v)
587  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
588  UTwrite<fpreal64>(os, &v.z()); }
589  static void saveData(std::ostream &os, UT_Vector4D v)
590  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
591  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
592  static void saveData(std::ostream &os, UT_Matrix2D v)
594  static void saveData(std::ostream &os, UT_Matrix3D v)
596  static void saveData(std::ostream &os, UT_Matrix4D v)
598  static void saveData(std::ostream &os, UT_StringHolder s)
599  { UT_StringWrap(s).saveBinary(os); }
600  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
602  UT_OStringStream ostr;
603  if (s) s->save(ostr);
604  result = ostr.str();
605  saveData(os, result);
606  }
607  static void saveData(std::ostream &os, PRM_DataItemHandle s)
609  UT_OStringStream ostr;
610  if (s)
611  {
612  ostr << s->getDataTypeToken();
613  ostr << ":";
614  s->saveBinary(ostr);
615  }
616  result = ostr.str();
617  saveData(os, result);
618  }
619 
620 
621  void save(std::ostream &os) const
622  {
623  int32 v = version();
624  UTwrite(os, &v);
625  saveData(os, myUseColor);
626  saveData(os, myColor);
627  saveData(os, mySize);
628  saveData(os, myCenter);
629  saveData(os, myRotate);
630  saveData(os, myUniformScale);
631  saveData(os, myDisplayIcon);
632  saveData(os, myControlType);
633  saveData(os, myOrientation);
634  saveData(os, myShadedMode);
635  saveData(os, myPacked);
636  {
637  int64 length = mySnapPoints.entries();
638  UTwrite(os, &length);
639  for (exint i = 0; i < length; i++)
640  {
641  auto && _curentry = mySnapPoints(i);
642  (void) _curentry;
643  saveData(os, _curentry.snappos);
644 
645  }
646  }
647 
648  }
649 
650  bool load(UT_IStream &is)
651  {
652  int32 v;
653  is.bread(&v, 1);
654  if (version() != v)
655  {
656  // Fail incompatible versions
657  return false;
658  }
659  loadData(is, myUseColor);
660  loadData(is, myColor);
661  loadData(is, mySize);
662  loadData(is, myCenter);
663  loadData(is, myRotate);
664  loadData(is, myUniformScale);
665  loadData(is, myDisplayIcon);
666  loadData(is, myControlType);
667  loadData(is, myOrientation);
668  loadData(is, myShadedMode);
669  loadData(is, myPacked);
670  {
671  int64 length;
672  is.read(&length, 1);
673  mySnapPoints.setSize(length);
674  for (exint i = 0; i < length; i++)
675  {
676  auto && _curentry = mySnapPoints(i);
677  (void) _curentry;
678  loadData(is, _curentry.snappos);
679 
680  }
681  }
682 
683  return true;
684  }
685 
686  bool getUseColor() const { return myUseColor; }
687  void setUseColor(bool val) { myUseColor = val; }
688  bool opUseColor(const SOP_NodeVerb::CookParms &cookparms) const
689  {
690  SOP_Node *thissop = cookparms.getNode();
691  if (!thissop) return getUseColor();
692  bool result;
693  OP_Utils::evalOpParm(result, thissop, "usecolor", cookparms.getCookTime(), 0);
694  return result;
695  }
696  UT_Vector3D getColor() const { return myColor; }
697  void setColor(UT_Vector3D val) { myColor = val; }
699  {
700  SOP_Node *thissop = cookparms.getNode();
701  if (!thissop) return getColor();
703  OP_Utils::evalOpParm(result, thissop, "color", cookparms.getCookTime(), 0);
704  return result;
705  }
706  UT_Vector3D getSize() const { return mySize; }
707  void setSize(UT_Vector3D val) { mySize = val; }
709  {
710  SOP_Node *thissop = cookparms.getNode();
711  if (!thissop) return getSize();
713  OP_Utils::evalOpParm(result, thissop, "size", cookparms.getCookTime(), 0);
714  return result;
715  }
716  UT_Vector3D getCenter() const { return myCenter; }
717  void setCenter(UT_Vector3D val) { myCenter = val; }
719  {
720  SOP_Node *thissop = cookparms.getNode();
721  if (!thissop) return getCenter();
723  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
724  return result;
725  }
726  UT_Vector3D getRotate() const { return myRotate; }
727  void setRotate(UT_Vector3D val) { myRotate = val; }
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return getRotate();
733  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
734  return result;
735  }
736  fpreal64 getUniformScale() const { return myUniformScale; }
737  void setUniformScale(fpreal64 val) { myUniformScale = val; }
739  {
740  SOP_Node *thissop = cookparms.getNode();
741  if (!thissop) return getUniformScale();
743  OP_Utils::evalOpParm(result, thissop, "scale", cookparms.getCookTime(), 0);
744  return result;
745  }
746  DisplayIcon getDisplayIcon() const { return DisplayIcon(myDisplayIcon); }
747  void setDisplayIcon(DisplayIcon val) { myDisplayIcon = int64(val); }
749  {
750  SOP_Node *thissop = cookparms.getNode();
751  if (!thissop) return getDisplayIcon();
752  int64 result;
753  OP_Utils::evalOpParm(result, thissop, "displayicon", cookparms.getCookTime(), 0);
754  return DisplayIcon(result);
755  }
756  ControlType getControlType() const { return ControlType(myControlType); }
757  void setControlType(ControlType val) { myControlType = int64(val); }
759  {
760  SOP_Node *thissop = cookparms.getNode();
761  if (!thissop) return getControlType();
762  int64 result;
763  OP_Utils::evalOpParm(result, thissop, "controltype", cookparms.getCookTime(), 0);
764  return ControlType(result);
765  }
766  Orientation getOrientation() const { return Orientation(myOrientation); }
767  void setOrientation(Orientation val) { myOrientation = int64(val); }
769  {
770  SOP_Node *thissop = cookparms.getNode();
771  if (!thissop) return getOrientation();
772  int64 result;
773  OP_Utils::evalOpParm(result, thissop, "orientation", cookparms.getCookTime(), 0);
774  return Orientation(result);
775  }
776  bool getShadedMode() const { return myShadedMode; }
777  void setShadedMode(bool val) { myShadedMode = val; }
778  bool opShadedMode(const SOP_NodeVerb::CookParms &cookparms) const
779  {
780  SOP_Node *thissop = cookparms.getNode();
781  if (!thissop) return getShadedMode();
782  bool result;
783  OP_Utils::evalOpParm(result, thissop, "shadedmode", cookparms.getCookTime(), 0);
784  return result;
785  }
786  bool getPacked() const { return myPacked; }
787  void setPacked(bool val) { myPacked = val; }
788  bool opPacked(const SOP_NodeVerb::CookParms &cookparms) const
789  {
790  SOP_Node *thissop = cookparms.getNode();
791  if (!thissop) return getPacked();
792  bool result;
793  OP_Utils::evalOpParm(result, thissop, "packed", cookparms.getCookTime(), 0);
794  return result;
795  }
796  const UT_Array<SnapPoints> &getSnapPoints() const { return mySnapPoints; }
797 void setSnapPoints(const UT_Array<SnapPoints> &val) { mySnapPoints = val; }
799  {
800  SOP_Node *thissop = cookparms.getNode();
801  if (!thissop) return getSnapPoints().entries();
802  exint result;
803  OP_Utils::evalOpParm(result, thissop, "numsnappoints", cookparms.getCookTime(), 0);
804  return result;
805  }
806  UT_Vector3D opSnapPoints_snappos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
807  { return opinstSnapPoints_snappos(cookparms, &_idx); }
808  UT_Vector3D opinstSnapPoints_snappos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
809  {
810  SOP_Node *thissop = cookparms.getNode();
811  if (!thissop) return (mySnapPoints(_idx[0]).snappos);
812  int _parmidx[2-1];
813  _parmidx[1-1] = _idx[1-1] + 1;
814 
816  OP_Utils::evalOpParmInst(result, thissop, "snappos#", _parmidx, cookparms.getCookTime(), 0, 2-1);
817  return (result);
818  }
819 
820 
821 private:
822  bool myUseColor;
823  UT_Vector3D myColor;
824  UT_Vector3D mySize;
825  UT_Vector3D myCenter;
826  UT_Vector3D myRotate;
827  fpreal64 myUniformScale;
828  int64 myDisplayIcon;
829  int64 myControlType;
830  int64 myOrientation;
831  bool myShadedMode;
832  bool myPacked;
833  UT_Array<SnapPoints> mySnapPoints;
834 
835 };
static void loadData(UT_IStream &is, UT_Vector4D &v)
DisplayIcon opDisplayIcon(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
bool getPacked() const
void setPacked(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void saveData(std::ostream &os, UT_StringHolder s)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
bool operator!=(const SOP_ControlParms &src) const
UT_Vector3D getRotate() const
void copyFrom(const OP_NodeParms *src) override
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
void
Definition: png.h:1083
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 GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
void setCenter(UT_Vector3D val)
void setSnapPoints(const UT_Array< SnapPoints > &val)
void setUseColor(bool val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
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
UT_Vector3D getSize() const
GLdouble s
Definition: glad.h:3009
bool isParmColorRamp(exint idx) const override
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
An output stream object that owns its own string buffer storage.
**But if you need a result
Definition: thread.h:613
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
Orientation getOrientation() const
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
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, UT_Vector4D v)
UT_StringHolder createString(const UT_Array< SnapPoints > &list) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, int64 &v)
bool opShadedMode(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
UT_Vector3D opRotate(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D opColor(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SnapPoints &src) const
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool load(UT_IStream &is)
exint length() const
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 loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
bool operator==(const SnapPoints &src) const
const UT_Array< SnapPoints > & getSnapPoints() const
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
static void saveData(std::ostream &os, UT_Matrix3D v)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
fpreal64 opUniformScale(const SOP_NodeVerb::CookParms &cookparms) const
ControlType getControlType() const
void save(std::ostream &os) const
exint opSnapPoints(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setUniformScale(fpreal64 val)
exint getNestNumParms(TempIndex idx) const override
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
long long int64
Definition: SYS_Types.h:116
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
UT_Vector3D opinstSnapPoints_snappos(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, bool v)
UT_Vector3T< fpreal64 > UT_Vector3D
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_Vector3D opCenter(const SOP_NodeVerb::CookParms &cookparms) const
Orientation opOrientation(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D getColor() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static int version()
SYS_FORCE_INLINE void strcat(const char *src)
bool opUseColor(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
void setSize(UT_Vector3D val)
bool opPacked(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setOrientation(Orientation val)
UT_Vector3D opSize(const SOP_NodeVerb::CookParms &cookparms) const
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
static void saveData(std::ostream &os, PRM_DataItemHandle s)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void loadData(UT_IStream &is, UT_Vector3D &v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
bool getUseColor() const
void setControlType(ControlType val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
void setRotate(UT_Vector3D val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool operator==(const SOP_ControlParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
ParmType getNestParmType(TempIndex fieldnum) 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
void setShadedMode(bool val)
fpreal64 getUniformScale() const
GLboolean r
Definition: glcorearb.h:1222
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, bool &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
static void saveData(std::ostream &os, UT_Vector2D v)
void setColor(UT_Vector3D val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setDisplayIcon(DisplayIcon val)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
bool getShadedMode() const
DisplayIcon getDisplayIcon() const
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_Vector3D opSnapPoints_snappos(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_Vector3D getCenter() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
ControlType opControlType(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663