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