HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_GuideDeformCore.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_GuideDeformCoreEnums
24 {
25  enum class DeformMethod
26  {
27  GUIDEWEIGHTS = 0,
32  };
33 
35  getToken(DeformMethod enum_value)
36  {
37  using namespace UT::Literal;
38  switch (enum_value) {
39  case DeformMethod::GUIDEWEIGHTS: return "guideweights"_sh;
40  case DeformMethod::GUIDEINTERPOLATIONMESH: return "guideinterpolationmesh"_sh;
41  case DeformMethod::SURFACEDEFORM: return "surfacedeform"_sh;
42  case DeformMethod::POINTDEFORM: return "pointdeform"_sh;
43  case DeformMethod::GUIDESHAPEINTERPOLATION: return "guideshapeinterpolation"_sh;
44  default: UT_ASSERT(false); return ""_sh;
45  }
46  }
47 
48  enum class GsiMode
49  {
50  CAPTUREDEFORM = 0,
51  CAPTURE,
52  DEFORM
53  };
54 
56  getToken(GsiMode enum_value)
57  {
58  using namespace UT::Literal;
59  switch (enum_value) {
60  case GsiMode::CAPTUREDEFORM: return "capturedeform"_sh;
61  case GsiMode::CAPTURE: return "capture"_sh;
62  case GsiMode::DEFORM: return "deform"_sh;
63  default: UT_ASSERT(false); return ""_sh;
64  }
65  }
66 
67 }
68 
69 
71 {
72 public:
73  static int version() { return 1; }
74 
76  {
77  myGroup = ""_UTsh;
78  myDeformEnable = true;
79  myDeformMethod = 0;
80  myTreatskinassubd = false;
81  myUseOrientAttrib = false;
82  myOrientBlend = 0;
83  myRecompile = false;
84  myLeaveOnGPU = false;
85  myLockRoots = true;
86  myPreserveShapeEnable = false;
87  myPreserveShapeIterations = 100;
88  myStretchStiffness = 1.0;
89  myBendStiffness = 0.001;
90  myRefPosStrength = 0.0;
91  myClumpStiffness = 0.0;
92  myClumpDamping = 1.0;
93  myClumpEnable = false;
94  myClumpMaxNeighbors = 50;
95  myClumpMaxConstraints = 3;
96  myGwDeleteCaptAttrs = false;
97  myGsiMode = 0;
98  myGsiMaxCandidates = 32;
99  myGsiSearchRadius = 0.2;
100  myGsiNSamples = 20;
101  myGsiMinGuides = 1;
102  myGsiMaxGuides = 8;
103  myGsiBlurWidth = 0.1;
104  myGsiWeightThreshold = 0.1;
105  myGsiLengthPenaltyScale = 0.0;
106  myGsiDeleteCaptAttrs = false;
107 
108  }
109 
110  explicit SOP_GuideDeformCoreParms(const SOP_GuideDeformCoreParms &) = default;
112  SOP_GuideDeformCoreParms(SOP_GuideDeformCoreParms &&) noexcept = default;
113  SOP_GuideDeformCoreParms &operator=(SOP_GuideDeformCoreParms &&) noexcept = default;
114 
116 
118  {
119  if (myGroup != src.myGroup) return false;
120  if (myDeformEnable != src.myDeformEnable) return false;
121  if (myDeformMethod != src.myDeformMethod) return false;
122  if (myTreatskinassubd != src.myTreatskinassubd) return false;
123  if (myUseOrientAttrib != src.myUseOrientAttrib) return false;
124  if (myOrientBlend != src.myOrientBlend) return false;
125  if (myRecompile != src.myRecompile) return false;
126  if (myLeaveOnGPU != src.myLeaveOnGPU) return false;
127  if (myLockRoots != src.myLockRoots) return false;
128  if (myPreserveShapeEnable != src.myPreserveShapeEnable) return false;
129  if (myPreserveShapeIterations != src.myPreserveShapeIterations) return false;
130  if (myStretchStiffness != src.myStretchStiffness) return false;
131  if (myBendStiffness != src.myBendStiffness) return false;
132  if (myRefPosStrength != src.myRefPosStrength) return false;
133  if (myClumpStiffness != src.myClumpStiffness) return false;
134  if (myClumpDamping != src.myClumpDamping) return false;
135  if (myClumpEnable != src.myClumpEnable) return false;
136  if (myClumpMaxNeighbors != src.myClumpMaxNeighbors) return false;
137  if (myClumpMaxConstraints != src.myClumpMaxConstraints) return false;
138  if (myGwDeleteCaptAttrs != src.myGwDeleteCaptAttrs) return false;
139  if (myGsiMode != src.myGsiMode) return false;
140  if (myGsiMaxCandidates != src.myGsiMaxCandidates) return false;
141  if (myGsiSearchRadius != src.myGsiSearchRadius) return false;
142  if (myGsiNSamples != src.myGsiNSamples) return false;
143  if (myGsiMinGuides != src.myGsiMinGuides) return false;
144  if (myGsiMaxGuides != src.myGsiMaxGuides) return false;
145  if (myGsiBlurWidth != src.myGsiBlurWidth) return false;
146  if (myGsiWeightThreshold != src.myGsiWeightThreshold) return false;
147  if (myGsiLengthPenaltyScale != src.myGsiLengthPenaltyScale) return false;
148  if (myGsiDeleteCaptAttrs != src.myGsiDeleteCaptAttrs) return false;
149 
150 
151  if (baseGetSignature() != src.baseGetSignature()) return false;
152 
153  return true;
154  }
156  {
157  return !operator==(src);
158  }
161 
162 
163 
164  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
165  {
166  myGroup = ""_UTsh;
167  if (true)
168  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
169  myDeformEnable = true;
170  if (true)
171  graph->evalOpParm(myDeformEnable, nodeidx, "deformenable", time, graph->isDirect()?nullptr:depnode);
172  myDeformMethod = 0;
173  if (true)
174  graph->evalOpParm(myDeformMethod, nodeidx, "deformmethod", time, graph->isDirect()?nullptr:depnode);
175  myTreatskinassubd = false;
176  if (true && ( (true&&!(((int64(getDeformMethod())==3)))) ) )
177  graph->evalOpParm(myTreatskinassubd, nodeidx, "treatskinassubd", time, graph->isDirect()?nullptr:depnode);
178  myUseOrientAttrib = false;
179  if (true)
180  graph->evalOpParm(myUseOrientAttrib, nodeidx, "useorientattrib", time, graph->isDirect()?nullptr:depnode);
181  myOrientBlend = 0;
182  if (true && ( (true&&!(((int64(getDeformMethod())==3))||((int64(getDeformMethod())==2))||((getUseOrientAttrib()==0)))) ) )
183  graph->evalOpParm(myOrientBlend, nodeidx, "orientblend", time, graph->isDirect()?nullptr:depnode);
184  myRecompile = false;
185  if (true)
186  graph->evalOpParm(myRecompile, nodeidx, "recompile", time, graph->isDirect()?nullptr:depnode);
187  myLeaveOnGPU = false;
188  if (true)
189  graph->evalOpParm(myLeaveOnGPU, nodeidx, "leaveongpu", time, graph->isDirect()?nullptr:depnode);
190  myLockRoots = true;
191  if (true)
192  graph->evalOpParm(myLockRoots, nodeidx, "lockroots", time, graph->isDirect()?nullptr:depnode);
193  myPreserveShapeEnable = false;
194  if (true)
195  graph->evalOpParm(myPreserveShapeEnable, nodeidx, "preserveshape_enable", time, graph->isDirect()?nullptr:depnode);
196  myPreserveShapeIterations = 100;
197  if (true && ( (true&&!(((getPreserveShapeEnable()==0)))) ) )
198  graph->evalOpParm(myPreserveShapeIterations, nodeidx, "preserveshape_iterations", time, graph->isDirect()?nullptr:depnode);
199  myStretchStiffness = 1.0;
200  if (true && ( (true&&!(((getPreserveShapeEnable()==0)))) ) )
201  graph->evalOpParm(myStretchStiffness, nodeidx, "preserveshape_kstretch", time, graph->isDirect()?nullptr:depnode);
202  myBendStiffness = 0.001;
203  if (true && ( (true&&!(((getPreserveShapeEnable()==0)))) ) )
204  graph->evalOpParm(myBendStiffness, nodeidx, "preserveshape_kbend", time, graph->isDirect()?nullptr:depnode);
205  myRefPosStrength = 0.0;
206  if (true && ( (true&&!(((getPreserveShapeEnable()==0)))) ) )
207  graph->evalOpParm(myRefPosStrength, nodeidx, "preserveshape_refposstrength", time, graph->isDirect()?nullptr:depnode);
208  myClumpStiffness = 0.0;
209  if (true && ( (true&&!(((getPreserveShapeEnable()==0)))) ) )
210  graph->evalOpParm(myClumpStiffness, nodeidx, "preserveclumps_stiffness", time, graph->isDirect()?nullptr:depnode);
211  myClumpDamping = 1.0;
212  if (true && ( (true&&!(((getPreserveShapeEnable()==0)))) ) )
213  graph->evalOpParm(myClumpDamping, nodeidx, "preserveclumps_damping", time, graph->isDirect()?nullptr:depnode);
214  myClumpEnable = false;
215  if (true && ( (true&&!(((getPreserveShapeEnable()==0)))) ) )
216  graph->evalOpParm(myClumpEnable, nodeidx, "preserveclumps_enable", time, graph->isDirect()?nullptr:depnode);
217  myClumpMaxNeighbors = 50;
218  if (true && ( (true&&!(((getPreserveShapeEnable()==0))||((getClumpEnable()==0)))) ) )
219  graph->evalOpParm(myClumpMaxNeighbors, nodeidx, "preserveclumps_maxneighbors", time, graph->isDirect()?nullptr:depnode);
220  myClumpMaxConstraints = 3;
221  if (true && ( (true&&!(((getPreserveShapeEnable()==0))||((getClumpEnable()==0)))) ) )
222  graph->evalOpParm(myClumpMaxConstraints, nodeidx, "preserveclumps_maxconstraints", time, graph->isDirect()?nullptr:depnode);
223  myGwDeleteCaptAttrs = false;
224  if (true && ( (true&&!(((int64(getDeformMethod())!=0)))) ) )
225  graph->evalOpParm(myGwDeleteCaptAttrs, nodeidx, "gw_delcaptatr", time, graph->isDirect()?nullptr:depnode);
226  myGsiMode = 0;
227  if (true && ( (true&&!(((int64(getDeformMethod())!=4)))) ) )
228  graph->evalOpParm(myGsiMode, nodeidx, "gsi_mode", time, graph->isDirect()?nullptr:depnode);
229  myGsiMaxCandidates = 32;
230  if (true && ( (true&&!(((int64(getDeformMethod())!=4)))) ) )
231  graph->evalOpParm(myGsiMaxCandidates, nodeidx, "gsi_maxcandidates", time, graph->isDirect()?nullptr:depnode);
232  myGsiSearchRadius = 0.2;
233  if (true && ( (true&&!(((int64(getDeformMethod())!=4)))) ) )
234  graph->evalOpParm(myGsiSearchRadius, nodeidx, "gsi_searchradius", time, graph->isDirect()?nullptr:depnode);
235  myGsiNSamples = 20;
236  if (true && ( (true&&!(((int64(getDeformMethod())!=4)))) ) )
237  graph->evalOpParm(myGsiNSamples, nodeidx, "gsi_nsamples", time, graph->isDirect()?nullptr:depnode);
238  myGsiMinGuides = 1;
239  if (true && ( (true&&!(((int64(getDeformMethod())!=4)))) ) )
240  graph->evalOpParm(myGsiMinGuides, nodeidx, "gsi_minguides", time, graph->isDirect()?nullptr:depnode);
241  myGsiMaxGuides = 8;
242  if (true && ( (true&&!(((int64(getDeformMethod())!=4)))) ) )
243  graph->evalOpParm(myGsiMaxGuides, nodeidx, "gsi_maxguides", time, graph->isDirect()?nullptr:depnode);
244  myGsiBlurWidth = 0.1;
245  if (true && ( (true&&!(((int64(getDeformMethod())!=4)))) ) )
246  graph->evalOpParm(myGsiBlurWidth, nodeidx, "gsi_blurwidth", time, graph->isDirect()?nullptr:depnode);
247  myGsiWeightThreshold = 0.1;
248  if (true && ( (true&&!(((int64(getDeformMethod())!=4)))) ) )
249  graph->evalOpParm(myGsiWeightThreshold, nodeidx, "gsi_weightthreshold", time, graph->isDirect()?nullptr:depnode);
250  myGsiLengthPenaltyScale = 0.0;
251  if (true && ( (true&&!(((int64(getDeformMethod())!=4)))) ) )
252  graph->evalOpParm(myGsiLengthPenaltyScale, nodeidx, "gsi_lengthpenaltyscale", time, graph->isDirect()?nullptr:depnode);
253  myGsiDeleteCaptAttrs = false;
254  if (true && ( (true&&!(((int64(getDeformMethod())!=4))||((int64(getGsiMode())==1)))) ) )
255  graph->evalOpParm(myGsiDeleteCaptAttrs, nodeidx, "gsi_delcaptatr", time, graph->isDirect()?nullptr:depnode);
256 
257  }
258 
259 
260  void loadFromOpSubclass(const LoadParms &loadparms) override
261  {
262  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
263  }
264 
265 
266  void copyFrom(const OP_NodeParms *src) override
267  {
268  *this = *((const SOP_GuideDeformCoreParms *)src);
269  }
270 
271  template <typename T>
272  void
273  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
274  {
275  if (idx.size() < 1)
276  return;
277  UT_ASSERT(idx.size() == instance.size()+1);
278  if (idx.size() != instance.size()+1)
279  return;
280  switch (idx[0])
281  {
282  case 0:
283  coerceValue(value, myGroup);
284  break;
285  case 1:
286  coerceValue(value, myDeformEnable);
287  break;
288  case 2:
289  coerceValue(value, myDeformMethod);
290  break;
291  case 3:
292  coerceValue(value, myTreatskinassubd);
293  break;
294  case 4:
295  coerceValue(value, myUseOrientAttrib);
296  break;
297  case 5:
298  coerceValue(value, myOrientBlend);
299  break;
300  case 6:
301  coerceValue(value, myRecompile);
302  break;
303  case 7:
304  coerceValue(value, myLeaveOnGPU);
305  break;
306  case 8:
307  coerceValue(value, myLockRoots);
308  break;
309  case 9:
310  coerceValue(value, myPreserveShapeEnable);
311  break;
312  case 10:
313  coerceValue(value, myPreserveShapeIterations);
314  break;
315  case 11:
316  coerceValue(value, myStretchStiffness);
317  break;
318  case 12:
319  coerceValue(value, myBendStiffness);
320  break;
321  case 13:
322  coerceValue(value, myRefPosStrength);
323  break;
324  case 14:
325  coerceValue(value, myClumpStiffness);
326  break;
327  case 15:
328  coerceValue(value, myClumpDamping);
329  break;
330  case 16:
331  coerceValue(value, myClumpEnable);
332  break;
333  case 17:
334  coerceValue(value, myClumpMaxNeighbors);
335  break;
336  case 18:
337  coerceValue(value, myClumpMaxConstraints);
338  break;
339  case 19:
340  coerceValue(value, myGwDeleteCaptAttrs);
341  break;
342  case 20:
343  coerceValue(value, myGsiMode);
344  break;
345  case 21:
346  coerceValue(value, myGsiMaxCandidates);
347  break;
348  case 22:
349  coerceValue(value, myGsiSearchRadius);
350  break;
351  case 23:
352  coerceValue(value, myGsiNSamples);
353  break;
354  case 24:
355  coerceValue(value, myGsiMinGuides);
356  break;
357  case 25:
358  coerceValue(value, myGsiMaxGuides);
359  break;
360  case 26:
361  coerceValue(value, myGsiBlurWidth);
362  break;
363  case 27:
364  coerceValue(value, myGsiWeightThreshold);
365  break;
366  case 28:
367  coerceValue(value, myGsiLengthPenaltyScale);
368  break;
369  case 29:
370  coerceValue(value, myGsiDeleteCaptAttrs);
371  break;
372 
373  }
374  }
375 
376  bool isParmColorRamp(exint idx) const override
377  {
378  switch (idx)
379  {
380 
381  }
382  return false;
383  }
384 
385  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
386  { doGetParmValue(idx, instance, value); }
387  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
388  { doGetParmValue(idx, instance, value); }
389  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
390  { doGetParmValue(idx, instance, value); }
391  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
392  { doGetParmValue(idx, instance, value); }
393  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
394  { doGetParmValue(idx, instance, value); }
395  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
396  { doGetParmValue(idx, instance, value); }
397  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
398  { doGetParmValue(idx, instance, value); }
399  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
400  { doGetParmValue(idx, instance, value); }
401  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
402  { doGetParmValue(idx, instance, value); }
403  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
404  { doGetParmValue(idx, instance, value); }
405  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
406  { doGetParmValue(idx, instance, value); }
407 
408  template <typename T>
409  void
410  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
411  {
412  if (idx.size() < 1)
413  return;
414  UT_ASSERT(idx.size() == instance.size()+1);
415  if (idx.size() != instance.size()+1)
416  return;
417  switch (idx[0])
418  {
419  case 0:
420  coerceValue(myGroup, ( ( value ) ));
421  break;
422  case 1:
423  coerceValue(myDeformEnable, ( ( value ) ));
424  break;
425  case 2:
426  coerceValue(myDeformMethod, clampMinValue(0, clampMaxValue(4, value ) ));
427  break;
428  case 3:
429  coerceValue(myTreatskinassubd, ( ( value ) ));
430  break;
431  case 4:
432  coerceValue(myUseOrientAttrib, ( ( value ) ));
433  break;
434  case 5:
435  coerceValue(myOrientBlend, clampMinValue(0, clampMaxValue(1, value ) ));
436  break;
437  case 6:
438  coerceValue(myRecompile, ( ( value ) ));
439  break;
440  case 7:
441  coerceValue(myLeaveOnGPU, ( ( value ) ));
442  break;
443  case 8:
444  coerceValue(myLockRoots, ( ( value ) ));
445  break;
446  case 9:
447  coerceValue(myPreserveShapeEnable, ( ( value ) ));
448  break;
449  case 10:
450  coerceValue(myPreserveShapeIterations, clampMinValue(0, ( value ) ));
451  break;
452  case 11:
453  coerceValue(myStretchStiffness, ( ( value ) ));
454  break;
455  case 12:
456  coerceValue(myBendStiffness, ( ( value ) ));
457  break;
458  case 13:
459  coerceValue(myRefPosStrength, ( ( value ) ));
460  break;
461  case 14:
462  coerceValue(myClumpStiffness, ( ( value ) ));
463  break;
464  case 15:
465  coerceValue(myClumpDamping, ( ( value ) ));
466  break;
467  case 16:
468  coerceValue(myClumpEnable, ( ( value ) ));
469  break;
470  case 17:
471  coerceValue(myClumpMaxNeighbors, clampMinValue(1, ( value ) ));
472  break;
473  case 18:
474  coerceValue(myClumpMaxConstraints, clampMinValue(1, ( value ) ));
475  break;
476  case 19:
477  coerceValue(myGwDeleteCaptAttrs, ( ( value ) ));
478  break;
479  case 20:
480  coerceValue(myGsiMode, clampMinValue(0, clampMaxValue(2, value ) ));
481  break;
482  case 21:
483  coerceValue(myGsiMaxCandidates, clampMinValue(1, ( value ) ));
484  break;
485  case 22:
486  coerceValue(myGsiSearchRadius, clampMinValue(0, ( value ) ));
487  break;
488  case 23:
489  coerceValue(myGsiNSamples, clampMinValue(1, ( value ) ));
490  break;
491  case 24:
492  coerceValue(myGsiMinGuides, clampMinValue(1, ( value ) ));
493  break;
494  case 25:
495  coerceValue(myGsiMaxGuides, clampMinValue(1, ( value ) ));
496  break;
497  case 26:
498  coerceValue(myGsiBlurWidth, ( ( value ) ));
499  break;
500  case 27:
501  coerceValue(myGsiWeightThreshold, clampMinValue(0, clampMaxValue(1, value ) ));
502  break;
503  case 28:
504  coerceValue(myGsiLengthPenaltyScale, clampMinValue(0, ( value ) ));
505  break;
506  case 29:
507  coerceValue(myGsiDeleteCaptAttrs, ( ( value ) ));
508  break;
509 
510  }
511  }
512 
513  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
514  { doSetParmValue(idx, instance, value); }
515  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
516  { doSetParmValue(idx, instance, value); }
517  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
518  { doSetParmValue(idx, instance, value); }
519  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
520  { doSetParmValue(idx, instance, value); }
521  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
522  { doSetParmValue(idx, instance, value); }
523  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
524  { doSetParmValue(idx, instance, value); }
525  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
526  { doSetParmValue(idx, instance, value); }
527  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
528  { doSetParmValue(idx, instance, value); }
529  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
530  { doSetParmValue(idx, instance, value); }
531  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
532  { doSetParmValue(idx, instance, value); }
533  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
534  { doSetParmValue(idx, instance, value); }
535 
536  exint getNestNumParms(TempIndex idx) const override
537  {
538  if (idx.size() == 0)
539  return 30;
540  switch (idx[0])
541  {
542 
543  }
544  // Invalid
545  return 0;
546  }
547 
548  const char *getNestParmName(TempIndex fieldnum) const override
549  {
550  if (fieldnum.size() < 1)
551  return 0;
552  switch (fieldnum[0])
553  {
554  case 0:
555  return "group";
556  case 1:
557  return "deformenable";
558  case 2:
559  return "deformmethod";
560  case 3:
561  return "treatskinassubd";
562  case 4:
563  return "useorientattrib";
564  case 5:
565  return "orientblend";
566  case 6:
567  return "recompile";
568  case 7:
569  return "leaveongpu";
570  case 8:
571  return "lockroots";
572  case 9:
573  return "preserveshape_enable";
574  case 10:
575  return "preserveshape_iterations";
576  case 11:
577  return "preserveshape_kstretch";
578  case 12:
579  return "preserveshape_kbend";
580  case 13:
581  return "preserveshape_refposstrength";
582  case 14:
583  return "preserveclumps_stiffness";
584  case 15:
585  return "preserveclumps_damping";
586  case 16:
587  return "preserveclumps_enable";
588  case 17:
589  return "preserveclumps_maxneighbors";
590  case 18:
591  return "preserveclumps_maxconstraints";
592  case 19:
593  return "gw_delcaptatr";
594  case 20:
595  return "gsi_mode";
596  case 21:
597  return "gsi_maxcandidates";
598  case 22:
599  return "gsi_searchradius";
600  case 23:
601  return "gsi_nsamples";
602  case 24:
603  return "gsi_minguides";
604  case 25:
605  return "gsi_maxguides";
606  case 26:
607  return "gsi_blurwidth";
608  case 27:
609  return "gsi_weightthreshold";
610  case 28:
611  return "gsi_lengthpenaltyscale";
612  case 29:
613  return "gsi_delcaptatr";
614 
615  }
616  return 0;
617  }
618 
619  ParmType getNestParmType(TempIndex fieldnum) const override
620  {
621  if (fieldnum.size() < 1)
622  return PARM_UNSUPPORTED;
623  switch (fieldnum[0])
624  {
625  case 0:
626  return PARM_STRING;
627  case 1:
628  return PARM_INTEGER;
629  case 2:
630  return PARM_INTEGER;
631  case 3:
632  return PARM_INTEGER;
633  case 4:
634  return PARM_INTEGER;
635  case 5:
636  return PARM_FLOAT;
637  case 6:
638  return PARM_INTEGER;
639  case 7:
640  return PARM_INTEGER;
641  case 8:
642  return PARM_INTEGER;
643  case 9:
644  return PARM_INTEGER;
645  case 10:
646  return PARM_INTEGER;
647  case 11:
648  return PARM_FLOAT;
649  case 12:
650  return PARM_FLOAT;
651  case 13:
652  return PARM_FLOAT;
653  case 14:
654  return PARM_FLOAT;
655  case 15:
656  return PARM_FLOAT;
657  case 16:
658  return PARM_INTEGER;
659  case 17:
660  return PARM_INTEGER;
661  case 18:
662  return PARM_INTEGER;
663  case 19:
664  return PARM_INTEGER;
665  case 20:
666  return PARM_INTEGER;
667  case 21:
668  return PARM_INTEGER;
669  case 22:
670  return PARM_FLOAT;
671  case 23:
672  return PARM_INTEGER;
673  case 24:
674  return PARM_INTEGER;
675  case 25:
676  return PARM_INTEGER;
677  case 26:
678  return PARM_FLOAT;
679  case 27:
680  return PARM_FLOAT;
681  case 28:
682  return PARM_FLOAT;
683  case 29:
684  return PARM_INTEGER;
685 
686  }
687  return PARM_UNSUPPORTED;
688  }
689 
690  // Boiler plate to load individual types.
691  static void loadData(UT_IStream &is, int64 &v)
692  { is.bread(&v, 1); }
693  static void loadData(UT_IStream &is, bool &v)
694  { int64 iv; is.bread(&iv, 1); v = iv; }
695  static void loadData(UT_IStream &is, fpreal64 &v)
696  { is.bread<fpreal64>(&v, 1); }
697  static void loadData(UT_IStream &is, UT_Vector2D &v)
698  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
699  static void loadData(UT_IStream &is, UT_Vector3D &v)
700  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
701  is.bread<fpreal64>(&v.z(), 1); }
702  static void loadData(UT_IStream &is, UT_Vector4D &v)
703  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
704  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
705  static void loadData(UT_IStream &is, UT_Matrix2D &v)
706  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
707  static void loadData(UT_IStream &is, UT_Matrix3D &v)
708  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
709  static void loadData(UT_IStream &is, UT_Matrix4D &v)
710  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
711  static void loadData(UT_IStream &is, UT_Vector2I &v)
712  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
713  static void loadData(UT_IStream &is, UT_Vector3I &v)
714  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
715  is.bread<int64>(&v.z(), 1); }
716  static void loadData(UT_IStream &is, UT_Vector4I &v)
717  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
718  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
720  { is.bread(v); }
722  { UT_StringHolder rampdata;
723  loadData(is, rampdata);
724  if (rampdata.isstring())
725  {
726  v.reset(new UT_Ramp());
727  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
728  v->load(istr);
729  }
730  else v.reset();
731  }
734  loadData(is, data);
735  if (data.isstring())
736  {
737  // Find the data type.
738  const char *colon = UT_StringWrap(data).findChar(':');
739  if (colon)
740  {
741  int typelen = colon - data.buffer();
743  type.strncpy(data.buffer(), typelen);
744  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
745 
746  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
747  }
748  }
749  else v.reset();
750  }
751 
752  static void saveData(std::ostream &os, int64 v)
753  { UTwrite(os, &v); }
754  static void saveData(std::ostream &os, bool v)
755  { int64 iv = v; UTwrite(os, &iv); }
756  static void saveData(std::ostream &os, fpreal64 v)
757  { UTwrite<fpreal64>(os, &v); }
758  static void saveData(std::ostream &os, UT_Vector2D v)
759  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
760  static void saveData(std::ostream &os, UT_Vector3D v)
761  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
762  UTwrite<fpreal64>(os, &v.z()); }
763  static void saveData(std::ostream &os, UT_Vector4D v)
764  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
765  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
766  static void saveData(std::ostream &os, UT_Matrix2D v)
768  static void saveData(std::ostream &os, UT_Matrix3D v)
770  static void saveData(std::ostream &os, UT_Matrix4D v)
772  static void saveData(std::ostream &os, UT_StringHolder s)
773  { UT_StringWrap(s).saveBinary(os); }
774  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
776  UT_OStringStream ostr;
777  if (s) s->save(ostr);
778  result = ostr.str();
779  saveData(os, result);
780  }
781  static void saveData(std::ostream &os, PRM_DataItemHandle s)
783  UT_OStringStream ostr;
784  if (s)
785  {
786  ostr << s->getDataTypeToken();
787  ostr << ":";
788  s->saveBinary(ostr);
789  }
790  result = ostr.str();
791  saveData(os, result);
792  }
793 
794 
795  void save(std::ostream &os) const
796  {
797  int32 v = version();
798  UTwrite(os, &v);
799  saveData(os, myGroup);
800  saveData(os, myDeformEnable);
801  saveData(os, myDeformMethod);
802  saveData(os, myTreatskinassubd);
803  saveData(os, myUseOrientAttrib);
804  saveData(os, myOrientBlend);
805  saveData(os, myRecompile);
806  saveData(os, myLeaveOnGPU);
807  saveData(os, myLockRoots);
808  saveData(os, myPreserveShapeEnable);
809  saveData(os, myPreserveShapeIterations);
810  saveData(os, myStretchStiffness);
811  saveData(os, myBendStiffness);
812  saveData(os, myRefPosStrength);
813  saveData(os, myClumpStiffness);
814  saveData(os, myClumpDamping);
815  saveData(os, myClumpEnable);
816  saveData(os, myClumpMaxNeighbors);
817  saveData(os, myClumpMaxConstraints);
818  saveData(os, myGwDeleteCaptAttrs);
819  saveData(os, myGsiMode);
820  saveData(os, myGsiMaxCandidates);
821  saveData(os, myGsiSearchRadius);
822  saveData(os, myGsiNSamples);
823  saveData(os, myGsiMinGuides);
824  saveData(os, myGsiMaxGuides);
825  saveData(os, myGsiBlurWidth);
826  saveData(os, myGsiWeightThreshold);
827  saveData(os, myGsiLengthPenaltyScale);
828  saveData(os, myGsiDeleteCaptAttrs);
829 
830  }
831 
832  bool load(UT_IStream &is)
833  {
834  int32 v;
835  is.bread(&v, 1);
836  if (version() != v)
837  {
838  // Fail incompatible versions
839  return false;
840  }
841  loadData(is, myGroup);
842  loadData(is, myDeformEnable);
843  loadData(is, myDeformMethod);
844  loadData(is, myTreatskinassubd);
845  loadData(is, myUseOrientAttrib);
846  loadData(is, myOrientBlend);
847  loadData(is, myRecompile);
848  loadData(is, myLeaveOnGPU);
849  loadData(is, myLockRoots);
850  loadData(is, myPreserveShapeEnable);
851  loadData(is, myPreserveShapeIterations);
852  loadData(is, myStretchStiffness);
853  loadData(is, myBendStiffness);
854  loadData(is, myRefPosStrength);
855  loadData(is, myClumpStiffness);
856  loadData(is, myClumpDamping);
857  loadData(is, myClumpEnable);
858  loadData(is, myClumpMaxNeighbors);
859  loadData(is, myClumpMaxConstraints);
860  loadData(is, myGwDeleteCaptAttrs);
861  loadData(is, myGsiMode);
862  loadData(is, myGsiMaxCandidates);
863  loadData(is, myGsiSearchRadius);
864  loadData(is, myGsiNSamples);
865  loadData(is, myGsiMinGuides);
866  loadData(is, myGsiMaxGuides);
867  loadData(is, myGsiBlurWidth);
868  loadData(is, myGsiWeightThreshold);
869  loadData(is, myGsiLengthPenaltyScale);
870  loadData(is, myGsiDeleteCaptAttrs);
871 
872  return true;
873  }
874 
875  const UT_StringHolder & getGroup() const { return myGroup; }
876  void setGroup(const UT_StringHolder & val) { myGroup = val; }
878  {
879  SOP_Node *thissop = cookparms.getNode();
880  if (!thissop) return getGroup();
882  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
883  return result;
884  }
885  bool getDeformEnable() const { return myDeformEnable; }
886  void setDeformEnable(bool val) { myDeformEnable = val; }
887  bool opDeformEnable(const SOP_NodeVerb::CookParms &cookparms) const
888  {
889  SOP_Node *thissop = cookparms.getNode();
890  if (!thissop) return getDeformEnable();
891  bool result;
892  OP_Utils::evalOpParm(result, thissop, "deformenable", cookparms.getCookTime(), 0);
893  return result;
894  }
895  DeformMethod getDeformMethod() const { return DeformMethod(myDeformMethod); }
896  void setDeformMethod(DeformMethod val) { myDeformMethod = int64(val); }
898  {
899  SOP_Node *thissop = cookparms.getNode();
900  if (!thissop) return getDeformMethod();
901  int64 result;
902  OP_Utils::evalOpParm(result, thissop, "deformmethod", cookparms.getCookTime(), 0);
903  return DeformMethod(result);
904  }
905  bool getTreatskinassubd() const { return myTreatskinassubd; }
906  void setTreatskinassubd(bool val) { myTreatskinassubd = val; }
907  bool opTreatskinassubd(const SOP_NodeVerb::CookParms &cookparms) const
908  {
909  SOP_Node *thissop = cookparms.getNode();
910  if (!thissop) return getTreatskinassubd();
911  bool result;
912  OP_Utils::evalOpParm(result, thissop, "treatskinassubd", cookparms.getCookTime(), 0);
913  return result;
914  }
915  bool getUseOrientAttrib() const { return myUseOrientAttrib; }
916  void setUseOrientAttrib(bool val) { myUseOrientAttrib = val; }
917  bool opUseOrientAttrib(const SOP_NodeVerb::CookParms &cookparms) const
918  {
919  SOP_Node *thissop = cookparms.getNode();
920  if (!thissop) return getUseOrientAttrib();
921  bool result;
922  OP_Utils::evalOpParm(result, thissop, "useorientattrib", cookparms.getCookTime(), 0);
923  return result;
924  }
925  fpreal64 getOrientBlend() const { return myOrientBlend; }
926  void setOrientBlend(fpreal64 val) { myOrientBlend = val; }
928  {
929  SOP_Node *thissop = cookparms.getNode();
930  if (!thissop) return getOrientBlend();
932  OP_Utils::evalOpParm(result, thissop, "orientblend", cookparms.getCookTime(), 0);
933  return result;
934  }
935  bool getRecompile() const { return myRecompile; }
936  void setRecompile(bool val) { myRecompile = val; }
937  bool opRecompile(const SOP_NodeVerb::CookParms &cookparms) const
938  {
939  SOP_Node *thissop = cookparms.getNode();
940  if (!thissop) return getRecompile();
941  bool result;
942  OP_Utils::evalOpParm(result, thissop, "recompile", cookparms.getCookTime(), 0);
943  return result;
944  }
945  bool getLeaveOnGPU() const { return myLeaveOnGPU; }
946  void setLeaveOnGPU(bool val) { myLeaveOnGPU = val; }
947  bool opLeaveOnGPU(const SOP_NodeVerb::CookParms &cookparms) const
948  {
949  SOP_Node *thissop = cookparms.getNode();
950  if (!thissop) return getLeaveOnGPU();
951  bool result;
952  OP_Utils::evalOpParm(result, thissop, "leaveongpu", cookparms.getCookTime(), 0);
953  return result;
954  }
955  bool getLockRoots() const { return myLockRoots; }
956  void setLockRoots(bool val) { myLockRoots = val; }
957  bool opLockRoots(const SOP_NodeVerb::CookParms &cookparms) const
958  {
959  SOP_Node *thissop = cookparms.getNode();
960  if (!thissop) return getLockRoots();
961  bool result;
962  OP_Utils::evalOpParm(result, thissop, "lockroots", cookparms.getCookTime(), 0);
963  return result;
964  }
965  bool getPreserveShapeEnable() const { return myPreserveShapeEnable; }
966  void setPreserveShapeEnable(bool val) { myPreserveShapeEnable = val; }
967  bool opPreserveShapeEnable(const SOP_NodeVerb::CookParms &cookparms) const
968  {
969  SOP_Node *thissop = cookparms.getNode();
970  if (!thissop) return getPreserveShapeEnable();
971  bool result;
972  OP_Utils::evalOpParm(result, thissop, "preserveshape_enable", cookparms.getCookTime(), 0);
973  return result;
974  }
975  int64 getPreserveShapeIterations() const { return myPreserveShapeIterations; }
976  void setPreserveShapeIterations(int64 val) { myPreserveShapeIterations = val; }
978  {
979  SOP_Node *thissop = cookparms.getNode();
980  if (!thissop) return getPreserveShapeIterations();
981  int64 result;
982  OP_Utils::evalOpParm(result, thissop, "preserveshape_iterations", cookparms.getCookTime(), 0);
983  return result;
984  }
985  fpreal64 getStretchStiffness() const { return myStretchStiffness; }
986  void setStretchStiffness(fpreal64 val) { myStretchStiffness = val; }
988  {
989  SOP_Node *thissop = cookparms.getNode();
990  if (!thissop) return getStretchStiffness();
992  OP_Utils::evalOpParm(result, thissop, "preserveshape_kstretch", cookparms.getCookTime(), 0);
993  return result;
994  }
995  fpreal64 getBendStiffness() const { return myBendStiffness; }
996  void setBendStiffness(fpreal64 val) { myBendStiffness = val; }
998  {
999  SOP_Node *thissop = cookparms.getNode();
1000  if (!thissop) return getBendStiffness();
1001  fpreal64 result;
1002  OP_Utils::evalOpParm(result, thissop, "preserveshape_kbend", cookparms.getCookTime(), 0);
1003  return result;
1004  }
1005  fpreal64 getRefPosStrength() const { return myRefPosStrength; }
1006  void setRefPosStrength(fpreal64 val) { myRefPosStrength = val; }
1008  {
1009  SOP_Node *thissop = cookparms.getNode();
1010  if (!thissop) return getRefPosStrength();
1011  fpreal64 result;
1012  OP_Utils::evalOpParm(result, thissop, "preserveshape_refposstrength", cookparms.getCookTime(), 0);
1013  return result;
1014  }
1015  fpreal64 getClumpStiffness() const { return myClumpStiffness; }
1016  void setClumpStiffness(fpreal64 val) { myClumpStiffness = val; }
1018  {
1019  SOP_Node *thissop = cookparms.getNode();
1020  if (!thissop) return getClumpStiffness();
1021  fpreal64 result;
1022  OP_Utils::evalOpParm(result, thissop, "preserveclumps_stiffness", cookparms.getCookTime(), 0);
1023  return result;
1024  }
1025  fpreal64 getClumpDamping() const { return myClumpDamping; }
1026  void setClumpDamping(fpreal64 val) { myClumpDamping = val; }
1028  {
1029  SOP_Node *thissop = cookparms.getNode();
1030  if (!thissop) return getClumpDamping();
1031  fpreal64 result;
1032  OP_Utils::evalOpParm(result, thissop, "preserveclumps_damping", cookparms.getCookTime(), 0);
1033  return result;
1034  }
1035  bool getClumpEnable() const { return myClumpEnable; }
1036  void setClumpEnable(bool val) { myClumpEnable = val; }
1037  bool opClumpEnable(const SOP_NodeVerb::CookParms &cookparms) const
1038  {
1039  SOP_Node *thissop = cookparms.getNode();
1040  if (!thissop) return getClumpEnable();
1041  bool result;
1042  OP_Utils::evalOpParm(result, thissop, "preserveclumps_enable", cookparms.getCookTime(), 0);
1043  return result;
1044  }
1045  int64 getClumpMaxNeighbors() const { return myClumpMaxNeighbors; }
1046  void setClumpMaxNeighbors(int64 val) { myClumpMaxNeighbors = val; }
1048  {
1049  SOP_Node *thissop = cookparms.getNode();
1050  if (!thissop) return getClumpMaxNeighbors();
1051  int64 result;
1052  OP_Utils::evalOpParm(result, thissop, "preserveclumps_maxneighbors", cookparms.getCookTime(), 0);
1053  return result;
1054  }
1055  int64 getClumpMaxConstraints() const { return myClumpMaxConstraints; }
1056  void setClumpMaxConstraints(int64 val) { myClumpMaxConstraints = val; }
1058  {
1059  SOP_Node *thissop = cookparms.getNode();
1060  if (!thissop) return getClumpMaxConstraints();
1061  int64 result;
1062  OP_Utils::evalOpParm(result, thissop, "preserveclumps_maxconstraints", cookparms.getCookTime(), 0);
1063  return result;
1064  }
1065  bool getGwDeleteCaptAttrs() const { return myGwDeleteCaptAttrs; }
1066  void setGwDeleteCaptAttrs(bool val) { myGwDeleteCaptAttrs = val; }
1067  bool opGwDeleteCaptAttrs(const SOP_NodeVerb::CookParms &cookparms) const
1068  {
1069  SOP_Node *thissop = cookparms.getNode();
1070  if (!thissop) return getGwDeleteCaptAttrs();
1071  bool result;
1072  OP_Utils::evalOpParm(result, thissop, "gw_delcaptatr", cookparms.getCookTime(), 0);
1073  return result;
1074  }
1075  GsiMode getGsiMode() const { return GsiMode(myGsiMode); }
1076  void setGsiMode(GsiMode val) { myGsiMode = int64(val); }
1078  {
1079  SOP_Node *thissop = cookparms.getNode();
1080  if (!thissop) return getGsiMode();
1081  int64 result;
1082  OP_Utils::evalOpParm(result, thissop, "gsi_mode", cookparms.getCookTime(), 0);
1083  return GsiMode(result);
1084  }
1085  int64 getGsiMaxCandidates() const { return myGsiMaxCandidates; }
1086  void setGsiMaxCandidates(int64 val) { myGsiMaxCandidates = val; }
1088  {
1089  SOP_Node *thissop = cookparms.getNode();
1090  if (!thissop) return getGsiMaxCandidates();
1091  int64 result;
1092  OP_Utils::evalOpParm(result, thissop, "gsi_maxcandidates", cookparms.getCookTime(), 0);
1093  return result;
1094  }
1095  fpreal64 getGsiSearchRadius() const { return myGsiSearchRadius; }
1096  void setGsiSearchRadius(fpreal64 val) { myGsiSearchRadius = val; }
1098  {
1099  SOP_Node *thissop = cookparms.getNode();
1100  if (!thissop) return getGsiSearchRadius();
1101  fpreal64 result;
1102  OP_Utils::evalOpParm(result, thissop, "gsi_searchradius", cookparms.getCookTime(), 0);
1103  return result;
1104  }
1105  int64 getGsiNSamples() const { return myGsiNSamples; }
1106  void setGsiNSamples(int64 val) { myGsiNSamples = val; }
1108  {
1109  SOP_Node *thissop = cookparms.getNode();
1110  if (!thissop) return getGsiNSamples();
1111  int64 result;
1112  OP_Utils::evalOpParm(result, thissop, "gsi_nsamples", cookparms.getCookTime(), 0);
1113  return result;
1114  }
1115  int64 getGsiMinGuides() const { return myGsiMinGuides; }
1116  void setGsiMinGuides(int64 val) { myGsiMinGuides = val; }
1118  {
1119  SOP_Node *thissop = cookparms.getNode();
1120  if (!thissop) return getGsiMinGuides();
1121  int64 result;
1122  OP_Utils::evalOpParm(result, thissop, "gsi_minguides", cookparms.getCookTime(), 0);
1123  return result;
1124  }
1125  int64 getGsiMaxGuides() const { return myGsiMaxGuides; }
1126  void setGsiMaxGuides(int64 val) { myGsiMaxGuides = val; }
1128  {
1129  SOP_Node *thissop = cookparms.getNode();
1130  if (!thissop) return getGsiMaxGuides();
1131  int64 result;
1132  OP_Utils::evalOpParm(result, thissop, "gsi_maxguides", cookparms.getCookTime(), 0);
1133  return result;
1134  }
1135  fpreal64 getGsiBlurWidth() const { return myGsiBlurWidth; }
1136  void setGsiBlurWidth(fpreal64 val) { myGsiBlurWidth = val; }
1138  {
1139  SOP_Node *thissop = cookparms.getNode();
1140  if (!thissop) return getGsiBlurWidth();
1141  fpreal64 result;
1142  OP_Utils::evalOpParm(result, thissop, "gsi_blurwidth", cookparms.getCookTime(), 0);
1143  return result;
1144  }
1145  fpreal64 getGsiWeightThreshold() const { return myGsiWeightThreshold; }
1146  void setGsiWeightThreshold(fpreal64 val) { myGsiWeightThreshold = val; }
1148  {
1149  SOP_Node *thissop = cookparms.getNode();
1150  if (!thissop) return getGsiWeightThreshold();
1151  fpreal64 result;
1152  OP_Utils::evalOpParm(result, thissop, "gsi_weightthreshold", cookparms.getCookTime(), 0);
1153  return result;
1154  }
1155  fpreal64 getGsiLengthPenaltyScale() const { return myGsiLengthPenaltyScale; }
1156  void setGsiLengthPenaltyScale(fpreal64 val) { myGsiLengthPenaltyScale = val; }
1158  {
1159  SOP_Node *thissop = cookparms.getNode();
1160  if (!thissop) return getGsiLengthPenaltyScale();
1161  fpreal64 result;
1162  OP_Utils::evalOpParm(result, thissop, "gsi_lengthpenaltyscale", cookparms.getCookTime(), 0);
1163  return result;
1164  }
1165  bool getGsiDeleteCaptAttrs() const { return myGsiDeleteCaptAttrs; }
1166  void setGsiDeleteCaptAttrs(bool val) { myGsiDeleteCaptAttrs = val; }
1167  bool opGsiDeleteCaptAttrs(const SOP_NodeVerb::CookParms &cookparms) const
1168  {
1169  SOP_Node *thissop = cookparms.getNode();
1170  if (!thissop) return getGsiDeleteCaptAttrs();
1171  bool result;
1172  OP_Utils::evalOpParm(result, thissop, "gsi_delcaptatr", cookparms.getCookTime(), 0);
1173  return result;
1174  }
1175 
1176 private:
1177  UT_StringHolder myGroup;
1178  bool myDeformEnable;
1179  int64 myDeformMethod;
1180  bool myTreatskinassubd;
1181  bool myUseOrientAttrib;
1182  fpreal64 myOrientBlend;
1183  bool myRecompile;
1184  bool myLeaveOnGPU;
1185  bool myLockRoots;
1186  bool myPreserveShapeEnable;
1187  int64 myPreserveShapeIterations;
1188  fpreal64 myStretchStiffness;
1189  fpreal64 myBendStiffness;
1190  fpreal64 myRefPosStrength;
1191  fpreal64 myClumpStiffness;
1192  fpreal64 myClumpDamping;
1193  bool myClumpEnable;
1194  int64 myClumpMaxNeighbors;
1195  int64 myClumpMaxConstraints;
1196  bool myGwDeleteCaptAttrs;
1197  int64 myGsiMode;
1198  int64 myGsiMaxCandidates;
1199  fpreal64 myGsiSearchRadius;
1200  int64 myGsiNSamples;
1201  int64 myGsiMinGuides;
1202  int64 myGsiMaxGuides;
1203  fpreal64 myGsiBlurWidth;
1204  fpreal64 myGsiWeightThreshold;
1205  fpreal64 myGsiLengthPenaltyScale;
1206  bool myGsiDeleteCaptAttrs;
1207 
1208 };
type
Definition: core.h:556
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:403
static void loadData(UT_IStream &is, bool &v)
fpreal64 opGsiWeightThreshold(const SOP_NodeVerb::CookParms &cookparms) const
bool opTreatskinassubd(const SOP_NodeVerb::CookParms &cookparms) const
int64 opGsiMaxGuides(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:495
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
GLsizei const GLfloat * value
Definition: glcorearb.h:824
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
const OP_Context & context() const
Definition: OP_NodeParms.h:105
GsiMode opGsiMode(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:669
int64 exint
Definition: SYS_Types.h:125
fpreal64 opGsiLengthPenaltyScale(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
int64 opGsiMinGuides(const SOP_NodeVerb::CookParms &cookparms) const
GLdouble s
Definition: glad.h:3009
bool opLeaveOnGPU(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
fpreal64 opClumpStiffness(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
int64 opClumpMaxConstraints(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getGroup() const
DeformMethod getDeformMethod() const
**But if you need a result
Definition: thread.h:622
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
exint nodeIdx() const
Definition: OP_NodeParms.h:103
void setGroup(const UT_StringHolder &val)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:493
void setGsiLengthPenaltyScale(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
double fpreal64
Definition: SYS_Types.h:201
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:426
bool opDeformEnable(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, UT_Vector3D &v)
exint length() const
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
int64 opPreserveShapeIterations(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:497
void loadFromOpSubclass(const LoadParms &loadparms) override
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:102
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void saveData(std::ostream &os, UT_Matrix4D v)
bool opRecompile(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
SYS_FORCE_INLINE UT_StringHolder getToken(DeformMethod enum_value)
bool isParmColorRamp(exint idx) const override
int64 opClumpMaxNeighbors(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
bool opGsiDeleteCaptAttrs(const SOP_NodeVerb::CookParms &cookparms) const
long long int64
Definition: SYS_Types.h:116
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
fpreal64 opBendStiffness(const SOP_NodeVerb::CookParms &cookparms) const
void setDeformMethod(DeformMethod val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool operator==(const SOP_GuideDeformCoreParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
int64 opGsiMaxCandidates(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
fpreal64 opClumpDamping(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:306
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, fpreal64 v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
bool opClumpEnable(const SOP_NodeVerb::CookParms &cookparms) const
bool opPreserveShapeEnable(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
const char * getNestParmName(TempIndex fieldnum) const override
bool opGwDeleteCaptAttrs(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
fpreal64 fpreal
Definition: SYS_Types.h:283
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:107
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
fpreal64 opOrientBlend(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
fpreal64 opRefPosStrength(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:499
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:302
bool opLockRoots(const SOP_NodeVerb::CookParms &cookparms) const
#define SOP_API
Definition: SOP_API.h:10
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:432
static void saveData(std::ostream &os, bool v)
const char * findChar(int c) const
Definition: UT_String.h:1421
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:165
void save(std::ostream &os) const
GLboolean r
Definition: glcorearb.h:1222
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_StringHolder &v)
exint bread(uint8 *buffer, exint asize=1)
bool operator!=(const SOP_GuideDeformCoreParms &src) const
DeformMethod opDeformMethod(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:667
static void saveData(std::ostream &os, UT_Matrix2D v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
fpreal64 opGsiSearchRadius(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opGsiBlurWidth(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
bool opUseOrientAttrib(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opStretchStiffness(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:428
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_Vector3D v)
int64 opGsiNSamples(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void saveData(std::ostream &os, UT_Vector4D v)
GLenum src
Definition: glcorearb.h:1793
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:665
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)