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 <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_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 
217  if (baseGetSignature() != src.baseGetSignature()) return false;
218 
219  return true;
220  }
222  {
223  return !operator==(src);
224  }
231 
232 
233 
234  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
235  {
236  myGroup = ""_UTsh;
237  if (true)
238  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
239  myGroupType = 0;
240  if (true)
241  graph->evalOpParm(myGroupType, nodeidx, "grouptype", time, graph->isDirect()?nullptr:depnode);
242  myUVAttrib = "uv"_UTsh;
243  if (true)
244  graph->evalOpParm(myUVAttrib, nodeidx, "uvattrib", time, graph->isDirect()?nullptr:depnode);
245  myXOrd = 0;
246  if (true)
247  graph->evalOpParm(myXOrd, nodeidx, "xOrd", time, graph->isDirect()?nullptr:depnode);
248  myROrd = 0;
249  if (true)
250  graph->evalOpParm(myROrd, nodeidx, "rOrd", time, graph->isDirect()?nullptr:depnode);
251  myT = UT_Vector3D(0,0,0);
252  if (true)
253  graph->evalOpParm(myT, nodeidx, "t", time, graph->isDirect()?nullptr:depnode);
254  myR = UT_Vector3D(0,0,0);
255  if (true)
256  graph->evalOpParm(myR, nodeidx, "r", time, graph->isDirect()?nullptr:depnode);
257  myS = UT_Vector3D(1,1,1);
258  if (true)
259  graph->evalOpParm(myS, nodeidx, "s", time, graph->isDirect()?nullptr:depnode);
260  myShear = UT_Vector3D(0,0,0);
261  if (true)
262  graph->evalOpParm(myShear, nodeidx, "shear", time, graph->isDirect()?nullptr:depnode);
263  myP = UT_Vector3D(0,0,0);
264  if (true)
265  graph->evalOpParm(myP, nodeidx, "p", time, graph->isDirect()?nullptr:depnode);
266  myRad = 0;
267  if (true)
268  graph->evalOpParm(myRad, nodeidx, "rad", time, graph->isDirect()?nullptr:depnode);
269  myType = 2;
270  if (true)
271  graph->evalOpParm(myType, nodeidx, "type", time, graph->isDirect()?nullptr:depnode);
272  myTandeg = UT_Vector2D(0,0);
273  if (true && ( (true&&!(((int64(getType())!=2)))) ) )
274  graph->evalOpParm(myTandeg, nodeidx, "tandeg", time, graph->isDirect()?nullptr:depnode);
275  myKernel = "wyvill"_UTsh;
276  if (true && ( (true&&!(((int64(getType())!=3)))) ) )
277  graph->evalOpParm(myKernel, nodeidx, "kernel", time, graph->isDirect()?nullptr:depnode);
278  myMetric = 0;
279  if (true)
280  graph->evalOpParm(myMetric, nodeidx, "metric", time, graph->isDirect()?nullptr:depnode);
281  myGlobal = false;
282  if (true)
283  graph->evalOpParm(myGlobal, nodeidx, "global", time, graph->isDirect()?nullptr:depnode);
284  myUVGlobal = false;
285  if (true)
286  graph->evalOpParm(myUVGlobal, nodeidx, "uvglobal", time, graph->isDirect()?nullptr:depnode);
287  myVisualizefalloff = 2;
288  if (true)
289  graph->evalOpParm(myVisualizefalloff, nodeidx, "visualizefalloff", time, graph->isDirect()?nullptr:depnode);
290 
291  }
292 
293 
294  void loadFromOpSubclass(const LoadParms &loadparms) override
295  {
296  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
297  }
298 
299 
300  void copyFrom(const OP_NodeParms *src) override
301  {
302  *this = *((const SOP_UVTransform_2_0Parms *)src);
303  }
304 
305  template <typename T>
306  void
307  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
308  {
309  if (idx.size() < 1)
310  return;
311  UT_ASSERT(idx.size() == instance.size()+1);
312  if (idx.size() != instance.size()+1)
313  return;
314  switch (idx[0])
315  {
316  case 0:
317  coerceValue(value, myGroup);
318  break;
319  case 1:
320  coerceValue(value, myGroupType);
321  break;
322  case 2:
323  coerceValue(value, myUVAttrib);
324  break;
325  case 3:
326  coerceValue(value, myXOrd);
327  break;
328  case 4:
329  coerceValue(value, myROrd);
330  break;
331  case 5:
332  coerceValue(value, myT);
333  break;
334  case 6:
335  coerceValue(value, myR);
336  break;
337  case 7:
338  coerceValue(value, myS);
339  break;
340  case 8:
341  coerceValue(value, myShear);
342  break;
343  case 9:
344  coerceValue(value, myP);
345  break;
346  case 10:
347  coerceValue(value, myRad);
348  break;
349  case 11:
350  coerceValue(value, myType);
351  break;
352  case 12:
353  coerceValue(value, myTandeg);
354  break;
355  case 13:
356  coerceValue(value, myKernel);
357  break;
358  case 14:
359  coerceValue(value, myMetric);
360  break;
361  case 15:
362  coerceValue(value, myGlobal);
363  break;
364  case 16:
365  coerceValue(value, myUVGlobal);
366  break;
367  case 17:
368  coerceValue(value, myVisualizefalloff);
369  break;
370 
371  }
372  }
373 
374  bool isParmColorRamp(exint idx) const override
375  {
376  switch (idx)
377  {
378 
379  }
380  return false;
381  }
382 
383  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
384  { doGetParmValue(idx, instance, value); }
385  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
386  { doGetParmValue(idx, instance, value); }
387  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
388  { doGetParmValue(idx, instance, value); }
389  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
390  { doGetParmValue(idx, instance, value); }
391  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
392  { doGetParmValue(idx, instance, value); }
393  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
394  { doGetParmValue(idx, instance, value); }
395  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
396  { doGetParmValue(idx, instance, value); }
397  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
398  { doGetParmValue(idx, instance, value); }
399  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
400  { doGetParmValue(idx, instance, value); }
401  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
402  { doGetParmValue(idx, instance, value); }
403  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
404  { doGetParmValue(idx, instance, value); }
405 
406  template <typename T>
407  void
408  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
409  {
410  if (idx.size() < 1)
411  return;
412  UT_ASSERT(idx.size() == instance.size()+1);
413  if (idx.size() != instance.size()+1)
414  return;
415  switch (idx[0])
416  {
417  case 0:
418  coerceValue(myGroup, ( ( value ) ));
419  break;
420  case 1:
421  coerceValue(myGroupType, clampMinValue(0, clampMaxValue(4, value ) ));
422  break;
423  case 2:
424  coerceValue(myUVAttrib, ( ( value ) ));
425  break;
426  case 3:
427  coerceValue(myXOrd, clampMinValue(0, clampMaxValue(5, value ) ));
428  break;
429  case 4:
430  coerceValue(myROrd, clampMinValue(0, clampMaxValue(5, value ) ));
431  break;
432  case 5:
433  coerceValue(myT, ( ( value ) ));
434  break;
435  case 6:
436  coerceValue(myR, ( ( value ) ));
437  break;
438  case 7:
439  coerceValue(myS, ( ( value ) ));
440  break;
441  case 8:
442  coerceValue(myShear, ( ( value ) ));
443  break;
444  case 9:
445  coerceValue(myP, ( ( value ) ));
446  break;
447  case 10:
448  coerceValue(myRad, clampMinValue(0, ( value ) ));
449  break;
450  case 11:
451  coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
452  break;
453  case 12:
454  coerceValue(myTandeg, ( ( value ) ));
455  break;
456  case 13:
457  coerceValue(myKernel, ( ( value ) ));
458  break;
459  case 14:
460  coerceValue(myMetric, clampMinValue(0, clampMaxValue(2, value ) ));
461  break;
462  case 15:
463  coerceValue(myGlobal, ( ( value ) ));
464  break;
465  case 16:
466  coerceValue(myUVGlobal, ( ( value ) ));
467  break;
468  case 17:
469  coerceValue(myVisualizefalloff, clampMinValue(0, clampMaxValue(2, value ) ));
470  break;
471 
472  }
473  }
474 
475  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
476  { doSetParmValue(idx, instance, value); }
477  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
478  { doSetParmValue(idx, instance, value); }
479  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
480  { doSetParmValue(idx, instance, value); }
481  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
482  { doSetParmValue(idx, instance, value); }
483  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
484  { doSetParmValue(idx, instance, value); }
485  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
486  { doSetParmValue(idx, instance, value); }
487  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
488  { doSetParmValue(idx, instance, value); }
489  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
490  { doSetParmValue(idx, instance, value); }
491  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
492  { doSetParmValue(idx, instance, value); }
493  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
494  { doSetParmValue(idx, instance, value); }
495  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
496  { doSetParmValue(idx, instance, value); }
497 
498  exint getNestNumParms(TempIndex idx) const override
499  {
500  if (idx.size() == 0)
501  return 18;
502  switch (idx[0])
503  {
504 
505  }
506  // Invalid
507  return 0;
508  }
509 
510  const char *getNestParmName(TempIndex fieldnum) const override
511  {
512  if (fieldnum.size() < 1)
513  return 0;
514  switch (fieldnum[0])
515  {
516  case 0:
517  return "group";
518  case 1:
519  return "grouptype";
520  case 2:
521  return "uvattrib";
522  case 3:
523  return "xOrd";
524  case 4:
525  return "rOrd";
526  case 5:
527  return "t";
528  case 6:
529  return "r";
530  case 7:
531  return "s";
532  case 8:
533  return "shear";
534  case 9:
535  return "p";
536  case 10:
537  return "rad";
538  case 11:
539  return "type";
540  case 12:
541  return "tandeg";
542  case 13:
543  return "kernel";
544  case 14:
545  return "metric";
546  case 15:
547  return "global";
548  case 16:
549  return "uvglobal";
550  case 17:
551  return "visualizefalloff";
552 
553  }
554  return 0;
555  }
556 
557  ParmType getNestParmType(TempIndex fieldnum) const override
558  {
559  if (fieldnum.size() < 1)
560  return PARM_UNSUPPORTED;
561  switch (fieldnum[0])
562  {
563  case 0:
564  return PARM_STRING;
565  case 1:
566  return PARM_INTEGER;
567  case 2:
568  return PARM_STRING;
569  case 3:
570  return PARM_INTEGER;
571  case 4:
572  return PARM_INTEGER;
573  case 5:
574  return PARM_VECTOR3;
575  case 6:
576  return PARM_VECTOR3;
577  case 7:
578  return PARM_VECTOR3;
579  case 8:
580  return PARM_VECTOR3;
581  case 9:
582  return PARM_VECTOR3;
583  case 10:
584  return PARM_FLOAT;
585  case 11:
586  return PARM_INTEGER;
587  case 12:
588  return PARM_VECTOR2;
589  case 13:
590  return PARM_STRING;
591  case 14:
592  return PARM_INTEGER;
593  case 15:
594  return PARM_INTEGER;
595  case 16:
596  return PARM_INTEGER;
597  case 17:
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, myGroup);
714  saveData(os, myGroupType);
715  saveData(os, myUVAttrib);
716  saveData(os, myXOrd);
717  saveData(os, myROrd);
718  saveData(os, myT);
719  saveData(os, myR);
720  saveData(os, myS);
721  saveData(os, myShear);
722  saveData(os, myP);
723  saveData(os, myRad);
724  saveData(os, myType);
725  saveData(os, myTandeg);
726  saveData(os, myKernel);
727  saveData(os, myMetric);
728  saveData(os, myGlobal);
729  saveData(os, myUVGlobal);
730  saveData(os, myVisualizefalloff);
731 
732  }
733 
734  bool load(UT_IStream &is)
735  {
736  int32 v;
737  is.bread(&v, 1);
738  if (version() != v)
739  {
740  // Fail incompatible versions
741  return false;
742  }
743  loadData(is, myGroup);
744  loadData(is, myGroupType);
745  loadData(is, myUVAttrib);
746  loadData(is, myXOrd);
747  loadData(is, myROrd);
748  loadData(is, myT);
749  loadData(is, myR);
750  loadData(is, myS);
751  loadData(is, myShear);
752  loadData(is, myP);
753  loadData(is, myRad);
754  loadData(is, myType);
755  loadData(is, myTandeg);
756  loadData(is, myKernel);
757  loadData(is, myMetric);
758  loadData(is, myGlobal);
759  loadData(is, myUVGlobal);
760  loadData(is, myVisualizefalloff);
761 
762  return true;
763  }
764 
765  const UT_StringHolder & getGroup() const { return myGroup; }
766  void setGroup(const UT_StringHolder & val) { myGroup = val; }
768  {
769  SOP_Node *thissop = cookparms.getNode();
770  if (!thissop) return getGroup();
772  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
773  return result;
774  }
775  GroupType getGroupType() const { return GroupType(myGroupType); }
776  void setGroupType(GroupType val) { myGroupType = int64(val); }
778  {
779  SOP_Node *thissop = cookparms.getNode();
780  if (!thissop) return getGroupType();
781  int64 result;
782  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
783  return GroupType(result);
784  }
785  const UT_StringHolder & getUVAttrib() const { return myUVAttrib; }
786  void setUVAttrib(const UT_StringHolder & val) { myUVAttrib = val; }
788  {
789  SOP_Node *thissop = cookparms.getNode();
790  if (!thissop) return getUVAttrib();
792  OP_Utils::evalOpParm(result, thissop, "uvattrib", cookparms.getCookTime(), 0);
793  return result;
794  }
795  XOrd getXOrd() const { return XOrd(myXOrd); }
796  void setXOrd(XOrd val) { myXOrd = int64(val); }
797  XOrd opXOrd(const SOP_NodeVerb::CookParms &cookparms) const
798  {
799  SOP_Node *thissop = cookparms.getNode();
800  if (!thissop) return getXOrd();
801  int64 result;
802  OP_Utils::evalOpParm(result, thissop, "xOrd", cookparms.getCookTime(), 0);
803  return XOrd(result);
804  }
805  ROrd getROrd() const { return ROrd(myROrd); }
806  void setROrd(ROrd val) { myROrd = int64(val); }
807  ROrd opROrd(const SOP_NodeVerb::CookParms &cookparms) const
808  {
809  SOP_Node *thissop = cookparms.getNode();
810  if (!thissop) return getROrd();
811  int64 result;
812  OP_Utils::evalOpParm(result, thissop, "rOrd", cookparms.getCookTime(), 0);
813  return ROrd(result);
814  }
815  UT_Vector3D getT() const { return myT; }
816  void setT(UT_Vector3D val) { myT = val; }
817  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
818  {
819  SOP_Node *thissop = cookparms.getNode();
820  if (!thissop) return getT();
822  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
823  return result;
824  }
825  UT_Vector3D getR() const { return myR; }
826  void setR(UT_Vector3D val) { myR = val; }
827  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
828  {
829  SOP_Node *thissop = cookparms.getNode();
830  if (!thissop) return getR();
832  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
833  return result;
834  }
835  UT_Vector3D getS() const { return myS; }
836  void setS(UT_Vector3D val) { myS = val; }
837  UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
838  {
839  SOP_Node *thissop = cookparms.getNode();
840  if (!thissop) return getS();
842  OP_Utils::evalOpParm(result, thissop, "s", cookparms.getCookTime(), 0);
843  return result;
844  }
845  UT_Vector3D getShear() const { return myShear; }
846  void setShear(UT_Vector3D val) { myShear = val; }
848  {
849  SOP_Node *thissop = cookparms.getNode();
850  if (!thissop) return getShear();
852  OP_Utils::evalOpParm(result, thissop, "shear", cookparms.getCookTime(), 0);
853  return result;
854  }
855  UT_Vector3D getP() const { return myP; }
856  void setP(UT_Vector3D val) { myP = val; }
857  UT_Vector3D opP(const SOP_NodeVerb::CookParms &cookparms) const
858  {
859  SOP_Node *thissop = cookparms.getNode();
860  if (!thissop) return getP();
862  OP_Utils::evalOpParm(result, thissop, "p", cookparms.getCookTime(), 0);
863  return result;
864  }
865  fpreal64 getRad() const { return myRad; }
866  void setRad(fpreal64 val) { myRad = val; }
867  fpreal64 opRad(const SOP_NodeVerb::CookParms &cookparms) const
868  {
869  SOP_Node *thissop = cookparms.getNode();
870  if (!thissop) return getRad();
872  OP_Utils::evalOpParm(result, thissop, "rad", cookparms.getCookTime(), 0);
873  return result;
874  }
875  Type getType() const { return Type(myType); }
876  void setType(Type val) { myType = int64(val); }
877  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
878  {
879  SOP_Node *thissop = cookparms.getNode();
880  if (!thissop) return getType();
881  int64 result;
882  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
883  return Type(result);
884  }
885  UT_Vector2D getTandeg() const { return myTandeg; }
886  void setTandeg(UT_Vector2D val) { myTandeg = val; }
888  {
889  SOP_Node *thissop = cookparms.getNode();
890  if (!thissop) return getTandeg();
892  OP_Utils::evalOpParm(result, thissop, "tandeg", cookparms.getCookTime(), 0);
893  return result;
894  }
895  const UT_StringHolder & getKernel() const { return myKernel; }
896  void setKernel(const UT_StringHolder & val) { myKernel = val; }
898  {
899  SOP_Node *thissop = cookparms.getNode();
900  if (!thissop) return getKernel();
902  OP_Utils::evalOpParm(result, thissop, "kernel", cookparms.getCookTime(), 0);
903  return result;
904  }
905  Metric getMetric() const { return Metric(myMetric); }
906  void setMetric(Metric val) { myMetric = int64(val); }
907  Metric opMetric(const SOP_NodeVerb::CookParms &cookparms) const
908  {
909  SOP_Node *thissop = cookparms.getNode();
910  if (!thissop) return getMetric();
911  int64 result;
912  OP_Utils::evalOpParm(result, thissop, "metric", cookparms.getCookTime(), 0);
913  return Metric(result);
914  }
915  bool getGlobal() const { return myGlobal; }
916  void setGlobal(bool val) { myGlobal = val; }
917  bool opGlobal(const SOP_NodeVerb::CookParms &cookparms) const
918  {
919  SOP_Node *thissop = cookparms.getNode();
920  if (!thissop) return getGlobal();
921  bool result;
922  OP_Utils::evalOpParm(result, thissop, "global", cookparms.getCookTime(), 0);
923  return result;
924  }
925  bool getUVGlobal() const { return myUVGlobal; }
926  void setUVGlobal(bool val) { myUVGlobal = val; }
927  bool opUVGlobal(const SOP_NodeVerb::CookParms &cookparms) const
928  {
929  SOP_Node *thissop = cookparms.getNode();
930  if (!thissop) return getUVGlobal();
931  bool result;
932  OP_Utils::evalOpParm(result, thissop, "uvglobal", cookparms.getCookTime(), 0);
933  return result;
934  }
935  Visualizefalloff getVisualizefalloff() const { return Visualizefalloff(myVisualizefalloff); }
936  void setVisualizefalloff(Visualizefalloff val) { myVisualizefalloff = int64(val); }
938  {
939  SOP_Node *thissop = cookparms.getNode();
940  if (!thissop) return getVisualizefalloff();
941  int64 result;
942  OP_Utils::evalOpParm(result, thissop, "visualizefalloff", cookparms.getCookTime(), 0);
943  return Visualizefalloff(result);
944  }
945 
946 private:
947  UT_StringHolder myGroup;
948  int64 myGroupType;
949  UT_StringHolder myUVAttrib;
950  int64 myXOrd;
951  int64 myROrd;
952  UT_Vector3D myT;
953  UT_Vector3D myR;
954  UT_Vector3D myS;
955  UT_Vector3D myShear;
956  UT_Vector3D myP;
957  fpreal64 myRad;
958  int64 myType;
959  UT_Vector2D myTandeg;
960  UT_StringHolder myKernel;
961  int64 myMetric;
962  bool myGlobal;
963  bool myUVGlobal;
964  int64 myVisualizefalloff;
965 
966 };
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)
type
Definition: core.h:556
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:63
UT_Vector2T< fpreal64 > UT_Vector2D
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
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 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:303
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: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
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)
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void loadFromOpSubclass(const LoadParms &loadparms) override
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