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  enum class Pivot
32  {
33  ORIGIN = 0,
34  CENTROID
35  };
36  enum class ViewportLOD
37  {
38  FULL = 0,
39  POINTS,
40  BOX,
41  CENTROID,
42  HIDDEN
43  };
44  enum class Xord
45  {
46  SRT = 0,
47  STR,
48  RST,
49  RTS,
50  TSR,
51  TRS
52  };
53  enum class Rord
54  {
55  XYZ = 0,
56  XZY,
57  YXZ,
58  YZX,
59  ZXY,
60  ZYX
61  };
62 }
63 
64 
66 {
67 public:
68  static int version() { return 1; }
69 
71  {
72  mySourceGroup = ""_UTsh;
73  mySourceGroupType = 0;
74  myNcy = 2;
75  myPack = false;
76  myPivot = 1;
77  myViewportLOD = 0;
78  myXord = 0;
79  myRord = 0;
80  myT = UT_Vector3D(0,0,0);
81  myR = UT_Vector3D(0,0,0);
82  myS = UT_Vector3D(1,1,1);
83  myShear = UT_Vector3D(0,0,0);
84  myScale = 1;
85  myP = UT_Vector3D(0,0,0);
86  myPr = UT_Vector3D(0,0,0);
87  myNewgroups = false;
88  myNewgroupprefix = "copyGroup"_UTsh;
89  myDocopyattrib = false;
90  myCopyattrib = "copynum"_UTsh;
91 
92  }
93 
94  explicit SOP_CopyTransformParms(const SOP_CopyTransformParms &) = default;
96  SOP_CopyTransformParms(SOP_CopyTransformParms &&) noexcept = default;
97  SOP_CopyTransformParms &operator=(SOP_CopyTransformParms &&) noexcept = default;
98 
99  ~SOP_CopyTransformParms() override {}
100 
102  {
103  if (mySourceGroup != src.mySourceGroup) return false;
104  if (mySourceGroupType != src.mySourceGroupType) return false;
105  if (myNcy != src.myNcy) return false;
106  if (myPack != src.myPack) return false;
107  if (myPivot != src.myPivot) return false;
108  if (myViewportLOD != src.myViewportLOD) return false;
109  if (myXord != src.myXord) return false;
110  if (myRord != src.myRord) return false;
111  if (myT != src.myT) return false;
112  if (myR != src.myR) return false;
113  if (myS != src.myS) return false;
114  if (myShear != src.myShear) return false;
115  if (myScale != src.myScale) return false;
116  if (myP != src.myP) return false;
117  if (myPr != src.myPr) return false;
118  if (myNewgroups != src.myNewgroups) return false;
119  if (myNewgroupprefix != src.myNewgroupprefix) return false;
120  if (myDocopyattrib != src.myDocopyattrib) return false;
121  if (myCopyattrib != src.myCopyattrib) return false;
122 
123  return true;
124  }
126  {
127  return !operator==(src);
128  }
134 
135 
136 
137  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
138  {
139  mySourceGroup = ""_UTsh;
140  if (true)
141  graph->evalOpParm(mySourceGroup, nodeidx, "sourcegroup", time, 0);
142  mySourceGroupType = 0;
143  if (true)
144  graph->evalOpParm(mySourceGroupType, nodeidx, "sourcegrouptype", time, 0);
145  myNcy = 2;
146  if (true)
147  graph->evalOpParm(myNcy, nodeidx, "ncy", time, 0);
148  myPack = false;
149  if (true)
150  graph->evalOpParm(myPack, nodeidx, "pack", time, 0);
151  myPivot = 1;
152  if (true && ( (true&&!(((getPack()==0)))) ) )
153  graph->evalOpParm(myPivot, nodeidx, "pivot", time, 0);
154  myViewportLOD = 0;
155  if (true && ( (true&&!(((getPack()==0)))) ) )
156  graph->evalOpParm(myViewportLOD, nodeidx, "viewportlod", time, 0);
157  myXord = 0;
158  if (true)
159  graph->evalOpParm(myXord, nodeidx, "xOrd", time, 0);
160  myRord = 0;
161  if (true)
162  graph->evalOpParm(myRord, nodeidx, "rOrd", time, 0);
163  myT = UT_Vector3D(0,0,0);
164  if (true)
165  graph->evalOpParm(myT, nodeidx, "t", time, 0);
166  myR = UT_Vector3D(0,0,0);
167  if (true)
168  graph->evalOpParm(myR, nodeidx, "r", time, 0);
169  myS = UT_Vector3D(1,1,1);
170  if (true)
171  graph->evalOpParm(myS, nodeidx, "s", time, 0);
172  myShear = UT_Vector3D(0,0,0);
173  if (true)
174  graph->evalOpParm(myShear, nodeidx, "shear", time, 0);
175  myScale = 1;
176  if (true)
177  graph->evalOpParm(myScale, nodeidx, "scale", time, 0);
178  myP = UT_Vector3D(0,0,0);
179  if (true)
180  graph->evalOpParm(myP, nodeidx, "p", time, 0);
181  myPr = UT_Vector3D(0,0,0);
182  if (true)
183  graph->evalOpParm(myPr, nodeidx, "pr", time, 0);
184  myNewgroups = false;
185  if (true)
186  graph->evalOpParm(myNewgroups, nodeidx, "newgroups", time, 0);
187  myNewgroupprefix = "copyGroup"_UTsh;
188  if (true && ( (true&&!(((getNewgroups()==0)))) ) )
189  graph->evalOpParm(myNewgroupprefix, nodeidx, "newgroupprefix", time, 0);
190  myDocopyattrib = false;
191  if (true)
192  graph->evalOpParm(myDocopyattrib, nodeidx, "docopyattrib", time, 0);
193  myCopyattrib = "copynum"_UTsh;
194  if (true && ( (true&&!(((getDocopyattrib()==0)))) ) )
195  graph->evalOpParm(myCopyattrib, nodeidx, "copyattrib", time, 0);
196 
197  }
198 
199 
200  void loadFromOpSubclass(const LoadParms &loadparms) override
201  {
202  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
203  }
204 
205 
206  void copyFrom(const OP_NodeParms *src) override
207  {
208  *this = *((const SOP_CopyTransformParms *)src);
209  }
210 
211  template <typename T>
212  void
213  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
214  {
215  if (idx.size() < 1)
216  return;
217  UT_ASSERT(idx.size() == instance.size()+1);
218  if (idx.size() != instance.size()+1)
219  return;
220  switch (idx[0])
221  {
222  case 0:
223  coerceValue(value, mySourceGroup);
224  break;
225  case 1:
226  coerceValue(value, mySourceGroupType);
227  break;
228  case 2:
229  coerceValue(value, myNcy);
230  break;
231  case 3:
232  coerceValue(value, myPack);
233  break;
234  case 4:
235  coerceValue(value, myPivot);
236  break;
237  case 5:
238  coerceValue(value, myViewportLOD);
239  break;
240  case 6:
241  coerceValue(value, myXord);
242  break;
243  case 7:
244  coerceValue(value, myRord);
245  break;
246  case 8:
247  coerceValue(value, myT);
248  break;
249  case 9:
250  coerceValue(value, myR);
251  break;
252  case 10:
253  coerceValue(value, myS);
254  break;
255  case 11:
256  coerceValue(value, myShear);
257  break;
258  case 12:
259  coerceValue(value, myScale);
260  break;
261  case 13:
262  coerceValue(value, myP);
263  break;
264  case 14:
265  coerceValue(value, myPr);
266  break;
267  case 15:
268  coerceValue(value, myNewgroups);
269  break;
270  case 16:
271  coerceValue(value, myNewgroupprefix);
272  break;
273  case 17:
274  coerceValue(value, myDocopyattrib);
275  break;
276  case 18:
277  coerceValue(value, myCopyattrib);
278  break;
279 
280  }
281  }
282 
283  bool isParmColorRamp(exint idx) const override
284  {
285  switch (idx)
286  {
287 
288  }
289  return false;
290  }
291 
292  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
293  { doGetParmValue(idx, instance, value); }
294  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
299  { doGetParmValue(idx, instance, value); }
300  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
305  { doGetParmValue(idx, instance, value); }
306  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
307  { doGetParmValue(idx, instance, value); }
308  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
309  { doGetParmValue(idx, instance, value); }
310  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
311  { doGetParmValue(idx, instance, value); }
312  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
313  { doGetParmValue(idx, instance, value); }
314 
315  template <typename T>
316  void
317  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
318  {
319  if (idx.size() < 1)
320  return;
321  UT_ASSERT(idx.size() == instance.size()+1);
322  if (idx.size() != instance.size()+1)
323  return;
324  switch (idx[0])
325  {
326  case 0:
327  coerceValue(mySourceGroup, ( ( value ) ));
328  break;
329  case 1:
330  coerceValue(mySourceGroupType, clampMinValue(0, clampMaxValue(2, value ) ));
331  break;
332  case 2:
333  coerceValue(myNcy, clampMinValue(0, ( value ) ));
334  break;
335  case 3:
336  coerceValue(myPack, ( ( value ) ));
337  break;
338  case 4:
339  coerceValue(myPivot, clampMinValue(0, clampMaxValue(1, value ) ));
340  break;
341  case 5:
342  coerceValue(myViewportLOD, clampMinValue(0, clampMaxValue(4, value ) ));
343  break;
344  case 6:
345  coerceValue(myXord, clampMinValue(0, clampMaxValue(5, value ) ));
346  break;
347  case 7:
348  coerceValue(myRord, clampMinValue(0, clampMaxValue(5, value ) ));
349  break;
350  case 8:
351  coerceValue(myT, ( ( value ) ));
352  break;
353  case 9:
354  coerceValue(myR, ( ( value ) ));
355  break;
356  case 10:
357  coerceValue(myS, ( ( value ) ));
358  break;
359  case 11:
360  coerceValue(myShear, ( ( value ) ));
361  break;
362  case 12:
363  coerceValue(myScale, ( ( value ) ));
364  break;
365  case 13:
366  coerceValue(myP, ( ( value ) ));
367  break;
368  case 14:
369  coerceValue(myPr, ( ( value ) ));
370  break;
371  case 15:
372  coerceValue(myNewgroups, ( ( value ) ));
373  break;
374  case 16:
375  coerceValue(myNewgroupprefix, ( ( value ) ));
376  break;
377  case 17:
378  coerceValue(myDocopyattrib, ( ( value ) ));
379  break;
380  case 18:
381  coerceValue(myCopyattrib, ( ( value ) ));
382  break;
383 
384  }
385  }
386 
387  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
388  { doSetParmValue(idx, instance, value); }
389  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
390  { doSetParmValue(idx, instance, value); }
391  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
392  { doSetParmValue(idx, instance, value); }
393  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
394  { doSetParmValue(idx, instance, value); }
395  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
396  { doSetParmValue(idx, instance, value); }
397  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
398  { doSetParmValue(idx, instance, value); }
399  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
400  { doSetParmValue(idx, instance, value); }
401  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
402  { doSetParmValue(idx, instance, value); }
403  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
404  { doSetParmValue(idx, instance, value); }
405  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
406  { doSetParmValue(idx, instance, value); }
407  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
408  { doSetParmValue(idx, instance, value); }
409 
410  exint getNestNumParms(TempIndex idx) const override
411  {
412  if (idx.size() == 0)
413  return 19;
414  switch (idx[0])
415  {
416 
417  }
418  // Invalid
419  return 0;
420  }
421 
422  const char *getNestParmName(TempIndex fieldnum) const override
423  {
424  if (fieldnum.size() < 1)
425  return 0;
426  switch (fieldnum[0])
427  {
428  case 0:
429  return "sourcegroup";
430  case 1:
431  return "sourcegrouptype";
432  case 2:
433  return "ncy";
434  case 3:
435  return "pack";
436  case 4:
437  return "pivot";
438  case 5:
439  return "viewportlod";
440  case 6:
441  return "xOrd";
442  case 7:
443  return "rOrd";
444  case 8:
445  return "t";
446  case 9:
447  return "r";
448  case 10:
449  return "s";
450  case 11:
451  return "shear";
452  case 12:
453  return "scale";
454  case 13:
455  return "p";
456  case 14:
457  return "pr";
458  case 15:
459  return "newgroups";
460  case 16:
461  return "newgroupprefix";
462  case 17:
463  return "docopyattrib";
464  case 18:
465  return "copyattrib";
466 
467  }
468  return 0;
469  }
470 
471  ParmType getNestParmType(TempIndex fieldnum) const override
472  {
473  if (fieldnum.size() < 1)
474  return PARM_UNSUPPORTED;
475  switch (fieldnum[0])
476  {
477  case 0:
478  return PARM_STRING;
479  case 1:
480  return PARM_INTEGER;
481  case 2:
482  return PARM_INTEGER;
483  case 3:
484  return PARM_INTEGER;
485  case 4:
486  return PARM_INTEGER;
487  case 5:
488  return PARM_INTEGER;
489  case 6:
490  return PARM_INTEGER;
491  case 7:
492  return PARM_INTEGER;
493  case 8:
494  return PARM_VECTOR3;
495  case 9:
496  return PARM_VECTOR3;
497  case 10:
498  return PARM_VECTOR3;
499  case 11:
500  return PARM_VECTOR3;
501  case 12:
502  return PARM_FLOAT;
503  case 13:
504  return PARM_VECTOR3;
505  case 14:
506  return PARM_VECTOR3;
507  case 15:
508  return PARM_INTEGER;
509  case 16:
510  return PARM_STRING;
511  case 17:
512  return PARM_INTEGER;
513  case 18:
514  return PARM_STRING;
515 
516  }
517  return PARM_UNSUPPORTED;
518  }
519 
520  // Boiler plate to load individual types.
521  static void loadData(UT_IStream &is, int64 &v)
522  { is.bread(&v, 1); }
523  static void loadData(UT_IStream &is, bool &v)
524  { int64 iv; is.bread(&iv, 1); v = iv; }
525  static void loadData(UT_IStream &is, fpreal64 &v)
526  { is.bread<fpreal64>(&v, 1); }
527  static void loadData(UT_IStream &is, UT_Vector2D &v)
528  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
529  static void loadData(UT_IStream &is, UT_Vector3D &v)
530  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
531  is.bread<fpreal64>(&v.z(), 1); }
532  static void loadData(UT_IStream &is, UT_Vector4D &v)
533  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
534  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
535  static void loadData(UT_IStream &is, UT_Matrix2D &v)
536  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
537  static void loadData(UT_IStream &is, UT_Matrix3D &v)
538  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
539  static void loadData(UT_IStream &is, UT_Matrix4D &v)
540  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
541  static void loadData(UT_IStream &is, UT_Vector2I &v)
542  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
543  static void loadData(UT_IStream &is, UT_Vector3I &v)
544  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
545  is.bread<int64>(&v.z(), 1); }
546  static void loadData(UT_IStream &is, UT_Vector4I &v)
547  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
548  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
550  { is.bread(v); }
552  { UT_StringHolder rampdata;
553  loadData(is, rampdata);
554  if (rampdata.isstring())
555  {
556  v.reset(new UT_Ramp());
557  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
558  v->load(istr);
559  }
560  else v.reset();
561  }
564  loadData(is, data);
565  if (data.isstring())
566  {
567  // Find the data type.
568  const char *colon = UT_StringWrap(data).findChar(':');
569  if (colon)
570  {
571  int typelen = colon - data.buffer();
573  type.strncpy(data.buffer(), typelen);
574  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
575 
576  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
577  }
578  }
579  else v.reset();
580  }
581 
582  static void saveData(std::ostream &os, int64 v)
583  { UTwrite(os, &v); }
584  static void saveData(std::ostream &os, bool v)
585  { int64 iv = v; UTwrite(os, &iv); }
586  static void saveData(std::ostream &os, fpreal64 v)
587  { UTwrite<fpreal64>(os, &v); }
588  static void saveData(std::ostream &os, UT_Vector2D v)
589  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
590  static void saveData(std::ostream &os, UT_Vector3D v)
591  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
592  UTwrite<fpreal64>(os, &v.z()); }
593  static void saveData(std::ostream &os, UT_Vector4D v)
594  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
595  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
596  static void saveData(std::ostream &os, UT_Matrix2D v)
598  static void saveData(std::ostream &os, UT_Matrix3D v)
600  static void saveData(std::ostream &os, UT_Matrix4D v)
602  static void saveData(std::ostream &os, UT_StringHolder s)
603  { UT_StringWrap(s).saveBinary(os); }
604  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
606  UT_OStringStream ostr;
607  if (s) s->save(ostr);
608  result = ostr.str();
609  saveData(os, result);
610  }
611  static void saveData(std::ostream &os, PRM_DataItemHandle s)
613  UT_OStringStream ostr;
614  if (s)
615  {
616  ostr << s->getDataTypeToken();
617  ostr << ":";
618  s->saveBinary(ostr);
619  }
620  result = ostr.str();
621  saveData(os, result);
622  }
623 
624 
625  void save(std::ostream &os) const
626  {
627  int32 v = version();
628  UTwrite(os, &v);
629  saveData(os, mySourceGroup);
630  saveData(os, mySourceGroupType);
631  saveData(os, myNcy);
632  saveData(os, myPack);
633  saveData(os, myPivot);
634  saveData(os, myViewportLOD);
635  saveData(os, myXord);
636  saveData(os, myRord);
637  saveData(os, myT);
638  saveData(os, myR);
639  saveData(os, myS);
640  saveData(os, myShear);
641  saveData(os, myScale);
642  saveData(os, myP);
643  saveData(os, myPr);
644  saveData(os, myNewgroups);
645  saveData(os, myNewgroupprefix);
646  saveData(os, myDocopyattrib);
647  saveData(os, myCopyattrib);
648 
649  }
650 
651  bool load(UT_IStream &is)
652  {
653  int32 v;
654  is.bread(&v, 1);
655  if (version() != v)
656  {
657  // Fail incompatible versions
658  return false;
659  }
660  loadData(is, mySourceGroup);
661  loadData(is, mySourceGroupType);
662  loadData(is, myNcy);
663  loadData(is, myPack);
664  loadData(is, myPivot);
665  loadData(is, myViewportLOD);
666  loadData(is, myXord);
667  loadData(is, myRord);
668  loadData(is, myT);
669  loadData(is, myR);
670  loadData(is, myS);
671  loadData(is, myShear);
672  loadData(is, myScale);
673  loadData(is, myP);
674  loadData(is, myPr);
675  loadData(is, myNewgroups);
676  loadData(is, myNewgroupprefix);
677  loadData(is, myDocopyattrib);
678  loadData(is, myCopyattrib);
679 
680  return true;
681  }
682 
683  const UT_StringHolder & getSourceGroup() const { return mySourceGroup; }
684  void setSourceGroup(const UT_StringHolder & val) { mySourceGroup = val; }
686  {
687  SOP_Node *thissop = cookparms.getNode();
688  if (!thissop) return getSourceGroup();
690  OP_Utils::evalOpParm(result, thissop, "sourcegroup", cookparms.getCookTime(), 0);
691  return result;
692  }
693  SourceGroupType getSourceGroupType() const { return SourceGroupType(mySourceGroupType); }
694  void setSourceGroupType(SourceGroupType val) { mySourceGroupType = int64(val); }
696  {
697  SOP_Node *thissop = cookparms.getNode();
698  if (!thissop) return getSourceGroupType();
699  int64 result;
700  OP_Utils::evalOpParm(result, thissop, "sourcegrouptype", cookparms.getCookTime(), 0);
701  return SourceGroupType(result);
702  }
703  int64 getNcy() const { return myNcy; }
704  void setNcy(int64 val) { myNcy = val; }
705  int64 opNcy(const SOP_NodeVerb::CookParms &cookparms) const
706  {
707  SOP_Node *thissop = cookparms.getNode();
708  if (!thissop) return getNcy();
709  int64 result;
710  OP_Utils::evalOpParm(result, thissop, "ncy", cookparms.getCookTime(), 0);
711  return result;
712  }
713  bool getPack() const { return myPack; }
714  void setPack(bool val) { myPack = val; }
715  bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
716  {
717  SOP_Node *thissop = cookparms.getNode();
718  if (!thissop) return getPack();
719  bool result;
720  OP_Utils::evalOpParm(result, thissop, "pack", cookparms.getCookTime(), 0);
721  return result;
722  }
723  Pivot getPivot() const { return Pivot(myPivot); }
724  void setPivot(Pivot val) { myPivot = int64(val); }
725  Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
726  {
727  SOP_Node *thissop = cookparms.getNode();
728  if (!thissop) return getPivot();
729  int64 result;
730  OP_Utils::evalOpParm(result, thissop, "pivot", cookparms.getCookTime(), 0);
731  return Pivot(result);
732  }
733  ViewportLOD getViewportLOD() const { return ViewportLOD(myViewportLOD); }
734  void setViewportLOD(ViewportLOD val) { myViewportLOD = int64(val); }
736  {
737  SOP_Node *thissop = cookparms.getNode();
738  if (!thissop) return getViewportLOD();
739  int64 result;
740  OP_Utils::evalOpParm(result, thissop, "viewportlod", cookparms.getCookTime(), 0);
741  return ViewportLOD(result);
742  }
743  Xord getXord() const { return Xord(myXord); }
744  void setXord(Xord val) { myXord = int64(val); }
745  Xord opXord(const SOP_NodeVerb::CookParms &cookparms) const
746  {
747  SOP_Node *thissop = cookparms.getNode();
748  if (!thissop) return getXord();
749  int64 result;
750  OP_Utils::evalOpParm(result, thissop, "xOrd", cookparms.getCookTime(), 0);
751  return Xord(result);
752  }
753  Rord getRord() const { return Rord(myRord); }
754  void setRord(Rord val) { myRord = int64(val); }
755  Rord opRord(const SOP_NodeVerb::CookParms &cookparms) const
756  {
757  SOP_Node *thissop = cookparms.getNode();
758  if (!thissop) return getRord();
759  int64 result;
760  OP_Utils::evalOpParm(result, thissop, "rOrd", cookparms.getCookTime(), 0);
761  return Rord(result);
762  }
763  UT_Vector3D getT() const { return myT; }
764  void setT(UT_Vector3D val) { myT = val; }
765  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
766  {
767  SOP_Node *thissop = cookparms.getNode();
768  if (!thissop) return getT();
770  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
771  return result;
772  }
773  UT_Vector3D getR() const { return myR; }
774  void setR(UT_Vector3D val) { myR = val; }
775  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
776  {
777  SOP_Node *thissop = cookparms.getNode();
778  if (!thissop) return getR();
780  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
781  return result;
782  }
783  UT_Vector3D getS() const { return myS; }
784  void setS(UT_Vector3D val) { myS = val; }
785  UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
786  {
787  SOP_Node *thissop = cookparms.getNode();
788  if (!thissop) return getS();
790  OP_Utils::evalOpParm(result, thissop, "s", cookparms.getCookTime(), 0);
791  return result;
792  }
793  UT_Vector3D getShear() const { return myShear; }
794  void setShear(UT_Vector3D val) { myShear = val; }
796  {
797  SOP_Node *thissop = cookparms.getNode();
798  if (!thissop) return getShear();
800  OP_Utils::evalOpParm(result, thissop, "shear", cookparms.getCookTime(), 0);
801  return result;
802  }
803  fpreal64 getScale() const { return myScale; }
804  void setScale(fpreal64 val) { myScale = val; }
805  fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
806  {
807  SOP_Node *thissop = cookparms.getNode();
808  if (!thissop) return getScale();
810  OP_Utils::evalOpParm(result, thissop, "scale", cookparms.getCookTime(), 0);
811  return result;
812  }
813  UT_Vector3D getP() const { return myP; }
814  void setP(UT_Vector3D val) { myP = val; }
815  UT_Vector3D opP(const SOP_NodeVerb::CookParms &cookparms) const
816  {
817  SOP_Node *thissop = cookparms.getNode();
818  if (!thissop) return getP();
820  OP_Utils::evalOpParm(result, thissop, "p", cookparms.getCookTime(), 0);
821  return result;
822  }
823  UT_Vector3D getPr() const { return myPr; }
824  void setPr(UT_Vector3D val) { myPr = val; }
825  UT_Vector3D opPr(const SOP_NodeVerb::CookParms &cookparms) const
826  {
827  SOP_Node *thissop = cookparms.getNode();
828  if (!thissop) return getPr();
830  OP_Utils::evalOpParm(result, thissop, "pr", cookparms.getCookTime(), 0);
831  return result;
832  }
833  bool getNewgroups() const { return myNewgroups; }
834  void setNewgroups(bool val) { myNewgroups = val; }
835  bool opNewgroups(const SOP_NodeVerb::CookParms &cookparms) const
836  {
837  SOP_Node *thissop = cookparms.getNode();
838  if (!thissop) return getNewgroups();
839  bool result;
840  OP_Utils::evalOpParm(result, thissop, "newgroups", cookparms.getCookTime(), 0);
841  return result;
842  }
843  const UT_StringHolder & getNewgroupprefix() const { return myNewgroupprefix; }
844  void setNewgroupprefix(const UT_StringHolder & val) { myNewgroupprefix = val; }
846  {
847  SOP_Node *thissop = cookparms.getNode();
848  if (!thissop) return getNewgroupprefix();
850  OP_Utils::evalOpParm(result, thissop, "newgroupprefix", cookparms.getCookTime(), 0);
851  return result;
852  }
853  bool getDocopyattrib() const { return myDocopyattrib; }
854  void setDocopyattrib(bool val) { myDocopyattrib = val; }
855  bool opDocopyattrib(const SOP_NodeVerb::CookParms &cookparms) const
856  {
857  SOP_Node *thissop = cookparms.getNode();
858  if (!thissop) return getDocopyattrib();
859  bool result;
860  OP_Utils::evalOpParm(result, thissop, "docopyattrib", cookparms.getCookTime(), 0);
861  return result;
862  }
863  const UT_StringHolder & getCopyattrib() const { return myCopyattrib; }
864  void setCopyattrib(const UT_StringHolder & val) { myCopyattrib = val; }
866  {
867  SOP_Node *thissop = cookparms.getNode();
868  if (!thissop) return getCopyattrib();
870  OP_Utils::evalOpParm(result, thissop, "copyattrib", cookparms.getCookTime(), 0);
871  return result;
872  }
873 
874 private:
875  UT_StringHolder mySourceGroup;
876  int64 mySourceGroupType;
877  int64 myNcy;
878  bool myPack;
879  int64 myPivot;
880  int64 myViewportLOD;
881  int64 myXord;
882  int64 myRord;
883  UT_Vector3D myT;
884  UT_Vector3D myR;
885  UT_Vector3D myS;
886  UT_Vector3D myShear;
887  fpreal64 myScale;
888  UT_Vector3D myP;
889  UT_Vector3D myPr;
890  bool myNewgroups;
891  UT_StringHolder myNewgroupprefix;
892  bool myDocopyattrib;
893  UT_StringHolder myCopyattrib;
894 
895 };
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
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
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)
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
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
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
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)
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
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
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
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:1385
#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:89
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
OP_NodeParms & operator=(const OP_NodeParms &)=default
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