HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_CopyTransform.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_CopyTransformEnums
24 {
25  enum class SourceGroupType
26  {
27  GUESS = 0,
28  PRIMS,
29  POINTS
30  };
31 
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case SourceGroupType::GUESS: return "guess"_sh;
38  case SourceGroupType::PRIMS: return "prims"_sh;
39  case SourceGroupType::POINTS: return "points"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class Pivot
45  {
46  ORIGIN = 0,
47  CENTROID
48  };
49 
51  getToken(Pivot enum_value)
52  {
53  using namespace UT::Literal;
54  switch (enum_value) {
55  case Pivot::ORIGIN: return "origin"_sh;
56  case Pivot::CENTROID: return "centroid"_sh;
57  default: UT_ASSERT(false); return ""_sh;
58  }
59  }
60 
61  enum class ViewportLOD
62  {
63  FULL = 0,
64  POINTS,
65  BOX,
66  CENTROID,
67  HIDDEN
68  };
69 
71  getToken(ViewportLOD enum_value)
72  {
73  using namespace UT::Literal;
74  switch (enum_value) {
75  case ViewportLOD::FULL: return "full"_sh;
76  case ViewportLOD::POINTS: return "points"_sh;
77  case ViewportLOD::BOX: return "box"_sh;
78  case ViewportLOD::CENTROID: return "centroid"_sh;
79  case ViewportLOD::HIDDEN: return "hidden"_sh;
80  default: UT_ASSERT(false); return ""_sh;
81  }
82  }
83 
84  enum class Xord
85  {
86  SRT = 0,
87  STR,
88  RST,
89  RTS,
90  TSR,
91  TRS
92  };
93 
95  getToken(Xord enum_value)
96  {
97  using namespace UT::Literal;
98  switch (enum_value) {
99  case Xord::SRT: return "srt"_sh;
100  case Xord::STR: return "str"_sh;
101  case Xord::RST: return "rst"_sh;
102  case Xord::RTS: return "rts"_sh;
103  case Xord::TSR: return "tsr"_sh;
104  case Xord::TRS: return "trs"_sh;
105  default: UT_ASSERT(false); return ""_sh;
106  }
107  }
108 
109  enum class Rord
110  {
111  XYZ = 0,
112  XZY,
113  YXZ,
114  YZX,
115  ZXY,
116  ZYX
117  };
118 
120  getToken(Rord enum_value)
121  {
122  using namespace UT::Literal;
123  switch (enum_value) {
124  case Rord::XYZ: return "xyz"_sh;
125  case Rord::XZY: return "xzy"_sh;
126  case Rord::YXZ: return "yxz"_sh;
127  case Rord::YZX: return "yzx"_sh;
128  case Rord::ZXY: return "zxy"_sh;
129  case Rord::ZYX: return "zyx"_sh;
130  default: UT_ASSERT(false); return ""_sh;
131  }
132  }
133 
134 }
135 
136 
138 {
139 public:
140  static int version() { return 1; }
141 
143  {
144  mySourceGroup = ""_UTsh;
145  mySourceGroupType = 0;
146  myNcy = 2;
147  myPack = false;
148  myPivot = 1;
149  myViewportLOD = 0;
150  myXord = 0;
151  myRord = 0;
152  myT = UT_Vector3D(0,0,0);
153  myR = UT_Vector3D(0,0,0);
154  myS = UT_Vector3D(1,1,1);
155  myShear = UT_Vector3D(0,0,0);
156  myScale = 1;
157  myP = UT_Vector3D(0,0,0);
158  myPr = UT_Vector3D(0,0,0);
159  myNewgroups = false;
160  myNewgroupprefix = "copyGroup"_UTsh;
161  myDocopyattrib = false;
162  myCopyattrib = "copynum"_UTsh;
163 
164  }
165 
166  explicit SOP_CopyTransformParms(const SOP_CopyTransformParms &) = default;
168  SOP_CopyTransformParms(SOP_CopyTransformParms &&) noexcept = default;
169  SOP_CopyTransformParms &operator=(SOP_CopyTransformParms &&) noexcept = default;
170 
171  ~SOP_CopyTransformParms() override {}
172 
174  {
175  if (mySourceGroup != src.mySourceGroup) return false;
176  if (mySourceGroupType != src.mySourceGroupType) return false;
177  if (myNcy != src.myNcy) return false;
178  if (myPack != src.myPack) return false;
179  if (myPivot != src.myPivot) return false;
180  if (myViewportLOD != src.myViewportLOD) 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 (myShear != src.myShear) return false;
187  if (myScale != src.myScale) return false;
188  if (myP != src.myP) return false;
189  if (myPr != src.myPr) return false;
190  if (myNewgroups != src.myNewgroups) return false;
191  if (myNewgroupprefix != src.myNewgroupprefix) return false;
192  if (myDocopyattrib != src.myDocopyattrib) return false;
193  if (myCopyattrib != src.myCopyattrib) return false;
194 
195  return true;
196  }
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  mySourceGroup = ""_UTsh;
212  if (true)
213  graph->evalOpParm(mySourceGroup, nodeidx, "sourcegroup", time, 0);
214  mySourceGroupType = 0;
215  if (true)
216  graph->evalOpParm(mySourceGroupType, nodeidx, "sourcegrouptype", time, 0);
217  myNcy = 2;
218  if (true)
219  graph->evalOpParm(myNcy, nodeidx, "ncy", time, 0);
220  myPack = false;
221  if (true)
222  graph->evalOpParm(myPack, nodeidx, "pack", time, 0);
223  myPivot = 1;
224  if (true && ( (true&&!(((getPack()==0)))) ) )
225  graph->evalOpParm(myPivot, nodeidx, "pivot", time, 0);
226  myViewportLOD = 0;
227  if (true && ( (true&&!(((getPack()==0)))) ) )
228  graph->evalOpParm(myViewportLOD, nodeidx, "viewportlod", time, 0);
229  myXord = 0;
230  if (true)
231  graph->evalOpParm(myXord, nodeidx, "xOrd", time, 0);
232  myRord = 0;
233  if (true)
234  graph->evalOpParm(myRord, nodeidx, "rOrd", time, 0);
235  myT = UT_Vector3D(0,0,0);
236  if (true)
237  graph->evalOpParm(myT, nodeidx, "t", time, 0);
238  myR = UT_Vector3D(0,0,0);
239  if (true)
240  graph->evalOpParm(myR, nodeidx, "r", time, 0);
241  myS = UT_Vector3D(1,1,1);
242  if (true)
243  graph->evalOpParm(myS, nodeidx, "s", time, 0);
244  myShear = UT_Vector3D(0,0,0);
245  if (true)
246  graph->evalOpParm(myShear, nodeidx, "shear", time, 0);
247  myScale = 1;
248  if (true)
249  graph->evalOpParm(myScale, nodeidx, "scale", time, 0);
250  myP = UT_Vector3D(0,0,0);
251  if (true)
252  graph->evalOpParm(myP, nodeidx, "p", time, 0);
253  myPr = UT_Vector3D(0,0,0);
254  if (true)
255  graph->evalOpParm(myPr, nodeidx, "pr", time, 0);
256  myNewgroups = false;
257  if (true)
258  graph->evalOpParm(myNewgroups, nodeidx, "newgroups", time, 0);
259  myNewgroupprefix = "copyGroup"_UTsh;
260  if (true && ( (true&&!(((getNewgroups()==0)))) ) )
261  graph->evalOpParm(myNewgroupprefix, nodeidx, "newgroupprefix", time, 0);
262  myDocopyattrib = false;
263  if (true)
264  graph->evalOpParm(myDocopyattrib, nodeidx, "docopyattrib", time, 0);
265  myCopyattrib = "copynum"_UTsh;
266  if (true && ( (true&&!(((getDocopyattrib()==0)))) ) )
267  graph->evalOpParm(myCopyattrib, nodeidx, "copyattrib", time, 0);
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_CopyTransformParms *)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, mySourceGroup);
296  break;
297  case 1:
298  coerceValue(value, mySourceGroupType);
299  break;
300  case 2:
301  coerceValue(value, myNcy);
302  break;
303  case 3:
304  coerceValue(value, myPack);
305  break;
306  case 4:
307  coerceValue(value, myPivot);
308  break;
309  case 5:
310  coerceValue(value, myViewportLOD);
311  break;
312  case 6:
313  coerceValue(value, myXord);
314  break;
315  case 7:
316  coerceValue(value, myRord);
317  break;
318  case 8:
319  coerceValue(value, myT);
320  break;
321  case 9:
322  coerceValue(value, myR);
323  break;
324  case 10:
325  coerceValue(value, myS);
326  break;
327  case 11:
328  coerceValue(value, myShear);
329  break;
330  case 12:
331  coerceValue(value, myScale);
332  break;
333  case 13:
334  coerceValue(value, myP);
335  break;
336  case 14:
337  coerceValue(value, myPr);
338  break;
339  case 15:
340  coerceValue(value, myNewgroups);
341  break;
342  case 16:
343  coerceValue(value, myNewgroupprefix);
344  break;
345  case 17:
346  coerceValue(value, myDocopyattrib);
347  break;
348  case 18:
349  coerceValue(value, myCopyattrib);
350  break;
351 
352  }
353  }
354 
355  bool isParmColorRamp(exint idx) const override
356  {
357  switch (idx)
358  {
359 
360  }
361  return false;
362  }
363 
364  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
365  { doGetParmValue(idx, instance, value); }
366  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
367  { doGetParmValue(idx, instance, value); }
368  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
369  { doGetParmValue(idx, instance, value); }
370  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
371  { doGetParmValue(idx, instance, value); }
372  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
373  { doGetParmValue(idx, instance, value); }
374  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
375  { doGetParmValue(idx, instance, value); }
376  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
377  { doGetParmValue(idx, instance, value); }
378  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
379  { doGetParmValue(idx, instance, value); }
380  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
381  { doGetParmValue(idx, instance, value); }
382  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
383  { doGetParmValue(idx, instance, value); }
384  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
385  { doGetParmValue(idx, instance, value); }
386 
387  template <typename T>
388  void
389  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
390  {
391  if (idx.size() < 1)
392  return;
393  UT_ASSERT(idx.size() == instance.size()+1);
394  if (idx.size() != instance.size()+1)
395  return;
396  switch (idx[0])
397  {
398  case 0:
399  coerceValue(mySourceGroup, ( ( value ) ));
400  break;
401  case 1:
402  coerceValue(mySourceGroupType, clampMinValue(0, clampMaxValue(2, value ) ));
403  break;
404  case 2:
405  coerceValue(myNcy, clampMinValue(0, ( value ) ));
406  break;
407  case 3:
408  coerceValue(myPack, ( ( value ) ));
409  break;
410  case 4:
411  coerceValue(myPivot, clampMinValue(0, clampMaxValue(1, value ) ));
412  break;
413  case 5:
414  coerceValue(myViewportLOD, clampMinValue(0, clampMaxValue(4, value ) ));
415  break;
416  case 6:
417  coerceValue(myXord, clampMinValue(0, clampMaxValue(5, value ) ));
418  break;
419  case 7:
420  coerceValue(myRord, clampMinValue(0, clampMaxValue(5, value ) ));
421  break;
422  case 8:
423  coerceValue(myT, ( ( value ) ));
424  break;
425  case 9:
426  coerceValue(myR, ( ( value ) ));
427  break;
428  case 10:
429  coerceValue(myS, ( ( value ) ));
430  break;
431  case 11:
432  coerceValue(myShear, ( ( value ) ));
433  break;
434  case 12:
435  coerceValue(myScale, ( ( value ) ));
436  break;
437  case 13:
438  coerceValue(myP, ( ( value ) ));
439  break;
440  case 14:
441  coerceValue(myPr, ( ( value ) ));
442  break;
443  case 15:
444  coerceValue(myNewgroups, ( ( value ) ));
445  break;
446  case 16:
447  coerceValue(myNewgroupprefix, ( ( value ) ));
448  break;
449  case 17:
450  coerceValue(myDocopyattrib, ( ( value ) ));
451  break;
452  case 18:
453  coerceValue(myCopyattrib, ( ( value ) ));
454  break;
455 
456  }
457  }
458 
459  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
460  { doSetParmValue(idx, instance, value); }
461  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
462  { doSetParmValue(idx, instance, value); }
463  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
464  { doSetParmValue(idx, instance, value); }
465  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
466  { doSetParmValue(idx, instance, value); }
467  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
468  { doSetParmValue(idx, instance, value); }
469  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
470  { doSetParmValue(idx, instance, value); }
471  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
472  { doSetParmValue(idx, instance, value); }
473  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
474  { doSetParmValue(idx, instance, value); }
475  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
476  { doSetParmValue(idx, instance, value); }
477  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
478  { doSetParmValue(idx, instance, value); }
479  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
480  { doSetParmValue(idx, instance, value); }
481 
482  exint getNestNumParms(TempIndex idx) const override
483  {
484  if (idx.size() == 0)
485  return 19;
486  switch (idx[0])
487  {
488 
489  }
490  // Invalid
491  return 0;
492  }
493 
494  const char *getNestParmName(TempIndex fieldnum) const override
495  {
496  if (fieldnum.size() < 1)
497  return 0;
498  switch (fieldnum[0])
499  {
500  case 0:
501  return "sourcegroup";
502  case 1:
503  return "sourcegrouptype";
504  case 2:
505  return "ncy";
506  case 3:
507  return "pack";
508  case 4:
509  return "pivot";
510  case 5:
511  return "viewportlod";
512  case 6:
513  return "xOrd";
514  case 7:
515  return "rOrd";
516  case 8:
517  return "t";
518  case 9:
519  return "r";
520  case 10:
521  return "s";
522  case 11:
523  return "shear";
524  case 12:
525  return "scale";
526  case 13:
527  return "p";
528  case 14:
529  return "pr";
530  case 15:
531  return "newgroups";
532  case 16:
533  return "newgroupprefix";
534  case 17:
535  return "docopyattrib";
536  case 18:
537  return "copyattrib";
538 
539  }
540  return 0;
541  }
542 
543  ParmType getNestParmType(TempIndex fieldnum) const override
544  {
545  if (fieldnum.size() < 1)
546  return PARM_UNSUPPORTED;
547  switch (fieldnum[0])
548  {
549  case 0:
550  return PARM_STRING;
551  case 1:
552  return PARM_INTEGER;
553  case 2:
554  return PARM_INTEGER;
555  case 3:
556  return PARM_INTEGER;
557  case 4:
558  return PARM_INTEGER;
559  case 5:
560  return PARM_INTEGER;
561  case 6:
562  return PARM_INTEGER;
563  case 7:
564  return PARM_INTEGER;
565  case 8:
566  return PARM_VECTOR3;
567  case 9:
568  return PARM_VECTOR3;
569  case 10:
570  return PARM_VECTOR3;
571  case 11:
572  return PARM_VECTOR3;
573  case 12:
574  return PARM_FLOAT;
575  case 13:
576  return PARM_VECTOR3;
577  case 14:
578  return PARM_VECTOR3;
579  case 15:
580  return PARM_INTEGER;
581  case 16:
582  return PARM_STRING;
583  case 17:
584  return PARM_INTEGER;
585  case 18:
586  return PARM_STRING;
587 
588  }
589  return PARM_UNSUPPORTED;
590  }
591 
592  // Boiler plate to load individual types.
593  static void loadData(UT_IStream &is, int64 &v)
594  { is.bread(&v, 1); }
595  static void loadData(UT_IStream &is, bool &v)
596  { int64 iv; is.bread(&iv, 1); v = iv; }
597  static void loadData(UT_IStream &is, fpreal64 &v)
598  { is.bread<fpreal64>(&v, 1); }
599  static void loadData(UT_IStream &is, UT_Vector2D &v)
600  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
601  static void loadData(UT_IStream &is, UT_Vector3D &v)
602  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
603  is.bread<fpreal64>(&v.z(), 1); }
604  static void loadData(UT_IStream &is, UT_Vector4D &v)
605  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
606  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
607  static void loadData(UT_IStream &is, UT_Matrix2D &v)
608  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
609  static void loadData(UT_IStream &is, UT_Matrix3D &v)
610  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
611  static void loadData(UT_IStream &is, UT_Matrix4D &v)
612  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
613  static void loadData(UT_IStream &is, UT_Vector2I &v)
614  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
615  static void loadData(UT_IStream &is, UT_Vector3I &v)
616  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
617  is.bread<int64>(&v.z(), 1); }
618  static void loadData(UT_IStream &is, UT_Vector4I &v)
619  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
620  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
622  { is.bread(v); }
624  { UT_StringHolder rampdata;
625  loadData(is, rampdata);
626  if (rampdata.isstring())
627  {
628  v.reset(new UT_Ramp());
629  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
630  v->load(istr);
631  }
632  else v.reset();
633  }
636  loadData(is, data);
637  if (data.isstring())
638  {
639  // Find the data type.
640  const char *colon = UT_StringWrap(data).findChar(':');
641  if (colon)
642  {
643  int typelen = colon - data.buffer();
645  type.strncpy(data.buffer(), typelen);
646  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
647 
648  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
649  }
650  }
651  else v.reset();
652  }
653 
654  static void saveData(std::ostream &os, int64 v)
655  { UTwrite(os, &v); }
656  static void saveData(std::ostream &os, bool v)
657  { int64 iv = v; UTwrite(os, &iv); }
658  static void saveData(std::ostream &os, fpreal64 v)
659  { UTwrite<fpreal64>(os, &v); }
660  static void saveData(std::ostream &os, UT_Vector2D v)
661  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
662  static void saveData(std::ostream &os, UT_Vector3D v)
663  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
664  UTwrite<fpreal64>(os, &v.z()); }
665  static void saveData(std::ostream &os, UT_Vector4D v)
666  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
667  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
668  static void saveData(std::ostream &os, UT_Matrix2D v)
670  static void saveData(std::ostream &os, UT_Matrix3D v)
672  static void saveData(std::ostream &os, UT_Matrix4D v)
674  static void saveData(std::ostream &os, UT_StringHolder s)
675  { UT_StringWrap(s).saveBinary(os); }
676  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
678  UT_OStringStream ostr;
679  if (s) s->save(ostr);
680  result = ostr.str();
681  saveData(os, result);
682  }
683  static void saveData(std::ostream &os, PRM_DataItemHandle s)
685  UT_OStringStream ostr;
686  if (s)
687  {
688  ostr << s->getDataTypeToken();
689  ostr << ":";
690  s->saveBinary(ostr);
691  }
692  result = ostr.str();
693  saveData(os, result);
694  }
695 
696 
697  void save(std::ostream &os) const
698  {
699  int32 v = version();
700  UTwrite(os, &v);
701  saveData(os, mySourceGroup);
702  saveData(os, mySourceGroupType);
703  saveData(os, myNcy);
704  saveData(os, myPack);
705  saveData(os, myPivot);
706  saveData(os, myViewportLOD);
707  saveData(os, myXord);
708  saveData(os, myRord);
709  saveData(os, myT);
710  saveData(os, myR);
711  saveData(os, myS);
712  saveData(os, myShear);
713  saveData(os, myScale);
714  saveData(os, myP);
715  saveData(os, myPr);
716  saveData(os, myNewgroups);
717  saveData(os, myNewgroupprefix);
718  saveData(os, myDocopyattrib);
719  saveData(os, myCopyattrib);
720 
721  }
722 
723  bool load(UT_IStream &is)
724  {
725  int32 v;
726  is.bread(&v, 1);
727  if (version() != v)
728  {
729  // Fail incompatible versions
730  return false;
731  }
732  loadData(is, mySourceGroup);
733  loadData(is, mySourceGroupType);
734  loadData(is, myNcy);
735  loadData(is, myPack);
736  loadData(is, myPivot);
737  loadData(is, myViewportLOD);
738  loadData(is, myXord);
739  loadData(is, myRord);
740  loadData(is, myT);
741  loadData(is, myR);
742  loadData(is, myS);
743  loadData(is, myShear);
744  loadData(is, myScale);
745  loadData(is, myP);
746  loadData(is, myPr);
747  loadData(is, myNewgroups);
748  loadData(is, myNewgroupprefix);
749  loadData(is, myDocopyattrib);
750  loadData(is, myCopyattrib);
751 
752  return true;
753  }
754 
755  const UT_StringHolder & getSourceGroup() const { return mySourceGroup; }
756  void setSourceGroup(const UT_StringHolder & val) { mySourceGroup = val; }
758  {
759  SOP_Node *thissop = cookparms.getNode();
760  if (!thissop) return getSourceGroup();
762  OP_Utils::evalOpParm(result, thissop, "sourcegroup", cookparms.getCookTime(), 0);
763  return result;
764  }
765  SourceGroupType getSourceGroupType() const { return SourceGroupType(mySourceGroupType); }
766  void setSourceGroupType(SourceGroupType val) { mySourceGroupType = int64(val); }
768  {
769  SOP_Node *thissop = cookparms.getNode();
770  if (!thissop) return getSourceGroupType();
771  int64 result;
772  OP_Utils::evalOpParm(result, thissop, "sourcegrouptype", cookparms.getCookTime(), 0);
773  return SourceGroupType(result);
774  }
775  int64 getNcy() const { return myNcy; }
776  void setNcy(int64 val) { myNcy = val; }
777  int64 opNcy(const SOP_NodeVerb::CookParms &cookparms) const
778  {
779  SOP_Node *thissop = cookparms.getNode();
780  if (!thissop) return getNcy();
781  int64 result;
782  OP_Utils::evalOpParm(result, thissop, "ncy", cookparms.getCookTime(), 0);
783  return result;
784  }
785  bool getPack() const { return myPack; }
786  void setPack(bool val) { myPack = val; }
787  bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
788  {
789  SOP_Node *thissop = cookparms.getNode();
790  if (!thissop) return getPack();
791  bool result;
792  OP_Utils::evalOpParm(result, thissop, "pack", cookparms.getCookTime(), 0);
793  return result;
794  }
795  Pivot getPivot() const { return Pivot(myPivot); }
796  void setPivot(Pivot val) { myPivot = int64(val); }
797  Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
798  {
799  SOP_Node *thissop = cookparms.getNode();
800  if (!thissop) return getPivot();
801  int64 result;
802  OP_Utils::evalOpParm(result, thissop, "pivot", cookparms.getCookTime(), 0);
803  return Pivot(result);
804  }
805  ViewportLOD getViewportLOD() const { return ViewportLOD(myViewportLOD); }
806  void setViewportLOD(ViewportLOD val) { myViewportLOD = int64(val); }
808  {
809  SOP_Node *thissop = cookparms.getNode();
810  if (!thissop) return getViewportLOD();
811  int64 result;
812  OP_Utils::evalOpParm(result, thissop, "viewportlod", cookparms.getCookTime(), 0);
813  return ViewportLOD(result);
814  }
815  Xord getXord() const { return Xord(myXord); }
816  void setXord(Xord val) { myXord = int64(val); }
817  Xord opXord(const SOP_NodeVerb::CookParms &cookparms) const
818  {
819  SOP_Node *thissop = cookparms.getNode();
820  if (!thissop) return getXord();
821  int64 result;
822  OP_Utils::evalOpParm(result, thissop, "xOrd", cookparms.getCookTime(), 0);
823  return Xord(result);
824  }
825  Rord getRord() const { return Rord(myRord); }
826  void setRord(Rord val) { myRord = int64(val); }
827  Rord opRord(const SOP_NodeVerb::CookParms &cookparms) const
828  {
829  SOP_Node *thissop = cookparms.getNode();
830  if (!thissop) return getRord();
831  int64 result;
832  OP_Utils::evalOpParm(result, thissop, "rOrd", cookparms.getCookTime(), 0);
833  return Rord(result);
834  }
835  UT_Vector3D getT() const { return myT; }
836  void setT(UT_Vector3D val) { myT = val; }
837  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
838  {
839  SOP_Node *thissop = cookparms.getNode();
840  if (!thissop) return getT();
842  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
843  return result;
844  }
845  UT_Vector3D getR() const { return myR; }
846  void setR(UT_Vector3D val) { myR = val; }
847  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
848  {
849  SOP_Node *thissop = cookparms.getNode();
850  if (!thissop) return getR();
852  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
853  return result;
854  }
855  UT_Vector3D getS() const { return myS; }
856  void setS(UT_Vector3D val) { myS = val; }
857  UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
858  {
859  SOP_Node *thissop = cookparms.getNode();
860  if (!thissop) return getS();
862  OP_Utils::evalOpParm(result, thissop, "s", cookparms.getCookTime(), 0);
863  return result;
864  }
865  UT_Vector3D getShear() const { return myShear; }
866  void setShear(UT_Vector3D val) { myShear = val; }
868  {
869  SOP_Node *thissop = cookparms.getNode();
870  if (!thissop) return getShear();
872  OP_Utils::evalOpParm(result, thissop, "shear", cookparms.getCookTime(), 0);
873  return result;
874  }
875  fpreal64 getScale() const { return myScale; }
876  void setScale(fpreal64 val) { myScale = val; }
877  fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
878  {
879  SOP_Node *thissop = cookparms.getNode();
880  if (!thissop) return getScale();
882  OP_Utils::evalOpParm(result, thissop, "scale", cookparms.getCookTime(), 0);
883  return result;
884  }
885  UT_Vector3D getP() const { return myP; }
886  void setP(UT_Vector3D val) { myP = val; }
887  UT_Vector3D opP(const SOP_NodeVerb::CookParms &cookparms) const
888  {
889  SOP_Node *thissop = cookparms.getNode();
890  if (!thissop) return getP();
892  OP_Utils::evalOpParm(result, thissop, "p", cookparms.getCookTime(), 0);
893  return result;
894  }
895  UT_Vector3D getPr() const { return myPr; }
896  void setPr(UT_Vector3D val) { myPr = val; }
897  UT_Vector3D opPr(const SOP_NodeVerb::CookParms &cookparms) const
898  {
899  SOP_Node *thissop = cookparms.getNode();
900  if (!thissop) return getPr();
902  OP_Utils::evalOpParm(result, thissop, "pr", cookparms.getCookTime(), 0);
903  return result;
904  }
905  bool getNewgroups() const { return myNewgroups; }
906  void setNewgroups(bool val) { myNewgroups = val; }
907  bool opNewgroups(const SOP_NodeVerb::CookParms &cookparms) const
908  {
909  SOP_Node *thissop = cookparms.getNode();
910  if (!thissop) return getNewgroups();
911  bool result;
912  OP_Utils::evalOpParm(result, thissop, "newgroups", cookparms.getCookTime(), 0);
913  return result;
914  }
915  const UT_StringHolder & getNewgroupprefix() const { return myNewgroupprefix; }
916  void setNewgroupprefix(const UT_StringHolder & val) { myNewgroupprefix = val; }
918  {
919  SOP_Node *thissop = cookparms.getNode();
920  if (!thissop) return getNewgroupprefix();
922  OP_Utils::evalOpParm(result, thissop, "newgroupprefix", cookparms.getCookTime(), 0);
923  return result;
924  }
925  bool getDocopyattrib() const { return myDocopyattrib; }
926  void setDocopyattrib(bool val) { myDocopyattrib = val; }
927  bool opDocopyattrib(const SOP_NodeVerb::CookParms &cookparms) const
928  {
929  SOP_Node *thissop = cookparms.getNode();
930  if (!thissop) return getDocopyattrib();
931  bool result;
932  OP_Utils::evalOpParm(result, thissop, "docopyattrib", cookparms.getCookTime(), 0);
933  return result;
934  }
935  const UT_StringHolder & getCopyattrib() const { return myCopyattrib; }
936  void setCopyattrib(const UT_StringHolder & val) { myCopyattrib = val; }
938  {
939  SOP_Node *thissop = cookparms.getNode();
940  if (!thissop) return getCopyattrib();
942  OP_Utils::evalOpParm(result, thissop, "copyattrib", cookparms.getCookTime(), 0);
943  return result;
944  }
945 
946 private:
947  UT_StringHolder mySourceGroup;
948  int64 mySourceGroupType;
949  int64 myNcy;
950  bool myPack;
951  int64 myPivot;
952  int64 myViewportLOD;
953  int64 myXord;
954  int64 myRord;
955  UT_Vector3D myT;
956  UT_Vector3D myR;
957  UT_Vector3D myS;
958  UT_Vector3D myShear;
959  fpreal64 myScale;
960  UT_Vector3D myP;
961  UT_Vector3D myPr;
962  bool myNewgroups;
963  UT_StringHolder myNewgroupprefix;
964  bool myDocopyattrib;
965  UT_StringHolder myCopyattrib;
966 
967 };
void setPr(UT_Vector3D val)
int64 opNcy(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opSourceGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setViewportLOD(ViewportLOD val)
void loadFromOpSubclass(const LoadParms &loadparms) override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
int int32
Definition: SYS_Types.h:39
UT_Vector3D getShear() const
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void copyFrom(const OP_NodeParms *src) 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
static void loadData(UT_IStream &is, UT_Vector2I &v)
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
void setNewgroupprefix(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, UT_Matrix2D v)
void setP(UT_Vector3D val)
UT_Vector3D opPr(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
**But if you need a result
Definition: thread.h:613
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
bool opNewgroups(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D opShear(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
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.
Xord opXord(const SOP_NodeVerb::CookParms &cookparms) const
void setS(UT_Vector3D val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, int64 v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setSourceGroupType(SourceGroupType val)
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setCopyattrib(const UT_StringHolder &val)
bool operator==(const SOP_CopyTransformParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
UT_StringHolder opNewgroupprefix(const SOP_NodeVerb::CookParms &cookparms) const
SourceGroupType opSourceGroupType(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
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, bool v)
static void saveData(std::ostream &os, UT_Vector2D v)
const UT_StringHolder & getNewgroupprefix() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
bool opDocopyattrib(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
long long int64
Definition: SYS_Types.h:116
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_Vector3T< fpreal64 > UT_Vector3D
SYS_FORCE_INLINE UT_StringHolder getToken(SourceGroupType enum_value)
const UT_StringHolder & getCopyattrib() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool operator!=(const SOP_CopyTransformParms &src) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void save(std::ostream &os) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
UT_StringHolder opCopyattrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
GT_API const UT_StringHolder version
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setT(UT_Vector3D val)
ViewportLOD getViewportLOD() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const UT_StringHolder & getSourceGroup() const
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
void setSourceGroup(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
static void loadData(UT_IStream &is, UT_Vector3I &v)
const char * getNestParmName(TempIndex fieldnum) const override
GLuint GLfloat * val
Definition: glcorearb.h:1608
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows.
Definition: Mat.h:633
bool isParmColorRamp(exint idx) const override
#define SOP_API
Definition: SOP_API.h:10
UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
void setShear(UT_Vector3D val)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
GLboolean r
Definition: glcorearb.h:1222
ViewportLOD opViewportLOD(const SOP_NodeVerb::CookParms &cookparms) const
Rord opRord(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
SourceGroupType getSourceGroupType() const
type
Definition: core.h:1059
bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
UT_Vector3D opP(const SOP_NodeVerb::CookParms &cookparms) const
void setR(UT_Vector3D val)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, UT_Vector2D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
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 setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override