HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Convert.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_ConvertEnums
24 {
25  enum class Fromtype
26  {
27  ALL = 0,
28  SPHERE,
29  TUBE,
30  PART,
31  METABALL,
32  POLY,
33  MESH,
34  BEZCURVE,
35  BEZSURF,
36  NURBCURVE,
37  NURBSURF,
38  PASTESURF,
39  CIRCLE,
40  TRISTRIP,
41  TRIFAN,
42  TRIBEZ,
43  VOLUME,
44  POLYSOUP,
45  VDB
46  };
47 
49  getToken(Fromtype enum_value)
50  {
51  using namespace UT::Literal;
52  switch (enum_value) {
53  case Fromtype::ALL: return "all"_sh;
54  case Fromtype::SPHERE: return "sphere"_sh;
55  case Fromtype::TUBE: return "tube"_sh;
56  case Fromtype::PART: return "part"_sh;
57  case Fromtype::METABALL: return "metaball"_sh;
58  case Fromtype::POLY: return "poly"_sh;
59  case Fromtype::MESH: return "mesh"_sh;
60  case Fromtype::BEZCURVE: return "bezCurve"_sh;
61  case Fromtype::BEZSURF: return "bezSurf"_sh;
62  case Fromtype::NURBCURVE: return "nurbCurve"_sh;
63  case Fromtype::NURBSURF: return "nurbSurf"_sh;
64  case Fromtype::PASTESURF: return "pasteSurf"_sh;
65  case Fromtype::CIRCLE: return "circle"_sh;
66  case Fromtype::TRISTRIP: return "tristrip"_sh;
67  case Fromtype::TRIFAN: return "trifan"_sh;
68  case Fromtype::TRIBEZ: return "tribez"_sh;
69  case Fromtype::VOLUME: return "volume"_sh;
70  case Fromtype::POLYSOUP: return "polySoup"_sh;
71  case Fromtype::VDB: return "vdb"_sh;
72  default: UT_ASSERT(false); return ""_sh;
73  }
74  }
75 
76  enum class Totype
77  {
78  POLY = 0,
79  MESH,
80  BEZCURVE,
81  BEZSURF,
82  NURBCURVE,
83  NURBSURF,
84  PASTESURF,
85  CIRCLE,
88  TRIBEZ,
89  POLYSOUP,
90  VOLUME,
91  VDB
92  };
93 
95  getToken(Totype enum_value)
96  {
97  using namespace UT::Literal;
98  switch (enum_value) {
99  case Totype::POLY: return "poly"_sh;
100  case Totype::MESH: return "mesh"_sh;
101  case Totype::BEZCURVE: return "bezCurve"_sh;
102  case Totype::BEZSURF: return "bezSurf"_sh;
103  case Totype::NURBCURVE: return "nurbCurve"_sh;
104  case Totype::NURBSURF: return "nurbSurf"_sh;
105  case Totype::PASTESURF: return "pasteSurf"_sh;
106  case Totype::CIRCLE: return "circle"_sh;
107  case Totype::TRIMBEZSURF: return "trimBezSurf"_sh;
108  case Totype::TRIMNURBSURF: return "trimNurbSurf"_sh;
109  case Totype::TRIBEZ: return "tribez"_sh;
110  case Totype::POLYSOUP: return "polySoup"_sh;
111  case Totype::VOLUME: return "volume"_sh;
112  case Totype::VDB: return "vdb"_sh;
113  default: UT_ASSERT(false); return ""_sh;
114  }
115  }
116 
117  enum class Surftype
118  {
119  ROWS = 0,
120  COLS,
121  ROWCOL,
122  TRIANGLES,
123  QUADS,
124  ALTTRIANGLES,
126  };
127 
129  getToken(Surftype enum_value)
130  {
131  using namespace UT::Literal;
132  switch (enum_value) {
133  case Surftype::ROWS: return "rows"_sh;
134  case Surftype::COLS: return "cols"_sh;
135  case Surftype::ROWCOL: return "rowcol"_sh;
136  case Surftype::TRIANGLES: return "triangles"_sh;
137  case Surftype::QUADS: return "quads"_sh;
138  case Surftype::ALTTRIANGLES: return "alttriangles"_sh;
139  case Surftype::REVTRIANGLES: return "revtriangles"_sh;
140  default: UT_ASSERT(false); return ""_sh;
141  }
142  }
143 
144  enum class Pastecoord
145  {
146  CFEATURE = 0,
147  CBASE
148  };
149 
151  getToken(Pastecoord enum_value)
152  {
153  using namespace UT::Literal;
154  switch (enum_value) {
155  case Pastecoord::CFEATURE: return "cfeature"_sh;
156  case Pastecoord::CBASE: return "cbase"_sh;
157  default: UT_ASSERT(false); return ""_sh;
158  }
159  }
160 
161  enum class Pasteattrib
162  {
163  AFEATURE = 0,
164  ABASE
165  };
166 
168  getToken(Pasteattrib enum_value)
169  {
170  using namespace UT::Literal;
171  switch (enum_value) {
172  case Pasteattrib::AFEATURE: return "afeature"_sh;
173  case Pasteattrib::ABASE: return "abase"_sh;
174  default: UT_ASSERT(false); return ""_sh;
175  }
176  }
177 
178 }
179 
180 
182 {
183 public:
184  static int version() { return 1; }
185 
187  {
188  myGroup = ""_UTsh;
189  myFromtype = 0;
190  myTotype = 0;
191  mySurftype = 4;
192  myStdswitcher = 0;
193  myOrderu = 4;
194  myOrderv = 4;
195  myPastecoord = 0;
196  myPasteattrib = 0;
197  myNew = false;
198  myInterphull = false;
199  myOffset = 0;
200  myLodu = 0.5;
201  myLodv = 0.5;
202  myLodtrim = 1;
203  myDivu = 2;
204  myDivv = 2;
205  myDivtrim = 1;
206 
207  }
208 
209  explicit SOP_ConvertParms(const SOP_ConvertParms &) = default;
210  SOP_ConvertParms &operator=(const SOP_ConvertParms &) = default;
211  SOP_ConvertParms(SOP_ConvertParms &&) noexcept = default;
212  SOP_ConvertParms &operator=(SOP_ConvertParms &&) noexcept = default;
213 
214  ~SOP_ConvertParms() override {}
215 
216  bool operator==(const SOP_ConvertParms &src) const
217  {
218  if (myGroup != src.myGroup) return false;
219  if (myFromtype != src.myFromtype) return false;
220  if (myTotype != src.myTotype) return false;
221  if (mySurftype != src.mySurftype) return false;
222  if (myStdswitcher != src.myStdswitcher) return false;
223  if (myOrderu != src.myOrderu) return false;
224  if (myOrderv != src.myOrderv) return false;
225  if (myPastecoord != src.myPastecoord) return false;
226  if (myPasteattrib != src.myPasteattrib) return false;
227  if (myNew != src.myNew) return false;
228  if (myInterphull != src.myInterphull) return false;
229  if (myOffset != src.myOffset) return false;
230  if (myLodu != src.myLodu) return false;
231  if (myLodv != src.myLodv) return false;
232  if (myLodtrim != src.myLodtrim) return false;
233  if (myDivu != src.myDivu) return false;
234  if (myDivv != src.myDivv) return false;
235  if (myDivtrim != src.myDivtrim) return false;
236 
237 
238  if (baseGetSignature() != src.baseGetSignature()) return false;
239 
240  return true;
241  }
242  bool operator!=(const SOP_ConvertParms &src) const
243  {
244  return !operator==(src);
245  }
251 
252 
253 
254  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
255  {
256  myGroup = ""_UTsh;
257  if (true)
258  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
259  myFromtype = 0;
260  if (true)
261  graph->evalOpParm(myFromtype, nodeidx, "fromtype", time, graph->isDirect()?nullptr:depnode);
262  myTotype = 0;
263  if (true)
264  graph->evalOpParm(myTotype, nodeidx, "totype", time, graph->isDirect()?nullptr:depnode);
265  mySurftype = 4;
266  if (true && ( (true&&!(((int64(getTotype())!=3)&&(int64(getTotype())!=5)&&(int64(getTotype())!=1)&&(int64(getTotype())!=0)&&(int64(getTotype())!=11)))) ) )
267  graph->evalOpParm(mySurftype, nodeidx, "surftype", time, graph->isDirect()?nullptr:depnode);
268  myStdswitcher = 0;
269  if (true)
270  graph->evalOpParm(myStdswitcher, nodeidx, "stdswitcher", time, graph->isDirect()?nullptr:depnode);
271  myOrderu = 4;
272  if (true && ( (true&&!(((int64(getTotype())!=2)&&(int64(getTotype())!=4)&&(int64(getTotype())!=3)&&(int64(getTotype())!=5)))) ) )
273  graph->evalOpParm(myOrderu, nodeidx, "orderu", time, graph->isDirect()?nullptr:depnode);
274  myOrderv = 4;
275  if (true && ( (true&&!(((int64(getTotype())!=3)&&(int64(getTotype())!=5)))) ) )
276  graph->evalOpParm(myOrderv, nodeidx, "orderv", time, graph->isDirect()?nullptr:depnode);
277  myPastecoord = 0;
278  if (true)
279  graph->evalOpParm(myPastecoord, nodeidx, "pastecoord", time, graph->isDirect()?nullptr:depnode);
280  myPasteattrib = 0;
281  if (true)
282  graph->evalOpParm(myPasteattrib, nodeidx, "pasteattrib", time, graph->isDirect()?nullptr:depnode);
283  myNew = false;
284  if (true)
285  graph->evalOpParm(myNew, nodeidx, "new", time, graph->isDirect()?nullptr:depnode);
286  myInterphull = false;
287  if (true)
288  graph->evalOpParm(myInterphull, nodeidx, "interphull", time, graph->isDirect()?nullptr:depnode);
289  myOffset = 0;
290  if (true)
291  graph->evalOpParm(myOffset, nodeidx, "offset", time, graph->isDirect()?nullptr:depnode);
292  myLodu = 0.5;
293  if (true && ( (true&&!(((getInterphull()==1)))) ) )
294  graph->evalOpParm(myLodu, nodeidx, "lodu", time, graph->isDirect()?nullptr:depnode);
295  myLodv = 0.5;
296  if (true && ( (true&&!(((getInterphull()==1)))) ) )
297  graph->evalOpParm(myLodv, nodeidx, "lodv", time, graph->isDirect()?nullptr:depnode);
298  myLodtrim = 1;
299  if (true && ( (true&&!(((getInterphull()==1)))) ) )
300  graph->evalOpParm(myLodtrim, nodeidx, "lodtrim", time, graph->isDirect()?nullptr:depnode);
301  myDivu = 2;
302  if (true && ( (true&&!(((getInterphull()==1)))) ) )
303  graph->evalOpParm(myDivu, nodeidx, "divu", time, graph->isDirect()?nullptr:depnode);
304  myDivv = 2;
305  if (true && ( (true&&!(((getInterphull()==1)))) ) )
306  graph->evalOpParm(myDivv, nodeidx, "divv", time, graph->isDirect()?nullptr:depnode);
307  myDivtrim = 1;
308  if (true && ( (true&&!(((getInterphull()==1)))) ) )
309  graph->evalOpParm(myDivtrim, nodeidx, "divtrim", time, graph->isDirect()?nullptr:depnode);
310 
311  }
312 
313 
314  void loadFromOpSubclass(const LoadParms &loadparms) override
315  {
316  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
317  }
318 
319 
320  void copyFrom(const OP_NodeParms *src) override
321  {
322  *this = *((const SOP_ConvertParms *)src);
323  }
324 
325  template <typename T>
326  void
327  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
328  {
329  if (idx.size() < 1)
330  return;
331  UT_ASSERT(idx.size() == instance.size()+1);
332  if (idx.size() != instance.size()+1)
333  return;
334  switch (idx[0])
335  {
336  case 0:
337  coerceValue(value, myGroup);
338  break;
339  case 1:
340  coerceValue(value, myFromtype);
341  break;
342  case 2:
343  coerceValue(value, myTotype);
344  break;
345  case 3:
346  coerceValue(value, mySurftype);
347  break;
348  case 4:
349  coerceValue(value, myStdswitcher);
350  break;
351  case 5:
352  coerceValue(value, myOrderu);
353  break;
354  case 6:
355  coerceValue(value, myOrderv);
356  break;
357  case 7:
358  coerceValue(value, myPastecoord);
359  break;
360  case 8:
361  coerceValue(value, myPasteattrib);
362  break;
363  case 9:
364  coerceValue(value, myNew);
365  break;
366  case 10:
367  coerceValue(value, myInterphull);
368  break;
369  case 11:
370  coerceValue(value, myOffset);
371  break;
372  case 12:
373  coerceValue(value, myLodu);
374  break;
375  case 13:
376  coerceValue(value, myLodv);
377  break;
378  case 14:
379  coerceValue(value, myLodtrim);
380  break;
381  case 15:
382  coerceValue(value, myDivu);
383  break;
384  case 16:
385  coerceValue(value, myDivv);
386  break;
387  case 17:
388  coerceValue(value, myDivtrim);
389  break;
390 
391  }
392  }
393 
394  bool isParmColorRamp(exint idx) const override
395  {
396  switch (idx)
397  {
398 
399  }
400  return false;
401  }
402 
403  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
404  { doGetParmValue(idx, instance, value); }
405  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
406  { doGetParmValue(idx, instance, value); }
407  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
408  { doGetParmValue(idx, instance, value); }
409  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
410  { doGetParmValue(idx, instance, value); }
411  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
412  { doGetParmValue(idx, instance, value); }
413  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
414  { doGetParmValue(idx, instance, value); }
415  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
416  { doGetParmValue(idx, instance, value); }
417  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
418  { doGetParmValue(idx, instance, value); }
419  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
420  { doGetParmValue(idx, instance, value); }
421  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
422  { doGetParmValue(idx, instance, value); }
423  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
424  { doGetParmValue(idx, instance, value); }
425 
426  template <typename T>
427  void
428  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
429  {
430  if (idx.size() < 1)
431  return;
432  UT_ASSERT(idx.size() == instance.size()+1);
433  if (idx.size() != instance.size()+1)
434  return;
435  switch (idx[0])
436  {
437  case 0:
438  coerceValue(myGroup, ( ( value ) ));
439  break;
440  case 1:
441  coerceValue(myFromtype, clampMinValue(0, clampMaxValue(18, value ) ));
442  break;
443  case 2:
444  coerceValue(myTotype, clampMinValue(0, clampMaxValue(13, value ) ));
445  break;
446  case 3:
447  coerceValue(mySurftype, clampMinValue(0, clampMaxValue(6, value ) ));
448  break;
449  case 4:
450  coerceValue(myStdswitcher, ( ( value ) ));
451  break;
452  case 5:
453  coerceValue(myOrderu, clampMinValue(2, clampMaxValue(11, value ) ));
454  break;
455  case 6:
456  coerceValue(myOrderv, clampMinValue(2, clampMaxValue(11, value ) ));
457  break;
458  case 7:
459  coerceValue(myPastecoord, clampMinValue(0, clampMaxValue(1, value ) ));
460  break;
461  case 8:
462  coerceValue(myPasteattrib, clampMinValue(0, clampMaxValue(1, value ) ));
463  break;
464  case 9:
465  coerceValue(myNew, ( ( value ) ));
466  break;
467  case 10:
468  coerceValue(myInterphull, ( ( value ) ));
469  break;
470  case 11:
471  coerceValue(myOffset, ( ( value ) ));
472  break;
473  case 12:
474  coerceValue(myLodu, clampMinValue(0.001, ( value ) ));
475  break;
476  case 13:
477  coerceValue(myLodv, clampMinValue(0.001, ( value ) ));
478  break;
479  case 14:
480  coerceValue(myLodtrim, clampMinValue(0.001, ( value ) ));
481  break;
482  case 15:
483  coerceValue(myDivu, clampMinValue(0, ( value ) ));
484  break;
485  case 16:
486  coerceValue(myDivv, clampMinValue(0, ( value ) ));
487  break;
488  case 17:
489  coerceValue(myDivtrim, clampMinValue(1, ( value ) ));
490  break;
491 
492  }
493  }
494 
495  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
496  { doSetParmValue(idx, instance, value); }
497  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
498  { doSetParmValue(idx, instance, value); }
499  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
500  { doSetParmValue(idx, instance, value); }
501  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
502  { doSetParmValue(idx, instance, value); }
503  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
504  { doSetParmValue(idx, instance, value); }
505  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
506  { doSetParmValue(idx, instance, value); }
507  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
508  { doSetParmValue(idx, instance, value); }
509  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
510  { doSetParmValue(idx, instance, value); }
511  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
512  { doSetParmValue(idx, instance, value); }
513  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
514  { doSetParmValue(idx, instance, value); }
515  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
516  { doSetParmValue(idx, instance, value); }
517 
518  exint getNestNumParms(TempIndex idx) const override
519  {
520  if (idx.size() == 0)
521  return 18;
522  switch (idx[0])
523  {
524 
525  }
526  // Invalid
527  return 0;
528  }
529 
530  const char *getNestParmName(TempIndex fieldnum) const override
531  {
532  if (fieldnum.size() < 1)
533  return 0;
534  switch (fieldnum[0])
535  {
536  case 0:
537  return "group";
538  case 1:
539  return "fromtype";
540  case 2:
541  return "totype";
542  case 3:
543  return "surftype";
544  case 4:
545  return "stdswitcher";
546  case 5:
547  return "orderu";
548  case 6:
549  return "orderv";
550  case 7:
551  return "pastecoord";
552  case 8:
553  return "pasteattrib";
554  case 9:
555  return "new";
556  case 10:
557  return "interphull";
558  case 11:
559  return "offset";
560  case 12:
561  return "lodu";
562  case 13:
563  return "lodv";
564  case 14:
565  return "lodtrim";
566  case 15:
567  return "divu";
568  case 16:
569  return "divv";
570  case 17:
571  return "divtrim";
572 
573  }
574  return 0;
575  }
576 
577  ParmType getNestParmType(TempIndex fieldnum) const override
578  {
579  if (fieldnum.size() < 1)
580  return PARM_UNSUPPORTED;
581  switch (fieldnum[0])
582  {
583  case 0:
584  return PARM_STRING;
585  case 1:
586  return PARM_INTEGER;
587  case 2:
588  return PARM_INTEGER;
589  case 3:
590  return PARM_INTEGER;
591  case 4:
592  return PARM_INTEGER;
593  case 5:
594  return PARM_INTEGER;
595  case 6:
596  return PARM_INTEGER;
597  case 7:
598  return PARM_INTEGER;
599  case 8:
600  return PARM_INTEGER;
601  case 9:
602  return PARM_INTEGER;
603  case 10:
604  return PARM_INTEGER;
605  case 11:
606  return PARM_FLOAT;
607  case 12:
608  return PARM_FLOAT;
609  case 13:
610  return PARM_FLOAT;
611  case 14:
612  return PARM_FLOAT;
613  case 15:
614  return PARM_INTEGER;
615  case 16:
616  return PARM_INTEGER;
617  case 17:
618  return PARM_INTEGER;
619 
620  }
621  return PARM_UNSUPPORTED;
622  }
623 
624  // Boiler plate to load individual types.
625  static void loadData(UT_IStream &is, int64 &v)
626  { is.bread(&v, 1); }
627  static void loadData(UT_IStream &is, bool &v)
628  { int64 iv; is.bread(&iv, 1); v = iv; }
629  static void loadData(UT_IStream &is, fpreal64 &v)
630  { is.bread<fpreal64>(&v, 1); }
631  static void loadData(UT_IStream &is, UT_Vector2D &v)
632  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
633  static void loadData(UT_IStream &is, UT_Vector3D &v)
634  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
635  is.bread<fpreal64>(&v.z(), 1); }
636  static void loadData(UT_IStream &is, UT_Vector4D &v)
637  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
638  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
639  static void loadData(UT_IStream &is, UT_Matrix2D &v)
640  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
641  static void loadData(UT_IStream &is, UT_Matrix3D &v)
642  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
643  static void loadData(UT_IStream &is, UT_Matrix4D &v)
644  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
645  static void loadData(UT_IStream &is, UT_Vector2I &v)
646  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
647  static void loadData(UT_IStream &is, UT_Vector3I &v)
648  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
649  is.bread<int64>(&v.z(), 1); }
650  static void loadData(UT_IStream &is, UT_Vector4I &v)
651  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
652  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
654  { is.bread(v); }
656  { UT_StringHolder rampdata;
657  loadData(is, rampdata);
658  if (rampdata.isstring())
659  {
660  v.reset(new UT_Ramp());
661  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
662  v->load(istr);
663  }
664  else v.reset();
665  }
668  loadData(is, data);
669  if (data.isstring())
670  {
671  // Find the data type.
672  const char *colon = UT_StringWrap(data).findChar(':');
673  if (colon)
674  {
675  int typelen = colon - data.buffer();
677  type.strncpy(data.buffer(), typelen);
678  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
679 
680  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
681  }
682  }
683  else v.reset();
684  }
685 
686  static void saveData(std::ostream &os, int64 v)
687  { UTwrite(os, &v); }
688  static void saveData(std::ostream &os, bool v)
689  { int64 iv = v; UTwrite(os, &iv); }
690  static void saveData(std::ostream &os, fpreal64 v)
691  { UTwrite<fpreal64>(os, &v); }
692  static void saveData(std::ostream &os, UT_Vector2D v)
693  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
694  static void saveData(std::ostream &os, UT_Vector3D v)
695  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
696  UTwrite<fpreal64>(os, &v.z()); }
697  static void saveData(std::ostream &os, UT_Vector4D v)
698  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
699  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
700  static void saveData(std::ostream &os, UT_Matrix2D v)
702  static void saveData(std::ostream &os, UT_Matrix3D v)
704  static void saveData(std::ostream &os, UT_Matrix4D v)
706  static void saveData(std::ostream &os, UT_StringHolder s)
707  { UT_StringWrap(s).saveBinary(os); }
708  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
710  UT_OStringStream ostr;
711  if (s) s->save(ostr);
712  result = ostr.str();
713  saveData(os, result);
714  }
715  static void saveData(std::ostream &os, PRM_DataItemHandle s)
717  UT_OStringStream ostr;
718  if (s)
719  {
720  ostr << s->getDataTypeToken();
721  ostr << ":";
722  s->saveBinary(ostr);
723  }
724  result = ostr.str();
725  saveData(os, result);
726  }
727 
728 
729  void save(std::ostream &os) const
730  {
731  int32 v = version();
732  UTwrite(os, &v);
733  saveData(os, myGroup);
734  saveData(os, myFromtype);
735  saveData(os, myTotype);
736  saveData(os, mySurftype);
737  saveData(os, myStdswitcher);
738  saveData(os, myOrderu);
739  saveData(os, myOrderv);
740  saveData(os, myPastecoord);
741  saveData(os, myPasteattrib);
742  saveData(os, myNew);
743  saveData(os, myInterphull);
744  saveData(os, myOffset);
745  saveData(os, myLodu);
746  saveData(os, myLodv);
747  saveData(os, myLodtrim);
748  saveData(os, myDivu);
749  saveData(os, myDivv);
750  saveData(os, myDivtrim);
751 
752  }
753 
754  bool load(UT_IStream &is)
755  {
756  int32 v;
757  is.bread(&v, 1);
758  if (version() != v)
759  {
760  // Fail incompatible versions
761  return false;
762  }
763  loadData(is, myGroup);
764  loadData(is, myFromtype);
765  loadData(is, myTotype);
766  loadData(is, mySurftype);
767  loadData(is, myStdswitcher);
768  loadData(is, myOrderu);
769  loadData(is, myOrderv);
770  loadData(is, myPastecoord);
771  loadData(is, myPasteattrib);
772  loadData(is, myNew);
773  loadData(is, myInterphull);
774  loadData(is, myOffset);
775  loadData(is, myLodu);
776  loadData(is, myLodv);
777  loadData(is, myLodtrim);
778  loadData(is, myDivu);
779  loadData(is, myDivv);
780  loadData(is, myDivtrim);
781 
782  return true;
783  }
784 
785  const UT_StringHolder & getGroup() const { return myGroup; }
786  void setGroup(const UT_StringHolder & val) { myGroup = val; }
788  {
789  SOP_Node *thissop = cookparms.getNode();
790  if (!thissop) return getGroup();
792  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
793  return result;
794  }
795  Fromtype getFromtype() const { return Fromtype(myFromtype); }
796  void setFromtype(Fromtype val) { myFromtype = int64(val); }
798  {
799  SOP_Node *thissop = cookparms.getNode();
800  if (!thissop) return getFromtype();
801  int64 result;
802  OP_Utils::evalOpParm(result, thissop, "fromtype", cookparms.getCookTime(), 0);
803  return Fromtype(result);
804  }
805  Totype getTotype() const { return Totype(myTotype); }
806  void setTotype(Totype val) { myTotype = int64(val); }
807  Totype opTotype(const SOP_NodeVerb::CookParms &cookparms) const
808  {
809  SOP_Node *thissop = cookparms.getNode();
810  if (!thissop) return getTotype();
811  int64 result;
812  OP_Utils::evalOpParm(result, thissop, "totype", cookparms.getCookTime(), 0);
813  return Totype(result);
814  }
815  Surftype getSurftype() const { return Surftype(mySurftype); }
816  void setSurftype(Surftype val) { mySurftype = int64(val); }
818  {
819  SOP_Node *thissop = cookparms.getNode();
820  if (!thissop) return getSurftype();
821  int64 result;
822  OP_Utils::evalOpParm(result, thissop, "surftype", cookparms.getCookTime(), 0);
823  return Surftype(result);
824  }
825  int64 getStdswitcher() const { return myStdswitcher; }
826  void setStdswitcher(int64 val) { myStdswitcher = val; }
828  {
829  SOP_Node *thissop = cookparms.getNode();
830  if (!thissop) return getStdswitcher();
831  int64 result;
832  OP_Utils::evalOpParm(result, thissop, "stdswitcher", cookparms.getCookTime(), 0);
833  return result;
834  }
835  int64 getOrderu() const { return myOrderu; }
836  void setOrderu(int64 val) { myOrderu = val; }
837  int64 opOrderu(const SOP_NodeVerb::CookParms &cookparms) const
838  {
839  SOP_Node *thissop = cookparms.getNode();
840  if (!thissop) return getOrderu();
841  int64 result;
842  OP_Utils::evalOpParm(result, thissop, "orderu", cookparms.getCookTime(), 0);
843  return result;
844  }
845  int64 getOrderv() const { return myOrderv; }
846  void setOrderv(int64 val) { myOrderv = val; }
847  int64 opOrderv(const SOP_NodeVerb::CookParms &cookparms) const
848  {
849  SOP_Node *thissop = cookparms.getNode();
850  if (!thissop) return getOrderv();
851  int64 result;
852  OP_Utils::evalOpParm(result, thissop, "orderv", cookparms.getCookTime(), 0);
853  return result;
854  }
855  Pastecoord getPastecoord() const { return Pastecoord(myPastecoord); }
856  void setPastecoord(Pastecoord val) { myPastecoord = int64(val); }
858  {
859  SOP_Node *thissop = cookparms.getNode();
860  if (!thissop) return getPastecoord();
861  int64 result;
862  OP_Utils::evalOpParm(result, thissop, "pastecoord", cookparms.getCookTime(), 0);
863  return Pastecoord(result);
864  }
865  Pasteattrib getPasteattrib() const { return Pasteattrib(myPasteattrib); }
866  void setPasteattrib(Pasteattrib val) { myPasteattrib = int64(val); }
868  {
869  SOP_Node *thissop = cookparms.getNode();
870  if (!thissop) return getPasteattrib();
871  int64 result;
872  OP_Utils::evalOpParm(result, thissop, "pasteattrib", cookparms.getCookTime(), 0);
873  return Pasteattrib(result);
874  }
875  bool getNew() const { return myNew; }
876  void setNew(bool val) { myNew = val; }
877  bool opNew(const SOP_NodeVerb::CookParms &cookparms) const
878  {
879  SOP_Node *thissop = cookparms.getNode();
880  if (!thissop) return getNew();
881  bool result;
882  OP_Utils::evalOpParm(result, thissop, "new", cookparms.getCookTime(), 0);
883  return result;
884  }
885  bool getInterphull() const { return myInterphull; }
886  void setInterphull(bool val) { myInterphull = val; }
887  bool opInterphull(const SOP_NodeVerb::CookParms &cookparms) const
888  {
889  SOP_Node *thissop = cookparms.getNode();
890  if (!thissop) return getInterphull();
891  bool result;
892  OP_Utils::evalOpParm(result, thissop, "interphull", cookparms.getCookTime(), 0);
893  return result;
894  }
895  fpreal64 getOffset() const { return myOffset; }
896  void setOffset(fpreal64 val) { myOffset = val; }
897  fpreal64 opOffset(const SOP_NodeVerb::CookParms &cookparms) const
898  {
899  SOP_Node *thissop = cookparms.getNode();
900  if (!thissop) return getOffset();
902  OP_Utils::evalOpParm(result, thissop, "offset", cookparms.getCookTime(), 0);
903  return result;
904  }
905  fpreal64 getLodu() const { return myLodu; }
906  void setLodu(fpreal64 val) { myLodu = val; }
907  fpreal64 opLodu(const SOP_NodeVerb::CookParms &cookparms) const
908  {
909  SOP_Node *thissop = cookparms.getNode();
910  if (!thissop) return getLodu();
912  OP_Utils::evalOpParm(result, thissop, "lodu", cookparms.getCookTime(), 0);
913  return result;
914  }
915  fpreal64 getLodv() const { return myLodv; }
916  void setLodv(fpreal64 val) { myLodv = val; }
917  fpreal64 opLodv(const SOP_NodeVerb::CookParms &cookparms) const
918  {
919  SOP_Node *thissop = cookparms.getNode();
920  if (!thissop) return getLodv();
922  OP_Utils::evalOpParm(result, thissop, "lodv", cookparms.getCookTime(), 0);
923  return result;
924  }
925  fpreal64 getLodtrim() const { return myLodtrim; }
926  void setLodtrim(fpreal64 val) { myLodtrim = val; }
928  {
929  SOP_Node *thissop = cookparms.getNode();
930  if (!thissop) return getLodtrim();
932  OP_Utils::evalOpParm(result, thissop, "lodtrim", cookparms.getCookTime(), 0);
933  return result;
934  }
935  int64 getDivu() const { return myDivu; }
936  void setDivu(int64 val) { myDivu = val; }
937  int64 opDivu(const SOP_NodeVerb::CookParms &cookparms) const
938  {
939  SOP_Node *thissop = cookparms.getNode();
940  if (!thissop) return getDivu();
941  int64 result;
942  OP_Utils::evalOpParm(result, thissop, "divu", cookparms.getCookTime(), 0);
943  return result;
944  }
945  int64 getDivv() const { return myDivv; }
946  void setDivv(int64 val) { myDivv = val; }
947  int64 opDivv(const SOP_NodeVerb::CookParms &cookparms) const
948  {
949  SOP_Node *thissop = cookparms.getNode();
950  if (!thissop) return getDivv();
951  int64 result;
952  OP_Utils::evalOpParm(result, thissop, "divv", cookparms.getCookTime(), 0);
953  return result;
954  }
955  int64 getDivtrim() const { return myDivtrim; }
956  void setDivtrim(int64 val) { myDivtrim = val; }
957  int64 opDivtrim(const SOP_NodeVerb::CookParms &cookparms) const
958  {
959  SOP_Node *thissop = cookparms.getNode();
960  if (!thissop) return getDivtrim();
961  int64 result;
962  OP_Utils::evalOpParm(result, thissop, "divtrim", cookparms.getCookTime(), 0);
963  return result;
964  }
965 
966 private:
967  UT_StringHolder myGroup;
968  int64 myFromtype;
969  int64 myTotype;
970  int64 mySurftype;
971  int64 myStdswitcher;
972  int64 myOrderu;
973  int64 myOrderv;
974  int64 myPastecoord;
975  int64 myPasteattrib;
976  bool myNew;
977  bool myInterphull;
978  fpreal64 myOffset;
979  fpreal64 myLodu;
980  fpreal64 myLodv;
981  fpreal64 myLodtrim;
982  int64 myDivu;
983  int64 myDivv;
984  int64 myDivtrim;
985 
986 };
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
type
Definition: core.h:556
fpreal64 opLodu(const SOP_NodeVerb::CookParms &cookparms) const
Totype getTotype() const
int64 opOrderu(const SOP_NodeVerb::CookParms &cookparms) const
int64 opOrderv(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
bool operator==(const SOP_ConvertParms &src) const
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
Fromtype opFromtype(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getTime() const
Definition: OP_Context.h:63
GLsizei const GLfloat * value
Definition: glcorearb.h:824
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
Totype opTotype(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
void setSurftype(Surftype val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
SYS_FORCE_INLINE const char * buffer() const
bool isParmColorRamp(exint idx) const override
GLdouble s
Definition: glad.h:3009
Pasteattrib getPasteattrib() const
void save(std::ostream &os) const
static void saveData(std::ostream &os, UT_Vector2D v)
int64 getDivu() const
void setDivv(int64 val)
An output stream object that owns its own string buffer storage.
int64 getStdswitcher() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
**But if you need a result
Definition: thread.h:622
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setLodv(fpreal64 val)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool getNew() const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
Pastecoord getPastecoord() const
double fpreal64
Definition: SYS_Types.h:201
static void saveData(std::ostream &os, UT_Matrix2D v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
Surftype opSurftype(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
exint length() const
void setLodu(fpreal64 val)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int64 getOrderv() const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
fpreal64 getLodtrim() const
void setGroup(const UT_StringHolder &val)
fpreal64 getLodv() const
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setPastecoord(Pastecoord val)
static void saveData(std::ostream &os, bool v)
long long int64
Definition: SYS_Types.h:116
Fromtype getFromtype() const
SYS_FORCE_INLINE UT_StringHolder getToken(Fromtype enum_value)
void setDivu(int64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setTotype(Totype val)
void setOffset(fpreal64 val)
int64 getDivv() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static int version()
void setPasteattrib(Pasteattrib val)
void setInterphull(bool val)
Pastecoord opPastecoord(const SOP_NodeVerb::CookParms &cookparms) const
void setStdswitcher(int64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
const UT_StringHolder & getGroup() const
static void saveData(std::ostream &os, UT_Matrix3D v)
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
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, PRM_DataItemHandle s)
exint getNestNumParms(TempIndex idx) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
fpreal64 opOffset(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
int64 opDivtrim(const SOP_NodeVerb::CookParms &cookparms) const
void setDivtrim(int64 val)
int64 getDivtrim() const
static void saveData(std::ostream &os, UT_Vector4D v)
void loadFromOpSubclass(const LoadParms &loadparms) override
bool getInterphull() const
void setOrderu(int64 val)
int64 opDivv(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opLodtrim(const SOP_NodeVerb::CookParms &cookparms) const
void setOrderv(int64 val)
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
bool opNew(const SOP_NodeVerb::CookParms &cookparms) const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
fpreal64 getLodu() const
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Vector2D &v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getOffset() const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
bool opInterphull(const SOP_NodeVerb::CookParms &cookparms) const
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
static void loadData(UT_IStream &is, UT_Vector2I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void copyFrom(const OP_NodeParms *src) override
#define SOP_API
Definition: SOP_API.h:10
bool operator!=(const SOP_ConvertParms &src) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
int64 opStdswitcher(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
int64 getOrderu() const
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
int64 opDivu(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
GLboolean r
Definition: glcorearb.h:1222
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static void loadData(UT_IStream &is, UT_Matrix2D &v)
fpreal64 opLodv(const SOP_NodeVerb::CookParms &cookparms) const
bool load(UT_IStream &is)
void setFromtype(Fromtype val)
void setLodtrim(fpreal64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
Surftype getSurftype() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNew(bool val)
Pasteattrib opPasteattrib(const SOP_NodeVerb::CookParms &cookparms) 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 getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663