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