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