HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_UVTransform-2.0.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_UVTransform_2_0Enums
24 {
25  enum class GroupType
26  {
27  GUESS = 0,
28  VERTICES,
29  EDGES,
30  POINTS,
31  PRIMS
32  };
33 
35  getToken(GroupType enum_value)
36  {
37  using namespace UT::Literal;
38  switch (enum_value) {
39  case GroupType::GUESS: return "guess"_sh;
40  case GroupType::VERTICES: return "vertices"_sh;
41  case GroupType::EDGES: return "edges"_sh;
42  case GroupType::POINTS: return "points"_sh;
43  case GroupType::PRIMS: return "prims"_sh;
44  default: UT_ASSERT(false); return ""_sh;
45  }
46  }
47 
48  enum class XOrd
49  {
50  SRT = 0,
51  STR,
52  RST,
53  RTS,
54  TSR,
55  TRS
56  };
57 
59  getToken(XOrd enum_value)
60  {
61  using namespace UT::Literal;
62  switch (enum_value) {
63  case XOrd::SRT: return "srt"_sh;
64  case XOrd::STR: return "str"_sh;
65  case XOrd::RST: return "rst"_sh;
66  case XOrd::RTS: return "rts"_sh;
67  case XOrd::TSR: return "tsr"_sh;
68  case XOrd::TRS: return "trs"_sh;
69  default: UT_ASSERT(false); return ""_sh;
70  }
71  }
72 
73  enum class ROrd
74  {
75  XYZ = 0,
76  XZY,
77  YXZ,
78  YZX,
79  ZXY,
80  ZYX
81  };
82 
84  getToken(ROrd enum_value)
85  {
86  using namespace UT::Literal;
87  switch (enum_value) {
88  case ROrd::XYZ: return "xyz"_sh;
89  case ROrd::XZY: return "xzy"_sh;
90  case ROrd::YXZ: return "yxz"_sh;
91  case ROrd::YZX: return "yzx"_sh;
92  case ROrd::ZXY: return "zxy"_sh;
93  case ROrd::ZYX: return "zyx"_sh;
94  default: UT_ASSERT(false); return ""_sh;
95  }
96  }
97 
98  enum class Type
99  {
100  LINEAR = 0,
101  QUADRATIC,
102  CUBIC,
103  META
104  };
105 
107  getToken(Type enum_value)
108  {
109  using namespace UT::Literal;
110  switch (enum_value) {
111  case Type::LINEAR: return "linear"_sh;
112  case Type::QUADRATIC: return "quadratic"_sh;
113  case Type::CUBIC: return "cubic"_sh;
114  case Type::META: return "meta"_sh;
115  default: UT_ASSERT(false); return ""_sh;
116  }
117  }
118 
119  enum class Metric
120  {
121  UV = 0,
122  UVW,
123  XYZ
124  };
125 
127  getToken(Metric enum_value)
128  {
129  using namespace UT::Literal;
130  switch (enum_value) {
131  case Metric::UV: return "uv"_sh;
132  case Metric::UVW: return "uvw"_sh;
133  case Metric::XYZ: return "xyz"_sh;
134  default: UT_ASSERT(false); return ""_sh;
135  }
136  }
137 
138  enum class Visualizefalloff
139  {
140  NEVER = 0,
141  ALWAYS,
142  STATE
143  };
144 
147  {
148  using namespace UT::Literal;
149  switch (enum_value) {
150  case Visualizefalloff::NEVER: return "never"_sh;
151  case Visualizefalloff::ALWAYS: return "always"_sh;
152  case Visualizefalloff::STATE: return "state"_sh;
153  default: UT_ASSERT(false); return ""_sh;
154  }
155  }
156 
157 }
158 
159 
161 {
162 public:
163  static int version() { return 1; }
164 
166  {
167  myGroup = ""_UTsh;
168  myGroupType = 0;
169  myUVAttrib = "uv"_UTsh;
170  myXOrd = 0;
171  myROrd = 0;
172  myT = UT_Vector3D(0,0,0);
173  myR = UT_Vector3D(0,0,0);
174  myS = UT_Vector3D(1,1,1);
175  myShear = UT_Vector3D(0,0,0);
176  myP = UT_Vector3D(0,0,0);
177  myRad = 0;
178  myType = 2;
179  myTandeg = UT_Vector2D(0,0);
180  myKernel = "wyvill"_UTsh;
181  myMetric = 0;
182  myGlobal = false;
183  myUVGlobal = false;
184  myVisualizefalloff = 2;
185 
186  }
187 
188  explicit SOP_UVTransform_2_0Parms(const SOP_UVTransform_2_0Parms &) = default;
190  SOP_UVTransform_2_0Parms(SOP_UVTransform_2_0Parms &&) noexcept = default;
191  SOP_UVTransform_2_0Parms &operator=(SOP_UVTransform_2_0Parms &&) noexcept = default;
192 
194 
196  {
197  if (myGroup != src.myGroup) return false;
198  if (myGroupType != src.myGroupType) return false;
199  if (myUVAttrib != src.myUVAttrib) return false;
200  if (myXOrd != src.myXOrd) return false;
201  if (myROrd != src.myROrd) return false;
202  if (myT != src.myT) return false;
203  if (myR != src.myR) return false;
204  if (myS != src.myS) return false;
205  if (myShear != src.myShear) return false;
206  if (myP != src.myP) return false;
207  if (myRad != src.myRad) return false;
208  if (myType != src.myType) return false;
209  if (myTandeg != src.myTandeg) return false;
210  if (myKernel != src.myKernel) return false;
211  if (myMetric != src.myMetric) return false;
212  if (myGlobal != src.myGlobal) return false;
213  if (myUVGlobal != src.myUVGlobal) return false;
214  if (myVisualizefalloff != src.myVisualizefalloff) return false;
215 
216  return true;
217  }
219  {
220  return !operator==(src);
221  }
228 
229 
230 
231  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
232  {
233  myGroup = ""_UTsh;
234  if (true)
235  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
236  myGroupType = 0;
237  if (true)
238  graph->evalOpParm(myGroupType, nodeidx, "grouptype", time, 0);
239  myUVAttrib = "uv"_UTsh;
240  if (true)
241  graph->evalOpParm(myUVAttrib, nodeidx, "uvattrib", time, 0);
242  myXOrd = 0;
243  if (true)
244  graph->evalOpParm(myXOrd, nodeidx, "xOrd", time, 0);
245  myROrd = 0;
246  if (true)
247  graph->evalOpParm(myROrd, nodeidx, "rOrd", time, 0);
248  myT = UT_Vector3D(0,0,0);
249  if (true)
250  graph->evalOpParm(myT, nodeidx, "t", time, 0);
251  myR = UT_Vector3D(0,0,0);
252  if (true)
253  graph->evalOpParm(myR, nodeidx, "r", time, 0);
254  myS = UT_Vector3D(1,1,1);
255  if (true)
256  graph->evalOpParm(myS, nodeidx, "s", time, 0);
257  myShear = UT_Vector3D(0,0,0);
258  if (true)
259  graph->evalOpParm(myShear, nodeidx, "shear", time, 0);
260  myP = UT_Vector3D(0,0,0);
261  if (true)
262  graph->evalOpParm(myP, nodeidx, "p", time, 0);
263  myRad = 0;
264  if (true)
265  graph->evalOpParm(myRad, nodeidx, "rad", time, 0);
266  myType = 2;
267  if (true)
268  graph->evalOpParm(myType, nodeidx, "type", time, 0);
269  myTandeg = UT_Vector2D(0,0);
270  if (true && ( (true&&!(((int64(getType())!=2)))) ) )
271  graph->evalOpParm(myTandeg, nodeidx, "tandeg", time, 0);
272  myKernel = "wyvill"_UTsh;
273  if (true && ( (true&&!(((int64(getType())!=3)))) ) )
274  graph->evalOpParm(myKernel, nodeidx, "kernel", time, 0);
275  myMetric = 0;
276  if (true)
277  graph->evalOpParm(myMetric, nodeidx, "metric", time, 0);
278  myGlobal = false;
279  if (true)
280  graph->evalOpParm(myGlobal, nodeidx, "global", time, 0);
281  myUVGlobal = false;
282  if (true)
283  graph->evalOpParm(myUVGlobal, nodeidx, "uvglobal", time, 0);
284  myVisualizefalloff = 2;
285  if (true)
286  graph->evalOpParm(myVisualizefalloff, nodeidx, "visualizefalloff", time, 0);
287 
288  }
289 
290 
291  void loadFromOpSubclass(const LoadParms &loadparms) override
292  {
293  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
294  }
295 
296 
297  void copyFrom(const OP_NodeParms *src) override
298  {
299  *this = *((const SOP_UVTransform_2_0Parms *)src);
300  }
301 
302  template <typename T>
303  void
304  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
305  {
306  if (idx.size() < 1)
307  return;
308  UT_ASSERT(idx.size() == instance.size()+1);
309  if (idx.size() != instance.size()+1)
310  return;
311  switch (idx[0])
312  {
313  case 0:
314  coerceValue(value, myGroup);
315  break;
316  case 1:
317  coerceValue(value, myGroupType);
318  break;
319  case 2:
320  coerceValue(value, myUVAttrib);
321  break;
322  case 3:
323  coerceValue(value, myXOrd);
324  break;
325  case 4:
326  coerceValue(value, myROrd);
327  break;
328  case 5:
329  coerceValue(value, myT);
330  break;
331  case 6:
332  coerceValue(value, myR);
333  break;
334  case 7:
335  coerceValue(value, myS);
336  break;
337  case 8:
338  coerceValue(value, myShear);
339  break;
340  case 9:
341  coerceValue(value, myP);
342  break;
343  case 10:
344  coerceValue(value, myRad);
345  break;
346  case 11:
347  coerceValue(value, myType);
348  break;
349  case 12:
350  coerceValue(value, myTandeg);
351  break;
352  case 13:
353  coerceValue(value, myKernel);
354  break;
355  case 14:
356  coerceValue(value, myMetric);
357  break;
358  case 15:
359  coerceValue(value, myGlobal);
360  break;
361  case 16:
362  coerceValue(value, myUVGlobal);
363  break;
364  case 17:
365  coerceValue(value, myVisualizefalloff);
366  break;
367 
368  }
369  }
370 
371  bool isParmColorRamp(exint idx) const override
372  {
373  switch (idx)
374  {
375 
376  }
377  return false;
378  }
379 
380  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
381  { doGetParmValue(idx, instance, value); }
382  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
383  { doGetParmValue(idx, instance, value); }
384  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
385  { doGetParmValue(idx, instance, value); }
386  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
387  { doGetParmValue(idx, instance, value); }
388  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
389  { doGetParmValue(idx, instance, value); }
390  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
391  { doGetParmValue(idx, instance, value); }
392  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
393  { doGetParmValue(idx, instance, value); }
394  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
395  { doGetParmValue(idx, instance, value); }
396  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
397  { doGetParmValue(idx, instance, value); }
398  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
399  { doGetParmValue(idx, instance, value); }
400  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
401  { doGetParmValue(idx, instance, value); }
402 
403  template <typename T>
404  void
405  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
406  {
407  if (idx.size() < 1)
408  return;
409  UT_ASSERT(idx.size() == instance.size()+1);
410  if (idx.size() != instance.size()+1)
411  return;
412  switch (idx[0])
413  {
414  case 0:
415  coerceValue(myGroup, ( ( value ) ));
416  break;
417  case 1:
418  coerceValue(myGroupType, clampMinValue(0, clampMaxValue(4, value ) ));
419  break;
420  case 2:
421  coerceValue(myUVAttrib, ( ( value ) ));
422  break;
423  case 3:
424  coerceValue(myXOrd, clampMinValue(0, clampMaxValue(5, value ) ));
425  break;
426  case 4:
427  coerceValue(myROrd, clampMinValue(0, clampMaxValue(5, value ) ));
428  break;
429  case 5:
430  coerceValue(myT, ( ( value ) ));
431  break;
432  case 6:
433  coerceValue(myR, ( ( value ) ));
434  break;
435  case 7:
436  coerceValue(myS, ( ( value ) ));
437  break;
438  case 8:
439  coerceValue(myShear, ( ( value ) ));
440  break;
441  case 9:
442  coerceValue(myP, ( ( value ) ));
443  break;
444  case 10:
445  coerceValue(myRad, clampMinValue(0, ( value ) ));
446  break;
447  case 11:
448  coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
449  break;
450  case 12:
451  coerceValue(myTandeg, ( ( value ) ));
452  break;
453  case 13:
454  coerceValue(myKernel, ( ( value ) ));
455  break;
456  case 14:
457  coerceValue(myMetric, clampMinValue(0, clampMaxValue(2, value ) ));
458  break;
459  case 15:
460  coerceValue(myGlobal, ( ( value ) ));
461  break;
462  case 16:
463  coerceValue(myUVGlobal, ( ( value ) ));
464  break;
465  case 17:
466  coerceValue(myVisualizefalloff, clampMinValue(0, clampMaxValue(2, value ) ));
467  break;
468 
469  }
470  }
471 
472  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
473  { doSetParmValue(idx, instance, value); }
474  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
475  { doSetParmValue(idx, instance, value); }
476  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
477  { doSetParmValue(idx, instance, value); }
478  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
479  { doSetParmValue(idx, instance, value); }
480  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
481  { doSetParmValue(idx, instance, value); }
482  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
483  { doSetParmValue(idx, instance, value); }
484  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
485  { doSetParmValue(idx, instance, value); }
486  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
487  { doSetParmValue(idx, instance, value); }
488  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
489  { doSetParmValue(idx, instance, value); }
490  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
491  { doSetParmValue(idx, instance, value); }
492  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
493  { doSetParmValue(idx, instance, value); }
494 
495  exint getNestNumParms(TempIndex idx) const override
496  {
497  if (idx.size() == 0)
498  return 18;
499  switch (idx[0])
500  {
501 
502  }
503  // Invalid
504  return 0;
505  }
506 
507  const char *getNestParmName(TempIndex fieldnum) const override
508  {
509  if (fieldnum.size() < 1)
510  return 0;
511  switch (fieldnum[0])
512  {
513  case 0:
514  return "group";
515  case 1:
516  return "grouptype";
517  case 2:
518  return "uvattrib";
519  case 3:
520  return "xOrd";
521  case 4:
522  return "rOrd";
523  case 5:
524  return "t";
525  case 6:
526  return "r";
527  case 7:
528  return "s";
529  case 8:
530  return "shear";
531  case 9:
532  return "p";
533  case 10:
534  return "rad";
535  case 11:
536  return "type";
537  case 12:
538  return "tandeg";
539  case 13:
540  return "kernel";
541  case 14:
542  return "metric";
543  case 15:
544  return "global";
545  case 16:
546  return "uvglobal";
547  case 17:
548  return "visualizefalloff";
549 
550  }
551  return 0;
552  }
553 
554  ParmType getNestParmType(TempIndex fieldnum) const override
555  {
556  if (fieldnum.size() < 1)
557  return PARM_UNSUPPORTED;
558  switch (fieldnum[0])
559  {
560  case 0:
561  return PARM_STRING;
562  case 1:
563  return PARM_INTEGER;
564  case 2:
565  return PARM_STRING;
566  case 3:
567  return PARM_INTEGER;
568  case 4:
569  return PARM_INTEGER;
570  case 5:
571  return PARM_VECTOR3;
572  case 6:
573  return PARM_VECTOR3;
574  case 7:
575  return PARM_VECTOR3;
576  case 8:
577  return PARM_VECTOR3;
578  case 9:
579  return PARM_VECTOR3;
580  case 10:
581  return PARM_FLOAT;
582  case 11:
583  return PARM_INTEGER;
584  case 12:
585  return PARM_VECTOR2;
586  case 13:
587  return PARM_STRING;
588  case 14:
589  return PARM_INTEGER;
590  case 15:
591  return PARM_INTEGER;
592  case 16:
593  return PARM_INTEGER;
594  case 17:
595  return PARM_INTEGER;
596 
597  }
598  return PARM_UNSUPPORTED;
599  }
600 
601  // Boiler plate to load individual types.
602  static void loadData(UT_IStream &is, int64 &v)
603  { is.bread(&v, 1); }
604  static void loadData(UT_IStream &is, bool &v)
605  { int64 iv; is.bread(&iv, 1); v = iv; }
606  static void loadData(UT_IStream &is, fpreal64 &v)
607  { is.bread<fpreal64>(&v, 1); }
608  static void loadData(UT_IStream &is, UT_Vector2D &v)
609  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
610  static void loadData(UT_IStream &is, UT_Vector3D &v)
611  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
612  is.bread<fpreal64>(&v.z(), 1); }
613  static void loadData(UT_IStream &is, UT_Vector4D &v)
614  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
615  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
616  static void loadData(UT_IStream &is, UT_Matrix2D &v)
617  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
618  static void loadData(UT_IStream &is, UT_Matrix3D &v)
619  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
620  static void loadData(UT_IStream &is, UT_Matrix4D &v)
621  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
622  static void loadData(UT_IStream &is, UT_Vector2I &v)
623  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
624  static void loadData(UT_IStream &is, UT_Vector3I &v)
625  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
626  is.bread<int64>(&v.z(), 1); }
627  static void loadData(UT_IStream &is, UT_Vector4I &v)
628  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
629  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
631  { is.bread(v); }
633  { UT_StringHolder rampdata;
634  loadData(is, rampdata);
635  if (rampdata.isstring())
636  {
637  v.reset(new UT_Ramp());
638  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
639  v->load(istr);
640  }
641  else v.reset();
642  }
645  loadData(is, data);
646  if (data.isstring())
647  {
648  // Find the data type.
649  const char *colon = UT_StringWrap(data).findChar(':');
650  if (colon)
651  {
652  int typelen = colon - data.buffer();
654  type.strncpy(data.buffer(), typelen);
655  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
656 
657  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
658  }
659  }
660  else v.reset();
661  }
662 
663  static void saveData(std::ostream &os, int64 v)
664  { UTwrite(os, &v); }
665  static void saveData(std::ostream &os, bool v)
666  { int64 iv = v; UTwrite(os, &iv); }
667  static void saveData(std::ostream &os, fpreal64 v)
668  { UTwrite<fpreal64>(os, &v); }
669  static void saveData(std::ostream &os, UT_Vector2D v)
670  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
671  static void saveData(std::ostream &os, UT_Vector3D v)
672  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
673  UTwrite<fpreal64>(os, &v.z()); }
674  static void saveData(std::ostream &os, UT_Vector4D v)
675  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
676  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
677  static void saveData(std::ostream &os, UT_Matrix2D v)
679  static void saveData(std::ostream &os, UT_Matrix3D v)
681  static void saveData(std::ostream &os, UT_Matrix4D v)
683  static void saveData(std::ostream &os, UT_StringHolder s)
684  { UT_StringWrap(s).saveBinary(os); }
685  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
687  UT_OStringStream ostr;
688  if (s) s->save(ostr);
689  result = ostr.str();
690  saveData(os, result);
691  }
692  static void saveData(std::ostream &os, PRM_DataItemHandle s)
694  UT_OStringStream ostr;
695  if (s)
696  {
697  ostr << s->getDataTypeToken();
698  ostr << ":";
699  s->saveBinary(ostr);
700  }
701  result = ostr.str();
702  saveData(os, result);
703  }
704 
705 
706  void save(std::ostream &os) const
707  {
708  int32 v = version();
709  UTwrite(os, &v);
710  saveData(os, myGroup);
711  saveData(os, myGroupType);
712  saveData(os, myUVAttrib);
713  saveData(os, myXOrd);
714  saveData(os, myROrd);
715  saveData(os, myT);
716  saveData(os, myR);
717  saveData(os, myS);
718  saveData(os, myShear);
719  saveData(os, myP);
720  saveData(os, myRad);
721  saveData(os, myType);
722  saveData(os, myTandeg);
723  saveData(os, myKernel);
724  saveData(os, myMetric);
725  saveData(os, myGlobal);
726  saveData(os, myUVGlobal);
727  saveData(os, myVisualizefalloff);
728 
729  }
730 
731  bool load(UT_IStream &is)
732  {
733  int32 v;
734  is.bread(&v, 1);
735  if (version() != v)
736  {
737  // Fail incompatible versions
738  return false;
739  }
740  loadData(is, myGroup);
741  loadData(is, myGroupType);
742  loadData(is, myUVAttrib);
743  loadData(is, myXOrd);
744  loadData(is, myROrd);
745  loadData(is, myT);
746  loadData(is, myR);
747  loadData(is, myS);
748  loadData(is, myShear);
749  loadData(is, myP);
750  loadData(is, myRad);
751  loadData(is, myType);
752  loadData(is, myTandeg);
753  loadData(is, myKernel);
754  loadData(is, myMetric);
755  loadData(is, myGlobal);
756  loadData(is, myUVGlobal);
757  loadData(is, myVisualizefalloff);
758 
759  return true;
760  }
761 
762  const UT_StringHolder & getGroup() const { return myGroup; }
763  void setGroup(const UT_StringHolder & val) { myGroup = val; }
765  {
766  SOP_Node *thissop = cookparms.getNode();
767  if (!thissop) return getGroup();
769  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
770  return result;
771  }
772  GroupType getGroupType() const { return GroupType(myGroupType); }
773  void setGroupType(GroupType val) { myGroupType = int64(val); }
775  {
776  SOP_Node *thissop = cookparms.getNode();
777  if (!thissop) return getGroupType();
778  int64 result;
779  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
780  return GroupType(result);
781  }
782  const UT_StringHolder & getUVAttrib() const { return myUVAttrib; }
783  void setUVAttrib(const UT_StringHolder & val) { myUVAttrib = val; }
785  {
786  SOP_Node *thissop = cookparms.getNode();
787  if (!thissop) return getUVAttrib();
789  OP_Utils::evalOpParm(result, thissop, "uvattrib", cookparms.getCookTime(), 0);
790  return result;
791  }
792  XOrd getXOrd() const { return XOrd(myXOrd); }
793  void setXOrd(XOrd val) { myXOrd = int64(val); }
794  XOrd opXOrd(const SOP_NodeVerb::CookParms &cookparms) const
795  {
796  SOP_Node *thissop = cookparms.getNode();
797  if (!thissop) return getXOrd();
798  int64 result;
799  OP_Utils::evalOpParm(result, thissop, "xOrd", cookparms.getCookTime(), 0);
800  return XOrd(result);
801  }
802  ROrd getROrd() const { return ROrd(myROrd); }
803  void setROrd(ROrd val) { myROrd = int64(val); }
804  ROrd opROrd(const SOP_NodeVerb::CookParms &cookparms) const
805  {
806  SOP_Node *thissop = cookparms.getNode();
807  if (!thissop) return getROrd();
808  int64 result;
809  OP_Utils::evalOpParm(result, thissop, "rOrd", cookparms.getCookTime(), 0);
810  return ROrd(result);
811  }
812  UT_Vector3D getT() const { return myT; }
813  void setT(UT_Vector3D val) { myT = val; }
814  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
815  {
816  SOP_Node *thissop = cookparms.getNode();
817  if (!thissop) return getT();
819  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
820  return result;
821  }
822  UT_Vector3D getR() const { return myR; }
823  void setR(UT_Vector3D val) { myR = val; }
824  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
825  {
826  SOP_Node *thissop = cookparms.getNode();
827  if (!thissop) return getR();
829  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
830  return result;
831  }
832  UT_Vector3D getS() const { return myS; }
833  void setS(UT_Vector3D val) { myS = val; }
834  UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
835  {
836  SOP_Node *thissop = cookparms.getNode();
837  if (!thissop) return getS();
839  OP_Utils::evalOpParm(result, thissop, "s", cookparms.getCookTime(), 0);
840  return result;
841  }
842  UT_Vector3D getShear() const { return myShear; }
843  void setShear(UT_Vector3D val) { myShear = val; }
845  {
846  SOP_Node *thissop = cookparms.getNode();
847  if (!thissop) return getShear();
849  OP_Utils::evalOpParm(result, thissop, "shear", cookparms.getCookTime(), 0);
850  return result;
851  }
852  UT_Vector3D getP() const { return myP; }
853  void setP(UT_Vector3D val) { myP = val; }
854  UT_Vector3D opP(const SOP_NodeVerb::CookParms &cookparms) const
855  {
856  SOP_Node *thissop = cookparms.getNode();
857  if (!thissop) return getP();
859  OP_Utils::evalOpParm(result, thissop, "p", cookparms.getCookTime(), 0);
860  return result;
861  }
862  fpreal64 getRad() const { return myRad; }
863  void setRad(fpreal64 val) { myRad = val; }
864  fpreal64 opRad(const SOP_NodeVerb::CookParms &cookparms) const
865  {
866  SOP_Node *thissop = cookparms.getNode();
867  if (!thissop) return getRad();
869  OP_Utils::evalOpParm(result, thissop, "rad", cookparms.getCookTime(), 0);
870  return result;
871  }
872  Type getType() const { return Type(myType); }
873  void setType(Type val) { myType = int64(val); }
874  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
875  {
876  SOP_Node *thissop = cookparms.getNode();
877  if (!thissop) return getType();
878  int64 result;
879  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
880  return Type(result);
881  }
882  UT_Vector2D getTandeg() const { return myTandeg; }
883  void setTandeg(UT_Vector2D val) { myTandeg = val; }
885  {
886  SOP_Node *thissop = cookparms.getNode();
887  if (!thissop) return getTandeg();
889  OP_Utils::evalOpParm(result, thissop, "tandeg", cookparms.getCookTime(), 0);
890  return result;
891  }
892  const UT_StringHolder & getKernel() const { return myKernel; }
893  void setKernel(const UT_StringHolder & val) { myKernel = val; }
895  {
896  SOP_Node *thissop = cookparms.getNode();
897  if (!thissop) return getKernel();
899  OP_Utils::evalOpParm(result, thissop, "kernel", cookparms.getCookTime(), 0);
900  return result;
901  }
902  Metric getMetric() const { return Metric(myMetric); }
903  void setMetric(Metric val) { myMetric = int64(val); }
904  Metric opMetric(const SOP_NodeVerb::CookParms &cookparms) const
905  {
906  SOP_Node *thissop = cookparms.getNode();
907  if (!thissop) return getMetric();
908  int64 result;
909  OP_Utils::evalOpParm(result, thissop, "metric", cookparms.getCookTime(), 0);
910  return Metric(result);
911  }
912  bool getGlobal() const { return myGlobal; }
913  void setGlobal(bool val) { myGlobal = val; }
914  bool opGlobal(const SOP_NodeVerb::CookParms &cookparms) const
915  {
916  SOP_Node *thissop = cookparms.getNode();
917  if (!thissop) return getGlobal();
918  bool result;
919  OP_Utils::evalOpParm(result, thissop, "global", cookparms.getCookTime(), 0);
920  return result;
921  }
922  bool getUVGlobal() const { return myUVGlobal; }
923  void setUVGlobal(bool val) { myUVGlobal = val; }
924  bool opUVGlobal(const SOP_NodeVerb::CookParms &cookparms) const
925  {
926  SOP_Node *thissop = cookparms.getNode();
927  if (!thissop) return getUVGlobal();
928  bool result;
929  OP_Utils::evalOpParm(result, thissop, "uvglobal", cookparms.getCookTime(), 0);
930  return result;
931  }
932  Visualizefalloff getVisualizefalloff() const { return Visualizefalloff(myVisualizefalloff); }
933  void setVisualizefalloff(Visualizefalloff val) { myVisualizefalloff = int64(val); }
935  {
936  SOP_Node *thissop = cookparms.getNode();
937  if (!thissop) return getVisualizefalloff();
938  int64 result;
939  OP_Utils::evalOpParm(result, thissop, "visualizefalloff", cookparms.getCookTime(), 0);
940  return Visualizefalloff(result);
941  }
942 
943 private:
944  UT_StringHolder myGroup;
945  int64 myGroupType;
946  UT_StringHolder myUVAttrib;
947  int64 myXOrd;
948  int64 myROrd;
949  UT_Vector3D myT;
950  UT_Vector3D myR;
951  UT_Vector3D myS;
952  UT_Vector3D myShear;
953  UT_Vector3D myP;
954  fpreal64 myRad;
955  int64 myType;
956  UT_Vector2D myTandeg;
957  UT_StringHolder myKernel;
958  int64 myMetric;
959  bool myGlobal;
960  bool myUVGlobal;
961  int64 myVisualizefalloff;
962 
963 };
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
void copyFrom(const OP_NodeParms *src) override
ROrd opROrd(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setKernel(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
Visualizefalloff getVisualizefalloff() const
int int32
Definition: SYS_Types.h:39
XOrd opXOrd(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
UT_Vector2T< fpreal64 > UT_Vector2D
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Matrix4D &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
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, fpreal64 v)
GLdouble s
Definition: glad.h:3009
static void saveData(std::ostream &os, bool v)
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, UT_Matrix4D v)
**But if you need a result
Definition: thread.h:613
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_StringHolder & getUVAttrib() const
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
GroupType opGroupType(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator!=(const SOP_UVTransform_2_0Parms &src) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
Metric opMetric(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
bool opGlobal(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
exint length() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
long long int64
Definition: SYS_Types.h:116
static void loadData(UT_IStream &is, UT_Vector2D &v)
UT_Vector3D opShear(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3T< fpreal64 > UT_Vector3D
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, UT_Vector2D v)
const UT_StringHolder & getKernel() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
UT_StringHolder opKernel(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
ParmType getNestParmType(TempIndex fieldnum) const override
fpreal64 opRad(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opUVAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void save(std::ostream &os) const
UT_Vector2D opTandeg(const SOP_NodeVerb::CookParms &cookparms) const
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
static void saveData(std::ostream &os, int64 v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setGroup(const UT_StringHolder &val)
void setVisualizefalloff(Visualizefalloff val)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
#define SOP_API
Definition: SOP_API.h:10
UT_Vector3D opP(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool operator==(const SOP_UVTransform_2_0Parms &src) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setUVAttrib(const UT_StringHolder &val)
SYS_FORCE_INLINE UT_StringHolder getToken(GroupType enum_value)
bool opUVGlobal(const SOP_NodeVerb::CookParms &cookparms) const
Visualizefalloff opVisualizefalloff(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, int64 &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
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
GLboolean r
Definition: glcorearb.h:1222
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
void loadFromOpSubclass(const LoadParms &loadparms) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
static void saveData(std::ostream &os, PRM_DataItemHandle s)
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const