HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_EdgeTransport.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_EdgeTransportEnums
24 {
25  enum class Method
26  {
27  CURVE = 0,
28  NET,
29  PARENT
30  };
31 
33  getToken(Method enum_value)
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case Method::CURVE: return "curve"_sh;
38  case Method::NET: return "net"_sh;
39  case Method::PARENT: return "parent"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class CurveDir
45  {
46  FORWARD = 0,
47  BACKWARD
48  };
49 
51  getToken(CurveDir enum_value)
52  {
53  using namespace UT::Literal;
54  switch (enum_value) {
55  case CurveDir::FORWARD: return "forward"_sh;
56  case CurveDir::BACKWARD: return "backward"_sh;
57  default: UT_ASSERT(false); return ""_sh;
58  }
59  }
60 
61  enum class RootType
62  {
63  FIRST = 0,
64  LAST,
65  GROUP
66  };
67 
69  getToken(RootType enum_value)
70  {
71  using namespace UT::Literal;
72  switch (enum_value) {
73  case RootType::FIRST: return "first"_sh;
74  case RootType::LAST: return "last"_sh;
75  case RootType::GROUP: return "group"_sh;
76  default: UT_ASSERT(false); return ""_sh;
77  }
78  }
79 
80  enum class Operation
81  {
82  COPY = 0,
83  COPYROOT,
84  SUM,
85  MAX,
86  MIN
87  };
88 
90  getToken(Operation enum_value)
91  {
92  using namespace UT::Literal;
93  switch (enum_value) {
94  case Operation::COPY: return "copy"_sh;
95  case Operation::COPYROOT: return "copyroot"_sh;
96  case Operation::SUM: return "sum"_sh;
97  case Operation::MAX: return "max"_sh;
98  case Operation::MIN: return "min"_sh;
99  default: UT_ASSERT(false); return ""_sh;
100  }
101  }
102 
103  enum class Normalization
104  {
105  COMPONENT = 0,
106  GLOBAL
107  };
108 
110  getToken(Normalization enum_value)
111  {
112  using namespace UT::Literal;
113  switch (enum_value) {
114  case Normalization::COMPONENT: return "component"_sh;
115  case Normalization::GLOBAL: return "global"_sh;
116  default: UT_ASSERT(false); return ""_sh;
117  }
118  }
119 
120  enum class RootValue
121  {
122  ZERO = 0,
123  HOLD
124  };
125 
127  getToken(RootValue enum_value)
128  {
129  using namespace UT::Literal;
130  switch (enum_value) {
131  case RootValue::ZERO: return "zero"_sh;
132  case RootValue::HOLD: return "hold"_sh;
133  default: UT_ASSERT(false); return ""_sh;
134  }
135  }
136 
137  enum class SplitMethod
138  {
139  COPY = 0,
140  SPLIT
141  };
142 
144  getToken(SplitMethod enum_value)
145  {
146  using namespace UT::Literal;
147  switch (enum_value) {
148  case SplitMethod::COPY: return "copy"_sh;
149  case SplitMethod::SPLIT: return "split"_sh;
150  default: UT_ASSERT(false); return ""_sh;
151  }
152  }
153 
154  enum class MergeMethod
155  {
156  SUM = 0,
157  MAX,
158  MIN
159  };
160 
162  getToken(MergeMethod enum_value)
163  {
164  using namespace UT::Literal;
165  switch (enum_value) {
166  case MergeMethod::SUM: return "sum"_sh;
167  case MergeMethod::MAX: return "max"_sh;
168  case MergeMethod::MIN: return "min"_sh;
169  default: UT_ASSERT(false); return ""_sh;
170  }
171  }
172 
173 }
174 
175 
177 {
178 public:
179  static int version() { return 1; }
180 
182  {
183  myMethod = 0;
184  myPointGroup = ""_UTsh;
185  myPrimitiveGroup = ""_UTsh;
186  myAttribute = "dist"_UTsh;
187  myCurveDir = 0;
188  myParentAttribute = "parent"_UTsh;
189  myRootType = 0;
190  myRootGroup = "0"_UTsh;
191  myOperation = 2;
192  myUseNormalization = false;
193  myNormalization = 0;
194  myRootValue = 0;
195  myIgnoreAttribute = true;
196  myScaleByEdge = true;
197  myRotateByEdge = false;
198  mySplitMethod = 0;
199  myMergeMethod = 0;
200 
201  }
202 
203  explicit SOP_EdgeTransportParms(const SOP_EdgeTransportParms &) = default;
205  SOP_EdgeTransportParms(SOP_EdgeTransportParms &&) noexcept = default;
206  SOP_EdgeTransportParms &operator=(SOP_EdgeTransportParms &&) noexcept = default;
207 
208  ~SOP_EdgeTransportParms() override {}
209 
211  {
212  if (myMethod != src.myMethod) return false;
213  if (myPointGroup != src.myPointGroup) return false;
214  if (myPrimitiveGroup != src.myPrimitiveGroup) return false;
215  if (myAttribute != src.myAttribute) return false;
216  if (myCurveDir != src.myCurveDir) return false;
217  if (myParentAttribute != src.myParentAttribute) return false;
218  if (myRootType != src.myRootType) return false;
219  if (myRootGroup != src.myRootGroup) return false;
220  if (myOperation != src.myOperation) return false;
221  if (myUseNormalization != src.myUseNormalization) return false;
222  if (myNormalization != src.myNormalization) return false;
223  if (myRootValue != src.myRootValue) return false;
224  if (myIgnoreAttribute != src.myIgnoreAttribute) return false;
225  if (myScaleByEdge != src.myScaleByEdge) return false;
226  if (myRotateByEdge != src.myRotateByEdge) return false;
227  if (mySplitMethod != src.mySplitMethod) return false;
228  if (myMergeMethod != src.myMergeMethod) return false;
229 
230  return true;
231  }
233  {
234  return !operator==(src);
235  }
244 
245 
246 
247  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
248  {
249  myMethod = 0;
250  if (true)
251  graph->evalOpParm(myMethod, nodeidx, "method", time, 0);
252  myPointGroup = ""_UTsh;
253  if (true && ( (true&&!(((int64(getMethod())==0)))) ) )
254  graph->evalOpParm(myPointGroup, nodeidx, "ptgroup", time, 0);
255  myPrimitiveGroup = ""_UTsh;
256  if (true && ( (true&&!(((int64(getMethod())!=0)))) ) )
257  graph->evalOpParm(myPrimitiveGroup, nodeidx, "primgroup", time, 0);
258  myAttribute = "dist"_UTsh;
259  if (true)
260  graph->evalOpParm(myAttribute, nodeidx, "attribute", time, 0);
261  myCurveDir = 0;
262  if (true)
263  graph->evalOpParm(myCurveDir, nodeidx, "curvedir", time, 0);
264  myParentAttribute = "parent"_UTsh;
265  if (true && ( (true&&!(((int64(getMethod())!=2)))) ) )
266  graph->evalOpParm(myParentAttribute, nodeidx, "parentattribute", time, 0);
267  myRootType = 0;
268  if (true && ( (true&&!(((int64(getMethod())!=1)))) ) )
269  graph->evalOpParm(myRootType, nodeidx, "roottype", time, 0);
270  myRootGroup = "0"_UTsh;
271  if (true && ( (true&&!(((int64(getRootType())!=2))||((int64(getMethod())!=1)))) ) )
272  graph->evalOpParm(myRootGroup, nodeidx, "rootgroup", time, 0);
273  myOperation = 2;
274  if (true)
275  graph->evalOpParm(myOperation, nodeidx, "operation", time, 0);
276  myUseNormalization = false;
277  if (true)
278  graph->evalOpParm(myUseNormalization, nodeidx, "donormalization", time, 0);
279  myNormalization = 0;
280  if (true && ( (true&&!(((getUseNormalization()==0)))) ) )
281  graph->evalOpParm(myNormalization, nodeidx, "normalization", time, 0);
282  myRootValue = 0;
283  if (true && ( (true&&!(((int64(getOperation())!=0)))) ) )
284  graph->evalOpParm(myRootValue, nodeidx, "rootvalue", time, 0);
285  myIgnoreAttribute = true;
286  if (true && ( (true&&!(((int64(getOperation())!=2)))) ) )
287  graph->evalOpParm(myIgnoreAttribute, nodeidx, "ignoreattribute", time, 0);
288  myScaleByEdge = true;
289  if (true && ( (true&&!(((int64(getOperation())!=2)))) ) )
290  graph->evalOpParm(myScaleByEdge, nodeidx, "scalebyedge", time, 0);
291  myRotateByEdge = false;
292  if (true && ( (true&&!(((int64(getMethod())!=0)&&(int64(getCurveDir())==1)))) ) )
293  graph->evalOpParm(myRotateByEdge, nodeidx, "rotatebyedge", time, 0);
294  mySplitMethod = 0;
295  if (true && ( (true&&!(((int64(getMethod())==0))||((int64(getCurveDir())!=0)))) ) )
296  graph->evalOpParm(mySplitMethod, nodeidx, "splitmethod", time, 0);
297  myMergeMethod = 0;
298  if (true && ( (true&&!(((int64(getMethod())==0))||((int64(getCurveDir())!=1)))) ) )
299  graph->evalOpParm(myMergeMethod, nodeidx, "mergemethod", time, 0);
300 
301  }
302 
303 
304  void loadFromOpSubclass(const LoadParms &loadparms) override
305  {
306  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
307  }
308 
309 
310  void copyFrom(const OP_NodeParms *src) override
311  {
312  *this = *((const SOP_EdgeTransportParms *)src);
313  }
314 
315  template <typename T>
316  void
317  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
318  {
319  if (idx.size() < 1)
320  return;
321  UT_ASSERT(idx.size() == instance.size()+1);
322  if (idx.size() != instance.size()+1)
323  return;
324  switch (idx[0])
325  {
326  case 0:
327  coerceValue(value, myMethod);
328  break;
329  case 1:
330  coerceValue(value, myPointGroup);
331  break;
332  case 2:
333  coerceValue(value, myPrimitiveGroup);
334  break;
335  case 3:
336  coerceValue(value, myAttribute);
337  break;
338  case 4:
339  coerceValue(value, myCurveDir);
340  break;
341  case 5:
342  coerceValue(value, myParentAttribute);
343  break;
344  case 6:
345  coerceValue(value, myRootType);
346  break;
347  case 7:
348  coerceValue(value, myRootGroup);
349  break;
350  case 8:
351  coerceValue(value, myOperation);
352  break;
353  case 9:
354  coerceValue(value, myUseNormalization);
355  break;
356  case 10:
357  coerceValue(value, myNormalization);
358  break;
359  case 11:
360  coerceValue(value, myRootValue);
361  break;
362  case 12:
363  coerceValue(value, myIgnoreAttribute);
364  break;
365  case 13:
366  coerceValue(value, myScaleByEdge);
367  break;
368  case 14:
369  coerceValue(value, myRotateByEdge);
370  break;
371  case 15:
372  coerceValue(value, mySplitMethod);
373  break;
374  case 16:
375  coerceValue(value, myMergeMethod);
376  break;
377 
378  }
379  }
380 
381  bool isParmColorRamp(exint idx) const override
382  {
383  switch (idx)
384  {
385 
386  }
387  return false;
388  }
389 
390  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
391  { doGetParmValue(idx, instance, value); }
392  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
393  { doGetParmValue(idx, instance, value); }
394  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
395  { doGetParmValue(idx, instance, value); }
396  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
397  { doGetParmValue(idx, instance, value); }
398  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
399  { doGetParmValue(idx, instance, value); }
400  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
401  { doGetParmValue(idx, instance, value); }
402  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
403  { doGetParmValue(idx, instance, value); }
404  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
405  { doGetParmValue(idx, instance, value); }
406  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
407  { doGetParmValue(idx, instance, value); }
408  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
409  { doGetParmValue(idx, instance, value); }
410  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
411  { doGetParmValue(idx, instance, value); }
412 
413  template <typename T>
414  void
415  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
416  {
417  if (idx.size() < 1)
418  return;
419  UT_ASSERT(idx.size() == instance.size()+1);
420  if (idx.size() != instance.size()+1)
421  return;
422  switch (idx[0])
423  {
424  case 0:
425  coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
426  break;
427  case 1:
428  coerceValue(myPointGroup, ( ( value ) ));
429  break;
430  case 2:
431  coerceValue(myPrimitiveGroup, ( ( value ) ));
432  break;
433  case 3:
434  coerceValue(myAttribute, ( ( value ) ));
435  break;
436  case 4:
437  coerceValue(myCurveDir, clampMinValue(0, clampMaxValue(1, value ) ));
438  break;
439  case 5:
440  coerceValue(myParentAttribute, ( ( value ) ));
441  break;
442  case 6:
443  coerceValue(myRootType, clampMinValue(0, clampMaxValue(2, value ) ));
444  break;
445  case 7:
446  coerceValue(myRootGroup, ( ( value ) ));
447  break;
448  case 8:
449  coerceValue(myOperation, clampMinValue(0, clampMaxValue(4, value ) ));
450  break;
451  case 9:
452  coerceValue(myUseNormalization, ( ( value ) ));
453  break;
454  case 10:
455  coerceValue(myNormalization, clampMinValue(0, clampMaxValue(1, value ) ));
456  break;
457  case 11:
458  coerceValue(myRootValue, clampMinValue(0, clampMaxValue(1, value ) ));
459  break;
460  case 12:
461  coerceValue(myIgnoreAttribute, ( ( value ) ));
462  break;
463  case 13:
464  coerceValue(myScaleByEdge, ( ( value ) ));
465  break;
466  case 14:
467  coerceValue(myRotateByEdge, ( ( value ) ));
468  break;
469  case 15:
470  coerceValue(mySplitMethod, clampMinValue(0, clampMaxValue(1, value ) ));
471  break;
472  case 16:
473  coerceValue(myMergeMethod, clampMinValue(0, clampMaxValue(2, value ) ));
474  break;
475 
476  }
477  }
478 
479  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
480  { doSetParmValue(idx, instance, value); }
481  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
482  { doSetParmValue(idx, instance, value); }
483  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
484  { doSetParmValue(idx, instance, value); }
485  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
486  { doSetParmValue(idx, instance, value); }
487  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
488  { doSetParmValue(idx, instance, value); }
489  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
490  { doSetParmValue(idx, instance, value); }
491  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
492  { doSetParmValue(idx, instance, value); }
493  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
494  { doSetParmValue(idx, instance, value); }
495  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
496  { doSetParmValue(idx, instance, value); }
497  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
498  { doSetParmValue(idx, instance, value); }
499  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
500  { doSetParmValue(idx, instance, value); }
501 
502  exint getNestNumParms(TempIndex idx) const override
503  {
504  if (idx.size() == 0)
505  return 17;
506  switch (idx[0])
507  {
508 
509  }
510  // Invalid
511  return 0;
512  }
513 
514  const char *getNestParmName(TempIndex fieldnum) const override
515  {
516  if (fieldnum.size() < 1)
517  return 0;
518  switch (fieldnum[0])
519  {
520  case 0:
521  return "method";
522  case 1:
523  return "ptgroup";
524  case 2:
525  return "primgroup";
526  case 3:
527  return "attribute";
528  case 4:
529  return "curvedir";
530  case 5:
531  return "parentattribute";
532  case 6:
533  return "roottype";
534  case 7:
535  return "rootgroup";
536  case 8:
537  return "operation";
538  case 9:
539  return "donormalization";
540  case 10:
541  return "normalization";
542  case 11:
543  return "rootvalue";
544  case 12:
545  return "ignoreattribute";
546  case 13:
547  return "scalebyedge";
548  case 14:
549  return "rotatebyedge";
550  case 15:
551  return "splitmethod";
552  case 16:
553  return "mergemethod";
554 
555  }
556  return 0;
557  }
558 
559  ParmType getNestParmType(TempIndex fieldnum) const override
560  {
561  if (fieldnum.size() < 1)
562  return PARM_UNSUPPORTED;
563  switch (fieldnum[0])
564  {
565  case 0:
566  return PARM_INTEGER;
567  case 1:
568  return PARM_STRING;
569  case 2:
570  return PARM_STRING;
571  case 3:
572  return PARM_STRING;
573  case 4:
574  return PARM_INTEGER;
575  case 5:
576  return PARM_STRING;
577  case 6:
578  return PARM_INTEGER;
579  case 7:
580  return PARM_STRING;
581  case 8:
582  return PARM_INTEGER;
583  case 9:
584  return PARM_INTEGER;
585  case 10:
586  return PARM_INTEGER;
587  case 11:
588  return PARM_INTEGER;
589  case 12:
590  return PARM_INTEGER;
591  case 13:
592  return PARM_INTEGER;
593  case 14:
594  return PARM_INTEGER;
595  case 15:
596  return PARM_INTEGER;
597  case 16:
598  return PARM_INTEGER;
599 
600  }
601  return PARM_UNSUPPORTED;
602  }
603 
604  // Boiler plate to load individual types.
605  static void loadData(UT_IStream &is, int64 &v)
606  { is.bread(&v, 1); }
607  static void loadData(UT_IStream &is, bool &v)
608  { int64 iv; is.bread(&iv, 1); v = iv; }
609  static void loadData(UT_IStream &is, fpreal64 &v)
610  { is.bread<fpreal64>(&v, 1); }
611  static void loadData(UT_IStream &is, UT_Vector2D &v)
612  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
613  static void loadData(UT_IStream &is, UT_Vector3D &v)
614  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
615  is.bread<fpreal64>(&v.z(), 1); }
616  static void loadData(UT_IStream &is, UT_Vector4D &v)
617  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
618  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
619  static void loadData(UT_IStream &is, UT_Matrix2D &v)
620  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
621  static void loadData(UT_IStream &is, UT_Matrix3D &v)
622  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
623  static void loadData(UT_IStream &is, UT_Matrix4D &v)
624  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
625  static void loadData(UT_IStream &is, UT_Vector2I &v)
626  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
627  static void loadData(UT_IStream &is, UT_Vector3I &v)
628  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
629  is.bread<int64>(&v.z(), 1); }
630  static void loadData(UT_IStream &is, UT_Vector4I &v)
631  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
632  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
634  { is.bread(v); }
636  { UT_StringHolder rampdata;
637  loadData(is, rampdata);
638  if (rampdata.isstring())
639  {
640  v.reset(new UT_Ramp());
641  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
642  v->load(istr);
643  }
644  else v.reset();
645  }
648  loadData(is, data);
649  if (data.isstring())
650  {
651  // Find the data type.
652  const char *colon = UT_StringWrap(data).findChar(':');
653  if (colon)
654  {
655  int typelen = colon - data.buffer();
657  type.strncpy(data.buffer(), typelen);
658  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
659 
660  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
661  }
662  }
663  else v.reset();
664  }
665 
666  static void saveData(std::ostream &os, int64 v)
667  { UTwrite(os, &v); }
668  static void saveData(std::ostream &os, bool v)
669  { int64 iv = v; UTwrite(os, &iv); }
670  static void saveData(std::ostream &os, fpreal64 v)
671  { UTwrite<fpreal64>(os, &v); }
672  static void saveData(std::ostream &os, UT_Vector2D v)
673  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
674  static void saveData(std::ostream &os, UT_Vector3D v)
675  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
676  UTwrite<fpreal64>(os, &v.z()); }
677  static void saveData(std::ostream &os, UT_Vector4D v)
678  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
679  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
680  static void saveData(std::ostream &os, UT_Matrix2D v)
682  static void saveData(std::ostream &os, UT_Matrix3D v)
684  static void saveData(std::ostream &os, UT_Matrix4D v)
686  static void saveData(std::ostream &os, UT_StringHolder s)
687  { UT_StringWrap(s).saveBinary(os); }
688  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
690  UT_OStringStream ostr;
691  if (s) s->save(ostr);
692  result = ostr.str();
693  saveData(os, result);
694  }
695  static void saveData(std::ostream &os, PRM_DataItemHandle s)
697  UT_OStringStream ostr;
698  if (s)
699  {
700  ostr << s->getDataTypeToken();
701  ostr << ":";
702  s->saveBinary(ostr);
703  }
704  result = ostr.str();
705  saveData(os, result);
706  }
707 
708 
709  void save(std::ostream &os) const
710  {
711  int32 v = version();
712  UTwrite(os, &v);
713  saveData(os, myMethod);
714  saveData(os, myPointGroup);
715  saveData(os, myPrimitiveGroup);
716  saveData(os, myAttribute);
717  saveData(os, myCurveDir);
718  saveData(os, myParentAttribute);
719  saveData(os, myRootType);
720  saveData(os, myRootGroup);
721  saveData(os, myOperation);
722  saveData(os, myUseNormalization);
723  saveData(os, myNormalization);
724  saveData(os, myRootValue);
725  saveData(os, myIgnoreAttribute);
726  saveData(os, myScaleByEdge);
727  saveData(os, myRotateByEdge);
728  saveData(os, mySplitMethod);
729  saveData(os, myMergeMethod);
730 
731  }
732 
733  bool load(UT_IStream &is)
734  {
735  int32 v;
736  is.bread(&v, 1);
737  if (version() != v)
738  {
739  // Fail incompatible versions
740  return false;
741  }
742  loadData(is, myMethod);
743  loadData(is, myPointGroup);
744  loadData(is, myPrimitiveGroup);
745  loadData(is, myAttribute);
746  loadData(is, myCurveDir);
747  loadData(is, myParentAttribute);
748  loadData(is, myRootType);
749  loadData(is, myRootGroup);
750  loadData(is, myOperation);
751  loadData(is, myUseNormalization);
752  loadData(is, myNormalization);
753  loadData(is, myRootValue);
754  loadData(is, myIgnoreAttribute);
755  loadData(is, myScaleByEdge);
756  loadData(is, myRotateByEdge);
757  loadData(is, mySplitMethod);
758  loadData(is, myMergeMethod);
759 
760  return true;
761  }
762 
763  Method getMethod() const { return Method(myMethod); }
764  void setMethod(Method val) { myMethod = int64(val); }
765  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
766  {
767  SOP_Node *thissop = cookparms.getNode();
768  if (!thissop) return getMethod();
769  int64 result;
770  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
771  return Method(result);
772  }
773  const UT_StringHolder & getPointGroup() const { return myPointGroup; }
774  void setPointGroup(const UT_StringHolder & val) { myPointGroup = val; }
776  {
777  SOP_Node *thissop = cookparms.getNode();
778  if (!thissop) return getPointGroup();
780  OP_Utils::evalOpParm(result, thissop, "ptgroup", cookparms.getCookTime(), 0);
781  return result;
782  }
783  const UT_StringHolder & getPrimitiveGroup() const { return myPrimitiveGroup; }
784  void setPrimitiveGroup(const UT_StringHolder & val) { myPrimitiveGroup = val; }
786  {
787  SOP_Node *thissop = cookparms.getNode();
788  if (!thissop) return getPrimitiveGroup();
790  OP_Utils::evalOpParm(result, thissop, "primgroup", cookparms.getCookTime(), 0);
791  return result;
792  }
793  const UT_StringHolder & getAttribute() const { return myAttribute; }
794  void setAttribute(const UT_StringHolder & val) { myAttribute = val; }
796  {
797  SOP_Node *thissop = cookparms.getNode();
798  if (!thissop) return getAttribute();
800  OP_Utils::evalOpParm(result, thissop, "attribute", cookparms.getCookTime(), 0);
801  return result;
802  }
803  CurveDir getCurveDir() const { return CurveDir(myCurveDir); }
804  void setCurveDir(CurveDir val) { myCurveDir = int64(val); }
806  {
807  SOP_Node *thissop = cookparms.getNode();
808  if (!thissop) return getCurveDir();
809  int64 result;
810  OP_Utils::evalOpParm(result, thissop, "curvedir", cookparms.getCookTime(), 0);
811  return CurveDir(result);
812  }
813  const UT_StringHolder & getParentAttribute() const { return myParentAttribute; }
814  void setParentAttribute(const UT_StringHolder & val) { myParentAttribute = val; }
816  {
817  SOP_Node *thissop = cookparms.getNode();
818  if (!thissop) return getParentAttribute();
820  OP_Utils::evalOpParm(result, thissop, "parentattribute", cookparms.getCookTime(), 0);
821  return result;
822  }
823  RootType getRootType() const { return RootType(myRootType); }
824  void setRootType(RootType val) { myRootType = int64(val); }
826  {
827  SOP_Node *thissop = cookparms.getNode();
828  if (!thissop) return getRootType();
829  int64 result;
830  OP_Utils::evalOpParm(result, thissop, "roottype", cookparms.getCookTime(), 0);
831  return RootType(result);
832  }
833  const UT_StringHolder & getRootGroup() const { return myRootGroup; }
834  void setRootGroup(const UT_StringHolder & val) { myRootGroup = val; }
836  {
837  SOP_Node *thissop = cookparms.getNode();
838  if (!thissop) return getRootGroup();
840  OP_Utils::evalOpParm(result, thissop, "rootgroup", cookparms.getCookTime(), 0);
841  return result;
842  }
843  Operation getOperation() const { return Operation(myOperation); }
844  void setOperation(Operation val) { myOperation = int64(val); }
846  {
847  SOP_Node *thissop = cookparms.getNode();
848  if (!thissop) return getOperation();
849  int64 result;
850  OP_Utils::evalOpParm(result, thissop, "operation", cookparms.getCookTime(), 0);
851  return Operation(result);
852  }
853  bool getUseNormalization() const { return myUseNormalization; }
854  void setUseNormalization(bool val) { myUseNormalization = val; }
855  bool opUseNormalization(const SOP_NodeVerb::CookParms &cookparms) const
856  {
857  SOP_Node *thissop = cookparms.getNode();
858  if (!thissop) return getUseNormalization();
859  bool result;
860  OP_Utils::evalOpParm(result, thissop, "donormalization", cookparms.getCookTime(), 0);
861  return result;
862  }
863  Normalization getNormalization() const { return Normalization(myNormalization); }
864  void setNormalization(Normalization val) { myNormalization = int64(val); }
866  {
867  SOP_Node *thissop = cookparms.getNode();
868  if (!thissop) return getNormalization();
869  int64 result;
870  OP_Utils::evalOpParm(result, thissop, "normalization", cookparms.getCookTime(), 0);
871  return Normalization(result);
872  }
873  RootValue getRootValue() const { return RootValue(myRootValue); }
874  void setRootValue(RootValue val) { myRootValue = int64(val); }
876  {
877  SOP_Node *thissop = cookparms.getNode();
878  if (!thissop) return getRootValue();
879  int64 result;
880  OP_Utils::evalOpParm(result, thissop, "rootvalue", cookparms.getCookTime(), 0);
881  return RootValue(result);
882  }
883  bool getIgnoreAttribute() const { return myIgnoreAttribute; }
884  void setIgnoreAttribute(bool val) { myIgnoreAttribute = val; }
885  bool opIgnoreAttribute(const SOP_NodeVerb::CookParms &cookparms) const
886  {
887  SOP_Node *thissop = cookparms.getNode();
888  if (!thissop) return getIgnoreAttribute();
889  bool result;
890  OP_Utils::evalOpParm(result, thissop, "ignoreattribute", cookparms.getCookTime(), 0);
891  return result;
892  }
893  bool getScaleByEdge() const { return myScaleByEdge; }
894  void setScaleByEdge(bool val) { myScaleByEdge = val; }
895  bool opScaleByEdge(const SOP_NodeVerb::CookParms &cookparms) const
896  {
897  SOP_Node *thissop = cookparms.getNode();
898  if (!thissop) return getScaleByEdge();
899  bool result;
900  OP_Utils::evalOpParm(result, thissop, "scalebyedge", cookparms.getCookTime(), 0);
901  return result;
902  }
903  bool getRotateByEdge() const { return myRotateByEdge; }
904  void setRotateByEdge(bool val) { myRotateByEdge = val; }
905  bool opRotateByEdge(const SOP_NodeVerb::CookParms &cookparms) const
906  {
907  SOP_Node *thissop = cookparms.getNode();
908  if (!thissop) return getRotateByEdge();
909  bool result;
910  OP_Utils::evalOpParm(result, thissop, "rotatebyedge", cookparms.getCookTime(), 0);
911  return result;
912  }
913  SplitMethod getSplitMethod() const { return SplitMethod(mySplitMethod); }
914  void setSplitMethod(SplitMethod val) { mySplitMethod = int64(val); }
916  {
917  SOP_Node *thissop = cookparms.getNode();
918  if (!thissop) return getSplitMethod();
919  int64 result;
920  OP_Utils::evalOpParm(result, thissop, "splitmethod", cookparms.getCookTime(), 0);
921  return SplitMethod(result);
922  }
923  MergeMethod getMergeMethod() const { return MergeMethod(myMergeMethod); }
924  void setMergeMethod(MergeMethod val) { myMergeMethod = int64(val); }
926  {
927  SOP_Node *thissop = cookparms.getNode();
928  if (!thissop) return getMergeMethod();
929  int64 result;
930  OP_Utils::evalOpParm(result, thissop, "mergemethod", cookparms.getCookTime(), 0);
931  return MergeMethod(result);
932  }
933 
934 private:
935  int64 myMethod;
936  UT_StringHolder myPointGroup;
937  UT_StringHolder myPrimitiveGroup;
938  UT_StringHolder myAttribute;
939  int64 myCurveDir;
940  UT_StringHolder myParentAttribute;
941  int64 myRootType;
942  UT_StringHolder myRootGroup;
943  int64 myOperation;
944  bool myUseNormalization;
945  int64 myNormalization;
946  int64 myRootValue;
947  bool myIgnoreAttribute;
948  bool myScaleByEdge;
949  bool myRotateByEdge;
950  int64 mySplitMethod;
951  int64 myMergeMethod;
952 
953 };
Normalization getNormalization() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setPointGroup(const UT_StringHolder &val)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
bool isParmColorRamp(exint idx) const override
void setParentAttribute(const UT_StringHolder &val)
const UT_StringHolder & getPrimitiveGroup() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector4D &v)
bool opScaleByEdge(const SOP_NodeVerb::CookParms &cookparms) const
Normalization opNormalization(const SOP_NodeVerb::CookParms &cookparms) const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
RootType opRootType(const SOP_NodeVerb::CookParms &cookparms) const
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 setOperation(Operation val)
static void loadData(UT_IStream &is, bool &v)
UT_StringHolder opRootGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
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
static void saveData(std::ostream &os, UT_Vector2D v)
const char * getNestParmName(TempIndex fieldnum) const override
const UT_StringHolder & getAttribute() const
SYS_FORCE_INLINE const char * buffer() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
GLdouble s
Definition: glad.h:3009
void setNormalization(Normalization val)
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const UT_StringHolder & getPointGroup() const
**But if you need a result
Definition: thread.h:613
UT_StringHolder opAttribute(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
SplitMethod opSplitMethod(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
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.
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
bool operator==(const SOP_EdgeTransportParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void saveData(std::ostream &os, UT_Matrix2D v)
bool opRotateByEdge(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
bool operator!=(const SOP_EdgeTransportParms &src) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, bool v)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
SplitMethod getSplitMethod() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, int64 v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
long long int64
Definition: SYS_Types.h:116
Operation opOperation(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const UT_StringHolder & getRootGroup() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
MergeMethod opMergeMethod(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
GT_API const UT_StringHolder version
void setSplitMethod(SplitMethod val)
void setRootValue(RootValue val)
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setRootGroup(const UT_StringHolder &val)
void setPrimitiveGroup(const UT_StringHolder &val)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
RootValue opRootValue(const SOP_NodeVerb::CookParms &cookparms) const
void setMergeMethod(MergeMethod val)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
GLuint GLfloat * val
Definition: glcorearb.h:1608
const UT_StringHolder & getParentAttribute() const
#define SOP_API
Definition: SOP_API.h:10
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
void setAttribute(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
GLboolean r
Definition: glcorearb.h:1222
ParmType getNestParmType(TempIndex fieldnum) const override
bool opIgnoreAttribute(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void copyFrom(const OP_NodeParms *src) 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_Matrix3D v)
static void saveData(std::ostream &os, UT_Vector4D v)
UT_StringHolder opPrimitiveGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
CurveDir opCurveDir(const SOP_NodeVerb::CookParms &cookparms) const
MergeMethod getMergeMethod() const
exint getNestNumParms(TempIndex idx) const override
UT_StringHolder opPointGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
bool opUseNormalization(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE bool isstring() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_StringHolder opParentAttribute(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
static void loadData(UT_IStream &is, UT_Matrix4D &v)
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const