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