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