HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_PolyReduce-2.0.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_PolyReduce_2_0Enums
24 {
25  enum class Target
26  {
27  POLY_PERCENT = 0,
28  PT_PERCENT,
29  POLY_COUNT,
30  PT_COUNT
31  };
32 
34  getToken(Target enum_value)
35  {
36  using namespace UT::Literal;
37  switch (enum_value) {
38  case Target::POLY_PERCENT: return "poly_percent"_sh;
39  case Target::PT_PERCENT: return "pt_percent"_sh;
40  case Target::POLY_COUNT: return "poly_count"_sh;
41  case Target::PT_COUNT: return "pt_count"_sh;
42  default: UT_ASSERT(false); return ""_sh;
43  }
44  }
45 
46 }
47 
48 
50 {
51 public:
52  static int version() { return 1; }
54  {
58 
59 
61  {
62  attribenabled = true;
63  attribname = ""_UTsh;
64  attribweight = 1;
65 
66  }
67 
68  bool operator==(const Controlattribs &src) const
69  {
70  if (attribenabled != src.attribenabled) return false;
71  if (attribname != src.attribname) return false;
72  if (attribweight != src.attribweight) return false;
73 
74  return true;
75  }
76  bool operator!=(const Controlattribs &src) const
77  {
78  return !operator==(src);
79  }
80 
81  };
82 
84  {
86 
87  buf.strcat("[ ");
88  for (int i = 0; i < list.entries(); i++)
89  {
90  if (i)
91  buf.strcat(", ");
92  buf.strcat("( ");
93  buf.append("");
94  buf.appendSprintf("%s", (list(i).attribenabled) ? "true" : "false");
95  buf.append(", ");
96  { UT_String tmp; tmp = UT_StringWrap(list(i).attribname).makeQuotedString('"'); buf.strcat(tmp); }
97  buf.append(", ");
98  buf.appendSprintf("%f", (list(i).attribweight));
99 
100  buf.strcat(" )");
101  }
102  buf.strcat(" ]");
103 
105  return result;
106  }
107 
109  {
110  myGroup = ""_UTsh;
111  myTarget = 0;
112  myPercentage = 100;
113  myFinalCount = 1000;
114  myReducePassedTarget = false;
115  myQualityToleance = 1e-5;
116  myUseNormalDevThreshold = false;
117  myNormalDevThreshold = 90;
118  myOriginalPoints = false;
119  myPreserveQuads = false;
120  myEqualizeLengths = 1e-10;
121  myBoundaryWeight = 1;
122  myVAttribSeamWeight = 1;
123  mySeamAttribs = "* ^N"_UTsh;
124  myHardFeaturePoints = ""_UTsh;
125  myHardFeatureEdges = ""_UTsh;
126  mySoftFeaturePoints = ""_UTsh;
127  mySoftFeaturePointWeight = 1;
128  mySoftFeatureEdges = ""_UTsh;
129  mySoftFeatureEdgeWeight = 1;
130  myUseRetainAttrib = false;
131  myRetainAttrib = "retention"_UTsh;
132  myRetainWeight = 1;
133  mySilhouetteWeight = 1;
134  myUseSilhouetteFalloff = false;
135  mySilhouetteFalloffDist = 1;
136  myFrontFacingWeight = 1;
137  myUseFrontFacingFalloff = false;
138  myFrontFacingFalloffDist = 1;
139  myControlattribs.setSize(0);
140 
141  }
142 
143  explicit SOP_PolyReduce_2_0Parms(const SOP_PolyReduce_2_0Parms &) = default;
145  SOP_PolyReduce_2_0Parms(SOP_PolyReduce_2_0Parms &&) noexcept = default;
146  SOP_PolyReduce_2_0Parms &operator=(SOP_PolyReduce_2_0Parms &&) noexcept = default;
147 
148  ~SOP_PolyReduce_2_0Parms() override {}
149 
151  {
152  if (myGroup != src.myGroup) return false;
153  if (myTarget != src.myTarget) return false;
154  if (myPercentage != src.myPercentage) return false;
155  if (myFinalCount != src.myFinalCount) return false;
156  if (myReducePassedTarget != src.myReducePassedTarget) return false;
157  if (myQualityToleance != src.myQualityToleance) return false;
158  if (myUseNormalDevThreshold != src.myUseNormalDevThreshold) return false;
159  if (myNormalDevThreshold != src.myNormalDevThreshold) return false;
160  if (myOriginalPoints != src.myOriginalPoints) return false;
161  if (myPreserveQuads != src.myPreserveQuads) return false;
162  if (myEqualizeLengths != src.myEqualizeLengths) return false;
163  if (myBoundaryWeight != src.myBoundaryWeight) return false;
164  if (myVAttribSeamWeight != src.myVAttribSeamWeight) return false;
165  if (mySeamAttribs != src.mySeamAttribs) return false;
166  if (myHardFeaturePoints != src.myHardFeaturePoints) return false;
167  if (myHardFeatureEdges != src.myHardFeatureEdges) return false;
168  if (mySoftFeaturePoints != src.mySoftFeaturePoints) return false;
169  if (mySoftFeaturePointWeight != src.mySoftFeaturePointWeight) return false;
170  if (mySoftFeatureEdges != src.mySoftFeatureEdges) return false;
171  if (mySoftFeatureEdgeWeight != src.mySoftFeatureEdgeWeight) return false;
172  if (myUseRetainAttrib != src.myUseRetainAttrib) return false;
173  if (myRetainAttrib != src.myRetainAttrib) return false;
174  if (myRetainWeight != src.myRetainWeight) return false;
175  if (mySilhouetteWeight != src.mySilhouetteWeight) return false;
176  if (myUseSilhouetteFalloff != src.myUseSilhouetteFalloff) return false;
177  if (mySilhouetteFalloffDist != src.mySilhouetteFalloffDist) return false;
178  if (myFrontFacingWeight != src.myFrontFacingWeight) return false;
179  if (myUseFrontFacingFalloff != src.myUseFrontFacingFalloff) return false;
180  if (myFrontFacingFalloffDist != src.myFrontFacingFalloffDist) return false;
181  if (myControlattribs != src.myControlattribs) return false;
182 
183 
184  if (baseGetSignature() != src.baseGetSignature()) return false;
185 
186  return true;
187  }
189  {
190  return !operator==(src);
191  }
193 
194 
195 
196  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
197  {
198  myGroup = ""_UTsh;
199  if (true)
200  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
201  myTarget = 0;
202  if (true)
203  graph->evalOpParm(myTarget, nodeidx, "target", time, graph->isDirect()?nullptr:depnode);
204  myPercentage = 100;
205  if (true && ( (true&&!(((int64(getTarget())==2))||((int64(getTarget())==3)))) ) )
206  graph->evalOpParm(myPercentage, nodeidx, "percentage", time, graph->isDirect()?nullptr:depnode);
207  myFinalCount = 1000;
208  if (true && ( (true&&!(((int64(getTarget())==0))||((int64(getTarget())==1)))) ) )
209  graph->evalOpParm(myFinalCount, nodeidx, "finalcount", time, graph->isDirect()?nullptr:depnode);
210  myReducePassedTarget = false;
211  if (true)
212  graph->evalOpParm(myReducePassedTarget, nodeidx, "reducepassedtarget", time, graph->isDirect()?nullptr:depnode);
213  myQualityToleance = 1e-5;
214  if (true && ( (true&&!(((getReducePassedTarget()==0)))) ) )
215  graph->evalOpParm(myQualityToleance, nodeidx, "qualitytolerance", time, graph->isDirect()?nullptr:depnode);
216  myUseNormalDevThreshold = false;
217  if (true)
218  graph->evalOpParm(myUseNormalDevThreshold, nodeidx, "usenormaldevthreshold", time, graph->isDirect()?nullptr:depnode);
219  myNormalDevThreshold = 90;
220  if (true && ( (true&&!(((getUseNormalDevThreshold()==0)))) ) )
221  graph->evalOpParm(myNormalDevThreshold, nodeidx, "normaldevthreshold", time, graph->isDirect()?nullptr:depnode);
222  myOriginalPoints = false;
223  if (true)
224  graph->evalOpParm(myOriginalPoints, nodeidx, "originalpoints", time, graph->isDirect()?nullptr:depnode);
225  myPreserveQuads = false;
226  if (true)
227  graph->evalOpParm(myPreserveQuads, nodeidx, "preservequads", time, graph->isDirect()?nullptr:depnode);
228  myEqualizeLengths = 1e-10;
229  if (true)
230  graph->evalOpParm(myEqualizeLengths, nodeidx, "equalizelengths", time, graph->isDirect()?nullptr:depnode);
231  myBoundaryWeight = 1;
232  if (true)
233  graph->evalOpParm(myBoundaryWeight, nodeidx, "boundaryweight", time, graph->isDirect()?nullptr:depnode);
234  myVAttribSeamWeight = 1;
235  if (true)
236  graph->evalOpParm(myVAttribSeamWeight, nodeidx, "vattribseamweight", time, graph->isDirect()?nullptr:depnode);
237  mySeamAttribs = "* ^N"_UTsh;
238  if (true && ( (true&&!(((getVAttribSeamWeight()==0)))) ) )
239  graph->evalOpParm(mySeamAttribs, nodeidx, "seamattribs", time, graph->isDirect()?nullptr:depnode);
240  myHardFeaturePoints = ""_UTsh;
241  if (true)
242  graph->evalOpParm(myHardFeaturePoints, nodeidx, "hardfeaturepoints", time, graph->isDirect()?nullptr:depnode);
243  myHardFeatureEdges = ""_UTsh;
244  if (true)
245  graph->evalOpParm(myHardFeatureEdges, nodeidx, "hardfeatureedges", time, graph->isDirect()?nullptr:depnode);
246  mySoftFeaturePoints = ""_UTsh;
247  if (true)
248  graph->evalOpParm(mySoftFeaturePoints, nodeidx, "softfeaturepoints", time, graph->isDirect()?nullptr:depnode);
249  mySoftFeaturePointWeight = 1;
250  if (true)
251  graph->evalOpParm(mySoftFeaturePointWeight, nodeidx, "softfeaturepointweight", time, graph->isDirect()?nullptr:depnode);
252  mySoftFeatureEdges = ""_UTsh;
253  if (true)
254  graph->evalOpParm(mySoftFeatureEdges, nodeidx, "softfeatureedges", time, graph->isDirect()?nullptr:depnode);
255  mySoftFeatureEdgeWeight = 1;
256  if (true)
257  graph->evalOpParm(mySoftFeatureEdgeWeight, nodeidx, "softfeatureedgeweight", time, graph->isDirect()?nullptr:depnode);
258  myUseRetainAttrib = false;
259  if (true)
260  graph->evalOpParm(myUseRetainAttrib, nodeidx, "useretainattrib", time, graph->isDirect()?nullptr:depnode);
261  myRetainAttrib = "retention"_UTsh;
262  if (true && ( (true&&!(((getUseRetainAttrib()==0)))) ) )
263  graph->evalOpParm(myRetainAttrib, nodeidx, "retainattrib", time, graph->isDirect()?nullptr:depnode);
264  myRetainWeight = 1;
265  if (true && ( (true&&!(((getUseRetainAttrib()==0)))) ) )
266  graph->evalOpParm(myRetainWeight, nodeidx, "retainattribweight", time, graph->isDirect()?nullptr:depnode);
267  mySilhouetteWeight = 1;
268  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==0)))) ) )
269  graph->evalOpParm(mySilhouetteWeight, nodeidx, "silhouetteweight", time, graph->isDirect()?nullptr:depnode);
270  myUseSilhouetteFalloff = false;
271  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==0)))) ) )
272  graph->evalOpParm(myUseSilhouetteFalloff, nodeidx, "usesilhouettefalloff", time, graph->isDirect()?nullptr:depnode);
273  mySilhouetteFalloffDist = 1;
274  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==0))||((getUseSilhouetteFalloff()==0)))) ) )
275  graph->evalOpParm(mySilhouetteFalloffDist, nodeidx, "silhouettefalloffdist", time, graph->isDirect()?nullptr:depnode);
276  myFrontFacingWeight = 1;
277  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==0)))) ) )
278  graph->evalOpParm(myFrontFacingWeight, nodeidx, "frontfacingweight", time, graph->isDirect()?nullptr:depnode);
279  myUseFrontFacingFalloff = false;
280  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==0)))) ) )
281  graph->evalOpParm(myUseFrontFacingFalloff, nodeidx, "usefrontfacingfalloff", time, graph->isDirect()?nullptr:depnode);
282  myFrontFacingFalloffDist = 1;
283  if (true && ( (true&&!((((graph->getInput(nodeidx,2)>=0)==0))||((getUseFrontFacingFalloff()==0)))) ) )
284  graph->evalOpParm(myFrontFacingFalloffDist, nodeidx, "frontfacingfalloffdist", time, graph->isDirect()?nullptr:depnode);
285  if (true)
286  {
287  int64 length = 0;
288  graph->evalOpParm(length, nodeidx, "controlattribs", time, graph->isDirect()?nullptr:depnode);
289  if (length < 0) length = 0;
290  myControlattribs.setSize(length);
291  for (exint i = 0; i < length; i++)
292  {
293  int parmidx[1];
294  int offsets[1];
295  parmidx[0] = i+1;
296  offsets[0] = 1;
297  auto && _curentry = myControlattribs(i);
298  (void) _curentry;
299  _curentry.attribenabled = true;
300  if (true)
301  graph->evalOpParmInst(_curentry.attribenabled, nodeidx, "attribenabled#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
302  _curentry.attribname = ""_UTsh;
303  if (true && ( (true&&!(((_curentry.attribenabled==0)))) ) )
304  graph->evalOpParmInst(_curentry.attribname, nodeidx, "attribname#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
305  _curentry.attribweight = 1;
306  if (true && ( (true&&!(((_curentry.attribenabled==0)))) ) )
307  graph->evalOpParmInst(_curentry.attribweight, nodeidx, "attribweight#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
308 
309  }
310  }
311  else
312  myControlattribs.clear();
313 
314  }
315 
316 
317  void loadFromOpSubclass(const LoadParms &loadparms) override
318  {
319  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
320  }
321 
322 
323  void copyFrom(const OP_NodeParms *src) override
324  {
325  *this = *((const SOP_PolyReduce_2_0Parms *)src);
326  }
327 
328  template <typename T>
329  void
330  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
331  {
332  if (idx.size() < 1)
333  return;
334  UT_ASSERT(idx.size() == instance.size()+1);
335  if (idx.size() != instance.size()+1)
336  return;
337  switch (idx[0])
338  {
339  case 0:
340  coerceValue(value, myGroup);
341  break;
342  case 1:
343  coerceValue(value, myTarget);
344  break;
345  case 2:
346  coerceValue(value, myPercentage);
347  break;
348  case 3:
349  coerceValue(value, myFinalCount);
350  break;
351  case 4:
352  coerceValue(value, myReducePassedTarget);
353  break;
354  case 5:
355  coerceValue(value, myQualityToleance);
356  break;
357  case 6:
358  coerceValue(value, myUseNormalDevThreshold);
359  break;
360  case 7:
361  coerceValue(value, myNormalDevThreshold);
362  break;
363  case 8:
364  coerceValue(value, myOriginalPoints);
365  break;
366  case 9:
367  coerceValue(value, myPreserveQuads);
368  break;
369  case 10:
370  coerceValue(value, myEqualizeLengths);
371  break;
372  case 11:
373  coerceValue(value, myBoundaryWeight);
374  break;
375  case 12:
376  coerceValue(value, myVAttribSeamWeight);
377  break;
378  case 13:
379  coerceValue(value, mySeamAttribs);
380  break;
381  case 14:
382  coerceValue(value, myHardFeaturePoints);
383  break;
384  case 15:
385  coerceValue(value, myHardFeatureEdges);
386  break;
387  case 16:
388  coerceValue(value, mySoftFeaturePoints);
389  break;
390  case 17:
391  coerceValue(value, mySoftFeaturePointWeight);
392  break;
393  case 18:
394  coerceValue(value, mySoftFeatureEdges);
395  break;
396  case 19:
397  coerceValue(value, mySoftFeatureEdgeWeight);
398  break;
399  case 20:
400  coerceValue(value, myUseRetainAttrib);
401  break;
402  case 21:
403  coerceValue(value, myRetainAttrib);
404  break;
405  case 22:
406  coerceValue(value, myRetainWeight);
407  break;
408  case 23:
409  coerceValue(value, mySilhouetteWeight);
410  break;
411  case 24:
412  coerceValue(value, myUseSilhouetteFalloff);
413  break;
414  case 25:
415  coerceValue(value, mySilhouetteFalloffDist);
416  break;
417  case 26:
418  coerceValue(value, myFrontFacingWeight);
419  break;
420  case 27:
421  coerceValue(value, myUseFrontFacingFalloff);
422  break;
423  case 28:
424  coerceValue(value, myFrontFacingFalloffDist);
425  break;
426  case 29:
427  if (idx.size() == 1)
428  coerceValue(value, myControlattribs.entries());
429  else if (instance[0] < myControlattribs.entries())
430  {
431  auto && _data = myControlattribs(instance[0]);
432  switch (idx[1])
433  {
434  case 0:
435  coerceValue(value, _data.attribenabled);
436  break;
437  case 1:
438  coerceValue(value, _data.attribname);
439  break;
440  case 2:
441  coerceValue(value, _data.attribweight);
442  break;
443 
444  }
445  }
446  break;
447 
448  }
449  }
450 
451  bool isParmColorRamp(exint idx) const override
452  {
453  switch (idx)
454  {
455 
456  }
457  return false;
458  }
459 
460  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
461  { doGetParmValue(idx, instance, value); }
462  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
463  { doGetParmValue(idx, instance, value); }
464  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
465  { doGetParmValue(idx, instance, value); }
466  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
467  { doGetParmValue(idx, instance, value); }
468  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
469  { doGetParmValue(idx, instance, value); }
470  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
471  { doGetParmValue(idx, instance, value); }
472  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
473  { doGetParmValue(idx, instance, value); }
474  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
475  { doGetParmValue(idx, instance, value); }
476  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
477  { doGetParmValue(idx, instance, value); }
478  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
479  { doGetParmValue(idx, instance, value); }
480  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
481  { doGetParmValue(idx, instance, value); }
482 
483  template <typename T>
484  void
485  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
486  {
487  if (idx.size() < 1)
488  return;
489  UT_ASSERT(idx.size() == instance.size()+1);
490  if (idx.size() != instance.size()+1)
491  return;
492  switch (idx[0])
493  {
494  case 0:
495  coerceValue(myGroup, ( ( value ) ));
496  break;
497  case 1:
498  coerceValue(myTarget, clampMinValue(0, clampMaxValue(3, value ) ));
499  break;
500  case 2:
501  coerceValue(myPercentage, clampMinValue(0, clampMaxValue(100, value ) ));
502  break;
503  case 3:
504  coerceValue(myFinalCount, clampMinValue(1, ( value ) ));
505  break;
506  case 4:
507  coerceValue(myReducePassedTarget, ( ( value ) ));
508  break;
509  case 5:
510  coerceValue(myQualityToleance, clampMinValue(0, ( value ) ));
511  break;
512  case 6:
513  coerceValue(myUseNormalDevThreshold, ( ( value ) ));
514  break;
515  case 7:
516  coerceValue(myNormalDevThreshold, clampMinValue(0, clampMaxValue(180, value ) ));
517  break;
518  case 8:
519  coerceValue(myOriginalPoints, ( ( value ) ));
520  break;
521  case 9:
522  coerceValue(myPreserveQuads, ( ( value ) ));
523  break;
524  case 10:
525  coerceValue(myEqualizeLengths, clampMinValue(0, ( value ) ));
526  break;
527  case 11:
528  coerceValue(myBoundaryWeight, ( ( value ) ));
529  break;
530  case 12:
531  coerceValue(myVAttribSeamWeight, ( ( value ) ));
532  break;
533  case 13:
534  coerceValue(mySeamAttribs, ( ( value ) ));
535  break;
536  case 14:
537  coerceValue(myHardFeaturePoints, ( ( value ) ));
538  break;
539  case 15:
540  coerceValue(myHardFeatureEdges, ( ( value ) ));
541  break;
542  case 16:
543  coerceValue(mySoftFeaturePoints, ( ( value ) ));
544  break;
545  case 17:
546  coerceValue(mySoftFeaturePointWeight, ( ( value ) ));
547  break;
548  case 18:
549  coerceValue(mySoftFeatureEdges, ( ( value ) ));
550  break;
551  case 19:
552  coerceValue(mySoftFeatureEdgeWeight, ( ( value ) ));
553  break;
554  case 20:
555  coerceValue(myUseRetainAttrib, ( ( value ) ));
556  break;
557  case 21:
558  coerceValue(myRetainAttrib, ( ( value ) ));
559  break;
560  case 22:
561  coerceValue(myRetainWeight, ( ( value ) ));
562  break;
563  case 23:
564  coerceValue(mySilhouetteWeight, ( ( value ) ));
565  break;
566  case 24:
567  coerceValue(myUseSilhouetteFalloff, ( ( value ) ));
568  break;
569  case 25:
570  coerceValue(mySilhouetteFalloffDist, clampMinValue(0, ( value ) ));
571  break;
572  case 26:
573  coerceValue(myFrontFacingWeight, ( ( value ) ));
574  break;
575  case 27:
576  coerceValue(myUseFrontFacingFalloff, ( ( value ) ));
577  break;
578  case 28:
579  coerceValue(myFrontFacingFalloffDist, clampMinValue(0, ( value ) ));
580  break;
581  case 29:
582  if (idx.size() == 1)
583  {
584  exint newsize;
585  coerceValue(newsize, value);
586  if (newsize < 0) newsize = 0;
587  myControlattribs.setSize(newsize);
588  }
589  else
590  {
591  if (instance[0] < 0)
592  return;
593  myControlattribs.setSizeIfNeeded(instance[0]+1);
594  auto && _data = myControlattribs(instance[0]);
595  switch (idx[1])
596  {
597  case 0:
598  coerceValue(_data.attribenabled, value);
599  break;
600  case 1:
601  coerceValue(_data.attribname, value);
602  break;
603  case 2:
604  coerceValue(_data.attribweight, value);
605  break;
606 
607  }
608  }
609  break;
610 
611  }
612  }
613 
614  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
615  { doSetParmValue(idx, instance, value); }
616  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
617  { doSetParmValue(idx, instance, value); }
618  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
619  { doSetParmValue(idx, instance, value); }
620  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
621  { doSetParmValue(idx, instance, value); }
622  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
623  { doSetParmValue(idx, instance, value); }
624  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
625  { doSetParmValue(idx, instance, value); }
626  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
627  { doSetParmValue(idx, instance, value); }
628  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
629  { doSetParmValue(idx, instance, value); }
630  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
631  { doSetParmValue(idx, instance, value); }
632  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
633  { doSetParmValue(idx, instance, value); }
634  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
635  { doSetParmValue(idx, instance, value); }
636 
637  exint getNestNumParms(TempIndex idx) const override
638  {
639  if (idx.size() == 0)
640  return 30;
641  switch (idx[0])
642  {
643  case 29:
644  return 3;
645 
646  }
647  // Invalid
648  return 0;
649  }
650 
651  const char *getNestParmName(TempIndex fieldnum) const override
652  {
653  if (fieldnum.size() < 1)
654  return 0;
655  switch (fieldnum[0])
656  {
657  case 0:
658  return "group";
659  case 1:
660  return "target";
661  case 2:
662  return "percentage";
663  case 3:
664  return "finalcount";
665  case 4:
666  return "reducepassedtarget";
667  case 5:
668  return "qualitytolerance";
669  case 6:
670  return "usenormaldevthreshold";
671  case 7:
672  return "normaldevthreshold";
673  case 8:
674  return "originalpoints";
675  case 9:
676  return "preservequads";
677  case 10:
678  return "equalizelengths";
679  case 11:
680  return "boundaryweight";
681  case 12:
682  return "vattribseamweight";
683  case 13:
684  return "seamattribs";
685  case 14:
686  return "hardfeaturepoints";
687  case 15:
688  return "hardfeatureedges";
689  case 16:
690  return "softfeaturepoints";
691  case 17:
692  return "softfeaturepointweight";
693  case 18:
694  return "softfeatureedges";
695  case 19:
696  return "softfeatureedgeweight";
697  case 20:
698  return "useretainattrib";
699  case 21:
700  return "retainattrib";
701  case 22:
702  return "retainattribweight";
703  case 23:
704  return "silhouetteweight";
705  case 24:
706  return "usesilhouettefalloff";
707  case 25:
708  return "silhouettefalloffdist";
709  case 26:
710  return "frontfacingweight";
711  case 27:
712  return "usefrontfacingfalloff";
713  case 28:
714  return "frontfacingfalloffdist";
715  case 29:
716  if (fieldnum.size() == 1)
717  return "controlattribs";
718  switch (fieldnum[1])
719  {
720  case 0:
721  return "attribenabled#";
722  case 1:
723  return "attribname#";
724  case 2:
725  return "attribweight#";
726 
727  }
728  return 0;
729 
730  }
731  return 0;
732  }
733 
734  ParmType getNestParmType(TempIndex fieldnum) const override
735  {
736  if (fieldnum.size() < 1)
737  return PARM_UNSUPPORTED;
738  switch (fieldnum[0])
739  {
740  case 0:
741  return PARM_STRING;
742  case 1:
743  return PARM_INTEGER;
744  case 2:
745  return PARM_FLOAT;
746  case 3:
747  return PARM_INTEGER;
748  case 4:
749  return PARM_INTEGER;
750  case 5:
751  return PARM_FLOAT;
752  case 6:
753  return PARM_INTEGER;
754  case 7:
755  return PARM_FLOAT;
756  case 8:
757  return PARM_INTEGER;
758  case 9:
759  return PARM_INTEGER;
760  case 10:
761  return PARM_FLOAT;
762  case 11:
763  return PARM_FLOAT;
764  case 12:
765  return PARM_FLOAT;
766  case 13:
767  return PARM_STRING;
768  case 14:
769  return PARM_STRING;
770  case 15:
771  return PARM_STRING;
772  case 16:
773  return PARM_STRING;
774  case 17:
775  return PARM_FLOAT;
776  case 18:
777  return PARM_STRING;
778  case 19:
779  return PARM_FLOAT;
780  case 20:
781  return PARM_INTEGER;
782  case 21:
783  return PARM_STRING;
784  case 22:
785  return PARM_FLOAT;
786  case 23:
787  return PARM_FLOAT;
788  case 24:
789  return PARM_INTEGER;
790  case 25:
791  return PARM_FLOAT;
792  case 26:
793  return PARM_FLOAT;
794  case 27:
795  return PARM_INTEGER;
796  case 28:
797  return PARM_FLOAT;
798  case 29:
799  if (fieldnum.size() == 1)
800  return PARM_MULTIPARM;
801  switch (fieldnum[1])
802  {
803  case 0:
804  return PARM_INTEGER;
805  case 1:
806  return PARM_STRING;
807  case 2:
808  return PARM_FLOAT;
809 
810  }
811  return PARM_UNSUPPORTED;
812 
813  }
814  return PARM_UNSUPPORTED;
815  }
816 
817  // Boiler plate to load individual types.
818  static void loadData(UT_IStream &is, int64 &v)
819  { is.bread(&v, 1); }
820  static void loadData(UT_IStream &is, bool &v)
821  { int64 iv; is.bread(&iv, 1); v = iv; }
822  static void loadData(UT_IStream &is, fpreal64 &v)
823  { is.bread<fpreal64>(&v, 1); }
824  static void loadData(UT_IStream &is, UT_Vector2D &v)
825  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
826  static void loadData(UT_IStream &is, UT_Vector3D &v)
827  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
828  is.bread<fpreal64>(&v.z(), 1); }
829  static void loadData(UT_IStream &is, UT_Vector4D &v)
830  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
831  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
832  static void loadData(UT_IStream &is, UT_Matrix2D &v)
833  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
834  static void loadData(UT_IStream &is, UT_Matrix3D &v)
835  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
836  static void loadData(UT_IStream &is, UT_Matrix4D &v)
837  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
838  static void loadData(UT_IStream &is, UT_Vector2I &v)
839  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
840  static void loadData(UT_IStream &is, UT_Vector3I &v)
841  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
842  is.bread<int64>(&v.z(), 1); }
843  static void loadData(UT_IStream &is, UT_Vector4I &v)
844  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
845  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
847  { is.bread(v); }
849  { UT_StringHolder rampdata;
850  loadData(is, rampdata);
851  if (rampdata.isstring())
852  {
853  v.reset(new UT_Ramp());
854  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
855  v->load(istr);
856  }
857  else v.reset();
858  }
861  loadData(is, data);
862  if (data.isstring())
863  {
864  // Find the data type.
865  const char *colon = UT_StringWrap(data).findChar(':');
866  if (colon)
867  {
868  int typelen = colon - data.buffer();
870  type.strncpy(data.buffer(), typelen);
871  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
872 
873  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
874  }
875  }
876  else v.reset();
877  }
878 
879  static void saveData(std::ostream &os, int64 v)
880  { UTwrite(os, &v); }
881  static void saveData(std::ostream &os, bool v)
882  { int64 iv = v; UTwrite(os, &iv); }
883  static void saveData(std::ostream &os, fpreal64 v)
884  { UTwrite<fpreal64>(os, &v); }
885  static void saveData(std::ostream &os, UT_Vector2D v)
886  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
887  static void saveData(std::ostream &os, UT_Vector3D v)
888  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
889  UTwrite<fpreal64>(os, &v.z()); }
890  static void saveData(std::ostream &os, UT_Vector4D v)
891  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
892  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
893  static void saveData(std::ostream &os, UT_Matrix2D v)
895  static void saveData(std::ostream &os, UT_Matrix3D v)
897  static void saveData(std::ostream &os, UT_Matrix4D v)
899  static void saveData(std::ostream &os, UT_StringHolder s)
900  { UT_StringWrap(s).saveBinary(os); }
901  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
903  UT_OStringStream ostr;
904  if (s) s->save(ostr);
905  result = ostr.str();
906  saveData(os, result);
907  }
908  static void saveData(std::ostream &os, PRM_DataItemHandle s)
910  UT_OStringStream ostr;
911  if (s)
912  {
913  ostr << s->getDataTypeToken();
914  ostr << ":";
915  s->saveBinary(ostr);
916  }
917  result = ostr.str();
918  saveData(os, result);
919  }
920 
921 
922  void save(std::ostream &os) const
923  {
924  int32 v = version();
925  UTwrite(os, &v);
926  saveData(os, myGroup);
927  saveData(os, myTarget);
928  saveData(os, myPercentage);
929  saveData(os, myFinalCount);
930  saveData(os, myReducePassedTarget);
931  saveData(os, myQualityToleance);
932  saveData(os, myUseNormalDevThreshold);
933  saveData(os, myNormalDevThreshold);
934  saveData(os, myOriginalPoints);
935  saveData(os, myPreserveQuads);
936  saveData(os, myEqualizeLengths);
937  saveData(os, myBoundaryWeight);
938  saveData(os, myVAttribSeamWeight);
939  saveData(os, mySeamAttribs);
940  saveData(os, myHardFeaturePoints);
941  saveData(os, myHardFeatureEdges);
942  saveData(os, mySoftFeaturePoints);
943  saveData(os, mySoftFeaturePointWeight);
944  saveData(os, mySoftFeatureEdges);
945  saveData(os, mySoftFeatureEdgeWeight);
946  saveData(os, myUseRetainAttrib);
947  saveData(os, myRetainAttrib);
948  saveData(os, myRetainWeight);
949  saveData(os, mySilhouetteWeight);
950  saveData(os, myUseSilhouetteFalloff);
951  saveData(os, mySilhouetteFalloffDist);
952  saveData(os, myFrontFacingWeight);
953  saveData(os, myUseFrontFacingFalloff);
954  saveData(os, myFrontFacingFalloffDist);
955  {
956  int64 length = myControlattribs.entries();
957  UTwrite(os, &length);
958  for (exint i = 0; i < length; i++)
959  {
960  auto && _curentry = myControlattribs(i);
961  (void) _curentry;
962  saveData(os, _curentry.attribenabled);
963  saveData(os, _curentry.attribname);
964  saveData(os, _curentry.attribweight);
965 
966  }
967  }
968 
969  }
970 
971  bool load(UT_IStream &is)
972  {
973  int32 v;
974  is.bread(&v, 1);
975  if (version() != v)
976  {
977  // Fail incompatible versions
978  return false;
979  }
980  loadData(is, myGroup);
981  loadData(is, myTarget);
982  loadData(is, myPercentage);
983  loadData(is, myFinalCount);
984  loadData(is, myReducePassedTarget);
985  loadData(is, myQualityToleance);
986  loadData(is, myUseNormalDevThreshold);
987  loadData(is, myNormalDevThreshold);
988  loadData(is, myOriginalPoints);
989  loadData(is, myPreserveQuads);
990  loadData(is, myEqualizeLengths);
991  loadData(is, myBoundaryWeight);
992  loadData(is, myVAttribSeamWeight);
993  loadData(is, mySeamAttribs);
994  loadData(is, myHardFeaturePoints);
995  loadData(is, myHardFeatureEdges);
996  loadData(is, mySoftFeaturePoints);
997  loadData(is, mySoftFeaturePointWeight);
998  loadData(is, mySoftFeatureEdges);
999  loadData(is, mySoftFeatureEdgeWeight);
1000  loadData(is, myUseRetainAttrib);
1001  loadData(is, myRetainAttrib);
1002  loadData(is, myRetainWeight);
1003  loadData(is, mySilhouetteWeight);
1004  loadData(is, myUseSilhouetteFalloff);
1005  loadData(is, mySilhouetteFalloffDist);
1006  loadData(is, myFrontFacingWeight);
1007  loadData(is, myUseFrontFacingFalloff);
1008  loadData(is, myFrontFacingFalloffDist);
1009  {
1010  int64 length;
1011  is.read(&length, 1);
1012  myControlattribs.setSize(length);
1013  for (exint i = 0; i < length; i++)
1014  {
1015  auto && _curentry = myControlattribs(i);
1016  (void) _curentry;
1017  loadData(is, _curentry.attribenabled);
1018  loadData(is, _curentry.attribname);
1019  loadData(is, _curentry.attribweight);
1020 
1021  }
1022  }
1023 
1024  return true;
1025  }
1026 
1027  const UT_StringHolder & getGroup() const { return myGroup; }
1028  void setGroup(const UT_StringHolder & val) { myGroup = val; }
1030  {
1031  SOP_Node *thissop = cookparms.getNode();
1032  if (!thissop) return getGroup();
1034  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
1035  return result;
1036  }
1037  Target getTarget() const { return Target(myTarget); }
1038  void setTarget(Target val) { myTarget = int64(val); }
1039  Target opTarget(const SOP_NodeVerb::CookParms &cookparms) const
1040  {
1041  SOP_Node *thissop = cookparms.getNode();
1042  if (!thissop) return getTarget();
1043  int64 result;
1044  OP_Utils::evalOpParm(result, thissop, "target", cookparms.getCookTime(), 0);
1045  return Target(result);
1046  }
1047  fpreal64 getPercentage() const { return myPercentage; }
1048  void setPercentage(fpreal64 val) { myPercentage = val; }
1050  {
1051  SOP_Node *thissop = cookparms.getNode();
1052  if (!thissop) return getPercentage();
1053  fpreal64 result;
1054  OP_Utils::evalOpParm(result, thissop, "percentage", cookparms.getCookTime(), 0);
1055  return result;
1056  }
1057  int64 getFinalCount() const { return myFinalCount; }
1058  void setFinalCount(int64 val) { myFinalCount = val; }
1060  {
1061  SOP_Node *thissop = cookparms.getNode();
1062  if (!thissop) return getFinalCount();
1063  int64 result;
1064  OP_Utils::evalOpParm(result, thissop, "finalcount", cookparms.getCookTime(), 0);
1065  return result;
1066  }
1067  bool getReducePassedTarget() const { return myReducePassedTarget; }
1068  void setReducePassedTarget(bool val) { myReducePassedTarget = val; }
1069  bool opReducePassedTarget(const SOP_NodeVerb::CookParms &cookparms) const
1070  {
1071  SOP_Node *thissop = cookparms.getNode();
1072  if (!thissop) return getReducePassedTarget();
1073  bool result;
1074  OP_Utils::evalOpParm(result, thissop, "reducepassedtarget", cookparms.getCookTime(), 0);
1075  return result;
1076  }
1077  fpreal64 getQualityToleance() const { return myQualityToleance; }
1078  void setQualityToleance(fpreal64 val) { myQualityToleance = val; }
1080  {
1081  SOP_Node *thissop = cookparms.getNode();
1082  if (!thissop) return getQualityToleance();
1083  fpreal64 result;
1084  OP_Utils::evalOpParm(result, thissop, "qualitytolerance", cookparms.getCookTime(), 0);
1085  return result;
1086  }
1087  bool getUseNormalDevThreshold() const { return myUseNormalDevThreshold; }
1088  void setUseNormalDevThreshold(bool val) { myUseNormalDevThreshold = val; }
1090  {
1091  SOP_Node *thissop = cookparms.getNode();
1092  if (!thissop) return getUseNormalDevThreshold();
1093  bool result;
1094  OP_Utils::evalOpParm(result, thissop, "usenormaldevthreshold", cookparms.getCookTime(), 0);
1095  return result;
1096  }
1097  fpreal64 getNormalDevThreshold() const { return myNormalDevThreshold; }
1098  void setNormalDevThreshold(fpreal64 val) { myNormalDevThreshold = val; }
1100  {
1101  SOP_Node *thissop = cookparms.getNode();
1102  if (!thissop) return getNormalDevThreshold();
1103  fpreal64 result;
1104  OP_Utils::evalOpParm(result, thissop, "normaldevthreshold", cookparms.getCookTime(), 0);
1105  return result;
1106  }
1107  bool getOriginalPoints() const { return myOriginalPoints; }
1108  void setOriginalPoints(bool val) { myOriginalPoints = val; }
1109  bool opOriginalPoints(const SOP_NodeVerb::CookParms &cookparms) const
1110  {
1111  SOP_Node *thissop = cookparms.getNode();
1112  if (!thissop) return getOriginalPoints();
1113  bool result;
1114  OP_Utils::evalOpParm(result, thissop, "originalpoints", cookparms.getCookTime(), 0);
1115  return result;
1116  }
1117  bool getPreserveQuads() const { return myPreserveQuads; }
1118  void setPreserveQuads(bool val) { myPreserveQuads = val; }
1119  bool opPreserveQuads(const SOP_NodeVerb::CookParms &cookparms) const
1120  {
1121  SOP_Node *thissop = cookparms.getNode();
1122  if (!thissop) return getPreserveQuads();
1123  bool result;
1124  OP_Utils::evalOpParm(result, thissop, "preservequads", cookparms.getCookTime(), 0);
1125  return result;
1126  }
1127  fpreal64 getEqualizeLengths() const { return myEqualizeLengths; }
1128  void setEqualizeLengths(fpreal64 val) { myEqualizeLengths = val; }
1130  {
1131  SOP_Node *thissop = cookparms.getNode();
1132  if (!thissop) return getEqualizeLengths();
1133  fpreal64 result;
1134  OP_Utils::evalOpParm(result, thissop, "equalizelengths", cookparms.getCookTime(), 0);
1135  return result;
1136  }
1137  fpreal64 getBoundaryWeight() const { return myBoundaryWeight; }
1138  void setBoundaryWeight(fpreal64 val) { myBoundaryWeight = val; }
1140  {
1141  SOP_Node *thissop = cookparms.getNode();
1142  if (!thissop) return getBoundaryWeight();
1143  fpreal64 result;
1144  OP_Utils::evalOpParm(result, thissop, "boundaryweight", cookparms.getCookTime(), 0);
1145  return result;
1146  }
1147  fpreal64 getVAttribSeamWeight() const { return myVAttribSeamWeight; }
1148  void setVAttribSeamWeight(fpreal64 val) { myVAttribSeamWeight = val; }
1150  {
1151  SOP_Node *thissop = cookparms.getNode();
1152  if (!thissop) return getVAttribSeamWeight();
1153  fpreal64 result;
1154  OP_Utils::evalOpParm(result, thissop, "vattribseamweight", cookparms.getCookTime(), 0);
1155  return result;
1156  }
1157  const UT_StringHolder & getSeamAttribs() const { return mySeamAttribs; }
1158  void setSeamAttribs(const UT_StringHolder & val) { mySeamAttribs = val; }
1160  {
1161  SOP_Node *thissop = cookparms.getNode();
1162  if (!thissop) return getSeamAttribs();
1164  OP_Utils::evalOpParm(result, thissop, "seamattribs", cookparms.getCookTime(), 0);
1165  return result;
1166  }
1167  const UT_StringHolder & getHardFeaturePoints() const { return myHardFeaturePoints; }
1168  void setHardFeaturePoints(const UT_StringHolder & val) { myHardFeaturePoints = val; }
1170  {
1171  SOP_Node *thissop = cookparms.getNode();
1172  if (!thissop) return getHardFeaturePoints();
1174  OP_Utils::evalOpParm(result, thissop, "hardfeaturepoints", cookparms.getCookTime(), 0);
1175  return result;
1176  }
1177  const UT_StringHolder & getHardFeatureEdges() const { return myHardFeatureEdges; }
1178  void setHardFeatureEdges(const UT_StringHolder & val) { myHardFeatureEdges = val; }
1180  {
1181  SOP_Node *thissop = cookparms.getNode();
1182  if (!thissop) return getHardFeatureEdges();
1184  OP_Utils::evalOpParm(result, thissop, "hardfeatureedges", cookparms.getCookTime(), 0);
1185  return result;
1186  }
1187  const UT_StringHolder & getSoftFeaturePoints() const { return mySoftFeaturePoints; }
1188  void setSoftFeaturePoints(const UT_StringHolder & val) { mySoftFeaturePoints = val; }
1190  {
1191  SOP_Node *thissop = cookparms.getNode();
1192  if (!thissop) return getSoftFeaturePoints();
1194  OP_Utils::evalOpParm(result, thissop, "softfeaturepoints", cookparms.getCookTime(), 0);
1195  return result;
1196  }
1197  fpreal64 getSoftFeaturePointWeight() const { return mySoftFeaturePointWeight; }
1198  void setSoftFeaturePointWeight(fpreal64 val) { mySoftFeaturePointWeight = val; }
1200  {
1201  SOP_Node *thissop = cookparms.getNode();
1202  if (!thissop) return getSoftFeaturePointWeight();
1203  fpreal64 result;
1204  OP_Utils::evalOpParm(result, thissop, "softfeaturepointweight", cookparms.getCookTime(), 0);
1205  return result;
1206  }
1207  const UT_StringHolder & getSoftFeatureEdges() const { return mySoftFeatureEdges; }
1208  void setSoftFeatureEdges(const UT_StringHolder & val) { mySoftFeatureEdges = val; }
1210  {
1211  SOP_Node *thissop = cookparms.getNode();
1212  if (!thissop) return getSoftFeatureEdges();
1214  OP_Utils::evalOpParm(result, thissop, "softfeatureedges", cookparms.getCookTime(), 0);
1215  return result;
1216  }
1217  fpreal64 getSoftFeatureEdgeWeight() const { return mySoftFeatureEdgeWeight; }
1218  void setSoftFeatureEdgeWeight(fpreal64 val) { mySoftFeatureEdgeWeight = val; }
1220  {
1221  SOP_Node *thissop = cookparms.getNode();
1222  if (!thissop) return getSoftFeatureEdgeWeight();
1223  fpreal64 result;
1224  OP_Utils::evalOpParm(result, thissop, "softfeatureedgeweight", cookparms.getCookTime(), 0);
1225  return result;
1226  }
1227  bool getUseRetainAttrib() const { return myUseRetainAttrib; }
1228  void setUseRetainAttrib(bool val) { myUseRetainAttrib = val; }
1229  bool opUseRetainAttrib(const SOP_NodeVerb::CookParms &cookparms) const
1230  {
1231  SOP_Node *thissop = cookparms.getNode();
1232  if (!thissop) return getUseRetainAttrib();
1233  bool result;
1234  OP_Utils::evalOpParm(result, thissop, "useretainattrib", cookparms.getCookTime(), 0);
1235  return result;
1236  }
1237  const UT_StringHolder & getRetainAttrib() const { return myRetainAttrib; }
1238  void setRetainAttrib(const UT_StringHolder & val) { myRetainAttrib = val; }
1240  {
1241  SOP_Node *thissop = cookparms.getNode();
1242  if (!thissop) return getRetainAttrib();
1244  OP_Utils::evalOpParm(result, thissop, "retainattrib", cookparms.getCookTime(), 0);
1245  return result;
1246  }
1247  fpreal64 getRetainWeight() const { return myRetainWeight; }
1248  void setRetainWeight(fpreal64 val) { myRetainWeight = val; }
1250  {
1251  SOP_Node *thissop = cookparms.getNode();
1252  if (!thissop) return getRetainWeight();
1253  fpreal64 result;
1254  OP_Utils::evalOpParm(result, thissop, "retainattribweight", cookparms.getCookTime(), 0);
1255  return result;
1256  }
1257  fpreal64 getSilhouetteWeight() const { return mySilhouetteWeight; }
1258  void setSilhouetteWeight(fpreal64 val) { mySilhouetteWeight = val; }
1260  {
1261  SOP_Node *thissop = cookparms.getNode();
1262  if (!thissop) return getSilhouetteWeight();
1263  fpreal64 result;
1264  OP_Utils::evalOpParm(result, thissop, "silhouetteweight", cookparms.getCookTime(), 0);
1265  return result;
1266  }
1267  bool getUseSilhouetteFalloff() const { return myUseSilhouetteFalloff; }
1268  void setUseSilhouetteFalloff(bool val) { myUseSilhouetteFalloff = val; }
1270  {
1271  SOP_Node *thissop = cookparms.getNode();
1272  if (!thissop) return getUseSilhouetteFalloff();
1273  bool result;
1274  OP_Utils::evalOpParm(result, thissop, "usesilhouettefalloff", cookparms.getCookTime(), 0);
1275  return result;
1276  }
1277  fpreal64 getSilhouetteFalloffDist() const { return mySilhouetteFalloffDist; }
1278  void setSilhouetteFalloffDist(fpreal64 val) { mySilhouetteFalloffDist = val; }
1280  {
1281  SOP_Node *thissop = cookparms.getNode();
1282  if (!thissop) return getSilhouetteFalloffDist();
1283  fpreal64 result;
1284  OP_Utils::evalOpParm(result, thissop, "silhouettefalloffdist", cookparms.getCookTime(), 0);
1285  return result;
1286  }
1287  fpreal64 getFrontFacingWeight() const { return myFrontFacingWeight; }
1288  void setFrontFacingWeight(fpreal64 val) { myFrontFacingWeight = val; }
1290  {
1291  SOP_Node *thissop = cookparms.getNode();
1292  if (!thissop) return getFrontFacingWeight();
1293  fpreal64 result;
1294  OP_Utils::evalOpParm(result, thissop, "frontfacingweight", cookparms.getCookTime(), 0);
1295  return result;
1296  }
1297  bool getUseFrontFacingFalloff() const { return myUseFrontFacingFalloff; }
1298  void setUseFrontFacingFalloff(bool val) { myUseFrontFacingFalloff = val; }
1300  {
1301  SOP_Node *thissop = cookparms.getNode();
1302  if (!thissop) return getUseFrontFacingFalloff();
1303  bool result;
1304  OP_Utils::evalOpParm(result, thissop, "usefrontfacingfalloff", cookparms.getCookTime(), 0);
1305  return result;
1306  }
1307  fpreal64 getFrontFacingFalloffDist() const { return myFrontFacingFalloffDist; }
1308  void setFrontFacingFalloffDist(fpreal64 val) { myFrontFacingFalloffDist = val; }
1310  {
1311  SOP_Node *thissop = cookparms.getNode();
1312  if (!thissop) return getFrontFacingFalloffDist();
1313  fpreal64 result;
1314  OP_Utils::evalOpParm(result, thissop, "frontfacingfalloffdist", cookparms.getCookTime(), 0);
1315  return result;
1316  }
1317  const UT_Array<Controlattribs> &getControlattribs() const { return myControlattribs; }
1318 void setControlattribs(const UT_Array<Controlattribs> &val) { myControlattribs = val; }
1320  {
1321  SOP_Node *thissop = cookparms.getNode();
1322  if (!thissop) return getControlattribs().entries();
1323  exint result;
1324  OP_Utils::evalOpParm(result, thissop, "controlattribs", cookparms.getCookTime(), 0);
1325  return result;
1326  }
1327  bool opControlattribs_attribenabled(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1328  { return opinstControlattribs_attribenabled(cookparms, &_idx); }
1329  bool opinstControlattribs_attribenabled(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1330  {
1331  SOP_Node *thissop = cookparms.getNode();
1332  if (!thissop) return (myControlattribs(_idx[0]).attribenabled);
1333  int _parmidx[2-1];
1334  _parmidx[1-1] = _idx[1-1] + 1;
1335 
1336  bool result;
1337  OP_Utils::evalOpParmInst(result, thissop, "attribenabled#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1338  return (result);
1339  }
1341  { return opinstControlattribs_attribname(cookparms, &_idx); }
1343  {
1344  SOP_Node *thissop = cookparms.getNode();
1345  if (!thissop) return (myControlattribs(_idx[0]).attribname);
1346  int _parmidx[2-1];
1347  _parmidx[1-1] = _idx[1-1] + 1;
1348 
1350  OP_Utils::evalOpParmInst(result, thissop, "attribname#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1351  return (result);
1352  }
1354  { return opinstControlattribs_attribweight(cookparms, &_idx); }
1355  fpreal64 opinstControlattribs_attribweight(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1356  {
1357  SOP_Node *thissop = cookparms.getNode();
1358  if (!thissop) return (myControlattribs(_idx[0]).attribweight);
1359  int _parmidx[2-1];
1360  _parmidx[1-1] = _idx[1-1] + 1;
1361 
1362  fpreal64 result;
1363  OP_Utils::evalOpParmInst(result, thissop, "attribweight#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1364  return (result);
1365  }
1366 
1367 
1368 private:
1369  UT_StringHolder myGroup;
1370  int64 myTarget;
1371  fpreal64 myPercentage;
1372  int64 myFinalCount;
1373  bool myReducePassedTarget;
1374  fpreal64 myQualityToleance;
1375  bool myUseNormalDevThreshold;
1376  fpreal64 myNormalDevThreshold;
1377  bool myOriginalPoints;
1378  bool myPreserveQuads;
1379  fpreal64 myEqualizeLengths;
1380  fpreal64 myBoundaryWeight;
1381  fpreal64 myVAttribSeamWeight;
1382  UT_StringHolder mySeamAttribs;
1383  UT_StringHolder myHardFeaturePoints;
1384  UT_StringHolder myHardFeatureEdges;
1385  UT_StringHolder mySoftFeaturePoints;
1386  fpreal64 mySoftFeaturePointWeight;
1387  UT_StringHolder mySoftFeatureEdges;
1388  fpreal64 mySoftFeatureEdgeWeight;
1389  bool myUseRetainAttrib;
1390  UT_StringHolder myRetainAttrib;
1391  fpreal64 myRetainWeight;
1392  fpreal64 mySilhouetteWeight;
1393  bool myUseSilhouetteFalloff;
1394  fpreal64 mySilhouetteFalloffDist;
1395  fpreal64 myFrontFacingWeight;
1396  bool myUseFrontFacingFalloff;
1397  fpreal64 myFrontFacingFalloffDist;
1398  UT_Array<Controlattribs> myControlattribs;
1399 
1400 };
static void loadData(UT_IStream &is, UT_Vector3D &v)
virtual NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused=false) const =0
type
Definition: core.h:556
void save(std::ostream &os) const
static void saveData(std::ostream &os, fpreal64 v)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setFrontFacingWeight(fpreal64 val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
fpreal64 getSoftFeaturePointWeight() const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
fpreal64 getFrontFacingFalloffDist() const
void copyFrom(const OP_NodeParms *src) override
fpreal64 opQualityToleance(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
const UT_StringHolder & getSoftFeaturePoints() const
void
Definition: png.h:1083
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
void setControlattribs(const UT_Array< Controlattribs > &val)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_Vector4D v)
bool opUseSilhouetteFalloff(const SOP_NodeVerb::CookParms &cookparms) const
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
static void saveData(std::ostream &os, UT_Matrix2D v)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
const UT_StringHolder & getRetainAttrib() const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
UT_StringHolder opSoftFeaturePoints(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_PolyReduce_2_0Parms &src) const
bool isParmColorRamp(exint idx) const override
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, bool &v)
GLdouble s
Definition: glad.h:3009
static void loadData(UT_IStream &is, UT_Vector4D &v)
UT_StringHolder opHardFeaturePoints(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
fpreal64 opinstControlattribs_attribweight(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
**But if you need a result
Definition: thread.h:622
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
bool operator!=(const Controlattribs &src) const
void setSoftFeatureEdges(const UT_StringHolder &val)
void setFrontFacingFalloffDist(fpreal64 val)
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_StringHolder opSoftFeatureEdges(const SOP_NodeVerb::CookParms &cookparms) const
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.
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setSilhouetteFalloffDist(fpreal64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setSoftFeaturePointWeight(fpreal64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
double fpreal64
Definition: SYS_Types.h:201
Target opTarget(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
exint opControlattribs(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
fpreal64 opFrontFacingWeight(const SOP_NodeVerb::CookParms &cookparms) const
void setRetainAttrib(const UT_StringHolder &val)
fpreal64 opSoftFeatureEdgeWeight(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
int64 opFinalCount(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
fpreal64 opControlattribs_attribweight(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint length() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
fpreal64 opSilhouetteFalloffDist(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNormalDevThreshold(fpreal64 val)
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void setVAttribSeamWeight(fpreal64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool opUseNormalDevThreshold(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
long long int64
Definition: SYS_Types.h:116
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool opOriginalPoints(const SOP_NodeVerb::CookParms &cookparms) const
bool opUseFrontFacingFalloff(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getHardFeatureEdges() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
bool opPreserveQuads(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opNormalDevThreshold(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
fpreal64 opSoftFeaturePointWeight(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
fpreal64 opSilhouetteWeight(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strcat(const char *src)
fpreal64 opBoundaryWeight(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
void setSilhouetteWeight(fpreal64 val)
fpreal64 opEqualizeLengths(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
UT_StringHolder opRetainAttrib(const SOP_NodeVerb::CookParms &cookparms) const
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:655
bool operator==(const SOP_PolyReduce_2_0Parms &src) const
static void loadData(UT_IStream &is, fpreal64 &v)
UT_StringHolder opControlattribs_attribname(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setHardFeatureEdges(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
SYS_FORCE_INLINE UT_StringHolder getToken(Target enum_value)
fpreal64 opRetainWeight(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
fpreal64 fpreal
Definition: SYS_Types.h:278
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
bool opControlattribs_attribenabled(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint getNestNumParms(TempIndex idx) const override
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
void setGroup(const UT_StringHolder &val)
fpreal64 getSoftFeatureEdgeWeight() const
bool operator==(const Controlattribs &src) const
static void saveData(std::ostream &os, UT_Matrix3D v)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
fpreal64 opPercentage(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLfloat * val
Definition: glcorearb.h:1608
fpreal64 opFrontFacingFalloffDist(const SOP_NodeVerb::CookParms &cookparms) const
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
UT_StringHolder opHardFeatureEdges(const SOP_NodeVerb::CookParms &cookparms) const
#define SOP_API
Definition: SOP_API.h:10
const UT_StringHolder & getSeamAttribs() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool opinstControlattribs_attribenabled(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opUseRetainAttrib(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder createString(const UT_Array< Controlattribs > &list) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
const UT_StringHolder & getHardFeaturePoints() const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, bool v)
void setSoftFeatureEdgeWeight(fpreal64 val)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
GLboolean r
Definition: glcorearb.h:1222
UT_StringHolder opSeamAttribs(const SOP_NodeVerb::CookParms &cookparms) const
void setSeamAttribs(const UT_StringHolder &val)
const UT_Array< Controlattribs > & getControlattribs() const
const UT_StringHolder & getSoftFeatureEdges() const
void setSoftFeaturePoints(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool opReducePassedTarget(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getSilhouetteFalloffDist() const
const char * getNestParmName(TempIndex fieldnum) const override
UT_StringHolder opinstControlattribs_attribname(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
void setHardFeaturePoints(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
ParmType getNestParmType(TempIndex fieldnum) const override
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
fpreal64 opVAttribSeamWeight(const SOP_NodeVerb::CookParms &cookparms) const