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