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 <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_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 
196  if (baseGetSignature() != src.baseGetSignature()) return false;
197 
198  return true;
199  }
200  bool operator!=(const SOP_UVProjectParms &src) const
201  {
202  return !operator==(src);
203  }
209 
210 
211 
212  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
213  {
214  myUVAttrib = "uv"_UTsh;
215  if (true)
216  graph->evalOpParm(myUVAttrib, nodeidx, "uvattrib", time, graph->isDirect()?nullptr:depnode);
217  myGroup = ""_UTsh;
218  if (true)
219  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
220  myGroupType = 0;
221  if (true)
222  graph->evalOpParm(myGroupType, nodeidx, "grouptype", time, graph->isDirect()?nullptr:depnode);
223  myProjType = 0;
224  if (true)
225  graph->evalOpParm(myProjType, nodeidx, "projtype", time, graph->isDirect()?nullptr:depnode);
226  myTorRad = 0.2;
227  if (true && ( (true&&!(((int64(getProjType())!=3)))) ) )
228  graph->evalOpParm(myTorRad, nodeidx, "torrad", time, graph->isDirect()?nullptr:depnode);
229  myXord = 0;
230  if (true)
231  graph->evalOpParm(myXord, nodeidx, "xOrd", time, graph->isDirect()?nullptr:depnode);
232  myRord = 0;
233  if (true)
234  graph->evalOpParm(myRord, nodeidx, "rOrd", time, graph->isDirect()?nullptr:depnode);
235  myT = UT_Vector3D(0,0,0);
236  if (true)
237  graph->evalOpParm(myT, nodeidx, "t", time, graph->isDirect()?nullptr:depnode);
238  myR = UT_Vector3D(0,0,0);
239  if (true)
240  graph->evalOpParm(myR, nodeidx, "r", time, graph->isDirect()?nullptr:depnode);
241  myS = UT_Vector3D(1,1,1);
242  if (true)
243  graph->evalOpParm(myS, nodeidx, "s", time, graph->isDirect()?nullptr:depnode);
244  myP = UT_Vector3D(0,0,0);
245  if (true)
246  graph->evalOpParm(myP, nodeidx, "p", time, graph->isDirect()?nullptr:depnode);
247  myInittype = 3;
248  if (true)
249  graph->evalOpParm(myInittype, nodeidx, "inittype", time, graph->isDirect()?nullptr:depnode);
250  myURange = UT_Vector2D(0,1);
251  if (true)
252  graph->evalOpParm(myURange, nodeidx, "urange", time, graph->isDirect()?nullptr:depnode);
253  myVRange = UT_Vector2D(0,1);
254  if (true)
255  graph->evalOpParm(myVRange, nodeidx, "vrange", time, graph->isDirect()?nullptr:depnode);
256  myAngle = 0;
257  if (true)
258  graph->evalOpParm(myAngle, nodeidx, "angle", time, graph->isDirect()?nullptr:depnode);
259  myFixSeams = true;
260  if (true && ( (true&&!(((int64(getProjType())==0))||((int64(getProjType())==4)))) ) )
261  graph->evalOpParm(myFixSeams, nodeidx, "fixseams", time, graph->isDirect()?nullptr:depnode);
262  myFixPolar = true;
263  if (true && ( (true&&!(((int64(getProjType())==0))||((int64(getProjType())==3)))) ) )
264  graph->evalOpParm(myFixPolar, nodeidx, "fixpolar", time, graph->isDirect()?nullptr:depnode);
265  myPoleRad = 0.01;
266  if (true && ( (true&&!(((int64(getProjType())==0))||((int64(getProjType())==3))||((getFixPolar()==0)))) ) )
267  graph->evalOpParm(myPoleRad, nodeidx, "polerad", time, graph->isDirect()?nullptr:depnode);
268 
269  }
270 
271 
272  void loadFromOpSubclass(const LoadParms &loadparms) override
273  {
274  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
275  }
276 
277 
278  void copyFrom(const OP_NodeParms *src) override
279  {
280  *this = *((const SOP_UVProjectParms *)src);
281  }
282 
283  template <typename T>
284  void
285  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
286  {
287  if (idx.size() < 1)
288  return;
289  UT_ASSERT(idx.size() == instance.size()+1);
290  if (idx.size() != instance.size()+1)
291  return;
292  switch (idx[0])
293  {
294  case 0:
295  coerceValue(value, myUVAttrib);
296  break;
297  case 1:
298  coerceValue(value, myGroup);
299  break;
300  case 2:
301  coerceValue(value, myGroupType);
302  break;
303  case 3:
304  coerceValue(value, myProjType);
305  break;
306  case 4:
307  coerceValue(value, myTorRad);
308  break;
309  case 5:
310  coerceValue(value, myXord);
311  break;
312  case 6:
313  coerceValue(value, myRord);
314  break;
315  case 7:
316  coerceValue(value, myT);
317  break;
318  case 8:
319  coerceValue(value, myR);
320  break;
321  case 9:
322  coerceValue(value, myS);
323  break;
324  case 10:
325  coerceValue(value, myP);
326  break;
327  case 11:
328  coerceValue(value, myInittype);
329  break;
330  case 12:
331  coerceValue(value, myURange);
332  break;
333  case 13:
334  coerceValue(value, myVRange);
335  break;
336  case 14:
337  coerceValue(value, myAngle);
338  break;
339  case 15:
340  coerceValue(value, myFixSeams);
341  break;
342  case 16:
343  coerceValue(value, myFixPolar);
344  break;
345  case 17:
346  coerceValue(value, myPoleRad);
347  break;
348 
349  }
350  }
351 
352  bool isParmColorRamp(exint idx) const override
353  {
354  switch (idx)
355  {
356 
357  }
358  return false;
359  }
360 
361  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
362  { doGetParmValue(idx, instance, value); }
363  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
364  { doGetParmValue(idx, instance, value); }
365  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
366  { doGetParmValue(idx, instance, value); }
367  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
368  { doGetParmValue(idx, instance, value); }
369  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
370  { doGetParmValue(idx, instance, value); }
371  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
372  { doGetParmValue(idx, instance, value); }
373  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
374  { doGetParmValue(idx, instance, value); }
375  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
376  { doGetParmValue(idx, instance, value); }
377  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
378  { doGetParmValue(idx, instance, value); }
379  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
380  { doGetParmValue(idx, instance, value); }
381  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
382  { doGetParmValue(idx, instance, value); }
383 
384  template <typename T>
385  void
386  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
387  {
388  if (idx.size() < 1)
389  return;
390  UT_ASSERT(idx.size() == instance.size()+1);
391  if (idx.size() != instance.size()+1)
392  return;
393  switch (idx[0])
394  {
395  case 0:
396  coerceValue(myUVAttrib, ( ( value ) ));
397  break;
398  case 1:
399  coerceValue(myGroup, ( ( value ) ));
400  break;
401  case 2:
402  coerceValue(myGroupType, clampMinValue(0, clampMaxValue(1, value ) ));
403  break;
404  case 3:
405  coerceValue(myProjType, clampMinValue(0, clampMaxValue(4, value ) ));
406  break;
407  case 4:
408  coerceValue(myTorRad, ( ( value ) ));
409  break;
410  case 5:
411  coerceValue(myXord, clampMinValue(0, clampMaxValue(5, value ) ));
412  break;
413  case 6:
414  coerceValue(myRord, clampMinValue(0, clampMaxValue(5, value ) ));
415  break;
416  case 7:
417  coerceValue(myT, ( ( value ) ));
418  break;
419  case 8:
420  coerceValue(myR, ( ( value ) ));
421  break;
422  case 9:
423  coerceValue(myS, ( ( value ) ));
424  break;
425  case 10:
426  coerceValue(myP, ( ( value ) ));
427  break;
428  case 11:
429  coerceValue(myInittype, clampMinValue(0, clampMaxValue(3, value ) ));
430  break;
431  case 12:
432  coerceValue(myURange, ( ( value ) ));
433  break;
434  case 13:
435  coerceValue(myVRange, ( ( value ) ));
436  break;
437  case 14:
438  coerceValue(myAngle, ( ( value ) ));
439  break;
440  case 15:
441  coerceValue(myFixSeams, ( ( value ) ));
442  break;
443  case 16:
444  coerceValue(myFixPolar, ( ( value ) ));
445  break;
446  case 17:
447  coerceValue(myPoleRad, ( ( value ) ));
448  break;
449 
450  }
451  }
452 
453  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
454  { doSetParmValue(idx, instance, value); }
455  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
456  { doSetParmValue(idx, instance, value); }
457  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
458  { doSetParmValue(idx, instance, value); }
459  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
460  { doSetParmValue(idx, instance, value); }
461  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
462  { doSetParmValue(idx, instance, value); }
463  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
464  { doSetParmValue(idx, instance, value); }
465  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
466  { doSetParmValue(idx, instance, value); }
467  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
468  { doSetParmValue(idx, instance, value); }
469  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
470  { doSetParmValue(idx, instance, value); }
471  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
472  { doSetParmValue(idx, instance, value); }
473  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
474  { doSetParmValue(idx, instance, value); }
475 
476  exint getNestNumParms(TempIndex idx) const override
477  {
478  if (idx.size() == 0)
479  return 18;
480  switch (idx[0])
481  {
482 
483  }
484  // Invalid
485  return 0;
486  }
487 
488  const char *getNestParmName(TempIndex fieldnum) const override
489  {
490  if (fieldnum.size() < 1)
491  return 0;
492  switch (fieldnum[0])
493  {
494  case 0:
495  return "uvattrib";
496  case 1:
497  return "group";
498  case 2:
499  return "grouptype";
500  case 3:
501  return "projtype";
502  case 4:
503  return "torrad";
504  case 5:
505  return "xOrd";
506  case 6:
507  return "rOrd";
508  case 7:
509  return "t";
510  case 8:
511  return "r";
512  case 9:
513  return "s";
514  case 10:
515  return "p";
516  case 11:
517  return "inittype";
518  case 12:
519  return "urange";
520  case 13:
521  return "vrange";
522  case 14:
523  return "angle";
524  case 15:
525  return "fixseams";
526  case 16:
527  return "fixpolar";
528  case 17:
529  return "polerad";
530 
531  }
532  return 0;
533  }
534 
535  ParmType getNestParmType(TempIndex fieldnum) const override
536  {
537  if (fieldnum.size() < 1)
538  return PARM_UNSUPPORTED;
539  switch (fieldnum[0])
540  {
541  case 0:
542  return PARM_STRING;
543  case 1:
544  return PARM_STRING;
545  case 2:
546  return PARM_INTEGER;
547  case 3:
548  return PARM_INTEGER;
549  case 4:
550  return PARM_FLOAT;
551  case 5:
552  return PARM_INTEGER;
553  case 6:
554  return PARM_INTEGER;
555  case 7:
556  return PARM_VECTOR3;
557  case 8:
558  return PARM_VECTOR3;
559  case 9:
560  return PARM_VECTOR3;
561  case 10:
562  return PARM_VECTOR3;
563  case 11:
564  return PARM_INTEGER;
565  case 12:
566  return PARM_VECTOR2;
567  case 13:
568  return PARM_VECTOR2;
569  case 14:
570  return PARM_FLOAT;
571  case 15:
572  return PARM_INTEGER;
573  case 16:
574  return PARM_INTEGER;
575  case 17:
576  return PARM_FLOAT;
577 
578  }
579  return PARM_UNSUPPORTED;
580  }
581 
582  // Boiler plate to load individual types.
583  static void loadData(UT_IStream &is, int64 &v)
584  { is.bread(&v, 1); }
585  static void loadData(UT_IStream &is, bool &v)
586  { int64 iv; is.bread(&iv, 1); v = iv; }
587  static void loadData(UT_IStream &is, fpreal64 &v)
588  { is.bread<fpreal64>(&v, 1); }
589  static void loadData(UT_IStream &is, UT_Vector2D &v)
590  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
591  static void loadData(UT_IStream &is, UT_Vector3D &v)
592  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
593  is.bread<fpreal64>(&v.z(), 1); }
594  static void loadData(UT_IStream &is, UT_Vector4D &v)
595  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
596  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
597  static void loadData(UT_IStream &is, UT_Matrix2D &v)
598  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
599  static void loadData(UT_IStream &is, UT_Matrix3D &v)
600  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
601  static void loadData(UT_IStream &is, UT_Matrix4D &v)
602  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
603  static void loadData(UT_IStream &is, UT_Vector2I &v)
604  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
605  static void loadData(UT_IStream &is, UT_Vector3I &v)
606  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
607  is.bread<int64>(&v.z(), 1); }
608  static void loadData(UT_IStream &is, UT_Vector4I &v)
609  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
610  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
612  { is.bread(v); }
614  { UT_StringHolder rampdata;
615  loadData(is, rampdata);
616  if (rampdata.isstring())
617  {
618  v.reset(new UT_Ramp());
619  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
620  v->load(istr);
621  }
622  else v.reset();
623  }
626  loadData(is, data);
627  if (data.isstring())
628  {
629  // Find the data type.
630  const char *colon = UT_StringWrap(data).findChar(':');
631  if (colon)
632  {
633  int typelen = colon - data.buffer();
635  type.strncpy(data.buffer(), typelen);
636  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
637 
638  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
639  }
640  }
641  else v.reset();
642  }
643 
644  static void saveData(std::ostream &os, int64 v)
645  { UTwrite(os, &v); }
646  static void saveData(std::ostream &os, bool v)
647  { int64 iv = v; UTwrite(os, &iv); }
648  static void saveData(std::ostream &os, fpreal64 v)
649  { UTwrite<fpreal64>(os, &v); }
650  static void saveData(std::ostream &os, UT_Vector2D v)
651  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
652  static void saveData(std::ostream &os, UT_Vector3D v)
653  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
654  UTwrite<fpreal64>(os, &v.z()); }
655  static void saveData(std::ostream &os, UT_Vector4D v)
656  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
657  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
658  static void saveData(std::ostream &os, UT_Matrix2D v)
660  static void saveData(std::ostream &os, UT_Matrix3D v)
662  static void saveData(std::ostream &os, UT_Matrix4D v)
664  static void saveData(std::ostream &os, UT_StringHolder s)
665  { UT_StringWrap(s).saveBinary(os); }
666  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
668  UT_OStringStream ostr;
669  if (s) s->save(ostr);
670  result = ostr.str();
671  saveData(os, result);
672  }
673  static void saveData(std::ostream &os, PRM_DataItemHandle s)
675  UT_OStringStream ostr;
676  if (s)
677  {
678  ostr << s->getDataTypeToken();
679  ostr << ":";
680  s->saveBinary(ostr);
681  }
682  result = ostr.str();
683  saveData(os, result);
684  }
685 
686 
687  void save(std::ostream &os) const
688  {
689  int32 v = version();
690  UTwrite(os, &v);
691  saveData(os, myUVAttrib);
692  saveData(os, myGroup);
693  saveData(os, myGroupType);
694  saveData(os, myProjType);
695  saveData(os, myTorRad);
696  saveData(os, myXord);
697  saveData(os, myRord);
698  saveData(os, myT);
699  saveData(os, myR);
700  saveData(os, myS);
701  saveData(os, myP);
702  saveData(os, myInittype);
703  saveData(os, myURange);
704  saveData(os, myVRange);
705  saveData(os, myAngle);
706  saveData(os, myFixSeams);
707  saveData(os, myFixPolar);
708  saveData(os, myPoleRad);
709 
710  }
711 
712  bool load(UT_IStream &is)
713  {
714  int32 v;
715  is.bread(&v, 1);
716  if (version() != v)
717  {
718  // Fail incompatible versions
719  return false;
720  }
721  loadData(is, myUVAttrib);
722  loadData(is, myGroup);
723  loadData(is, myGroupType);
724  loadData(is, myProjType);
725  loadData(is, myTorRad);
726  loadData(is, myXord);
727  loadData(is, myRord);
728  loadData(is, myT);
729  loadData(is, myR);
730  loadData(is, myS);
731  loadData(is, myP);
732  loadData(is, myInittype);
733  loadData(is, myURange);
734  loadData(is, myVRange);
735  loadData(is, myAngle);
736  loadData(is, myFixSeams);
737  loadData(is, myFixPolar);
738  loadData(is, myPoleRad);
739 
740  return true;
741  }
742 
743  const UT_StringHolder & getUVAttrib() const { return myUVAttrib; }
744  void setUVAttrib(const UT_StringHolder & val) { myUVAttrib = val; }
746  {
747  SOP_Node *thissop = cookparms.getNode();
748  if (!thissop) return getUVAttrib();
750  OP_Utils::evalOpParm(result, thissop, "uvattrib", cookparms.getCookTime(), 0);
751  return result;
752  }
753  const UT_StringHolder & getGroup() const { return myGroup; }
754  void setGroup(const UT_StringHolder & val) { myGroup = val; }
756  {
757  SOP_Node *thissop = cookparms.getNode();
758  if (!thissop) return getGroup();
760  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
761  return result;
762  }
763  GroupType getGroupType() const { return GroupType(myGroupType); }
764  void setGroupType(GroupType val) { myGroupType = int64(val); }
766  {
767  SOP_Node *thissop = cookparms.getNode();
768  if (!thissop) return getGroupType();
769  int64 result;
770  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
771  return GroupType(result);
772  }
773  ProjType getProjType() const { return ProjType(myProjType); }
774  void setProjType(ProjType val) { myProjType = int64(val); }
776  {
777  SOP_Node *thissop = cookparms.getNode();
778  if (!thissop) return getProjType();
779  int64 result;
780  OP_Utils::evalOpParm(result, thissop, "projtype", cookparms.getCookTime(), 0);
781  return ProjType(result);
782  }
783  fpreal64 getTorRad() const { return myTorRad; }
784  void setTorRad(fpreal64 val) { myTorRad = val; }
785  fpreal64 opTorRad(const SOP_NodeVerb::CookParms &cookparms) const
786  {
787  SOP_Node *thissop = cookparms.getNode();
788  if (!thissop) return getTorRad();
790  OP_Utils::evalOpParm(result, thissop, "torrad", cookparms.getCookTime(), 0);
791  return result;
792  }
793  Xord getXord() const { return Xord(myXord); }
794  void setXord(Xord val) { myXord = int64(val); }
795  Xord opXord(const SOP_NodeVerb::CookParms &cookparms) const
796  {
797  SOP_Node *thissop = cookparms.getNode();
798  if (!thissop) return getXord();
799  int64 result;
800  OP_Utils::evalOpParm(result, thissop, "xOrd", cookparms.getCookTime(), 0);
801  return Xord(result);
802  }
803  Rord getRord() const { return Rord(myRord); }
804  void setRord(Rord val) { myRord = int64(val); }
805  Rord opRord(const SOP_NodeVerb::CookParms &cookparms) const
806  {
807  SOP_Node *thissop = cookparms.getNode();
808  if (!thissop) return getRord();
809  int64 result;
810  OP_Utils::evalOpParm(result, thissop, "rOrd", cookparms.getCookTime(), 0);
811  return Rord(result);
812  }
813  UT_Vector3D getT() const { return myT; }
814  void setT(UT_Vector3D val) { myT = val; }
815  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
816  {
817  SOP_Node *thissop = cookparms.getNode();
818  if (!thissop) return getT();
820  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
821  return result;
822  }
823  UT_Vector3D getR() const { return myR; }
824  void setR(UT_Vector3D val) { myR = val; }
825  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
826  {
827  SOP_Node *thissop = cookparms.getNode();
828  if (!thissop) return getR();
830  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
831  return result;
832  }
833  UT_Vector3D getS() const { return myS; }
834  void setS(UT_Vector3D val) { myS = val; }
835  UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
836  {
837  SOP_Node *thissop = cookparms.getNode();
838  if (!thissop) return getS();
840  OP_Utils::evalOpParm(result, thissop, "s", cookparms.getCookTime(), 0);
841  return result;
842  }
843  UT_Vector3D getP() const { return myP; }
844  void setP(UT_Vector3D val) { myP = val; }
845  UT_Vector3D opP(const SOP_NodeVerb::CookParms &cookparms) const
846  {
847  SOP_Node *thissop = cookparms.getNode();
848  if (!thissop) return getP();
850  OP_Utils::evalOpParm(result, thissop, "p", cookparms.getCookTime(), 0);
851  return result;
852  }
853  Inittype getInittype() const { return Inittype(myInittype); }
854  void setInittype(Inittype val) { myInittype = int64(val); }
856  {
857  SOP_Node *thissop = cookparms.getNode();
858  if (!thissop) return getInittype();
859  int64 result;
860  OP_Utils::evalOpParm(result, thissop, "inittype", cookparms.getCookTime(), 0);
861  return Inittype(result);
862  }
863  UT_Vector2D getURange() const { return myURange; }
864  void setURange(UT_Vector2D val) { myURange = val; }
866  {
867  SOP_Node *thissop = cookparms.getNode();
868  if (!thissop) return getURange();
870  OP_Utils::evalOpParm(result, thissop, "urange", cookparms.getCookTime(), 0);
871  return result;
872  }
873  UT_Vector2D getVRange() const { return myVRange; }
874  void setVRange(UT_Vector2D val) { myVRange = val; }
876  {
877  SOP_Node *thissop = cookparms.getNode();
878  if (!thissop) return getVRange();
880  OP_Utils::evalOpParm(result, thissop, "vrange", cookparms.getCookTime(), 0);
881  return result;
882  }
883  fpreal64 getAngle() const { return myAngle; }
884  void setAngle(fpreal64 val) { myAngle = val; }
885  fpreal64 opAngle(const SOP_NodeVerb::CookParms &cookparms) const
886  {
887  SOP_Node *thissop = cookparms.getNode();
888  if (!thissop) return getAngle();
890  OP_Utils::evalOpParm(result, thissop, "angle", cookparms.getCookTime(), 0);
891  return result;
892  }
893  bool getFixSeams() const { return myFixSeams; }
894  void setFixSeams(bool val) { myFixSeams = val; }
895  bool opFixSeams(const SOP_NodeVerb::CookParms &cookparms) const
896  {
897  SOP_Node *thissop = cookparms.getNode();
898  if (!thissop) return getFixSeams();
899  bool result;
900  OP_Utils::evalOpParm(result, thissop, "fixseams", cookparms.getCookTime(), 0);
901  return result;
902  }
903  bool getFixPolar() const { return myFixPolar; }
904  void setFixPolar(bool val) { myFixPolar = val; }
905  bool opFixPolar(const SOP_NodeVerb::CookParms &cookparms) const
906  {
907  SOP_Node *thissop = cookparms.getNode();
908  if (!thissop) return getFixPolar();
909  bool result;
910  OP_Utils::evalOpParm(result, thissop, "fixpolar", cookparms.getCookTime(), 0);
911  return result;
912  }
913  fpreal64 getPoleRad() const { return myPoleRad; }
914  void setPoleRad(fpreal64 val) { myPoleRad = val; }
916  {
917  SOP_Node *thissop = cookparms.getNode();
918  if (!thissop) return getPoleRad();
920  OP_Utils::evalOpParm(result, thissop, "polerad", cookparms.getCookTime(), 0);
921  return result;
922  }
923 
924 private:
925  UT_StringHolder myUVAttrib;
926  UT_StringHolder myGroup;
927  int64 myGroupType;
928  int64 myProjType;
929  fpreal64 myTorRad;
930  int64 myXord;
931  int64 myRord;
932  UT_Vector3D myT;
933  UT_Vector3D myR;
934  UT_Vector3D myS;
935  UT_Vector3D myP;
936  int64 myInittype;
937  UT_Vector2D myURange;
938  UT_Vector2D myVRange;
939  fpreal64 myAngle;
940  bool myFixSeams;
941  bool myFixPolar;
942  fpreal64 myPoleRad;
943 
944 };
type
Definition: core.h:556
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:63
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
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
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 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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
void setFixPolar(bool val)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
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)
void setR(UT_Vector3D val)
ProjType opProjType(const SOP_NodeVerb::CookParms &cookparms) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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
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