HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_SoftTransform.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_SoftTransformEnums
24 {
25  enum class Xord
26  {
27  SRT = 0,
28  STR,
29  RST,
30  RTS,
31  TSR,
32  TRS
33  };
34  enum class Rord
35  {
36  XYZ = 0,
37  XZY,
38  YXZ,
39  YZX,
40  ZXY,
41  ZYX
42  };
43  enum class Distmetric
44  {
45  CUSTOM = 0,
46  EDGES,
47  GLOBAL,
49  SURFACE
50  };
51  enum class Type
52  {
53  LINEAR = 0,
54  QUADRATIC,
55  CUBIC,
56  META
57  };
58  enum class Visualizefalloff
59  {
60  NEVER = 0,
61  ALWAYS,
62  STATE
63  };
64 }
65 
66 
68 {
69 public:
70  static int version() { return 1; }
71 
73  {
74  myGroup = ""_UTsh;
75  myXord = 0;
76  myRord = 0;
77  myT = UT_Vector3D(0,0,0);
78  myR = UT_Vector3D(0,0,0);
79  myS = UT_Vector3D(1,1,1);
80  myShear = UT_Vector3D(0,0,0);
81  myP = UT_Vector3D(0,0,0);
82  myPr = UT_Vector3D(0,0,0);
83  myDistmetric = 4;
84  myApplyrolloff = false;
85  myDistattr = ""_UTsh;
86  myRad = 0.5;
87  myType = 2;
88  myTandeg = UT_Vector2D(0,0);
89  myKernel = "wyvill"_UTsh;
90  myAttribs = "*"_UTsh;
91  myUpdatenmls = false;
92  myUpdateaffectednmls = true;
93  myVlength = true;
94  myVisualizefalloff = 2;
95  myLocalspace = false;
96  myUpvector = UT_Vector3D(0,1,0);
97 
98  }
99 
100  explicit SOP_SoftTransformParms(const SOP_SoftTransformParms &) = default;
102  SOP_SoftTransformParms(SOP_SoftTransformParms &&) noexcept = default;
103  SOP_SoftTransformParms &operator=(SOP_SoftTransformParms &&) noexcept = default;
104 
105  ~SOP_SoftTransformParms() override {}
106 
108  {
109  if (myGroup != src.myGroup) return false;
110  if (myXord != src.myXord) return false;
111  if (myRord != src.myRord) return false;
112  if (myT != src.myT) return false;
113  if (myR != src.myR) return false;
114  if (myS != src.myS) return false;
115  if (myShear != src.myShear) return false;
116  if (myP != src.myP) return false;
117  if (myPr != src.myPr) return false;
118  if (myDistmetric != src.myDistmetric) return false;
119  if (myApplyrolloff != src.myApplyrolloff) return false;
120  if (myDistattr != src.myDistattr) return false;
121  if (myRad != src.myRad) return false;
122  if (myType != src.myType) return false;
123  if (myTandeg != src.myTandeg) return false;
124  if (myKernel != src.myKernel) return false;
125  if (myAttribs != src.myAttribs) return false;
126  if (myUpdatenmls != src.myUpdatenmls) return false;
127  if (myUpdateaffectednmls != src.myUpdateaffectednmls) return false;
128  if (myVlength != src.myVlength) return false;
129  if (myVisualizefalloff != src.myVisualizefalloff) return false;
130  if (myLocalspace != src.myLocalspace) return false;
131  if (myUpvector != src.myUpvector) return false;
132 
133  return true;
134  }
136  {
137  return !operator==(src);
138  }
144 
145 
146 
147  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
148  {
149  myGroup = ""_UTsh;
150  if (true)
151  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
152  myXord = 0;
153  if (true)
154  graph->evalOpParm(myXord, nodeidx, "xOrd", time, 0);
155  myRord = 0;
156  if (true)
157  graph->evalOpParm(myRord, nodeidx, "rOrd", time, 0);
158  myT = UT_Vector3D(0,0,0);
159  if (true)
160  graph->evalOpParm(myT, nodeidx, "t", time, 0);
161  myR = UT_Vector3D(0,0,0);
162  if (true)
163  graph->evalOpParm(myR, nodeidx, "r", time, 0);
164  myS = UT_Vector3D(1,1,1);
165  if (true)
166  graph->evalOpParm(myS, nodeidx, "s", time, 0);
167  myShear = UT_Vector3D(0,0,0);
168  if (true)
169  graph->evalOpParm(myShear, nodeidx, "shear", time, 0);
170  myP = UT_Vector3D(0,0,0);
171  if (true)
172  graph->evalOpParm(myP, nodeidx, "p", time, 0);
173  myPr = UT_Vector3D(0,0,0);
174  if (true)
175  graph->evalOpParm(myPr, nodeidx, "pr", time, 0);
176  myDistmetric = 4;
177  if (true)
178  graph->evalOpParm(myDistmetric, nodeidx, "distmetric", time, 0);
179  myApplyrolloff = false;
180  if (true && ( (true&&!(((int64(getDistmetric())!=0)))) ) )
181  graph->evalOpParm(myApplyrolloff, nodeidx, "applyrolloff", time, 0);
182  myDistattr = ""_UTsh;
183  if (true && ( (true&&!(((int64(getDistmetric())!=0)))) ) )
184  graph->evalOpParm(myDistattr, nodeidx, "distattr", time, 0);
185  myRad = 0.5;
186  if (true && ( (true&&!(((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
187  graph->evalOpParm(myRad, nodeidx, "rad", time, 0);
188  myType = 2;
189  if (true && ( (true&&!(((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
190  graph->evalOpParm(myType, nodeidx, "type", time, 0);
191  myTandeg = UT_Vector2D(0,0);
192  if (true && ( (true&&!(((int64(getType())!=2))||((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
193  graph->evalOpParm(myTandeg, nodeidx, "tandeg", time, 0);
194  myKernel = "wyvill"_UTsh;
195  if (true && ( (true&&!(((int64(getType())!=3))||((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
196  graph->evalOpParm(myKernel, nodeidx, "kernel", time, 0);
197  myAttribs = "*"_UTsh;
198  if (true)
199  graph->evalOpParm(myAttribs, nodeidx, "attribs", time, 0);
200  myUpdatenmls = false;
201  if (true)
202  graph->evalOpParm(myUpdatenmls, nodeidx, "updatenmls", time, 0);
203  myUpdateaffectednmls = true;
204  if (true && ( (true&&!(((getUpdatenmls()==1)))) ) )
205  graph->evalOpParm(myUpdateaffectednmls, nodeidx, "updateaffectednmls", time, 0);
206  myVlength = true;
207  if (true && ( (true&&!(((getUpdatenmls()==1)))) ) )
208  graph->evalOpParm(myVlength, nodeidx, "vlength", time, 0);
209  myVisualizefalloff = 2;
210  if (true)
211  graph->evalOpParm(myVisualizefalloff, nodeidx, "visualizefalloff", time, 0);
212  myLocalspace = false;
213  if (true)
214  graph->evalOpParm(myLocalspace, nodeidx, "localspace", time, 0);
215  myUpvector = UT_Vector3D(0,1,0);
216  if (true && ( (true&&!(((getLocalspace()==0)))) ) )
217  graph->evalOpParm(myUpvector, nodeidx, "upvector", time, 0);
218 
219  }
220 
221 
222  void loadFromOpSubclass(const LoadParms &loadparms) override
223  {
224  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
225  }
226 
227 
228  void copyFrom(const OP_NodeParms *src) override
229  {
230  *this = *((const SOP_SoftTransformParms *)src);
231  }
232 
233  template <typename T>
234  void
235  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
236  {
237  if (idx.size() < 1)
238  return;
239  UT_ASSERT(idx.size() == instance.size()+1);
240  if (idx.size() != instance.size()+1)
241  return;
242  switch (idx[0])
243  {
244  case 0:
245  coerceValue(value, myGroup);
246  break;
247  case 1:
248  coerceValue(value, myXord);
249  break;
250  case 2:
251  coerceValue(value, myRord);
252  break;
253  case 3:
254  coerceValue(value, myT);
255  break;
256  case 4:
257  coerceValue(value, myR);
258  break;
259  case 5:
260  coerceValue(value, myS);
261  break;
262  case 6:
263  coerceValue(value, myShear);
264  break;
265  case 7:
266  coerceValue(value, myP);
267  break;
268  case 8:
269  coerceValue(value, myPr);
270  break;
271  case 9:
272  coerceValue(value, myDistmetric);
273  break;
274  case 10:
275  coerceValue(value, myApplyrolloff);
276  break;
277  case 11:
278  coerceValue(value, myDistattr);
279  break;
280  case 12:
281  coerceValue(value, myRad);
282  break;
283  case 13:
284  coerceValue(value, myType);
285  break;
286  case 14:
287  coerceValue(value, myTandeg);
288  break;
289  case 15:
290  coerceValue(value, myKernel);
291  break;
292  case 16:
293  coerceValue(value, myAttribs);
294  break;
295  case 17:
296  coerceValue(value, myUpdatenmls);
297  break;
298  case 18:
299  coerceValue(value, myUpdateaffectednmls);
300  break;
301  case 19:
302  coerceValue(value, myVlength);
303  break;
304  case 20:
305  coerceValue(value, myVisualizefalloff);
306  break;
307  case 21:
308  coerceValue(value, myLocalspace);
309  break;
310  case 22:
311  coerceValue(value, myUpvector);
312  break;
313 
314  }
315  }
316 
317  bool isParmColorRamp(exint idx) const override
318  {
319  switch (idx)
320  {
321 
322  }
323  return false;
324  }
325 
326  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
327  { doGetParmValue(idx, instance, value); }
328  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
329  { doGetParmValue(idx, instance, value); }
330  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
331  { doGetParmValue(idx, instance, value); }
332  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
333  { doGetParmValue(idx, instance, value); }
334  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
335  { doGetParmValue(idx, instance, value); }
336  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
337  { doGetParmValue(idx, instance, value); }
338  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
339  { doGetParmValue(idx, instance, value); }
340  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
341  { doGetParmValue(idx, instance, value); }
342  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
343  { doGetParmValue(idx, instance, value); }
344  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
345  { doGetParmValue(idx, instance, value); }
346  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
347  { doGetParmValue(idx, instance, value); }
348 
349  template <typename T>
350  void
351  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
352  {
353  if (idx.size() < 1)
354  return;
355  UT_ASSERT(idx.size() == instance.size()+1);
356  if (idx.size() != instance.size()+1)
357  return;
358  switch (idx[0])
359  {
360  case 0:
361  coerceValue(myGroup, ( ( value ) ));
362  break;
363  case 1:
364  coerceValue(myXord, clampMinValue(0, clampMaxValue(5, value ) ));
365  break;
366  case 2:
367  coerceValue(myRord, clampMinValue(0, clampMaxValue(5, value ) ));
368  break;
369  case 3:
370  coerceValue(myT, ( ( value ) ));
371  break;
372  case 4:
373  coerceValue(myR, ( ( value ) ));
374  break;
375  case 5:
376  coerceValue(myS, ( ( value ) ));
377  break;
378  case 6:
379  coerceValue(myShear, ( ( value ) ));
380  break;
381  case 7:
382  coerceValue(myP, ( ( value ) ));
383  break;
384  case 8:
385  coerceValue(myPr, ( ( value ) ));
386  break;
387  case 9:
388  coerceValue(myDistmetric, clampMinValue(0, clampMaxValue(4, value ) ));
389  break;
390  case 10:
391  coerceValue(myApplyrolloff, ( ( value ) ));
392  break;
393  case 11:
394  coerceValue(myDistattr, ( ( value ) ));
395  break;
396  case 12:
397  coerceValue(myRad, clampMinValue(0, ( value ) ));
398  break;
399  case 13:
400  coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
401  break;
402  case 14:
403  coerceValue(myTandeg, ( ( value ) ));
404  break;
405  case 15:
406  coerceValue(myKernel, ( ( value ) ));
407  break;
408  case 16:
409  coerceValue(myAttribs, ( ( value ) ));
410  break;
411  case 17:
412  coerceValue(myUpdatenmls, ( ( value ) ));
413  break;
414  case 18:
415  coerceValue(myUpdateaffectednmls, ( ( value ) ));
416  break;
417  case 19:
418  coerceValue(myVlength, ( ( value ) ));
419  break;
420  case 20:
421  coerceValue(myVisualizefalloff, clampMinValue(0, clampMaxValue(2, value ) ));
422  break;
423  case 21:
424  coerceValue(myLocalspace, ( ( value ) ));
425  break;
426  case 22:
427  coerceValue(myUpvector, ( ( value ) ));
428  break;
429 
430  }
431  }
432 
433  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
434  { doSetParmValue(idx, instance, value); }
435  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
436  { doSetParmValue(idx, instance, value); }
437  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
438  { doSetParmValue(idx, instance, value); }
439  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
440  { doSetParmValue(idx, instance, value); }
441  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
442  { doSetParmValue(idx, instance, value); }
443  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
444  { doSetParmValue(idx, instance, value); }
445  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
446  { doSetParmValue(idx, instance, value); }
447  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
448  { doSetParmValue(idx, instance, value); }
449  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
450  { doSetParmValue(idx, instance, value); }
451  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
452  { doSetParmValue(idx, instance, value); }
453  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
454  { doSetParmValue(idx, instance, value); }
455 
456  exint getNestNumParms(TempIndex idx) const override
457  {
458  if (idx.size() == 0)
459  return 23;
460  switch (idx[0])
461  {
462 
463  }
464  // Invalid
465  return 0;
466  }
467 
468  const char *getNestParmName(TempIndex fieldnum) const override
469  {
470  if (fieldnum.size() < 1)
471  return 0;
472  switch (fieldnum[0])
473  {
474  case 0:
475  return "group";
476  case 1:
477  return "xOrd";
478  case 2:
479  return "rOrd";
480  case 3:
481  return "t";
482  case 4:
483  return "r";
484  case 5:
485  return "s";
486  case 6:
487  return "shear";
488  case 7:
489  return "p";
490  case 8:
491  return "pr";
492  case 9:
493  return "distmetric";
494  case 10:
495  return "applyrolloff";
496  case 11:
497  return "distattr";
498  case 12:
499  return "rad";
500  case 13:
501  return "type";
502  case 14:
503  return "tandeg";
504  case 15:
505  return "kernel";
506  case 16:
507  return "attribs";
508  case 17:
509  return "updatenmls";
510  case 18:
511  return "updateaffectednmls";
512  case 19:
513  return "vlength";
514  case 20:
515  return "visualizefalloff";
516  case 21:
517  return "localspace";
518  case 22:
519  return "upvector";
520 
521  }
522  return 0;
523  }
524 
525  ParmType getNestParmType(TempIndex fieldnum) const override
526  {
527  if (fieldnum.size() < 1)
528  return PARM_UNSUPPORTED;
529  switch (fieldnum[0])
530  {
531  case 0:
532  return PARM_STRING;
533  case 1:
534  return PARM_INTEGER;
535  case 2:
536  return PARM_INTEGER;
537  case 3:
538  return PARM_VECTOR3;
539  case 4:
540  return PARM_VECTOR3;
541  case 5:
542  return PARM_VECTOR3;
543  case 6:
544  return PARM_VECTOR3;
545  case 7:
546  return PARM_VECTOR3;
547  case 8:
548  return PARM_VECTOR3;
549  case 9:
550  return PARM_INTEGER;
551  case 10:
552  return PARM_INTEGER;
553  case 11:
554  return PARM_STRING;
555  case 12:
556  return PARM_FLOAT;
557  case 13:
558  return PARM_INTEGER;
559  case 14:
560  return PARM_VECTOR2;
561  case 15:
562  return PARM_STRING;
563  case 16:
564  return PARM_STRING;
565  case 17:
566  return PARM_INTEGER;
567  case 18:
568  return PARM_INTEGER;
569  case 19:
570  return PARM_INTEGER;
571  case 20:
572  return PARM_INTEGER;
573  case 21:
574  return PARM_INTEGER;
575  case 22:
576  return PARM_VECTOR3;
577 
578  }
579  return PARM_UNSUPPORTED;
580  }
581 
582  // Boiler plate to load individual types.
583  static void loadData(UT_IStream &is, int64 &v)
584  { is.bread(&v, 1); }
585  static void loadData(UT_IStream &is, bool &v)
586  { int64 iv; is.bread(&iv, 1); v = iv; }
587  static void loadData(UT_IStream &is, fpreal64 &v)
588  { is.bread<fpreal64>(&v, 1); }
589  static void loadData(UT_IStream &is, UT_Vector2D &v)
590  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
591  static void loadData(UT_IStream &is, UT_Vector3D &v)
592  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
593  is.bread<fpreal64>(&v.z(), 1); }
594  static void loadData(UT_IStream &is, UT_Vector4D &v)
595  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
596  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
597  static void loadData(UT_IStream &is, UT_Matrix2D &v)
598  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
599  static void loadData(UT_IStream &is, UT_Matrix3D &v)
600  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
601  static void loadData(UT_IStream &is, UT_Matrix4D &v)
602  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
603  static void loadData(UT_IStream &is, UT_Vector2I &v)
604  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
605  static void loadData(UT_IStream &is, UT_Vector3I &v)
606  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
607  is.bread<int64>(&v.z(), 1); }
608  static void loadData(UT_IStream &is, UT_Vector4I &v)
609  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
610  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
612  { is.bread(v); }
614  { UT_StringHolder rampdata;
615  loadData(is, rampdata);
616  if (rampdata.isstring())
617  {
618  v.reset(new UT_Ramp());
619  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
620  v->load(istr);
621  }
622  else v.reset();
623  }
626  loadData(is, data);
627  if (data.isstring())
628  {
629  // Find the data type.
630  const char *colon = UT_StringWrap(data).findChar(':');
631  if (colon)
632  {
633  int typelen = colon - data.buffer();
635  type.strncpy(data.buffer(), typelen);
636  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
637 
638  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
639  }
640  }
641  else v.reset();
642  }
643 
644  static void saveData(std::ostream &os, int64 v)
645  { UTwrite(os, &v); }
646  static void saveData(std::ostream &os, bool v)
647  { int64 iv = v; UTwrite(os, &iv); }
648  static void saveData(std::ostream &os, fpreal64 v)
649  { UTwrite<fpreal64>(os, &v); }
650  static void saveData(std::ostream &os, UT_Vector2D v)
651  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
652  static void saveData(std::ostream &os, UT_Vector3D v)
653  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
654  UTwrite<fpreal64>(os, &v.z()); }
655  static void saveData(std::ostream &os, UT_Vector4D v)
656  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
657  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
658  static void saveData(std::ostream &os, UT_Matrix2D v)
660  static void saveData(std::ostream &os, UT_Matrix3D v)
662  static void saveData(std::ostream &os, UT_Matrix4D v)
664  static void saveData(std::ostream &os, UT_StringHolder s)
665  { UT_StringWrap(s).saveBinary(os); }
666  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
668  UT_OStringStream ostr;
669  if (s) s->save(ostr);
670  result = ostr.str();
671  saveData(os, result);
672  }
673  static void saveData(std::ostream &os, PRM_DataItemHandle s)
675  UT_OStringStream ostr;
676  if (s)
677  {
678  ostr << s->getDataTypeToken();
679  ostr << ":";
680  s->saveBinary(ostr);
681  }
682  result = ostr.str();
683  saveData(os, result);
684  }
685 
686 
687  void save(std::ostream &os) const
688  {
689  int32 v = version();
690  UTwrite(os, &v);
691  saveData(os, myGroup);
692  saveData(os, myXord);
693  saveData(os, myRord);
694  saveData(os, myT);
695  saveData(os, myR);
696  saveData(os, myS);
697  saveData(os, myShear);
698  saveData(os, myP);
699  saveData(os, myPr);
700  saveData(os, myDistmetric);
701  saveData(os, myApplyrolloff);
702  saveData(os, myDistattr);
703  saveData(os, myRad);
704  saveData(os, myType);
705  saveData(os, myTandeg);
706  saveData(os, myKernel);
707  saveData(os, myAttribs);
708  saveData(os, myUpdatenmls);
709  saveData(os, myUpdateaffectednmls);
710  saveData(os, myVlength);
711  saveData(os, myVisualizefalloff);
712  saveData(os, myLocalspace);
713  saveData(os, myUpvector);
714 
715  }
716 
717  bool load(UT_IStream &is)
718  {
719  int32 v;
720  is.bread(&v, 1);
721  if (version() != v)
722  {
723  // Fail incompatible versions
724  return false;
725  }
726  loadData(is, myGroup);
727  loadData(is, myXord);
728  loadData(is, myRord);
729  loadData(is, myT);
730  loadData(is, myR);
731  loadData(is, myS);
732  loadData(is, myShear);
733  loadData(is, myP);
734  loadData(is, myPr);
735  loadData(is, myDistmetric);
736  loadData(is, myApplyrolloff);
737  loadData(is, myDistattr);
738  loadData(is, myRad);
739  loadData(is, myType);
740  loadData(is, myTandeg);
741  loadData(is, myKernel);
742  loadData(is, myAttribs);
743  loadData(is, myUpdatenmls);
744  loadData(is, myUpdateaffectednmls);
745  loadData(is, myVlength);
746  loadData(is, myVisualizefalloff);
747  loadData(is, myLocalspace);
748  loadData(is, myUpvector);
749 
750  return true;
751  }
752 
753  const UT_StringHolder & getGroup() const { return myGroup; }
754  void setGroup(const UT_StringHolder & val) { myGroup = val; }
756  {
757  SOP_Node *thissop = cookparms.getNode();
758  if (!thissop) return getGroup();
760  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
761  return result;
762  }
763  Xord getXord() const { return Xord(myXord); }
764  void setXord(Xord val) { myXord = int64(val); }
765  Xord opXord(const SOP_NodeVerb::CookParms &cookparms) const
766  {
767  SOP_Node *thissop = cookparms.getNode();
768  if (!thissop) return getXord();
769  int64 result;
770  OP_Utils::evalOpParm(result, thissop, "xOrd", cookparms.getCookTime(), 0);
771  return Xord(result);
772  }
773  Rord getRord() const { return Rord(myRord); }
774  void setRord(Rord val) { myRord = int64(val); }
775  Rord opRord(const SOP_NodeVerb::CookParms &cookparms) const
776  {
777  SOP_Node *thissop = cookparms.getNode();
778  if (!thissop) return getRord();
779  int64 result;
780  OP_Utils::evalOpParm(result, thissop, "rOrd", cookparms.getCookTime(), 0);
781  return Rord(result);
782  }
783  UT_Vector3D getT() const { return myT; }
784  void setT(UT_Vector3D val) { myT = val; }
785  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
786  {
787  SOP_Node *thissop = cookparms.getNode();
788  if (!thissop) return getT();
790  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
791  return result;
792  }
793  UT_Vector3D getR() const { return myR; }
794  void setR(UT_Vector3D val) { myR = val; }
795  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
796  {
797  SOP_Node *thissop = cookparms.getNode();
798  if (!thissop) return getR();
800  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
801  return result;
802  }
803  UT_Vector3D getS() const { return myS; }
804  void setS(UT_Vector3D val) { myS = val; }
805  UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
806  {
807  SOP_Node *thissop = cookparms.getNode();
808  if (!thissop) return getS();
810  OP_Utils::evalOpParm(result, thissop, "s", cookparms.getCookTime(), 0);
811  return result;
812  }
813  UT_Vector3D getShear() const { return myShear; }
814  void setShear(UT_Vector3D val) { myShear = val; }
816  {
817  SOP_Node *thissop = cookparms.getNode();
818  if (!thissop) return getShear();
820  OP_Utils::evalOpParm(result, thissop, "shear", cookparms.getCookTime(), 0);
821  return result;
822  }
823  UT_Vector3D getP() const { return myP; }
824  void setP(UT_Vector3D val) { myP = val; }
825  UT_Vector3D opP(const SOP_NodeVerb::CookParms &cookparms) const
826  {
827  SOP_Node *thissop = cookparms.getNode();
828  if (!thissop) return getP();
830  OP_Utils::evalOpParm(result, thissop, "p", cookparms.getCookTime(), 0);
831  return result;
832  }
833  UT_Vector3D getPr() const { return myPr; }
834  void setPr(UT_Vector3D val) { myPr = val; }
835  UT_Vector3D opPr(const SOP_NodeVerb::CookParms &cookparms) const
836  {
837  SOP_Node *thissop = cookparms.getNode();
838  if (!thissop) return getPr();
840  OP_Utils::evalOpParm(result, thissop, "pr", cookparms.getCookTime(), 0);
841  return result;
842  }
843  Distmetric getDistmetric() const { return Distmetric(myDistmetric); }
844  void setDistmetric(Distmetric val) { myDistmetric = int64(val); }
846  {
847  SOP_Node *thissop = cookparms.getNode();
848  if (!thissop) return getDistmetric();
849  int64 result;
850  OP_Utils::evalOpParm(result, thissop, "distmetric", cookparms.getCookTime(), 0);
851  return Distmetric(result);
852  }
853  bool getApplyrolloff() const { return myApplyrolloff; }
854  void setApplyrolloff(bool val) { myApplyrolloff = val; }
855  bool opApplyrolloff(const SOP_NodeVerb::CookParms &cookparms) const
856  {
857  SOP_Node *thissop = cookparms.getNode();
858  if (!thissop) return getApplyrolloff();
859  bool result;
860  OP_Utils::evalOpParm(result, thissop, "applyrolloff", cookparms.getCookTime(), 0);
861  return result;
862  }
863  const UT_StringHolder & getDistattr() const { return myDistattr; }
864  void setDistattr(const UT_StringHolder & val) { myDistattr = val; }
866  {
867  SOP_Node *thissop = cookparms.getNode();
868  if (!thissop) return getDistattr();
870  OP_Utils::evalOpParm(result, thissop, "distattr", cookparms.getCookTime(), 0);
871  return result;
872  }
873  fpreal64 getRad() const { return myRad; }
874  void setRad(fpreal64 val) { myRad = val; }
875  fpreal64 opRad(const SOP_NodeVerb::CookParms &cookparms) const
876  {
877  SOP_Node *thissop = cookparms.getNode();
878  if (!thissop) return getRad();
880  OP_Utils::evalOpParm(result, thissop, "rad", cookparms.getCookTime(), 0);
881  return result;
882  }
883  Type getType() const { return Type(myType); }
884  void setType(Type val) { myType = int64(val); }
885  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
886  {
887  SOP_Node *thissop = cookparms.getNode();
888  if (!thissop) return getType();
889  int64 result;
890  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
891  return Type(result);
892  }
893  UT_Vector2D getTandeg() const { return myTandeg; }
894  void setTandeg(UT_Vector2D val) { myTandeg = val; }
896  {
897  SOP_Node *thissop = cookparms.getNode();
898  if (!thissop) return getTandeg();
900  OP_Utils::evalOpParm(result, thissop, "tandeg", cookparms.getCookTime(), 0);
901  return result;
902  }
903  const UT_StringHolder & getKernel() const { return myKernel; }
904  void setKernel(const UT_StringHolder & val) { myKernel = val; }
906  {
907  SOP_Node *thissop = cookparms.getNode();
908  if (!thissop) return getKernel();
910  OP_Utils::evalOpParm(result, thissop, "kernel", cookparms.getCookTime(), 0);
911  return result;
912  }
913  const UT_StringHolder & getAttribs() const { return myAttribs; }
914  void setAttribs(const UT_StringHolder & val) { myAttribs = val; }
916  {
917  SOP_Node *thissop = cookparms.getNode();
918  if (!thissop) return getAttribs();
920  OP_Utils::evalOpParm(result, thissop, "attribs", cookparms.getCookTime(), 0);
921  return result;
922  }
923  bool getUpdatenmls() const { return myUpdatenmls; }
924  void setUpdatenmls(bool val) { myUpdatenmls = val; }
925  bool opUpdatenmls(const SOP_NodeVerb::CookParms &cookparms) const
926  {
927  SOP_Node *thissop = cookparms.getNode();
928  if (!thissop) return getUpdatenmls();
929  bool result;
930  OP_Utils::evalOpParm(result, thissop, "updatenmls", cookparms.getCookTime(), 0);
931  return result;
932  }
933  bool getUpdateaffectednmls() const { return myUpdateaffectednmls; }
934  void setUpdateaffectednmls(bool val) { myUpdateaffectednmls = val; }
935  bool opUpdateaffectednmls(const SOP_NodeVerb::CookParms &cookparms) const
936  {
937  SOP_Node *thissop = cookparms.getNode();
938  if (!thissop) return getUpdateaffectednmls();
939  bool result;
940  OP_Utils::evalOpParm(result, thissop, "updateaffectednmls", cookparms.getCookTime(), 0);
941  return result;
942  }
943  bool getVlength() const { return myVlength; }
944  void setVlength(bool val) { myVlength = val; }
945  bool opVlength(const SOP_NodeVerb::CookParms &cookparms) const
946  {
947  SOP_Node *thissop = cookparms.getNode();
948  if (!thissop) return getVlength();
949  bool result;
950  OP_Utils::evalOpParm(result, thissop, "vlength", cookparms.getCookTime(), 0);
951  return result;
952  }
953  Visualizefalloff getVisualizefalloff() const { return Visualizefalloff(myVisualizefalloff); }
954  void setVisualizefalloff(Visualizefalloff val) { myVisualizefalloff = int64(val); }
956  {
957  SOP_Node *thissop = cookparms.getNode();
958  if (!thissop) return getVisualizefalloff();
959  int64 result;
960  OP_Utils::evalOpParm(result, thissop, "visualizefalloff", cookparms.getCookTime(), 0);
961  return Visualizefalloff(result);
962  }
963  bool getLocalspace() const { return myLocalspace; }
964  void setLocalspace(bool val) { myLocalspace = val; }
965  bool opLocalspace(const SOP_NodeVerb::CookParms &cookparms) const
966  {
967  SOP_Node *thissop = cookparms.getNode();
968  if (!thissop) return getLocalspace();
969  bool result;
970  OP_Utils::evalOpParm(result, thissop, "localspace", cookparms.getCookTime(), 0);
971  return result;
972  }
973  UT_Vector3D getUpvector() const { return myUpvector; }
974  void setUpvector(UT_Vector3D val) { myUpvector = val; }
976  {
977  SOP_Node *thissop = cookparms.getNode();
978  if (!thissop) return getUpvector();
980  OP_Utils::evalOpParm(result, thissop, "upvector", cookparms.getCookTime(), 0);
981  return result;
982  }
983 
984 private:
985  UT_StringHolder myGroup;
986  int64 myXord;
987  int64 myRord;
988  UT_Vector3D myT;
989  UT_Vector3D myR;
990  UT_Vector3D myS;
991  UT_Vector3D myShear;
992  UT_Vector3D myP;
993  UT_Vector3D myPr;
994  int64 myDistmetric;
995  bool myApplyrolloff;
996  UT_StringHolder myDistattr;
997  fpreal64 myRad;
998  int64 myType;
999  UT_Vector2D myTandeg;
1000  UT_StringHolder myKernel;
1001  UT_StringHolder myAttribs;
1002  bool myUpdatenmls;
1003  bool myUpdateaffectednmls;
1004  bool myVlength;
1005  int64 myVisualizefalloff;
1006  bool myLocalspace;
1007  UT_Vector3D myUpvector;
1008 
1009 };
UT_StringHolder opKernel(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_Vector3D opUpvector(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
int int32
Definition: SYS_Types.h:39
void setP(UT_Vector3D val)
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
Visualizefalloff getVisualizefalloff() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
Visualizefalloff opVisualizefalloff(const SOP_NodeVerb::CookParms &cookparms) const
bool opUpdateaffectednmls(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
UT_Vector3D getShear() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
exint bread(int32 *buffer, exint asize=1)
exint getNestNumParms(TempIndex idx) const override
GLboolean * data
Definition: glcorearb.h:131
void setDistattr(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
UT_Vector2T< fpreal64 > UT_Vector2D
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D getTandeg() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
const OP_Context & context() const
Definition: OP_NodeParms.h:97
const UT_StringHolder & getAttribs() const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
GLdouble s
Definition: glad.h:3009
void setAttribs(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
Rord opRord(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
void setShear(UT_Vector3D val)
**But if you need a result
Definition: thread.h:613
void setGroup(const UT_StringHolder &val)
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
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.
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
double fpreal64
Definition: SYS_Types.h:201
Distmetric opDistmetric(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
static void loadData(UT_IStream &is, UT_Vector4D &v)
void copyFrom(const OP_NodeParms *src) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
UT_Vector3D opShear(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
exint length() const
static void loadData(UT_IStream &is, fpreal64 &v)
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
const char * getNestParmName(TempIndex fieldnum) const override
Xord opXord(const SOP_NodeVerb::CookParms &cookparms) const
bool opVlength(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool isParmColorRamp(exint idx) const override
void setUpvector(UT_Vector3D val)
static void saveData(std::ostream &os, int64 v)
fpreal64 opRad(const SOP_NodeVerb::CookParms &cookparms) const
bool opApplyrolloff(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getDistattr() const
UT_Vector3D opS(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
long long int64
Definition: SYS_Types.h:116
UT_Vector3D opP(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
static void saveData(std::ostream &os, UT_StringHolder s)
UT_StringHolder opAttribs(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3T< fpreal64 > UT_Vector3D
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
UT_Vector2D opTandeg(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
bool opLocalspace(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const UT_StringHolder & getKernel() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
GT_API const UT_StringHolder version
void setTandeg(UT_Vector2D val)
void save(std::ostream &os) const
bool operator==(const SOP_SoftTransformParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setT(UT_Vector3D val)
void setPr(UT_Vector3D val)
static void loadData(UT_IStream &is, int64 &v)
ParmType getNestParmType(TempIndex fieldnum) const override
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
const UT_StringHolder & getGroup() const
void setDistmetric(Distmetric val)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
UT_StringHolder opDistattr(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
UT_Vector3D getUpvector() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
void setVisualizefalloff(Visualizefalloff val)
GLuint GLfloat * val
Definition: glcorearb.h:1608
static void loadData(UT_IStream &is, bool &v)
void setS(UT_Vector3D val)
#define SOP_API
Definition: SOP_API.h:10
static void saveData(std::ostream &os, UT_Matrix3D v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
void setR(UT_Vector3D val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
const char * findChar(int c) const
Definition: UT_String.h:1385
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
bool operator!=(const SOP_SoftTransformParms &src) const
void setKernel(const UT_StringHolder &val)
Distmetric getDistmetric() const
GLboolean r
Definition: glcorearb.h:1222
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
UT_Vector3D opPr(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
type
Definition: core.h:1059
bool opUpdatenmls(const SOP_NodeVerb::CookParms &cookparms) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, bool v)
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663