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_NodeVerb.h>
7 #include <SOP/SOP_GraphProxy.h>
8 
9 #include <OP/OP_Utils.h>
10 #include <PRM/PRM_Parm.h>
11 #include <UT/UT_IStream.h>
12 #include <UT/UT_NTStreamUtil.h>
13 #include <UT/UT_Ramp.h>
14 #include <UT/UT_SharedPtr.h>
15 #include <UT/UT_StringHolder.h>
16 #include <UT/UT_StringStream.h>
17 #include <UT/UT_VectorTypes.h>
18 #include <SYS/SYS_Types.h>
19 
20 using namespace UT::Literal;
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 
118  }
119 
120  explicit SOP_ControlParms(const SOP_ControlParms &) = default;
121 
122  ~SOP_ControlParms() override {}
123 
124  bool operator==(const SOP_ControlParms &src) const
125  {
126  if (myUseColor != src.myUseColor) return false;
127  if (myColor != src.myColor) return false;
128  if (mySize != src.mySize) return false;
129  if (myCenter != src.myCenter) return false;
130  if (myRotate != src.myRotate) return false;
131  if (myUniformScale != src.myUniformScale) return false;
132  if (myDisplayIcon != src.myDisplayIcon) return false;
133  if (myControlType != src.myControlType) return false;
134  if (myOrientation != src.myOrientation) return false;
135  if (myShadedMode != src.myShadedMode) return false;
136  if (myPacked != src.myPacked) return false;
137  if (mySnapPoints != src.mySnapPoints) return false;
138 
139  return true;
140  }
141  bool operator!=(const SOP_ControlParms &src) const
142  {
143  return !operator==(src);
144  }
148 
149 
150 
151  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
152  {
153  myUseColor = true;
154  if (true)
155  graph->evalOpParm(myUseColor, nodeidx, "usecolor", time, 0);
156  myColor = UT_Vector3D(1,1,1);
157  if (true)
158  graph->evalOpParm(myColor, nodeidx, "color", time, 0);
159  mySize = UT_Vector3D(1,1,1);
160  if (true)
161  graph->evalOpParm(mySize, nodeidx, "size", time, 0);
162  myCenter = UT_Vector3D(0,0,0);
163  if (true)
164  graph->evalOpParm(myCenter, nodeidx, "t", time, 0);
165  myRotate = UT_Vector3D(0,0,0);
166  if (true)
167  graph->evalOpParm(myRotate, nodeidx, "r", time, 0);
168  myUniformScale = 1;
169  if (true)
170  graph->evalOpParm(myUniformScale, nodeidx, "scale", time, 0);
171  myDisplayIcon = 0;
172  if (true)
173  graph->evalOpParm(myDisplayIcon, nodeidx, "displayicon", time, 0);
174  myControlType = 0;
175  if (true && ( (!(((int64(getDisplayIcon())==1)))) ) )
176  graph->evalOpParm(myControlType, nodeidx, "controltype", time, 0);
177  myOrientation = 0;
178  if (true && ( (!(((int64(getDisplayIcon())==1))||((int64(getDisplayIcon())!=1)&&(int64(getControlType())!=1)&&(int64(getControlType())!=3)&&(int64(getControlType())!=4)&&(int64(getControlType())!=6)))) ) )
179  graph->evalOpParm(myOrientation, nodeidx, "orientation", time, 0);
180  myShadedMode = false;
181  if (true)
182  graph->evalOpParm(myShadedMode, nodeidx, "shadedmode", time, 0);
183  myPacked = true;
184  if (true)
185  graph->evalOpParm(myPacked, nodeidx, "packed", time, 0);
186  if (true)
187  {
188  int64 length = 0;
189  graph->evalOpParm(length, nodeidx, "numsnappoints", time, 0);
190  mySnapPoints.entries(length);
191  for (exint i = 0; i < length; i++)
192  {
193  int parmidx = i+1;
194  auto && _curentry = mySnapPoints(i);
195  (void) _curentry;
196  mySnapPoints(i).snappos = UT_Vector3D(0,0,0);
197  if (true)
198  graph->evalOpParmInst(mySnapPoints(i).snappos, nodeidx, "snappos#", &parmidx, time, 0);
199 
200  }
201  }
202  else
203  mySnapPoints.clear();
204 
205  }
206 
207 
208  void loadFromOpSubclass(const LoadParms &loadparms) override
209  {
210  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
211  }
212 
213 
214  void copyFrom(const SOP_NodeParms *src) override
215  {
216  *this = *((const SOP_ControlParms *)src);
217  }
218 
219  template <typename T>
220  void
221  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
222  {
223  if (idx.size() < 1)
224  return;
225  UT_ASSERT(idx.size() == instance.size()+1);
226  if (idx.size() != instance.size()+1)
227  return;
228  switch (idx[0])
229  {
230  case 0:
231  coerceValue(value, myUseColor);
232  break;
233  case 1:
234  coerceValue(value, myColor);
235  break;
236  case 2:
237  coerceValue(value, mySize);
238  break;
239  case 3:
240  coerceValue(value, myCenter);
241  break;
242  case 4:
243  coerceValue(value, myRotate);
244  break;
245  case 5:
246  coerceValue(value, myUniformScale);
247  break;
248  case 6:
249  coerceValue(value, myDisplayIcon);
250  break;
251  case 7:
252  coerceValue(value, myControlType);
253  break;
254  case 8:
255  coerceValue(value, myOrientation);
256  break;
257  case 9:
258  coerceValue(value, myShadedMode);
259  break;
260  case 10:
261  coerceValue(value, myPacked);
262  break;
263  case 11:
264  if (idx.size() == 1)
265  coerceValue(value, mySnapPoints.entries());
266  else if (instance[0] < mySnapPoints.entries())
267  {
268  auto && _data = mySnapPoints(instance[0]);
269  switch (idx[1])
270  {
271  case 0:
272  coerceValue(value, _data.snappos);
273  break;
274 
275  }
276  }
277  break;
278 
279  }
280  }
281 
282  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
283  { doGetParmValue(idx, instance, value); }
284  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
285  { doGetParmValue(idx, instance, value); }
286  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
287  { doGetParmValue(idx, instance, value); }
288  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
289  { doGetParmValue(idx, instance, value); }
290  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
291  { doGetParmValue(idx, instance, value); }
292  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
293  { doGetParmValue(idx, instance, value); }
294  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
299  { doGetParmValue(idx, instance, value); }
300  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
303  { doGetParmValue(idx, instance, value); }
304 
305  template <typename T>
306  void
307  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
308  {
309  if (idx.size() < 1)
310  return;
311  UT_ASSERT(idx.size() == instance.size()+1);
312  if (idx.size() != instance.size()+1)
313  return;
314  switch (idx[0])
315  {
316  case 0:
317  coerceValue(myUseColor, value);
318  break;
319  case 1:
320  coerceValue(myColor, value);
321  break;
322  case 2:
323  coerceValue(mySize, value);
324  break;
325  case 3:
326  coerceValue(myCenter, value);
327  break;
328  case 4:
329  coerceValue(myRotate, value);
330  break;
331  case 5:
332  coerceValue(myUniformScale, value);
333  break;
334  case 6:
335  coerceValue(myDisplayIcon, value);
336  break;
337  case 7:
338  coerceValue(myControlType, value);
339  break;
340  case 8:
341  coerceValue(myOrientation, value);
342  break;
343  case 9:
344  coerceValue(myShadedMode, value);
345  break;
346  case 10:
347  coerceValue(myPacked, value);
348  break;
349  case 11:
350  if (idx.size() == 1)
351  {
352  exint newsize;
353  coerceValue(newsize, value);
354  mySnapPoints.setSize(newsize);
355  }
356  else
357  {
358  mySnapPoints.setSizeIfNeeded(instance[0]+1);
359  auto && _data = mySnapPoints(instance[0]);
360  switch (idx[1])
361  {
362  case 0:
363  coerceValue(_data.snappos, value);
364  break;
365 
366  }
367  }
368  break;
369 
370  }
371  }
372 
373  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
374  { doSetParmValue(idx, instance, value); }
375  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
376  { doSetParmValue(idx, instance, value); }
377  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
378  { doSetParmValue(idx, instance, value); }
379  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
380  { doSetParmValue(idx, instance, value); }
381  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
382  { doSetParmValue(idx, instance, value); }
383  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
384  { doSetParmValue(idx, instance, value); }
385  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
386  { doSetParmValue(idx, instance, value); }
387  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
388  { doSetParmValue(idx, instance, value); }
389  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
390  { doSetParmValue(idx, instance, value); }
391  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
392  { doSetParmValue(idx, instance, value); }
393  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
394  { doSetParmValue(idx, instance, value); }
395 
396  exint getNestNumParms(TempIndex idx) const override
397  {
398  if (idx.size() == 0)
399  return 12;
400  switch (idx[0])
401  {
402  case 11:
403  return 1;
404 
405  }
406  // Invalid
407  return 0;
408  }
409 
410  const char *getNestParmName(TempIndex fieldnum) const override
411  {
412  if (fieldnum.size() < 1)
413  return 0;
414  switch (fieldnum[0])
415  {
416  case 0:
417  return "usecolor";
418  case 1:
419  return "color";
420  case 2:
421  return "size";
422  case 3:
423  return "t";
424  case 4:
425  return "r";
426  case 5:
427  return "scale";
428  case 6:
429  return "displayicon";
430  case 7:
431  return "controltype";
432  case 8:
433  return "orientation";
434  case 9:
435  return "shadedmode";
436  case 10:
437  return "packed";
438  case 11:
439  if (fieldnum.size() == 1)
440  return "numsnappoints";
441  switch (fieldnum[1])
442  {
443  case 0:
444  return "snappos#";
445 
446  }
447  return 0;
448 
449  }
450  return 0;
451  }
452 
453  ParmType getNestParmType(TempIndex fieldnum) const override
454  {
455  if (fieldnum.size() < 1)
456  return PARM_UNSUPPORTED;
457  switch (fieldnum[0])
458  {
459  case 0:
460  return PARM_INTEGER;
461  case 1:
462  return PARM_VECTOR3;
463  case 2:
464  return PARM_VECTOR3;
465  case 3:
466  return PARM_VECTOR3;
467  case 4:
468  return PARM_VECTOR3;
469  case 5:
470  return PARM_FLOAT;
471  case 6:
472  return PARM_INTEGER;
473  case 7:
474  return PARM_INTEGER;
475  case 8:
476  return PARM_INTEGER;
477  case 9:
478  return PARM_INTEGER;
479  case 10:
480  return PARM_INTEGER;
481  case 11:
482  if (fieldnum.size() == 1)
483  return PARM_MULTIPARM;
484  switch (fieldnum[1])
485  {
486  case 0:
487  return PARM_VECTOR3;
488 
489  }
490  return PARM_UNSUPPORTED;
491 
492  }
493  return PARM_UNSUPPORTED;
494  }
495 
496  // Boiler plate to load individual types.
497  static void loadData(UT_IStream &is, int64 &v)
498  { is.bread(&v, 1); }
499  static void loadData(UT_IStream &is, bool &v)
500  { int64 iv; is.bread(&iv, 1); v = iv; }
501  static void loadData(UT_IStream &is, fpreal64 &v)
502  { is.bread<fpreal64>(&v, 1); }
503  static void loadData(UT_IStream &is, UT_Vector2D &v)
504  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
505  static void loadData(UT_IStream &is, UT_Vector3D &v)
506  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
507  is.bread<fpreal64>(&v.z(), 1); }
508  static void loadData(UT_IStream &is, UT_Vector4D &v)
509  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
510  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
511  static void loadData(UT_IStream &is, UT_Matrix2D &v)
512  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
513  static void loadData(UT_IStream &is, UT_Matrix3D &v)
514  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
515  static void loadData(UT_IStream &is, UT_Matrix4D &v)
516  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
517  static void loadData(UT_IStream &is, UT_Vector2I &v)
518  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
519  static void loadData(UT_IStream &is, UT_Vector3I &v)
520  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
521  is.bread<int64>(&v.z(), 1); }
522  static void loadData(UT_IStream &is, UT_Vector4I &v)
523  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
524  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
526  { is.bread(v); }
528  { UT_StringHolder rampdata;
529  loadData(is, rampdata);
530  if (rampdata.isstring())
531  {
532  v.reset(new UT_Ramp());
533  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
534  v->load(istr);
535  }
536  else v.reset();
537  }
540  loadData(is, data);
541  if (data.isstring())
542  {
543  // Find the data type.
544  const char *colon = UT_StringWrap(data).findChar(':');
545  if (colon)
546  {
547  int typelen = colon - data.buffer();
549  type.strncpy(data.buffer(), typelen);
550  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
551 
552  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
553  }
554  }
555  else v.reset();
556  }
557 
558  static void saveData(std::ostream &os, int64 v)
559  { UTwrite(os, &v); }
560  static void saveData(std::ostream &os, bool v)
561  { int64 iv = v; UTwrite(os, &iv); }
562  static void saveData(std::ostream &os, fpreal64 v)
563  { UTwrite<fpreal64>(os, &v); }
564  static void saveData(std::ostream &os, UT_Vector2D v)
565  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
566  static void saveData(std::ostream &os, UT_Vector3D v)
567  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
568  UTwrite<fpreal64>(os, &v.z()); }
569  static void saveData(std::ostream &os, UT_Vector4D v)
570  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
571  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
572  static void saveData(std::ostream &os, UT_Matrix2D v)
574  static void saveData(std::ostream &os, UT_Matrix3D v)
576  static void saveData(std::ostream &os, UT_Matrix4D v)
578  static void saveData(std::ostream &os, UT_StringHolder s)
579  { UT_StringWrap(s).saveBinary(os); }
580  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
582  UT_OStringStream ostr;
583  if (s) s->save(ostr);
584  result = ostr.str();
585  saveData(os, result);
586  }
587  static void saveData(std::ostream &os, PRM_DataItemHandle s)
589  UT_OStringStream ostr;
590  if (s)
591  {
592  ostr << s->getDataTypeToken();
593  ostr << ":";
594  s->saveBinary(ostr);
595  }
596  result = ostr.str();
597  saveData(os, result);
598  }
599 
600 
601  void save(std::ostream &os) const
602  {
603  int32 v = version();
604  UTwrite(os, &v);
605  saveData(os, myUseColor);
606  saveData(os, myColor);
607  saveData(os, mySize);
608  saveData(os, myCenter);
609  saveData(os, myRotate);
610  saveData(os, myUniformScale);
611  saveData(os, myDisplayIcon);
612  saveData(os, myControlType);
613  saveData(os, myOrientation);
614  saveData(os, myShadedMode);
615  saveData(os, myPacked);
616  {
617  int64 length = mySnapPoints.entries();
618  UTwrite(os, &length);
619  for (exint i = 0; i < length; i++)
620  {
621  saveData(os, mySnapPoints(i).snappos);
622 
623  }
624  }
625 
626  }
627 
628  bool load(UT_IStream &is)
629  {
630  int32 v;
631  is.bread(&v, 1);
632  if (version() != v)
633  {
634  // Fail incompatible versions
635  return false;
636  }
637  loadData(is, myUseColor);
638  loadData(is, myColor);
639  loadData(is, mySize);
640  loadData(is, myCenter);
641  loadData(is, myRotate);
642  loadData(is, myUniformScale);
643  loadData(is, myDisplayIcon);
644  loadData(is, myControlType);
645  loadData(is, myOrientation);
646  loadData(is, myShadedMode);
647  loadData(is, myPacked);
648  {
649  int64 length;
650  is.read(&length, 1);
651  mySnapPoints.entries(length);
652  for (exint i = 0; i < length; i++)
653  {
654  loadData(is, mySnapPoints(i).snappos);
655 
656  }
657  }
658 
659  return true;
660  }
661 
662  bool getUseColor() const { return myUseColor; }
663  void setUseColor(bool val) { myUseColor = val; }
664  bool opUseColor(const SOP_NodeVerb::CookParms &cookparms) const
665  {
666  SOP_Node *thissop = cookparms.getNode();
667  if (!thissop) return getUseColor();
668  bool result;
669  OP_Utils::evalOpParm(result, thissop, "usecolor", cookparms.getCookTime(), 0);
670  return result;
671  }
672  UT_Vector3D getColor() const { return myColor; }
673  void setColor(UT_Vector3D val) { myColor = val; }
675  {
676  SOP_Node *thissop = cookparms.getNode();
677  if (!thissop) return getColor();
679  OP_Utils::evalOpParm(result, thissop, "color", cookparms.getCookTime(), 0);
680  return result;
681  }
682  UT_Vector3D getSize() const { return mySize; }
683  void setSize(UT_Vector3D val) { mySize = val; }
685  {
686  SOP_Node *thissop = cookparms.getNode();
687  if (!thissop) return getSize();
689  OP_Utils::evalOpParm(result, thissop, "size", cookparms.getCookTime(), 0);
690  return result;
691  }
692  UT_Vector3D getCenter() const { return myCenter; }
693  void setCenter(UT_Vector3D val) { myCenter = val; }
695  {
696  SOP_Node *thissop = cookparms.getNode();
697  if (!thissop) return getCenter();
699  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
700  return result;
701  }
702  UT_Vector3D getRotate() const { return myRotate; }
703  void setRotate(UT_Vector3D val) { myRotate = val; }
705  {
706  SOP_Node *thissop = cookparms.getNode();
707  if (!thissop) return getRotate();
709  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
710  return result;
711  }
712  fpreal64 getUniformScale() const { return myUniformScale; }
713  void setUniformScale(fpreal64 val) { myUniformScale = val; }
715  {
716  SOP_Node *thissop = cookparms.getNode();
717  if (!thissop) return getUniformScale();
719  OP_Utils::evalOpParm(result, thissop, "scale", cookparms.getCookTime(), 0);
720  return result;
721  }
722  DisplayIcon getDisplayIcon() const { return DisplayIcon(myDisplayIcon); }
723  void setDisplayIcon(DisplayIcon val) { myDisplayIcon = int64(val); }
725  {
726  SOP_Node *thissop = cookparms.getNode();
727  if (!thissop) return getDisplayIcon();
728  int64 result;
729  OP_Utils::evalOpParm(result, thissop, "displayicon", cookparms.getCookTime(), 0);
730  return DisplayIcon(result);
731  }
732  ControlType getControlType() const { return ControlType(myControlType); }
733  void setControlType(ControlType val) { myControlType = int64(val); }
735  {
736  SOP_Node *thissop = cookparms.getNode();
737  if (!thissop) return getControlType();
738  int64 result;
739  OP_Utils::evalOpParm(result, thissop, "controltype", cookparms.getCookTime(), 0);
740  return ControlType(result);
741  }
742  Orientation getOrientation() const { return Orientation(myOrientation); }
743  void setOrientation(Orientation val) { myOrientation = int64(val); }
745  {
746  SOP_Node *thissop = cookparms.getNode();
747  if (!thissop) return getOrientation();
748  int64 result;
749  OP_Utils::evalOpParm(result, thissop, "orientation", cookparms.getCookTime(), 0);
750  return Orientation(result);
751  }
752  bool getShadedMode() const { return myShadedMode; }
753  void setShadedMode(bool val) { myShadedMode = val; }
754  bool opShadedMode(const SOP_NodeVerb::CookParms &cookparms) const
755  {
756  SOP_Node *thissop = cookparms.getNode();
757  if (!thissop) return getShadedMode();
758  bool result;
759  OP_Utils::evalOpParm(result, thissop, "shadedmode", cookparms.getCookTime(), 0);
760  return result;
761  }
762  bool getPacked() const { return myPacked; }
763  void setPacked(bool val) { myPacked = val; }
764  bool opPacked(const SOP_NodeVerb::CookParms &cookparms) const
765  {
766  SOP_Node *thissop = cookparms.getNode();
767  if (!thissop) return getPacked();
768  bool result;
769  OP_Utils::evalOpParm(result, thissop, "packed", cookparms.getCookTime(), 0);
770  return result;
771  }
772  const UT_Array<SnapPoints> &getSnapPoints() const { return mySnapPoints; }
773  void setSnapPoints(const UT_Array<SnapPoints> &val) { mySnapPoints = val; }
775  {
776  SOP_Node *thissop = cookparms.getNode();
777  if (!thissop) return getSnapPoints().entries();
778  exint result;
779  OP_Utils::evalOpParm(result, thissop, "numsnappoints", cookparms.getCookTime(), 0);
780  return result;
781  }
783  {
784  SOP_Node *thissop = cookparms.getNode();
785  if (!thissop) return (mySnapPoints(_idx).snappos);
786  int _parmidx = _idx + 1;
788  OP_Utils::evalOpParmInst(result, thissop, "snappos#", &_parmidx, cookparms.getCookTime(), 0);
789  return (result);
790  }
791 
792 
793 private:
794  bool myUseColor;
795  UT_Vector3D myColor;
796  UT_Vector3D mySize;
797  UT_Vector3D myCenter;
798  UT_Vector3D myRotate;
799  fpreal64 myUniformScale;
800  int64 myDisplayIcon;
801  int64 myControlType;
802  int64 myOrientation;
803  bool myShadedMode;
804  bool myPacked;
805  UT_Array<SnapPoints> mySnapPoints;
806 
807 };
static void loadData(UT_IStream &is, UT_Vector4D &v)
GLdouble s
Definition: glew.h:1390
DisplayIcon opDisplayIcon(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D opSnapPoints_snappos(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool getPacked() const
exint nodeIdx() const
Definition: SOP_NodeVerb.h:114
void setPacked(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:640
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
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, int *inst, fpreal time, DEP_MicroNode *depnode) const =0
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
fpreal getTime() const
Definition: OP_Context.h:60
GLuint const GLfloat * val
Definition: glew.h:2794
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)
void copyFrom(const SOP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:113
UT_Vector3D getSize() const
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.
const GLdouble * v
Definition: glew.h:1391
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
Orientation getOrientation() const
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)
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
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
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
double fpreal64
Definition: SYS_Types.h:201
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
SYS_FORCE_INLINE T & y()
Definition: UT_Vector3.h:513
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:28
~SOP_ControlParms() override
static void loadData(UT_IStream &is, fpreal64 &v)
bool operator==(const SnapPoints &src) const
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const UT_Array< SnapPoints > & getSnapPoints() const
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:284
static void saveData(std::ostream &os, UT_Matrix3D v)
fpreal64 opUniformScale(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE T & z()
Definition: UT_Vector3.h:515
ControlType getControlType() const
void save(std::ostream &os) const
exint opSnapPoints(const SOP_NodeVerb::CookParms &cookparms) const
void
Definition: png.h:1083
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setUniformScale(fpreal64 val)
const GLfloat * c
Definition: glew.h:16296
GLuint GLsizei GLsizei * length
Definition: glew.h:1825
exint getNestNumParms(TempIndex idx) const override
long long int64
Definition: SYS_Types.h:116
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
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
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:294
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:121
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:460
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
static void saveData(std::ostream &os, PRM_DataItemHandle s)
fpreal64 fpreal
Definition: SYS_Types.h:277
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:84
bool getUseColor() const
void setControlType(ControlType val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
SYS_FORCE_INLINE void append(char character)
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
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
#define SOP_API
Definition: SOP_API.h:10
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool operator==(const SOP_ControlParms &src) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
SYS_FORCE_INLINE T & x()
Definition: UT_Vector3.h:511
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:654
GLuint64EXT * result
Definition: glew.h:14007
ParmType getNestParmType(TempIndex fieldnum) const override
const char * findChar(int c) const
Definition: UT_String.h:1367
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
void setShadedMode(bool val)
fpreal64 getUniformScale() const
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
GLenum GLuint GLsizei const GLchar * buf
Definition: glew.h:2580
static void saveData(std::ostream &os, UT_Vector2D v)
void setColor(UT_Vector3D val)
GLsizei const GLfloat * value
Definition: glew.h:1849
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setDisplayIcon(DisplayIcon val)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:119
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
SYS_FORCE_INLINE bool isstring() const
bool getShadedMode() const
DisplayIcon getDisplayIcon() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_Vector3D getCenter() const
type
Definition: core.h:528
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