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 <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_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 
231  if (baseGetSignature() != src.baseGetSignature()) return false;
232 
233  return true;
234  }
236  {
237  return !operator==(src);
238  }
247 
248 
249 
250  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
251  {
252  myMethod = 0;
253  if (true)
254  graph->evalOpParm(myMethod, nodeidx, "method", time, graph->isDirect()?nullptr:depnode);
255  myPointGroup = ""_UTsh;
256  if (true && ( (true&&!(((int64(getMethod())==0)))) ) )
257  graph->evalOpParm(myPointGroup, nodeidx, "ptgroup", time, graph->isDirect()?nullptr:depnode);
258  myPrimitiveGroup = ""_UTsh;
259  if (true && ( (true&&!(((int64(getMethod())!=0)))) ) )
260  graph->evalOpParm(myPrimitiveGroup, nodeidx, "primgroup", time, graph->isDirect()?nullptr:depnode);
261  myAttribute = "dist"_UTsh;
262  if (true)
263  graph->evalOpParm(myAttribute, nodeidx, "attribute", time, graph->isDirect()?nullptr:depnode);
264  myCurveDir = 0;
265  if (true)
266  graph->evalOpParm(myCurveDir, nodeidx, "curvedir", time, graph->isDirect()?nullptr:depnode);
267  myParentAttribute = "parent"_UTsh;
268  if (true && ( (true&&!(((int64(getMethod())!=2)))) ) )
269  graph->evalOpParm(myParentAttribute, nodeidx, "parentattribute", time, graph->isDirect()?nullptr:depnode);
270  myRootType = 0;
271  if (true && ( (true&&!(((int64(getMethod())!=1)))) ) )
272  graph->evalOpParm(myRootType, nodeidx, "roottype", time, graph->isDirect()?nullptr:depnode);
273  myRootGroup = "0"_UTsh;
274  if (true && ( (true&&!(((int64(getRootType())!=2))||((int64(getMethod())!=1)))) ) )
275  graph->evalOpParm(myRootGroup, nodeidx, "rootgroup", time, graph->isDirect()?nullptr:depnode);
276  myOperation = 2;
277  if (true)
278  graph->evalOpParm(myOperation, nodeidx, "operation", time, graph->isDirect()?nullptr:depnode);
279  myUseNormalization = false;
280  if (true)
281  graph->evalOpParm(myUseNormalization, nodeidx, "donormalization", time, graph->isDirect()?nullptr:depnode);
282  myNormalization = 0;
283  if (true && ( (true&&!(((getUseNormalization()==0)))) ) )
284  graph->evalOpParm(myNormalization, nodeidx, "normalization", time, graph->isDirect()?nullptr:depnode);
285  myRootValue = 0;
286  if (true && ( (true&&!(((int64(getOperation())!=0)))) ) )
287  graph->evalOpParm(myRootValue, nodeidx, "rootvalue", time, graph->isDirect()?nullptr:depnode);
288  myIgnoreAttribute = true;
289  if (true && ( (true&&!(((int64(getOperation())!=2)))) ) )
290  graph->evalOpParm(myIgnoreAttribute, nodeidx, "ignoreattribute", time, graph->isDirect()?nullptr:depnode);
291  myScaleByEdge = true;
292  if (true && ( (true&&!(((int64(getOperation())!=2)))) ) )
293  graph->evalOpParm(myScaleByEdge, nodeidx, "scalebyedge", time, graph->isDirect()?nullptr:depnode);
294  myRotateByEdge = false;
295  if (true && ( (true&&!(((int64(getMethod())!=0)&&(int64(getCurveDir())==1)))) ) )
296  graph->evalOpParm(myRotateByEdge, nodeidx, "rotatebyedge", time, graph->isDirect()?nullptr:depnode);
297  mySplitMethod = 0;
298  if (true && ( (true&&!(((int64(getMethod())==0))||((int64(getCurveDir())!=0)))) ) )
299  graph->evalOpParm(mySplitMethod, nodeidx, "splitmethod", time, graph->isDirect()?nullptr:depnode);
300  myMergeMethod = 0;
301  if (true && ( (true&&!(((int64(getMethod())==0))||((int64(getCurveDir())!=1)))) ) )
302  graph->evalOpParm(myMergeMethod, nodeidx, "mergemethod", time, graph->isDirect()?nullptr:depnode);
303 
304  }
305 
306 
307  void loadFromOpSubclass(const LoadParms &loadparms) override
308  {
309  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
310  }
311 
312 
313  void copyFrom(const OP_NodeParms *src) override
314  {
315  *this = *((const SOP_EdgeTransportParms *)src);
316  }
317 
318  template <typename T>
319  void
320  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
321  {
322  if (idx.size() < 1)
323  return;
324  UT_ASSERT(idx.size() == instance.size()+1);
325  if (idx.size() != instance.size()+1)
326  return;
327  switch (idx[0])
328  {
329  case 0:
330  coerceValue(value, myMethod);
331  break;
332  case 1:
333  coerceValue(value, myPointGroup);
334  break;
335  case 2:
336  coerceValue(value, myPrimitiveGroup);
337  break;
338  case 3:
339  coerceValue(value, myAttribute);
340  break;
341  case 4:
342  coerceValue(value, myCurveDir);
343  break;
344  case 5:
345  coerceValue(value, myParentAttribute);
346  break;
347  case 6:
348  coerceValue(value, myRootType);
349  break;
350  case 7:
351  coerceValue(value, myRootGroup);
352  break;
353  case 8:
354  coerceValue(value, myOperation);
355  break;
356  case 9:
357  coerceValue(value, myUseNormalization);
358  break;
359  case 10:
360  coerceValue(value, myNormalization);
361  break;
362  case 11:
363  coerceValue(value, myRootValue);
364  break;
365  case 12:
366  coerceValue(value, myIgnoreAttribute);
367  break;
368  case 13:
369  coerceValue(value, myScaleByEdge);
370  break;
371  case 14:
372  coerceValue(value, myRotateByEdge);
373  break;
374  case 15:
375  coerceValue(value, mySplitMethod);
376  break;
377  case 16:
378  coerceValue(value, myMergeMethod);
379  break;
380 
381  }
382  }
383 
384  bool isParmColorRamp(exint idx) const override
385  {
386  switch (idx)
387  {
388 
389  }
390  return false;
391  }
392 
393  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
394  { doGetParmValue(idx, instance, value); }
395  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
396  { doGetParmValue(idx, instance, value); }
397  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
398  { doGetParmValue(idx, instance, value); }
399  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
400  { doGetParmValue(idx, instance, value); }
401  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
402  { doGetParmValue(idx, instance, value); }
403  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
404  { doGetParmValue(idx, instance, value); }
405  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
406  { doGetParmValue(idx, instance, value); }
407  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
408  { doGetParmValue(idx, instance, value); }
409  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
410  { doGetParmValue(idx, instance, value); }
411  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
412  { doGetParmValue(idx, instance, value); }
413  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
414  { doGetParmValue(idx, instance, value); }
415 
416  template <typename T>
417  void
418  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
419  {
420  if (idx.size() < 1)
421  return;
422  UT_ASSERT(idx.size() == instance.size()+1);
423  if (idx.size() != instance.size()+1)
424  return;
425  switch (idx[0])
426  {
427  case 0:
428  coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
429  break;
430  case 1:
431  coerceValue(myPointGroup, ( ( value ) ));
432  break;
433  case 2:
434  coerceValue(myPrimitiveGroup, ( ( value ) ));
435  break;
436  case 3:
437  coerceValue(myAttribute, ( ( value ) ));
438  break;
439  case 4:
440  coerceValue(myCurveDir, clampMinValue(0, clampMaxValue(1, value ) ));
441  break;
442  case 5:
443  coerceValue(myParentAttribute, ( ( value ) ));
444  break;
445  case 6:
446  coerceValue(myRootType, clampMinValue(0, clampMaxValue(2, value ) ));
447  break;
448  case 7:
449  coerceValue(myRootGroup, ( ( value ) ));
450  break;
451  case 8:
452  coerceValue(myOperation, clampMinValue(0, clampMaxValue(4, value ) ));
453  break;
454  case 9:
455  coerceValue(myUseNormalization, ( ( value ) ));
456  break;
457  case 10:
458  coerceValue(myNormalization, clampMinValue(0, clampMaxValue(1, value ) ));
459  break;
460  case 11:
461  coerceValue(myRootValue, clampMinValue(0, clampMaxValue(1, value ) ));
462  break;
463  case 12:
464  coerceValue(myIgnoreAttribute, ( ( value ) ));
465  break;
466  case 13:
467  coerceValue(myScaleByEdge, ( ( value ) ));
468  break;
469  case 14:
470  coerceValue(myRotateByEdge, ( ( value ) ));
471  break;
472  case 15:
473  coerceValue(mySplitMethod, clampMinValue(0, clampMaxValue(1, value ) ));
474  break;
475  case 16:
476  coerceValue(myMergeMethod, clampMinValue(0, clampMaxValue(2, value ) ));
477  break;
478 
479  }
480  }
481 
482  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
483  { doSetParmValue(idx, instance, value); }
484  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
485  { doSetParmValue(idx, instance, value); }
486  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
487  { doSetParmValue(idx, instance, value); }
488  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
489  { doSetParmValue(idx, instance, value); }
490  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
491  { doSetParmValue(idx, instance, value); }
492  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
493  { doSetParmValue(idx, instance, value); }
494  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
495  { doSetParmValue(idx, instance, value); }
496  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
497  { doSetParmValue(idx, instance, value); }
498  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
499  { doSetParmValue(idx, instance, value); }
500  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
501  { doSetParmValue(idx, instance, value); }
502  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
503  { doSetParmValue(idx, instance, value); }
504 
505  exint getNestNumParms(TempIndex idx) const override
506  {
507  if (idx.size() == 0)
508  return 17;
509  switch (idx[0])
510  {
511 
512  }
513  // Invalid
514  return 0;
515  }
516 
517  const char *getNestParmName(TempIndex fieldnum) const override
518  {
519  if (fieldnum.size() < 1)
520  return 0;
521  switch (fieldnum[0])
522  {
523  case 0:
524  return "method";
525  case 1:
526  return "ptgroup";
527  case 2:
528  return "primgroup";
529  case 3:
530  return "attribute";
531  case 4:
532  return "curvedir";
533  case 5:
534  return "parentattribute";
535  case 6:
536  return "roottype";
537  case 7:
538  return "rootgroup";
539  case 8:
540  return "operation";
541  case 9:
542  return "donormalization";
543  case 10:
544  return "normalization";
545  case 11:
546  return "rootvalue";
547  case 12:
548  return "ignoreattribute";
549  case 13:
550  return "scalebyedge";
551  case 14:
552  return "rotatebyedge";
553  case 15:
554  return "splitmethod";
555  case 16:
556  return "mergemethod";
557 
558  }
559  return 0;
560  }
561 
562  ParmType getNestParmType(TempIndex fieldnum) const override
563  {
564  if (fieldnum.size() < 1)
565  return PARM_UNSUPPORTED;
566  switch (fieldnum[0])
567  {
568  case 0:
569  return PARM_INTEGER;
570  case 1:
571  return PARM_STRING;
572  case 2:
573  return PARM_STRING;
574  case 3:
575  return PARM_STRING;
576  case 4:
577  return PARM_INTEGER;
578  case 5:
579  return PARM_STRING;
580  case 6:
581  return PARM_INTEGER;
582  case 7:
583  return PARM_STRING;
584  case 8:
585  return PARM_INTEGER;
586  case 9:
587  return PARM_INTEGER;
588  case 10:
589  return PARM_INTEGER;
590  case 11:
591  return PARM_INTEGER;
592  case 12:
593  return PARM_INTEGER;
594  case 13:
595  return PARM_INTEGER;
596  case 14:
597  return PARM_INTEGER;
598  case 15:
599  return PARM_INTEGER;
600  case 16:
601  return PARM_INTEGER;
602 
603  }
604  return PARM_UNSUPPORTED;
605  }
606 
607  // Boiler plate to load individual types.
608  static void loadData(UT_IStream &is, int64 &v)
609  { is.bread(&v, 1); }
610  static void loadData(UT_IStream &is, bool &v)
611  { int64 iv; is.bread(&iv, 1); v = iv; }
612  static void loadData(UT_IStream &is, fpreal64 &v)
613  { is.bread<fpreal64>(&v, 1); }
614  static void loadData(UT_IStream &is, UT_Vector2D &v)
615  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
616  static void loadData(UT_IStream &is, UT_Vector3D &v)
617  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
618  is.bread<fpreal64>(&v.z(), 1); }
619  static void loadData(UT_IStream &is, UT_Vector4D &v)
620  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
621  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
622  static void loadData(UT_IStream &is, UT_Matrix2D &v)
623  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
624  static void loadData(UT_IStream &is, UT_Matrix3D &v)
625  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
626  static void loadData(UT_IStream &is, UT_Matrix4D &v)
627  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
628  static void loadData(UT_IStream &is, UT_Vector2I &v)
629  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
630  static void loadData(UT_IStream &is, UT_Vector3I &v)
631  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
632  is.bread<int64>(&v.z(), 1); }
633  static void loadData(UT_IStream &is, UT_Vector4I &v)
634  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
635  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
637  { is.bread(v); }
639  { UT_StringHolder rampdata;
640  loadData(is, rampdata);
641  if (rampdata.isstring())
642  {
643  v.reset(new UT_Ramp());
644  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
645  v->load(istr);
646  }
647  else v.reset();
648  }
651  loadData(is, data);
652  if (data.isstring())
653  {
654  // Find the data type.
655  const char *colon = UT_StringWrap(data).findChar(':');
656  if (colon)
657  {
658  int typelen = colon - data.buffer();
660  type.strncpy(data.buffer(), typelen);
661  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
662 
663  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
664  }
665  }
666  else v.reset();
667  }
668 
669  static void saveData(std::ostream &os, int64 v)
670  { UTwrite(os, &v); }
671  static void saveData(std::ostream &os, bool v)
672  { int64 iv = v; UTwrite(os, &iv); }
673  static void saveData(std::ostream &os, fpreal64 v)
674  { UTwrite<fpreal64>(os, &v); }
675  static void saveData(std::ostream &os, UT_Vector2D v)
676  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
677  static void saveData(std::ostream &os, UT_Vector3D v)
678  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
679  UTwrite<fpreal64>(os, &v.z()); }
680  static void saveData(std::ostream &os, UT_Vector4D v)
681  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
682  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
683  static void saveData(std::ostream &os, UT_Matrix2D v)
685  static void saveData(std::ostream &os, UT_Matrix3D v)
687  static void saveData(std::ostream &os, UT_Matrix4D v)
689  static void saveData(std::ostream &os, UT_StringHolder s)
690  { UT_StringWrap(s).saveBinary(os); }
691  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
693  UT_OStringStream ostr;
694  if (s) s->save(ostr);
695  result = ostr.str();
696  saveData(os, result);
697  }
698  static void saveData(std::ostream &os, PRM_DataItemHandle s)
700  UT_OStringStream ostr;
701  if (s)
702  {
703  ostr << s->getDataTypeToken();
704  ostr << ":";
705  s->saveBinary(ostr);
706  }
707  result = ostr.str();
708  saveData(os, result);
709  }
710 
711 
712  void save(std::ostream &os) const
713  {
714  int32 v = version();
715  UTwrite(os, &v);
716  saveData(os, myMethod);
717  saveData(os, myPointGroup);
718  saveData(os, myPrimitiveGroup);
719  saveData(os, myAttribute);
720  saveData(os, myCurveDir);
721  saveData(os, myParentAttribute);
722  saveData(os, myRootType);
723  saveData(os, myRootGroup);
724  saveData(os, myOperation);
725  saveData(os, myUseNormalization);
726  saveData(os, myNormalization);
727  saveData(os, myRootValue);
728  saveData(os, myIgnoreAttribute);
729  saveData(os, myScaleByEdge);
730  saveData(os, myRotateByEdge);
731  saveData(os, mySplitMethod);
732  saveData(os, myMergeMethod);
733 
734  }
735 
736  bool load(UT_IStream &is)
737  {
738  int32 v;
739  is.bread(&v, 1);
740  if (version() != v)
741  {
742  // Fail incompatible versions
743  return false;
744  }
745  loadData(is, myMethod);
746  loadData(is, myPointGroup);
747  loadData(is, myPrimitiveGroup);
748  loadData(is, myAttribute);
749  loadData(is, myCurveDir);
750  loadData(is, myParentAttribute);
751  loadData(is, myRootType);
752  loadData(is, myRootGroup);
753  loadData(is, myOperation);
754  loadData(is, myUseNormalization);
755  loadData(is, myNormalization);
756  loadData(is, myRootValue);
757  loadData(is, myIgnoreAttribute);
758  loadData(is, myScaleByEdge);
759  loadData(is, myRotateByEdge);
760  loadData(is, mySplitMethod);
761  loadData(is, myMergeMethod);
762 
763  return true;
764  }
765 
766  Method getMethod() const { return Method(myMethod); }
767  void setMethod(Method val) { myMethod = int64(val); }
768  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
769  {
770  SOP_Node *thissop = cookparms.getNode();
771  if (!thissop) return getMethod();
772  int64 result;
773  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
774  return Method(result);
775  }
776  const UT_StringHolder & getPointGroup() const { return myPointGroup; }
777  void setPointGroup(const UT_StringHolder & val) { myPointGroup = val; }
779  {
780  SOP_Node *thissop = cookparms.getNode();
781  if (!thissop) return getPointGroup();
783  OP_Utils::evalOpParm(result, thissop, "ptgroup", cookparms.getCookTime(), 0);
784  return result;
785  }
786  const UT_StringHolder & getPrimitiveGroup() const { return myPrimitiveGroup; }
787  void setPrimitiveGroup(const UT_StringHolder & val) { myPrimitiveGroup = val; }
789  {
790  SOP_Node *thissop = cookparms.getNode();
791  if (!thissop) return getPrimitiveGroup();
793  OP_Utils::evalOpParm(result, thissop, "primgroup", cookparms.getCookTime(), 0);
794  return result;
795  }
796  const UT_StringHolder & getAttribute() const { return myAttribute; }
797  void setAttribute(const UT_StringHolder & val) { myAttribute = val; }
799  {
800  SOP_Node *thissop = cookparms.getNode();
801  if (!thissop) return getAttribute();
803  OP_Utils::evalOpParm(result, thissop, "attribute", cookparms.getCookTime(), 0);
804  return result;
805  }
806  CurveDir getCurveDir() const { return CurveDir(myCurveDir); }
807  void setCurveDir(CurveDir val) { myCurveDir = int64(val); }
809  {
810  SOP_Node *thissop = cookparms.getNode();
811  if (!thissop) return getCurveDir();
812  int64 result;
813  OP_Utils::evalOpParm(result, thissop, "curvedir", cookparms.getCookTime(), 0);
814  return CurveDir(result);
815  }
816  const UT_StringHolder & getParentAttribute() const { return myParentAttribute; }
817  void setParentAttribute(const UT_StringHolder & val) { myParentAttribute = val; }
819  {
820  SOP_Node *thissop = cookparms.getNode();
821  if (!thissop) return getParentAttribute();
823  OP_Utils::evalOpParm(result, thissop, "parentattribute", cookparms.getCookTime(), 0);
824  return result;
825  }
826  RootType getRootType() const { return RootType(myRootType); }
827  void setRootType(RootType val) { myRootType = int64(val); }
829  {
830  SOP_Node *thissop = cookparms.getNode();
831  if (!thissop) return getRootType();
832  int64 result;
833  OP_Utils::evalOpParm(result, thissop, "roottype", cookparms.getCookTime(), 0);
834  return RootType(result);
835  }
836  const UT_StringHolder & getRootGroup() const { return myRootGroup; }
837  void setRootGroup(const UT_StringHolder & val) { myRootGroup = val; }
839  {
840  SOP_Node *thissop = cookparms.getNode();
841  if (!thissop) return getRootGroup();
843  OP_Utils::evalOpParm(result, thissop, "rootgroup", cookparms.getCookTime(), 0);
844  return result;
845  }
846  Operation getOperation() const { return Operation(myOperation); }
847  void setOperation(Operation val) { myOperation = int64(val); }
849  {
850  SOP_Node *thissop = cookparms.getNode();
851  if (!thissop) return getOperation();
852  int64 result;
853  OP_Utils::evalOpParm(result, thissop, "operation", cookparms.getCookTime(), 0);
854  return Operation(result);
855  }
856  bool getUseNormalization() const { return myUseNormalization; }
857  void setUseNormalization(bool val) { myUseNormalization = val; }
858  bool opUseNormalization(const SOP_NodeVerb::CookParms &cookparms) const
859  {
860  SOP_Node *thissop = cookparms.getNode();
861  if (!thissop) return getUseNormalization();
862  bool result;
863  OP_Utils::evalOpParm(result, thissop, "donormalization", cookparms.getCookTime(), 0);
864  return result;
865  }
866  Normalization getNormalization() const { return Normalization(myNormalization); }
867  void setNormalization(Normalization val) { myNormalization = int64(val); }
869  {
870  SOP_Node *thissop = cookparms.getNode();
871  if (!thissop) return getNormalization();
872  int64 result;
873  OP_Utils::evalOpParm(result, thissop, "normalization", cookparms.getCookTime(), 0);
874  return Normalization(result);
875  }
876  RootValue getRootValue() const { return RootValue(myRootValue); }
877  void setRootValue(RootValue val) { myRootValue = int64(val); }
879  {
880  SOP_Node *thissop = cookparms.getNode();
881  if (!thissop) return getRootValue();
882  int64 result;
883  OP_Utils::evalOpParm(result, thissop, "rootvalue", cookparms.getCookTime(), 0);
884  return RootValue(result);
885  }
886  bool getIgnoreAttribute() const { return myIgnoreAttribute; }
887  void setIgnoreAttribute(bool val) { myIgnoreAttribute = val; }
888  bool opIgnoreAttribute(const SOP_NodeVerb::CookParms &cookparms) const
889  {
890  SOP_Node *thissop = cookparms.getNode();
891  if (!thissop) return getIgnoreAttribute();
892  bool result;
893  OP_Utils::evalOpParm(result, thissop, "ignoreattribute", cookparms.getCookTime(), 0);
894  return result;
895  }
896  bool getScaleByEdge() const { return myScaleByEdge; }
897  void setScaleByEdge(bool val) { myScaleByEdge = val; }
898  bool opScaleByEdge(const SOP_NodeVerb::CookParms &cookparms) const
899  {
900  SOP_Node *thissop = cookparms.getNode();
901  if (!thissop) return getScaleByEdge();
902  bool result;
903  OP_Utils::evalOpParm(result, thissop, "scalebyedge", cookparms.getCookTime(), 0);
904  return result;
905  }
906  bool getRotateByEdge() const { return myRotateByEdge; }
907  void setRotateByEdge(bool val) { myRotateByEdge = val; }
908  bool opRotateByEdge(const SOP_NodeVerb::CookParms &cookparms) const
909  {
910  SOP_Node *thissop = cookparms.getNode();
911  if (!thissop) return getRotateByEdge();
912  bool result;
913  OP_Utils::evalOpParm(result, thissop, "rotatebyedge", cookparms.getCookTime(), 0);
914  return result;
915  }
916  SplitMethod getSplitMethod() const { return SplitMethod(mySplitMethod); }
917  void setSplitMethod(SplitMethod val) { mySplitMethod = int64(val); }
919  {
920  SOP_Node *thissop = cookparms.getNode();
921  if (!thissop) return getSplitMethod();
922  int64 result;
923  OP_Utils::evalOpParm(result, thissop, "splitmethod", cookparms.getCookTime(), 0);
924  return SplitMethod(result);
925  }
926  MergeMethod getMergeMethod() const { return MergeMethod(myMergeMethod); }
927  void setMergeMethod(MergeMethod val) { myMergeMethod = int64(val); }
929  {
930  SOP_Node *thissop = cookparms.getNode();
931  if (!thissop) return getMergeMethod();
932  int64 result;
933  OP_Utils::evalOpParm(result, thissop, "mergemethod", cookparms.getCookTime(), 0);
934  return MergeMethod(result);
935  }
936 
937 private:
938  int64 myMethod;
939  UT_StringHolder myPointGroup;
940  UT_StringHolder myPrimitiveGroup;
941  UT_StringHolder myAttribute;
942  int64 myCurveDir;
943  UT_StringHolder myParentAttribute;
944  int64 myRootType;
945  UT_StringHolder myRootGroup;
946  int64 myOperation;
947  bool myUseNormalization;
948  int64 myNormalization;
949  int64 myRootValue;
950  bool myIgnoreAttribute;
951  bool myScaleByEdge;
952  bool myRotateByEdge;
953  int64 mySplitMethod;
954  int64 myMergeMethod;
955 
956 };
Normalization getNormalization() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
type
Definition: core.h:556
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:63
void setOperation(Operation val)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool 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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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