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_NodeVerb.h>
7 #include <OP/OP_Utils.h>
8 #include <PRM/PRM_Parm.h>
9 #include <UT/UT_IStream.h>
10 #include <UT/UT_NTStreamUtil.h>
11 #include <UT/UT_Ramp.h>
12 #include <UT/UT_SharedPtr.h>
13 #include <UT/UT_StringHolder.h>
14 #include <UT/UT_StringStream.h>
15 #include <UT/UT_VectorTypes.h>
16 #include <SYS/SYS_Types.h>
17 
18 using namespace UT::Literal;
19 
20 class DEP_MicroNode;
21 namespace SOP_CopyTransformEnums
22 {
23  enum class Pivot
24  {
25  ORIGIN = 0,
26  CENTROID
27  };
28  enum class Viewportlod
29  {
30  FULL = 0,
31  POINTS,
32  BOX,
33  CENTROID,
34  HIDDEN
35  };
36  enum class Xord
37  {
38  SRT = 0,
39  STR,
40  RST,
41  RTS,
42  TSR,
43  TRS
44  };
45  enum class Rord
46  {
47  XYZ = 0,
48  XZY,
49  YXZ,
50  YZX,
51  ZXY,
52  ZYX
53  };
54 }
55 
56 
58 {
59 public:
60  static int version() { return 1; }
61 
63  {
64  mySourceGroup = ""_sh;
65  myNcy = 2;
66  myPack = false;
67  myPivot = 1;
68  myViewportlod = 0;
69  myXord = 0;
70  myRord = 0;
71  myT = UT_Vector3D(0,0,0);
72  myR = UT_Vector3D(0,0,0);
73  myS = UT_Vector3D(1,1,1);
74  myShear = UT_Vector3D(0,0,0);
75  myScale = 1;
76  myP = UT_Vector3D(0,0,0);
77  myPr = UT_Vector3D(0,0,0);
78  myNewgroups = false;
79  myNewgroupprefix = "copyGroup"_sh;
80  myDocopyattrib = false;
81  myCopyattrib = "copynum"_sh;
82 
83  }
84 
85  explicit SOP_CopyTransformParms(const SOP_CopyTransformParms &) = default;
86 
88 
90  {
91  if (mySourceGroup != src.mySourceGroup) return false;
92  if (myNcy != src.myNcy) return false;
93  if (myPack != src.myPack) return false;
94  if (myPivot != src.myPivot) return false;
95  if (myViewportlod != src.myViewportlod) return false;
96  if (myXord != src.myXord) return false;
97  if (myRord != src.myRord) return false;
98  if (myT != src.myT) return false;
99  if (myR != src.myR) return false;
100  if (myS != src.myS) return false;
101  if (myShear != src.myShear) return false;
102  if (myScale != src.myScale) return false;
103  if (myP != src.myP) return false;
104  if (myPr != src.myPr) return false;
105  if (myNewgroups != src.myNewgroups) return false;
106  if (myNewgroupprefix != src.myNewgroupprefix) return false;
107  if (myDocopyattrib != src.myDocopyattrib) return false;
108  if (myCopyattrib != src.myCopyattrib) return false;
109 
110  return true;
111  }
113  {
114  return !operator==(src);
115  }
120 
121 
122 
123  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
124  {
125  if (true)
126  OP_Utils::evalOpParm(mySourceGroup, node, "sourcegroup", time, 0);
127  else mySourceGroup = ""_sh;
128  if (true)
129  OP_Utils::evalOpParm(myNcy, node, "ncy", time, 0);
130  else myNcy = 2;
131  if (true)
132  OP_Utils::evalOpParm(myPack, node, "pack", time, 0);
133  else myPack = false;
134  if (true && ( (!(((getPack()==0)))) ) )
135  OP_Utils::evalOpParm(myPivot, node, "pivot", time, 0);
136  else myPivot = 1;
137  if (true && ( (!(((getPack()==0)))) ) )
138  OP_Utils::evalOpParm(myViewportlod, node, "viewportlod", time, 0);
139  else myViewportlod = 0;
140  if (true)
141  OP_Utils::evalOpParm(myXord, node, "xOrd", time, 0);
142  else myXord = 0;
143  if (true)
144  OP_Utils::evalOpParm(myRord, node, "rOrd", time, 0);
145  else myRord = 0;
146  if (true)
147  OP_Utils::evalOpParm(myT, node, "t", time, 0);
148  else myT = UT_Vector3D(0,0,0);
149  if (true)
150  OP_Utils::evalOpParm(myR, node, "r", time, 0);
151  else myR = UT_Vector3D(0,0,0);
152  if (true)
153  OP_Utils::evalOpParm(myS, node, "s", time, 0);
154  else myS = UT_Vector3D(1,1,1);
155  if (true)
156  OP_Utils::evalOpParm(myShear, node, "shear", time, 0);
157  else myShear = UT_Vector3D(0,0,0);
158  if (true)
159  OP_Utils::evalOpParm(myScale, node, "scale", time, 0);
160  else myScale = 1;
161  if (true)
162  OP_Utils::evalOpParm(myP, node, "p", time, 0);
163  else myP = UT_Vector3D(0,0,0);
164  if (true)
165  OP_Utils::evalOpParm(myPr, node, "pr", time, 0);
166  else myPr = UT_Vector3D(0,0,0);
167  if (true)
168  OP_Utils::evalOpParm(myNewgroups, node, "newgroups", time, 0);
169  else myNewgroups = false;
170  if (true && ( (!(((getNewgroups()==0)))) ) )
171  OP_Utils::evalOpParm(myNewgroupprefix, node, "newgroupprefix", time, 0);
172  else myNewgroupprefix = "copyGroup"_sh;
173  if (true)
174  OP_Utils::evalOpParm(myDocopyattrib, node, "docopyattrib", time, 0);
175  else myDocopyattrib = false;
176  if (true && ( (!(((getDocopyattrib()==0)))) ) )
177  OP_Utils::evalOpParm(myCopyattrib, node, "copyattrib", time, 0);
178  else myCopyattrib = "copynum"_sh;
179 
180  }
181 
182 
183  virtual void loadFromOpSubclass(const LoadParms &loadparms)
184  {
185  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
186  }
187 
188 
189  virtual void copyFrom(const SOP_NodeParms *src)
190  {
191  *this = *((const SOP_CopyTransformParms *)src);
192  }
193 
194  template <typename T>
195  void
196  doGetParmValue(exint idx, T &value) const
197  {
198  switch (idx)
199  {
200  case 0:
201  coerceValue(value, mySourceGroup);
202  break;
203  case 1:
204  coerceValue(value, myNcy);
205  break;
206  case 2:
207  coerceValue(value, myPack);
208  break;
209  case 3:
210  coerceValue(value, myPivot);
211  break;
212  case 4:
213  coerceValue(value, myViewportlod);
214  break;
215  case 5:
216  coerceValue(value, myXord);
217  break;
218  case 6:
219  coerceValue(value, myRord);
220  break;
221  case 7:
222  coerceValue(value, myT);
223  break;
224  case 8:
225  coerceValue(value, myR);
226  break;
227  case 9:
228  coerceValue(value, myS);
229  break;
230  case 10:
231  coerceValue(value, myShear);
232  break;
233  case 11:
234  coerceValue(value, myScale);
235  break;
236  case 12:
237  coerceValue(value, myP);
238  break;
239  case 13:
240  coerceValue(value, myPr);
241  break;
242  case 14:
243  coerceValue(value, myNewgroups);
244  break;
245  case 15:
246  coerceValue(value, myNewgroupprefix);
247  break;
248  case 16:
249  coerceValue(value, myDocopyattrib);
250  break;
251  case 17:
252  coerceValue(value, myCopyattrib);
253  break;
254 
255  }
256  }
257 
258  void getParmValue(exint idx, exint &value) const
259  { doGetParmValue(idx, value); }
260  void getParmValue(exint idx, fpreal &value) const
261  { doGetParmValue(idx, value); }
263  { doGetParmValue(idx, value); }
265  { doGetParmValue(idx, value); }
267  { doGetParmValue(idx, value); }
269  { doGetParmValue(idx, value); }
271  { doGetParmValue(idx, value); }
273  { doGetParmValue(idx, value); }
275  { doGetParmValue(idx, value); }
277  { doGetParmValue(idx, value); }
279  { doGetParmValue(idx, value); }
280 
281  template <typename T>
282  void
283  doSetParmValue(exint idx, const T &value)
284  {
285  switch (idx)
286  {
287  case 0:
288  coerceValue(mySourceGroup, value);
289  break;
290  case 1:
291  coerceValue(myNcy, value);
292  break;
293  case 2:
294  coerceValue(myPack, value);
295  break;
296  case 3:
297  coerceValue(myPivot, value);
298  break;
299  case 4:
300  coerceValue(myViewportlod, value);
301  break;
302  case 5:
303  coerceValue(myXord, value);
304  break;
305  case 6:
306  coerceValue(myRord, value);
307  break;
308  case 7:
309  coerceValue(myT, value);
310  break;
311  case 8:
312  coerceValue(myR, value);
313  break;
314  case 9:
315  coerceValue(myS, value);
316  break;
317  case 10:
318  coerceValue(myShear, value);
319  break;
320  case 11:
321  coerceValue(myScale, value);
322  break;
323  case 12:
324  coerceValue(myP, value);
325  break;
326  case 13:
327  coerceValue(myPr, value);
328  break;
329  case 14:
330  coerceValue(myNewgroups, value);
331  break;
332  case 15:
333  coerceValue(myNewgroupprefix, value);
334  break;
335  case 16:
336  coerceValue(myDocopyattrib, value);
337  break;
338  case 17:
339  coerceValue(myCopyattrib, value);
340  break;
341 
342  }
343  }
344 
345  void setParmValue(exint idx, const exint &value)
346  { doSetParmValue(idx, value); }
347  void setParmValue(exint idx, const fpreal &value)
348  { doSetParmValue(idx, value); }
349  void setParmValue(exint idx, const UT_Vector2D &value)
350  { doSetParmValue(idx, value); }
351  void setParmValue(exint idx, const UT_Vector3D &value)
352  { doSetParmValue(idx, value); }
353  void setParmValue(exint idx, const UT_Vector4D &value)
354  { doSetParmValue(idx, value); }
355  void setParmValue(exint idx, const UT_Matrix2D &value)
356  { doSetParmValue(idx, value); }
357  void setParmValue(exint idx, const UT_Matrix3D &value)
358  { doSetParmValue(idx, value); }
359  void setParmValue(exint idx, const UT_Matrix4D &value)
360  { doSetParmValue(idx, value); }
362  { doSetParmValue(idx, value); }
364  { doSetParmValue(idx, value); }
366  { doSetParmValue(idx, value); }
367 
368  virtual exint getNumParms() const
369  {
370  return 18;
371  }
372 
373  virtual const char *getParmName(exint fieldnum) const
374  {
375  switch (fieldnum)
376  {
377  case 0:
378  return "sourcegroup";
379  case 1:
380  return "ncy";
381  case 2:
382  return "pack";
383  case 3:
384  return "pivot";
385  case 4:
386  return "viewportlod";
387  case 5:
388  return "xOrd";
389  case 6:
390  return "rOrd";
391  case 7:
392  return "t";
393  case 8:
394  return "r";
395  case 9:
396  return "s";
397  case 10:
398  return "shear";
399  case 11:
400  return "scale";
401  case 12:
402  return "p";
403  case 13:
404  return "pr";
405  case 14:
406  return "newgroups";
407  case 15:
408  return "newgroupprefix";
409  case 16:
410  return "docopyattrib";
411  case 17:
412  return "copyattrib";
413 
414  }
415  return 0;
416  }
417 
418  virtual ParmType getParmType(exint fieldnum) const
419  {
420  switch (fieldnum)
421  {
422  case 0:
423  return PARM_STRING;
424  case 1:
425  return PARM_INTEGER;
426  case 2:
427  return PARM_INTEGER;
428  case 3:
429  return PARM_INTEGER;
430  case 4:
431  return PARM_INTEGER;
432  case 5:
433  return PARM_INTEGER;
434  case 6:
435  return PARM_INTEGER;
436  case 7:
437  return PARM_VECTOR3;
438  case 8:
439  return PARM_VECTOR3;
440  case 9:
441  return PARM_VECTOR3;
442  case 10:
443  return PARM_VECTOR3;
444  case 11:
445  return PARM_FLOAT;
446  case 12:
447  return PARM_VECTOR3;
448  case 13:
449  return PARM_VECTOR3;
450  case 14:
451  return PARM_INTEGER;
452  case 15:
453  return PARM_STRING;
454  case 16:
455  return PARM_INTEGER;
456  case 17:
457  return PARM_STRING;
458 
459  }
460  return PARM_UNSUPPORTED;
461  }
462 
463  // Boiler plate to load individual types.
464  static void loadData(UT_IStream &is, int64 &v)
465  { is.bread(&v, 1); }
466  static void loadData(UT_IStream &is, bool &v)
467  { int64 iv; is.bread(&iv, 1); v = iv; }
468  static void loadData(UT_IStream &is, fpreal64 &v)
469  { is.bread<fpreal64>(&v, 1); }
470  static void loadData(UT_IStream &is, UT_Vector2D &v)
471  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
472  static void loadData(UT_IStream &is, UT_Vector3D &v)
473  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
474  is.bread<fpreal64>(&v.z(), 1); }
475  static void loadData(UT_IStream &is, UT_Vector4D &v)
476  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
477  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
478  static void loadData(UT_IStream &is, UT_Matrix2D &v)
479  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
480  static void loadData(UT_IStream &is, UT_Matrix3D &v)
481  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
482  static void loadData(UT_IStream &is, UT_Matrix4D &v)
483  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
484  static void loadData(UT_IStream &is, UT_Vector2I &v)
485  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
486  static void loadData(UT_IStream &is, UT_Vector3I &v)
487  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
488  is.bread<int64>(&v.z(), 1); }
489  static void loadData(UT_IStream &is, UT_Vector4I &v)
490  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
491  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
493  { is.bread(v); }
495  { UT_StringHolder rampdata;
496  loadData(is, rampdata);
497  if (rampdata.isstring())
498  {
499  v.reset(new UT_Ramp());
500  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
501  v->load(istr);
502  }
503  else v.reset();
504  }
507  loadData(is, data);
508  if (data.isstring())
509  {
510  // Find the data type.
511  char *colon = UT_StringWrap(data).findChar(':');
512  if (colon)
513  {
514  int typelen = colon - data.buffer();
516  type.strncpy(data.buffer(), typelen);
517  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
518 
519  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
520  }
521  }
522  else v.reset();
523  }
524 
525  static void saveData(std::ostream &os, int64 v)
526  { UTwrite(os, &v); }
527  static void saveData(std::ostream &os, bool v)
528  { int64 iv = v; UTwrite(os, &iv); }
529  static void saveData(std::ostream &os, fpreal64 v)
530  { UTwrite<fpreal64>(os, &v); }
531  static void saveData(std::ostream &os, UT_Vector2D v)
532  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
533  static void saveData(std::ostream &os, UT_Vector3D v)
534  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
535  UTwrite<fpreal64>(os, &v.z()); }
536  static void saveData(std::ostream &os, UT_Vector4D v)
537  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
538  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
539  static void saveData(std::ostream &os, UT_Matrix2D v)
541  static void saveData(std::ostream &os, UT_Matrix3D v)
543  static void saveData(std::ostream &os, UT_Matrix4D v)
545  static void saveData(std::ostream &os, UT_StringHolder s)
546  { UT_StringWrap(s).saveBinary(os); }
547  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
548  { UT_StringHolder result;
549  UT_OStringStream ostr;
550  if (s) s->save(ostr);
551  result = ostr.str();
552  saveData(os, result);
553  }
554  static void saveData(std::ostream &os, PRM_DataItemHandle s)
555  { UT_StringHolder result;
556  UT_OStringStream ostr;
557  if (s)
558  {
559  ostr << s->getDataTypeToken();
560  ostr << ":";
561  s->saveBinary(ostr);
562  }
563  result = ostr.str();
564  saveData(os, result);
565  }
566 
567 
568  void save(std::ostream &os) const
569  {
570  int32 v = version();
571  UTwrite(os, &v);
572  saveData(os, mySourceGroup);
573  saveData(os, myNcy);
574  saveData(os, myPack);
575  saveData(os, myPivot);
576  saveData(os, myViewportlod);
577  saveData(os, myXord);
578  saveData(os, myRord);
579  saveData(os, myT);
580  saveData(os, myR);
581  saveData(os, myS);
582  saveData(os, myShear);
583  saveData(os, myScale);
584  saveData(os, myP);
585  saveData(os, myPr);
586  saveData(os, myNewgroups);
587  saveData(os, myNewgroupprefix);
588  saveData(os, myDocopyattrib);
589  saveData(os, myCopyattrib);
590 
591  }
592 
593  bool load(UT_IStream &is)
594  {
595  int32 v;
596  is.bread(&v, 1);
597  if (version() != v)
598  {
599  // Fail incompatible versions
600  return false;
601  }
602  loadData(is, mySourceGroup);
603  loadData(is, myNcy);
604  loadData(is, myPack);
605  loadData(is, myPivot);
606  loadData(is, myViewportlod);
607  loadData(is, myXord);
608  loadData(is, myRord);
609  loadData(is, myT);
610  loadData(is, myR);
611  loadData(is, myS);
612  loadData(is, myShear);
613  loadData(is, myScale);
614  loadData(is, myP);
615  loadData(is, myPr);
616  loadData(is, myNewgroups);
617  loadData(is, myNewgroupprefix);
618  loadData(is, myDocopyattrib);
619  loadData(is, myCopyattrib);
620 
621  return true;
622  }
623 
624  const UT_StringHolder & getSourceGroup() const { return mySourceGroup; }
625  void setSourceGroup(const UT_StringHolder & val) { mySourceGroup = val; }
627  {
628  SOP_Node *thissop = cookparms.getNode();
629  if (!thissop) return getSourceGroup();
630  UT_StringHolder result;
631  OP_Utils::evalOpParm(result, thissop, "sourcegroup", cookparms.getCookTime(), 0);
632  return result;
633  }
634  int64 getNcy() const { return myNcy; }
635  void setNcy(int64 val) { myNcy = val; }
636  int64 opNcy(const SOP_NodeVerb::CookParms &cookparms) const
637  {
638  SOP_Node *thissop = cookparms.getNode();
639  if (!thissop) return getNcy();
640  int64 result;
641  OP_Utils::evalOpParm(result, thissop, "ncy", cookparms.getCookTime(), 0);
642  return result;
643  }
644  bool getPack() const { return myPack; }
645  void setPack(bool val) { myPack = val; }
646  bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
647  {
648  SOP_Node *thissop = cookparms.getNode();
649  if (!thissop) return getPack();
650  bool result;
651  OP_Utils::evalOpParm(result, thissop, "pack", cookparms.getCookTime(), 0);
652  return result;
653  }
654  Pivot getPivot() const { return Pivot(myPivot); }
655  void setPivot(Pivot val) { myPivot = int64(val); }
656  Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
657  {
658  SOP_Node *thissop = cookparms.getNode();
659  if (!thissop) return getPivot();
660  int64 result;
661  OP_Utils::evalOpParm(result, thissop, "pivot", cookparms.getCookTime(), 0);
662  return Pivot(result);
663  }
664  Viewportlod getViewportlod() const { return Viewportlod(myViewportlod); }
665  void setViewportlod(Viewportlod val) { myViewportlod = int64(val); }
667  {
668  SOP_Node *thissop = cookparms.getNode();
669  if (!thissop) return getViewportlod();
670  int64 result;
671  OP_Utils::evalOpParm(result, thissop, "viewportlod", cookparms.getCookTime(), 0);
672  return Viewportlod(result);
673  }
674  Xord getXord() const { return Xord(myXord); }
675  void setXord(Xord val) { myXord = int64(val); }
676  Xord opXord(const SOP_NodeVerb::CookParms &cookparms) const
677  {
678  SOP_Node *thissop = cookparms.getNode();
679  if (!thissop) return getXord();
680  int64 result;
681  OP_Utils::evalOpParm(result, thissop, "xOrd", cookparms.getCookTime(), 0);
682  return Xord(result);
683  }
684  Rord getRord() const { return Rord(myRord); }
685  void setRord(Rord val) { myRord = int64(val); }
686  Rord opRord(const SOP_NodeVerb::CookParms &cookparms) const
687  {
688  SOP_Node *thissop = cookparms.getNode();
689  if (!thissop) return getRord();
690  int64 result;
691  OP_Utils::evalOpParm(result, thissop, "rOrd", cookparms.getCookTime(), 0);
692  return Rord(result);
693  }
694  UT_Vector3D getT() const { return myT; }
695  void setT(UT_Vector3D val) { myT = val; }
696  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
697  {
698  SOP_Node *thissop = cookparms.getNode();
699  if (!thissop) return getT();
700  UT_Vector3D result;
701  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
702  return result;
703  }
704  UT_Vector3D getR() const { return myR; }
705  void setR(UT_Vector3D val) { myR = val; }
706  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
707  {
708  SOP_Node *thissop = cookparms.getNode();
709  if (!thissop) return getR();
710  UT_Vector3D result;
711  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
712  return result;
713  }
714  UT_Vector3D getS() const { return myS; }
715  void setS(UT_Vector3D val) { myS = val; }
716  UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
717  {
718  SOP_Node *thissop = cookparms.getNode();
719  if (!thissop) return getS();
720  UT_Vector3D result;
721  OP_Utils::evalOpParm(result, thissop, "s", cookparms.getCookTime(), 0);
722  return result;
723  }
724  UT_Vector3D getShear() const { return myShear; }
725  void setShear(UT_Vector3D val) { myShear = val; }
727  {
728  SOP_Node *thissop = cookparms.getNode();
729  if (!thissop) return getShear();
730  UT_Vector3D result;
731  OP_Utils::evalOpParm(result, thissop, "shear", cookparms.getCookTime(), 0);
732  return result;
733  }
734  fpreal64 getScale() const { return myScale; }
735  void setScale(fpreal64 val) { myScale = val; }
736  fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
737  {
738  SOP_Node *thissop = cookparms.getNode();
739  if (!thissop) return getScale();
740  fpreal64 result;
741  OP_Utils::evalOpParm(result, thissop, "scale", cookparms.getCookTime(), 0);
742  return result;
743  }
744  UT_Vector3D getP() const { return myP; }
745  void setP(UT_Vector3D val) { myP = val; }
746  UT_Vector3D opP(const SOP_NodeVerb::CookParms &cookparms) const
747  {
748  SOP_Node *thissop = cookparms.getNode();
749  if (!thissop) return getP();
750  UT_Vector3D result;
751  OP_Utils::evalOpParm(result, thissop, "p", cookparms.getCookTime(), 0);
752  return result;
753  }
754  UT_Vector3D getPr() const { return myPr; }
755  void setPr(UT_Vector3D val) { myPr = val; }
756  UT_Vector3D opPr(const SOP_NodeVerb::CookParms &cookparms) const
757  {
758  SOP_Node *thissop = cookparms.getNode();
759  if (!thissop) return getPr();
760  UT_Vector3D result;
761  OP_Utils::evalOpParm(result, thissop, "pr", cookparms.getCookTime(), 0);
762  return result;
763  }
764  bool getNewgroups() const { return myNewgroups; }
765  void setNewgroups(bool val) { myNewgroups = val; }
766  bool opNewgroups(const SOP_NodeVerb::CookParms &cookparms) const
767  {
768  SOP_Node *thissop = cookparms.getNode();
769  if (!thissop) return getNewgroups();
770  bool result;
771  OP_Utils::evalOpParm(result, thissop, "newgroups", cookparms.getCookTime(), 0);
772  return result;
773  }
774  const UT_StringHolder & getNewgroupprefix() const { return myNewgroupprefix; }
775  void setNewgroupprefix(const UT_StringHolder & val) { myNewgroupprefix = val; }
777  {
778  SOP_Node *thissop = cookparms.getNode();
779  if (!thissop) return getNewgroupprefix();
780  UT_StringHolder result;
781  OP_Utils::evalOpParm(result, thissop, "newgroupprefix", cookparms.getCookTime(), 0);
782  return result;
783  }
784  bool getDocopyattrib() const { return myDocopyattrib; }
785  void setDocopyattrib(bool val) { myDocopyattrib = val; }
786  bool opDocopyattrib(const SOP_NodeVerb::CookParms &cookparms) const
787  {
788  SOP_Node *thissop = cookparms.getNode();
789  if (!thissop) return getDocopyattrib();
790  bool result;
791  OP_Utils::evalOpParm(result, thissop, "docopyattrib", cookparms.getCookTime(), 0);
792  return result;
793  }
794  const UT_StringHolder & getCopyattrib() const { return myCopyattrib; }
795  void setCopyattrib(const UT_StringHolder & val) { myCopyattrib = val; }
797  {
798  SOP_Node *thissop = cookparms.getNode();
799  if (!thissop) return getCopyattrib();
800  UT_StringHolder result;
801  OP_Utils::evalOpParm(result, thissop, "copyattrib", cookparms.getCookTime(), 0);
802  return result;
803  }
804 
805 private:
806  UT_StringHolder mySourceGroup;
807  int64 myNcy;
808  bool myPack;
809  int64 myPivot;
810  int64 myViewportlod;
811  int64 myXord;
812  int64 myRord;
813  UT_Vector3D myT;
814  UT_Vector3D myR;
815  UT_Vector3D myS;
816  UT_Vector3D myShear;
817  fpreal64 myScale;
818  UT_Vector3D myP;
819  UT_Vector3D myPr;
820  bool myNewgroups;
821  UT_StringHolder myNewgroupprefix;
822  bool myDocopyattrib;
823  UT_StringHolder myCopyattrib;
824 
825 };
void setPr(UT_Vector3D val)
int64 opNcy(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const UT_Matrix3D &value)
void getParmValue(exint idx, UT_Matrix2D &value) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opSourceGroup(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(exint idx, T &value) const
virtual const char * getParmName(exint fieldnum) const
UT_Vector3D getShear() const
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:494
static void loadData(UT_IStream &is, UT_Vector4D &v)
T & z(void)
Definition: UT_Vector4.h:379
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, fpreal64 &v)
fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
static void loadData(UT_IStream &is, UT_Vector2I &v)
fpreal getTime() const
Definition: OP_Context.h:60
const GLdouble * v
Definition: glcorearb.h:836
void setNewgroupprefix(const UT_StringHolder &val)
void getParmValue(exint idx, exint &value) const
Viewportlod getViewportlod() const
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
T & x(void)
Definition: UT_Vector2.h:285
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setParmValue(exint idx, const UT_Vector4D &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.
const UT_WorkBuffer & str() const
Returns a read-only reference to the underlying UT_WorkBuffer.
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:498
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
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
Xord opXord(const SOP_NodeVerb::CookParms &cookparms) const
void setS(UT_Vector3D val)
void getParmValue(exint idx, UT_Vector4D &value) const
static void saveData(std::ostream &os, int64 v)
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, UT_StringHolder s)
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:502
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
long long int64
Definition: SYS_Types.h:107
void setCopyattrib(const UT_StringHolder &val)
bool operator==(const SOP_CopyTransformParms &src) const
void setParmValue(exint idx, const UT_StringHolder &value)
void doSetParmValue(exint idx, const T &value)
static void loadData(UT_IStream &is, bool &v)
void getParmValue(exint idx, UT_Vector3D &value) const
static void saveData(std::ostream &os, UT_Matrix4D v)
UT_StringHolder opNewgroupprefix(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
char * findChar(int c) const
Find first occurrance of character. Returns NULL upon failure.
Definition: UT_String.h:550
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
static void saveData(std::ostream &os, bool v)
int64 exint
Definition: SYS_Types.h:116
const OP_Node * node() const
Definition: SOP_NodeVerb.h:104
static void saveData(std::ostream &os, UT_Vector2D v)
const UT_StringHolder & getNewgroupprefix() const
double fpreal64
Definition: SYS_Types.h:192
void setParmValue(exint idx, const UT_Matrix4D &value)
bool opDocopyattrib(const SOP_NodeVerb::CookParms &cookparms) const
void getParmValue(exint idx, UT_StringHolder &value) const
virtual exint getNumParms() const
void getParmValue(exint idx, UT_Vector2D &value) const
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const UT_Matrix2D &value)
UT_Vector3T< fpreal64 > UT_Vector3D
GLboolean * data
Definition: glcorearb.h:130
void setViewportlod(Viewportlod val)
const UT_StringHolder & getCopyattrib() const
int int32
Definition: SYS_Types.h:35
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
T & y(void)
Definition: UT_Vector4.h:377
bool operator!=(const SOP_CopyTransformParms &src) const
void save(std::ostream &os) const
void getParmValue(exint idx, UT_Matrix4D &value) const
virtual void copyFrom(const SOP_NodeParms *src)
void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
UT_StringHolder opCopyattrib(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:111
static void loadData(UT_IStream &is, UT_Vector4I &v)
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:500
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:270
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setT(UT_Vector3D val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const UT_StringHolder & getSourceGroup() const
Viewportlod opViewportlod(const SOP_NodeVerb::CookParms &cookparms) const
virtual ParmType getParmType(exint fieldnum) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
void setSourceGroup(const UT_StringHolder &val)
void getParmValue(exint idx, fpreal &value) const
void getParmValue(exint idx, UT_Matrix3D &value) const
Pivot opPivot(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
GLuint GLfloat * val
Definition: glcorearb.h:1607
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:665
#define SOP_API
Definition: SOP_API.h:10
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:501
virtual void loadFromOpSubclass(const LoadParms &loadparms)
void setParmValue(exint idx, const UT_Vector3D &value)
T & x(void)
Definition: UT_Vector4.h:375
void setShear(UT_Vector3D val)
T & y(void)
Definition: UT_Vector2.h:287
void setParmValue(exint idx, const UT_Vector2D &value)
void setParmValue(exint idx, const exint &value)
GLboolean r
Definition: glcorearb.h:1221
void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
Rord opRord(const SOP_NodeVerb::CookParms &cookparms) const
T & w(void)
Definition: UT_Vector4.h:381
void setParmValue(exint idx, const PRM_DataItemHandle &value)
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)
void getParmValue(exint idx, PRM_DataItemHandle &value) const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:109
static void loadData(UT_IStream &is, UT_Vector2D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:88
void setParmValue(exint idx, const fpreal &value)
SYS_FORCE_INLINE bool isstring() const
void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1792