HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Relax.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 
25 {
26 public:
27  static int version() { return 1; }
28 
30  {
31  myGroup = ""_UTsh;
32  myInfluenceGroup = ""_UTsh;
33  mySurfaceGroup = ""_UTsh;
34  myMaxIterations = 10;
35  myRadius = 1;
36  myUseRadiusAttrib = true;
37  myRadiusAttrib = "pscale"_UTsh;
38  myRelaxIn3D = false;
39  myUseNormals = true;
40  myUseGeometricNormals = false;
41  myNormal = UT_Vector3D(0,1,0);
42  myUseMaxStepAttrib = false;
43  myMaxStepAttrib = "maxstep"_UTsh;
44  myUsePrimNumAttrib = false;
45  myPrimNumAttrib = "sourceprim"_UTsh;
46  myUsePrimUVWAttrib = false;
47  myPrimUVWAttrib = "sourceprimuv"_UTsh;
48 
49  }
50 
51  explicit SOP_RelaxParms(const SOP_RelaxParms &) = default;
52  SOP_RelaxParms &operator=(const SOP_RelaxParms &) = default;
53  SOP_RelaxParms(SOP_RelaxParms &&) noexcept = default;
54  SOP_RelaxParms &operator=(SOP_RelaxParms &&) noexcept = default;
55 
56  ~SOP_RelaxParms() override {}
57 
58  bool operator==(const SOP_RelaxParms &src) const
59  {
60  if (myGroup != src.myGroup) return false;
61  if (myInfluenceGroup != src.myInfluenceGroup) return false;
62  if (mySurfaceGroup != src.mySurfaceGroup) return false;
63  if (myMaxIterations != src.myMaxIterations) return false;
64  if (myRadius != src.myRadius) return false;
65  if (myUseRadiusAttrib != src.myUseRadiusAttrib) return false;
66  if (myRadiusAttrib != src.myRadiusAttrib) return false;
67  if (myRelaxIn3D != src.myRelaxIn3D) return false;
68  if (myUseNormals != src.myUseNormals) return false;
69  if (myUseGeometricNormals != src.myUseGeometricNormals) return false;
70  if (myNormal != src.myNormal) return false;
71  if (myUseMaxStepAttrib != src.myUseMaxStepAttrib) return false;
72  if (myMaxStepAttrib != src.myMaxStepAttrib) return false;
73  if (myUsePrimNumAttrib != src.myUsePrimNumAttrib) return false;
74  if (myPrimNumAttrib != src.myPrimNumAttrib) return false;
75  if (myUsePrimUVWAttrib != src.myUsePrimUVWAttrib) return false;
76  if (myPrimUVWAttrib != src.myPrimUVWAttrib) return false;
77 
78 
79  if (baseGetSignature() != src.baseGetSignature()) return false;
80 
81  return true;
82  }
83  bool operator!=(const SOP_RelaxParms &src) const
84  {
85  return !operator==(src);
86  }
87 
88 
89 
90  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
91  {
92  myGroup = ""_UTsh;
93  if (true)
94  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
95  myInfluenceGroup = ""_UTsh;
96  if (true)
97  graph->evalOpParm(myInfluenceGroup, nodeidx, "influencegroup", time, graph->isDirect()?nullptr:depnode);
98  mySurfaceGroup = ""_UTsh;
99  if (true && ( (true&&!((((graph->getInput(nodeidx,1)>=0)==0)))) ) )
100  graph->evalOpParm(mySurfaceGroup, nodeidx, "surfacegroup", time, graph->isDirect()?nullptr:depnode);
101  myMaxIterations = 10;
102  if (true)
103  graph->evalOpParm(myMaxIterations, nodeidx, "maxiterations", time, graph->isDirect()?nullptr:depnode);
104  myRadius = 1;
105  if (true)
106  graph->evalOpParm(myRadius, nodeidx, "radius", time, graph->isDirect()?nullptr:depnode);
107  myUseRadiusAttrib = true;
108  if (true)
109  graph->evalOpParm(myUseRadiusAttrib, nodeidx, "useradiusattrib", time, graph->isDirect()?nullptr:depnode);
110  myRadiusAttrib = "pscale"_UTsh;
111  if (true && ( (true&&!(((getUseRadiusAttrib()==0)))) ) )
112  graph->evalOpParm(myRadiusAttrib, nodeidx, "radiusattrib", time, graph->isDirect()?nullptr:depnode);
113  myRelaxIn3D = false;
114  if (true)
115  graph->evalOpParm(myRelaxIn3D, nodeidx, "relaxin3d", time, graph->isDirect()?nullptr:depnode);
116  myUseNormals = true;
117  if (true && ( (true&&!(((getRelaxIn3D()==1)))) ) )
118  graph->evalOpParm(myUseNormals, nodeidx, "usenormals", time, graph->isDirect()?nullptr:depnode);
119  myUseGeometricNormals = false;
120  if (true && ( (true&&!(((getRelaxIn3D()==1))||((getUseNormals()==0)))) ) )
121  graph->evalOpParm(myUseGeometricNormals, nodeidx, "usegeometricnormals", time, graph->isDirect()?nullptr:depnode);
122  myNormal = UT_Vector3D(0,1,0);
123  if (true && ( (true&&!(((getRelaxIn3D()==1))||((getUseNormals()==1)))) ) )
124  graph->evalOpParm(myNormal, nodeidx, "normal", time, graph->isDirect()?nullptr:depnode);
125  myUseMaxStepAttrib = false;
126  if (true)
127  graph->evalOpParm(myUseMaxStepAttrib, nodeidx, "usemaxstepattrib", time, graph->isDirect()?nullptr:depnode);
128  myMaxStepAttrib = "maxstep"_UTsh;
129  if (true && ( (true&&!(((getUseMaxStepAttrib()==0)))) ) )
130  graph->evalOpParm(myMaxStepAttrib, nodeidx, "maxstepattrib", time, graph->isDirect()?nullptr:depnode);
131  myUsePrimNumAttrib = false;
132  if (true && ( (true&&!((((graph->getInput(nodeidx,1)>=0)==0)))) ) )
133  graph->evalOpParm(myUsePrimNumAttrib, nodeidx, "useprimnumattrib", time, graph->isDirect()?nullptr:depnode);
134  myPrimNumAttrib = "sourceprim"_UTsh;
135  if (true && ( (true&&!((((graph->getInput(nodeidx,1)>=0)==0))||((getUsePrimNumAttrib()==0)))) ) )
136  graph->evalOpParm(myPrimNumAttrib, nodeidx, "primnumattrib", time, graph->isDirect()?nullptr:depnode);
137  myUsePrimUVWAttrib = false;
138  if (true && ( (true&&!((((graph->getInput(nodeidx,1)>=0)==0)))) ) )
139  graph->evalOpParm(myUsePrimUVWAttrib, nodeidx, "useprimuvwattrib", time, graph->isDirect()?nullptr:depnode);
140  myPrimUVWAttrib = "sourceprimuv"_UTsh;
141  if (true && ( (true&&!((((graph->getInput(nodeidx,1)>=0)==0))||((getUsePrimUVWAttrib()==0)))) ) )
142  graph->evalOpParm(myPrimUVWAttrib, nodeidx, "primuvwattrib", time, graph->isDirect()?nullptr:depnode);
143 
144  }
145 
146 
147  void loadFromOpSubclass(const LoadParms &loadparms) override
148  {
149  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
150  }
151 
152 
153  void copyFrom(const OP_NodeParms *src) override
154  {
155  *this = *((const SOP_RelaxParms *)src);
156  }
157 
158  template <typename T>
159  void
160  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
161  {
162  if (idx.size() < 1)
163  return;
164  UT_ASSERT(idx.size() == instance.size()+1);
165  if (idx.size() != instance.size()+1)
166  return;
167  switch (idx[0])
168  {
169  case 0:
170  coerceValue(value, myGroup);
171  break;
172  case 1:
173  coerceValue(value, myInfluenceGroup);
174  break;
175  case 2:
176  coerceValue(value, mySurfaceGroup);
177  break;
178  case 3:
179  coerceValue(value, myMaxIterations);
180  break;
181  case 4:
182  coerceValue(value, myRadius);
183  break;
184  case 5:
185  coerceValue(value, myUseRadiusAttrib);
186  break;
187  case 6:
188  coerceValue(value, myRadiusAttrib);
189  break;
190  case 7:
191  coerceValue(value, myRelaxIn3D);
192  break;
193  case 8:
194  coerceValue(value, myUseNormals);
195  break;
196  case 9:
197  coerceValue(value, myUseGeometricNormals);
198  break;
199  case 10:
200  coerceValue(value, myNormal);
201  break;
202  case 11:
203  coerceValue(value, myUseMaxStepAttrib);
204  break;
205  case 12:
206  coerceValue(value, myMaxStepAttrib);
207  break;
208  case 13:
209  coerceValue(value, myUsePrimNumAttrib);
210  break;
211  case 14:
212  coerceValue(value, myPrimNumAttrib);
213  break;
214  case 15:
215  coerceValue(value, myUsePrimUVWAttrib);
216  break;
217  case 16:
218  coerceValue(value, myPrimUVWAttrib);
219  break;
220 
221  }
222  }
223 
224  bool isParmColorRamp(exint idx) const override
225  {
226  switch (idx)
227  {
228 
229  }
230  return false;
231  }
232 
233  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
234  { doGetParmValue(idx, instance, value); }
235  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
236  { doGetParmValue(idx, instance, value); }
237  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
238  { doGetParmValue(idx, instance, value); }
239  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
240  { doGetParmValue(idx, instance, value); }
241  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
242  { doGetParmValue(idx, instance, value); }
243  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
244  { doGetParmValue(idx, instance, value); }
245  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
246  { doGetParmValue(idx, instance, value); }
247  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
248  { doGetParmValue(idx, instance, value); }
249  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
250  { doGetParmValue(idx, instance, value); }
251  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
252  { doGetParmValue(idx, instance, value); }
253  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
254  { doGetParmValue(idx, instance, value); }
255 
256  template <typename T>
257  void
258  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
259  {
260  if (idx.size() < 1)
261  return;
262  UT_ASSERT(idx.size() == instance.size()+1);
263  if (idx.size() != instance.size()+1)
264  return;
265  switch (idx[0])
266  {
267  case 0:
268  coerceValue(myGroup, ( ( value ) ));
269  break;
270  case 1:
271  coerceValue(myInfluenceGroup, ( ( value ) ));
272  break;
273  case 2:
274  coerceValue(mySurfaceGroup, ( ( value ) ));
275  break;
276  case 3:
277  coerceValue(myMaxIterations, clampMinValue(0, ( value ) ));
278  break;
279  case 4:
280  coerceValue(myRadius, ( ( value ) ));
281  break;
282  case 5:
283  coerceValue(myUseRadiusAttrib, ( ( value ) ));
284  break;
285  case 6:
286  coerceValue(myRadiusAttrib, ( ( value ) ));
287  break;
288  case 7:
289  coerceValue(myRelaxIn3D, ( ( value ) ));
290  break;
291  case 8:
292  coerceValue(myUseNormals, ( ( value ) ));
293  break;
294  case 9:
295  coerceValue(myUseGeometricNormals, ( ( value ) ));
296  break;
297  case 10:
298  coerceValue(myNormal, ( ( value ) ));
299  break;
300  case 11:
301  coerceValue(myUseMaxStepAttrib, ( ( value ) ));
302  break;
303  case 12:
304  coerceValue(myMaxStepAttrib, ( ( value ) ));
305  break;
306  case 13:
307  coerceValue(myUsePrimNumAttrib, ( ( value ) ));
308  break;
309  case 14:
310  coerceValue(myPrimNumAttrib, ( ( value ) ));
311  break;
312  case 15:
313  coerceValue(myUsePrimUVWAttrib, ( ( value ) ));
314  break;
315  case 16:
316  coerceValue(myPrimUVWAttrib, ( ( value ) ));
317  break;
318 
319  }
320  }
321 
322  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
323  { doSetParmValue(idx, instance, value); }
324  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
325  { doSetParmValue(idx, instance, value); }
326  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
327  { doSetParmValue(idx, instance, value); }
328  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
329  { doSetParmValue(idx, instance, value); }
330  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
331  { doSetParmValue(idx, instance, value); }
332  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
333  { doSetParmValue(idx, instance, value); }
334  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
335  { doSetParmValue(idx, instance, value); }
336  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
337  { doSetParmValue(idx, instance, value); }
338  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
339  { doSetParmValue(idx, instance, value); }
340  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
341  { doSetParmValue(idx, instance, value); }
342  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
343  { doSetParmValue(idx, instance, value); }
344 
345  exint getNestNumParms(TempIndex idx) const override
346  {
347  if (idx.size() == 0)
348  return 17;
349  switch (idx[0])
350  {
351 
352  }
353  // Invalid
354  return 0;
355  }
356 
357  const char *getNestParmName(TempIndex fieldnum) const override
358  {
359  if (fieldnum.size() < 1)
360  return 0;
361  switch (fieldnum[0])
362  {
363  case 0:
364  return "group";
365  case 1:
366  return "influencegroup";
367  case 2:
368  return "surfacegroup";
369  case 3:
370  return "maxiterations";
371  case 4:
372  return "radius";
373  case 5:
374  return "useradiusattrib";
375  case 6:
376  return "radiusattrib";
377  case 7:
378  return "relaxin3d";
379  case 8:
380  return "usenormals";
381  case 9:
382  return "usegeometricnormals";
383  case 10:
384  return "normal";
385  case 11:
386  return "usemaxstepattrib";
387  case 12:
388  return "maxstepattrib";
389  case 13:
390  return "useprimnumattrib";
391  case 14:
392  return "primnumattrib";
393  case 15:
394  return "useprimuvwattrib";
395  case 16:
396  return "primuvwattrib";
397 
398  }
399  return 0;
400  }
401 
402  ParmType getNestParmType(TempIndex fieldnum) const override
403  {
404  if (fieldnum.size() < 1)
405  return PARM_UNSUPPORTED;
406  switch (fieldnum[0])
407  {
408  case 0:
409  return PARM_STRING;
410  case 1:
411  return PARM_STRING;
412  case 2:
413  return PARM_STRING;
414  case 3:
415  return PARM_INTEGER;
416  case 4:
417  return PARM_FLOAT;
418  case 5:
419  return PARM_INTEGER;
420  case 6:
421  return PARM_STRING;
422  case 7:
423  return PARM_INTEGER;
424  case 8:
425  return PARM_INTEGER;
426  case 9:
427  return PARM_INTEGER;
428  case 10:
429  return PARM_VECTOR3;
430  case 11:
431  return PARM_INTEGER;
432  case 12:
433  return PARM_STRING;
434  case 13:
435  return PARM_INTEGER;
436  case 14:
437  return PARM_STRING;
438  case 15:
439  return PARM_INTEGER;
440  case 16:
441  return PARM_STRING;
442 
443  }
444  return PARM_UNSUPPORTED;
445  }
446 
447  // Boiler plate to load individual types.
448  static void loadData(UT_IStream &is, int64 &v)
449  { is.bread(&v, 1); }
450  static void loadData(UT_IStream &is, bool &v)
451  { int64 iv; is.bread(&iv, 1); v = iv; }
452  static void loadData(UT_IStream &is, fpreal64 &v)
453  { is.bread<fpreal64>(&v, 1); }
454  static void loadData(UT_IStream &is, UT_Vector2D &v)
455  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
456  static void loadData(UT_IStream &is, UT_Vector3D &v)
457  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
458  is.bread<fpreal64>(&v.z(), 1); }
459  static void loadData(UT_IStream &is, UT_Vector4D &v)
460  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
461  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
462  static void loadData(UT_IStream &is, UT_Matrix2D &v)
463  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
464  static void loadData(UT_IStream &is, UT_Matrix3D &v)
465  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
466  static void loadData(UT_IStream &is, UT_Matrix4D &v)
467  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
468  static void loadData(UT_IStream &is, UT_Vector2I &v)
469  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
470  static void loadData(UT_IStream &is, UT_Vector3I &v)
471  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
472  is.bread<int64>(&v.z(), 1); }
473  static void loadData(UT_IStream &is, UT_Vector4I &v)
474  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
475  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
477  { is.bread(v); }
479  { UT_StringHolder rampdata;
480  loadData(is, rampdata);
481  if (rampdata.isstring())
482  {
483  v.reset(new UT_Ramp());
484  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
485  v->load(istr);
486  }
487  else v.reset();
488  }
491  loadData(is, data);
492  if (data.isstring())
493  {
494  // Find the data type.
495  const char *colon = UT_StringWrap(data).findChar(':');
496  if (colon)
497  {
498  int typelen = colon - data.buffer();
500  type.strncpy(data.buffer(), typelen);
501  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
502 
503  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
504  }
505  }
506  else v.reset();
507  }
508 
509  static void saveData(std::ostream &os, int64 v)
510  { UTwrite(os, &v); }
511  static void saveData(std::ostream &os, bool v)
512  { int64 iv = v; UTwrite(os, &iv); }
513  static void saveData(std::ostream &os, fpreal64 v)
514  { UTwrite<fpreal64>(os, &v); }
515  static void saveData(std::ostream &os, UT_Vector2D v)
516  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
517  static void saveData(std::ostream &os, UT_Vector3D v)
518  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
519  UTwrite<fpreal64>(os, &v.z()); }
520  static void saveData(std::ostream &os, UT_Vector4D v)
521  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
522  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
523  static void saveData(std::ostream &os, UT_Matrix2D v)
525  static void saveData(std::ostream &os, UT_Matrix3D v)
527  static void saveData(std::ostream &os, UT_Matrix4D v)
529  static void saveData(std::ostream &os, UT_StringHolder s)
530  { UT_StringWrap(s).saveBinary(os); }
531  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
533  UT_OStringStream ostr;
534  if (s) s->save(ostr);
535  result = ostr.str();
536  saveData(os, result);
537  }
538  static void saveData(std::ostream &os, PRM_DataItemHandle s)
540  UT_OStringStream ostr;
541  if (s)
542  {
543  ostr << s->getDataTypeToken();
544  ostr << ":";
545  s->saveBinary(ostr);
546  }
547  result = ostr.str();
548  saveData(os, result);
549  }
550 
551 
552  void save(std::ostream &os) const
553  {
554  int32 v = version();
555  UTwrite(os, &v);
556  saveData(os, myGroup);
557  saveData(os, myInfluenceGroup);
558  saveData(os, mySurfaceGroup);
559  saveData(os, myMaxIterations);
560  saveData(os, myRadius);
561  saveData(os, myUseRadiusAttrib);
562  saveData(os, myRadiusAttrib);
563  saveData(os, myRelaxIn3D);
564  saveData(os, myUseNormals);
565  saveData(os, myUseGeometricNormals);
566  saveData(os, myNormal);
567  saveData(os, myUseMaxStepAttrib);
568  saveData(os, myMaxStepAttrib);
569  saveData(os, myUsePrimNumAttrib);
570  saveData(os, myPrimNumAttrib);
571  saveData(os, myUsePrimUVWAttrib);
572  saveData(os, myPrimUVWAttrib);
573 
574  }
575 
576  bool load(UT_IStream &is)
577  {
578  int32 v;
579  is.bread(&v, 1);
580  if (version() != v)
581  {
582  // Fail incompatible versions
583  return false;
584  }
585  loadData(is, myGroup);
586  loadData(is, myInfluenceGroup);
587  loadData(is, mySurfaceGroup);
588  loadData(is, myMaxIterations);
589  loadData(is, myRadius);
590  loadData(is, myUseRadiusAttrib);
591  loadData(is, myRadiusAttrib);
592  loadData(is, myRelaxIn3D);
593  loadData(is, myUseNormals);
594  loadData(is, myUseGeometricNormals);
595  loadData(is, myNormal);
596  loadData(is, myUseMaxStepAttrib);
597  loadData(is, myMaxStepAttrib);
598  loadData(is, myUsePrimNumAttrib);
599  loadData(is, myPrimNumAttrib);
600  loadData(is, myUsePrimUVWAttrib);
601  loadData(is, myPrimUVWAttrib);
602 
603  return true;
604  }
605 
606  const UT_StringHolder & getGroup() const { return myGroup; }
607  void setGroup(const UT_StringHolder & val) { myGroup = val; }
609  {
610  SOP_Node *thissop = cookparms.getNode();
611  if (!thissop) return getGroup();
613  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
614  return result;
615  }
616  const UT_StringHolder & getInfluenceGroup() const { return myInfluenceGroup; }
617  void setInfluenceGroup(const UT_StringHolder & val) { myInfluenceGroup = val; }
619  {
620  SOP_Node *thissop = cookparms.getNode();
621  if (!thissop) return getInfluenceGroup();
623  OP_Utils::evalOpParm(result, thissop, "influencegroup", cookparms.getCookTime(), 0);
624  return result;
625  }
626  const UT_StringHolder & getSurfaceGroup() const { return mySurfaceGroup; }
627  void setSurfaceGroup(const UT_StringHolder & val) { mySurfaceGroup = val; }
629  {
630  SOP_Node *thissop = cookparms.getNode();
631  if (!thissop) return getSurfaceGroup();
633  OP_Utils::evalOpParm(result, thissop, "surfacegroup", cookparms.getCookTime(), 0);
634  return result;
635  }
636  int64 getMaxIterations() const { return myMaxIterations; }
637  void setMaxIterations(int64 val) { myMaxIterations = val; }
639  {
640  SOP_Node *thissop = cookparms.getNode();
641  if (!thissop) return getMaxIterations();
642  int64 result;
643  OP_Utils::evalOpParm(result, thissop, "maxiterations", cookparms.getCookTime(), 0);
644  return result;
645  }
646  fpreal64 getRadius() const { return myRadius; }
647  void setRadius(fpreal64 val) { myRadius = val; }
648  fpreal64 opRadius(const SOP_NodeVerb::CookParms &cookparms) const
649  {
650  SOP_Node *thissop = cookparms.getNode();
651  if (!thissop) return getRadius();
653  OP_Utils::evalOpParm(result, thissop, "radius", cookparms.getCookTime(), 0);
654  return result;
655  }
656  bool getUseRadiusAttrib() const { return myUseRadiusAttrib; }
657  void setUseRadiusAttrib(bool val) { myUseRadiusAttrib = val; }
658  bool opUseRadiusAttrib(const SOP_NodeVerb::CookParms &cookparms) const
659  {
660  SOP_Node *thissop = cookparms.getNode();
661  if (!thissop) return getUseRadiusAttrib();
662  bool result;
663  OP_Utils::evalOpParm(result, thissop, "useradiusattrib", cookparms.getCookTime(), 0);
664  return result;
665  }
666  const UT_StringHolder & getRadiusAttrib() const { return myRadiusAttrib; }
667  void setRadiusAttrib(const UT_StringHolder & val) { myRadiusAttrib = val; }
669  {
670  SOP_Node *thissop = cookparms.getNode();
671  if (!thissop) return getRadiusAttrib();
673  OP_Utils::evalOpParm(result, thissop, "radiusattrib", cookparms.getCookTime(), 0);
674  return result;
675  }
676  bool getRelaxIn3D() const { return myRelaxIn3D; }
677  void setRelaxIn3D(bool val) { myRelaxIn3D = val; }
678  bool opRelaxIn3D(const SOP_NodeVerb::CookParms &cookparms) const
679  {
680  SOP_Node *thissop = cookparms.getNode();
681  if (!thissop) return getRelaxIn3D();
682  bool result;
683  OP_Utils::evalOpParm(result, thissop, "relaxin3d", cookparms.getCookTime(), 0);
684  return result;
685  }
686  bool getUseNormals() const { return myUseNormals; }
687  void setUseNormals(bool val) { myUseNormals = val; }
688  bool opUseNormals(const SOP_NodeVerb::CookParms &cookparms) const
689  {
690  SOP_Node *thissop = cookparms.getNode();
691  if (!thissop) return getUseNormals();
692  bool result;
693  OP_Utils::evalOpParm(result, thissop, "usenormals", cookparms.getCookTime(), 0);
694  return result;
695  }
696  bool getUseGeometricNormals() const { return myUseGeometricNormals; }
697  void setUseGeometricNormals(bool val) { myUseGeometricNormals = val; }
698  bool opUseGeometricNormals(const SOP_NodeVerb::CookParms &cookparms) const
699  {
700  SOP_Node *thissop = cookparms.getNode();
701  if (!thissop) return getUseGeometricNormals();
702  bool result;
703  OP_Utils::evalOpParm(result, thissop, "usegeometricnormals", cookparms.getCookTime(), 0);
704  return result;
705  }
706  UT_Vector3D getNormal() const { return myNormal; }
707  void setNormal(UT_Vector3D val) { myNormal = val; }
709  {
710  SOP_Node *thissop = cookparms.getNode();
711  if (!thissop) return getNormal();
713  OP_Utils::evalOpParm(result, thissop, "normal", cookparms.getCookTime(), 0);
714  return result;
715  }
716  bool getUseMaxStepAttrib() const { return myUseMaxStepAttrib; }
717  void setUseMaxStepAttrib(bool val) { myUseMaxStepAttrib = val; }
718  bool opUseMaxStepAttrib(const SOP_NodeVerb::CookParms &cookparms) const
719  {
720  SOP_Node *thissop = cookparms.getNode();
721  if (!thissop) return getUseMaxStepAttrib();
722  bool result;
723  OP_Utils::evalOpParm(result, thissop, "usemaxstepattrib", cookparms.getCookTime(), 0);
724  return result;
725  }
726  const UT_StringHolder & getMaxStepAttrib() const { return myMaxStepAttrib; }
727  void setMaxStepAttrib(const UT_StringHolder & val) { myMaxStepAttrib = val; }
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return getMaxStepAttrib();
733  OP_Utils::evalOpParm(result, thissop, "maxstepattrib", cookparms.getCookTime(), 0);
734  return result;
735  }
736  bool getUsePrimNumAttrib() const { return myUsePrimNumAttrib; }
737  void setUsePrimNumAttrib(bool val) { myUsePrimNumAttrib = val; }
738  bool opUsePrimNumAttrib(const SOP_NodeVerb::CookParms &cookparms) const
739  {
740  SOP_Node *thissop = cookparms.getNode();
741  if (!thissop) return getUsePrimNumAttrib();
742  bool result;
743  OP_Utils::evalOpParm(result, thissop, "useprimnumattrib", cookparms.getCookTime(), 0);
744  return result;
745  }
746  const UT_StringHolder & getPrimNumAttrib() const { return myPrimNumAttrib; }
747  void setPrimNumAttrib(const UT_StringHolder & val) { myPrimNumAttrib = val; }
749  {
750  SOP_Node *thissop = cookparms.getNode();
751  if (!thissop) return getPrimNumAttrib();
753  OP_Utils::evalOpParm(result, thissop, "primnumattrib", cookparms.getCookTime(), 0);
754  return result;
755  }
756  bool getUsePrimUVWAttrib() const { return myUsePrimUVWAttrib; }
757  void setUsePrimUVWAttrib(bool val) { myUsePrimUVWAttrib = val; }
758  bool opUsePrimUVWAttrib(const SOP_NodeVerb::CookParms &cookparms) const
759  {
760  SOP_Node *thissop = cookparms.getNode();
761  if (!thissop) return getUsePrimUVWAttrib();
762  bool result;
763  OP_Utils::evalOpParm(result, thissop, "useprimuvwattrib", cookparms.getCookTime(), 0);
764  return result;
765  }
766  const UT_StringHolder & getPrimUVWAttrib() const { return myPrimUVWAttrib; }
767  void setPrimUVWAttrib(const UT_StringHolder & val) { myPrimUVWAttrib = val; }
769  {
770  SOP_Node *thissop = cookparms.getNode();
771  if (!thissop) return getPrimUVWAttrib();
773  OP_Utils::evalOpParm(result, thissop, "primuvwattrib", cookparms.getCookTime(), 0);
774  return result;
775  }
776 
777 private:
778  UT_StringHolder myGroup;
779  UT_StringHolder myInfluenceGroup;
780  UT_StringHolder mySurfaceGroup;
781  int64 myMaxIterations;
782  fpreal64 myRadius;
783  bool myUseRadiusAttrib;
784  UT_StringHolder myRadiusAttrib;
785  bool myRelaxIn3D;
786  bool myUseNormals;
787  bool myUseGeometricNormals;
788  UT_Vector3D myNormal;
789  bool myUseMaxStepAttrib;
790  UT_StringHolder myMaxStepAttrib;
791  bool myUsePrimNumAttrib;
792  UT_StringHolder myPrimNumAttrib;
793  bool myUsePrimUVWAttrib;
794  UT_StringHolder myPrimUVWAttrib;
795 
796 };
virtual NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused=false) const =0
bool getUseMaxStepAttrib() const
type
Definition: core.h:556
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
int64 getMaxIterations() const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setRadius(fpreal64 val)
void copyFrom(const OP_NodeParms *src) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
bool getUsePrimUVWAttrib() const
const UT_StringHolder & getPrimNumAttrib() const
const UT_StringHolder & getPrimUVWAttrib() const
UT_Vector3D opNormal(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setPrimUVWAttrib(const UT_StringHolder &val)
UT_StringHolder opSurfaceGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
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
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
GLsizei const GLfloat * value
Definition: glcorearb.h:824
bool getRelaxIn3D() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_Vector3D v)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
static void loadData(UT_IStream &is, UT_Vector3I &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
void save(std::ostream &os) const
An output stream object that owns its own string buffer storage.
const UT_StringHolder & getSurfaceGroup() const
**But if you need a result
Definition: thread.h:622
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:317
static void saveData(std::ostream &os, UT_Vector2D v)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
UT_StringHolder opPrimUVWAttrib(const SOP_NodeVerb::CookParms &cookparms) const
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setRadiusAttrib(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_StringHolder s)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
bool opUsePrimUVWAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
exint getNestNumParms(TempIndex idx) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
static void loadData(UT_IStream &is, UT_StringHolder &v)
void loadFromOpSubclass(const LoadParms &loadparms) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool getUsePrimNumAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static int version()
bool opUseRadiusAttrib(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, int64 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
void setMaxStepAttrib(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setMaxIterations(int64 val)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
bool operator!=(const SOP_RelaxParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setPrimNumAttrib(const UT_StringHolder &val)
ParmType getNestParmType(TempIndex fieldnum) const override
fpreal64 getRadius() const
void setUseNormals(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_StringHolder opInfluenceGroup(const SOP_NodeVerb::CookParms &cookparms) const
bool opRelaxIn3D(const SOP_NodeVerb::CookParms &cookparms) const
long long int64
Definition: SYS_Types.h:116
UT_StringHolder opRadiusAttrib(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getRadiusAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setInfluenceGroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
UT_Vector3T< fpreal64 > UT_Vector3D
bool opUsePrimNumAttrib(const SOP_NodeVerb::CookParms &cookparms) const
bool getUseNormals() const
bool getUseRadiusAttrib() const
UT_StringHolder opPrimNumAttrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, fpreal64 v)
const char * getNestParmName(TempIndex fieldnum) const override
const UT_StringHolder & getInfluenceGroup() const
void setGroup(const UT_StringHolder &val)
bool operator==(const SOP_RelaxParms &src) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
bool load(UT_IStream &is)
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:310
void setUsePrimUVWAttrib(bool val)
const UT_StringHolder & getMaxStepAttrib() const
int64 opMaxIterations(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, bool v)
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
#define SOP_API
Definition: SOP_API.h:10
static void saveData(std::ostream &os, UT_Matrix2D v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
fpreal64 opRadius(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNormal(UT_Vector3D val)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
bool opUseNormals(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getGroup() const
bool opUseMaxStepAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
GLboolean r
Definition: glcorearb.h:1222
void setUseRadiusAttrib(bool val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setRelaxIn3D(bool val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setUseGeometricNormals(bool val)
bool getUseGeometricNormals() const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setUsePrimNumAttrib(bool val)
UT_Vector3D getNormal() const
bool opUseGeometricNormals(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
UT_StringHolder opMaxStepAttrib(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
void setSurfaceGroup(const UT_StringHolder &val)
void setUseMaxStepAttrib(bool val)
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