HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Triangulate2D-3.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_Triangulate2D_3_0Enums
24 {
25  enum class PlanePosSrc
26  {
27  FITPLANE = 0,
28  SETPROJPLANE,
29  USEATTRIB
30  };
31  enum class TriangleSize
32  {
33  UNRESTRICTED = 0,
34  CAPMAXAREA,
36  };
37 }
38 
39 
41 {
42 public:
43  static int version() { return 1; }
44 
46  {
47  myPoints = ""_sh;
48  myPlanePosSrc = 0;
49  myOrigin = UT_Vector3D(0,0,0);
50  myDist = 0;
51  myDir = UT_Vector3D(0,1,0);
52  myPos2AttribName = ""_sh;
53  myUseConstrEdges = false;
54  myConstrEdges = ""_sh;
55  myUseConstrPolys = false;
56  myConstrPolys = ""_sh;
57  myIgnorePolyBridges = false;
58  myUseSilhouettePolys = false;
59  mySilhouettePolys = ""_sh;
60  myAllowConstrSplit = true;
61  myUseExactConstruction = false;
62  myIgnoreNonConstrPts = false;
63  myRemoveFromConvexHull = false;
64  myRemoveFromConstrPolys = false;
65  myRemoveOutsideSilhouette = false;
66  myRefine = false;
67  myAllowRefineConstrSplits = true;
68  myEncroachAngle = 180;
69  myMinAngle = 0;
70  myTriangleSize = 0;
71  myMaxArea = 10000;
72  myTargetEdgeLength = 100;
73  myMinEdgeLength = 0.0001;
74  myMaxNewPts = 5000;
75  myNumLloydSteps = 0;
76  myAllowMovingInteriorInputPts = false;
77  myRestorePos = false;
78  myKeepPrims = false;
79  myUpdateNormals = true;
80  myRemoveUnusedPts = true;
81  myRemoveDuplicatePts = true;
82  myUseConstrSplitPtsGrp = false;
83  myConstrSplitPtsGrp = "constrsplitpts"_sh;
84  myUseConstrdEdges = false;
85  myConstrdEdges = "constrdedges"_sh;
86  myRandomSeed = 5678;
87 
88  }
89 
90  explicit SOP_Triangulate2D_3_0Parms(const SOP_Triangulate2D_3_0Parms &) = default;
91 
93 
95  {
96  if (myPoints != src.myPoints) return false;
97  if (myPlanePosSrc != src.myPlanePosSrc) return false;
98  if (myOrigin != src.myOrigin) return false;
99  if (myDist != src.myDist) return false;
100  if (myDir != src.myDir) return false;
101  if (myPos2AttribName != src.myPos2AttribName) return false;
102  if (myUseConstrEdges != src.myUseConstrEdges) return false;
103  if (myConstrEdges != src.myConstrEdges) return false;
104  if (myUseConstrPolys != src.myUseConstrPolys) return false;
105  if (myConstrPolys != src.myConstrPolys) return false;
106  if (myIgnorePolyBridges != src.myIgnorePolyBridges) return false;
107  if (myUseSilhouettePolys != src.myUseSilhouettePolys) return false;
108  if (mySilhouettePolys != src.mySilhouettePolys) return false;
109  if (myAllowConstrSplit != src.myAllowConstrSplit) return false;
110  if (myUseExactConstruction != src.myUseExactConstruction) return false;
111  if (myIgnoreNonConstrPts != src.myIgnoreNonConstrPts) return false;
112  if (myRemoveFromConvexHull != src.myRemoveFromConvexHull) return false;
113  if (myRemoveFromConstrPolys != src.myRemoveFromConstrPolys) return false;
114  if (myRemoveOutsideSilhouette != src.myRemoveOutsideSilhouette) return false;
115  if (myRefine != src.myRefine) return false;
116  if (myAllowRefineConstrSplits != src.myAllowRefineConstrSplits) return false;
117  if (myEncroachAngle != src.myEncroachAngle) return false;
118  if (myMinAngle != src.myMinAngle) return false;
119  if (myTriangleSize != src.myTriangleSize) return false;
120  if (myMaxArea != src.myMaxArea) return false;
121  if (myTargetEdgeLength != src.myTargetEdgeLength) return false;
122  if (myMinEdgeLength != src.myMinEdgeLength) return false;
123  if (myMaxNewPts != src.myMaxNewPts) return false;
124  if (myNumLloydSteps != src.myNumLloydSteps) return false;
125  if (myAllowMovingInteriorInputPts != src.myAllowMovingInteriorInputPts) return false;
126  if (myRestorePos != src.myRestorePos) return false;
127  if (myKeepPrims != src.myKeepPrims) return false;
128  if (myUpdateNormals != src.myUpdateNormals) return false;
129  if (myRemoveUnusedPts != src.myRemoveUnusedPts) return false;
130  if (myRemoveDuplicatePts != src.myRemoveDuplicatePts) return false;
131  if (myUseConstrSplitPtsGrp != src.myUseConstrSplitPtsGrp) return false;
132  if (myConstrSplitPtsGrp != src.myConstrSplitPtsGrp) return false;
133  if (myUseConstrdEdges != src.myUseConstrdEdges) return false;
134  if (myConstrdEdges != src.myConstrdEdges) return false;
135  if (myRandomSeed != src.myRandomSeed) return false;
136 
137  return true;
138  }
140  {
141  return !operator==(src);
142  }
145 
146 
147 
148  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
149  {
150  myPoints = ""_sh;
151  if (true)
152  graph->evalOpParm(myPoints, nodeidx, "points", time, 0);
153  myPlanePosSrc = 0;
154  if (true)
155  graph->evalOpParm(myPlanePosSrc, nodeidx, "planepossrc", time, 0);
156  myOrigin = UT_Vector3D(0,0,0);
157  if (true && ( (!(((int64(getPlanePosSrc())!=1)))) ) )
158  graph->evalOpParm(myOrigin, nodeidx, "origin", time, 0);
159  myDist = 0;
160  if (true && ( (!(((int64(getPlanePosSrc())!=1)))) ) )
161  graph->evalOpParm(myDist, nodeidx, "dist", time, 0);
162  myDir = UT_Vector3D(0,1,0);
163  if (true && ( (!(((int64(getPlanePosSrc())!=1)))) ) )
164  graph->evalOpParm(myDir, nodeidx, "dir", time, 0);
165  myPos2AttribName = ""_sh;
166  if (true && ( (!(((int64(getPlanePosSrc())!=2)))) ) )
167  graph->evalOpParm(myPos2AttribName, nodeidx, "pos2attrib", time, 0);
168  myUseConstrEdges = false;
169  if (true)
170  graph->evalOpParm(myUseConstrEdges, nodeidx, "useconstredges", time, 0);
171  myConstrEdges = ""_sh;
172  if (true && ( (!(((getUseConstrEdges()==0)))) ) )
173  graph->evalOpParm(myConstrEdges, nodeidx, "constredges", time, 0);
174  myUseConstrPolys = false;
175  if (true)
176  graph->evalOpParm(myUseConstrPolys, nodeidx, "useconstrpolys", time, 0);
177  myConstrPolys = ""_sh;
178  if (true && ( (!(((getUseConstrPolys()==0)))) ) )
179  graph->evalOpParm(myConstrPolys, nodeidx, "constrpolys", time, 0);
180  myIgnorePolyBridges = false;
181  if (true && ( (!(((getUseConstrPolys()==0)))) ) )
182  graph->evalOpParm(myIgnorePolyBridges, nodeidx, "ignorepolybridges", time, 0);
183  myUseSilhouettePolys = false;
184  if (true)
185  graph->evalOpParm(myUseSilhouettePolys, nodeidx, "usesilhouettepolys", time, 0);
186  mySilhouettePolys = ""_sh;
187  if (true && ( (!(((getUseSilhouettePolys()==0)))) ) )
188  graph->evalOpParm(mySilhouettePolys, nodeidx, "silhouettepolys", time, 0);
189  myAllowConstrSplit = true;
190  if (true)
191  graph->evalOpParm(myAllowConstrSplit, nodeidx, "allowconstrsplit", time, 0);
192  myUseExactConstruction = false;
193  if (true && ( (!(((getAllowConstrSplit()==0)))) ) )
194  graph->evalOpParm(myUseExactConstruction, nodeidx, "useexactconstruction", time, 0);
195  myIgnoreNonConstrPts = false;
196  if (true && ( (!(((getUseConstrEdges()==0)&&(getUseConstrPolys()==0)&&(getUseSilhouettePolys()==0)))) ) )
197  graph->evalOpParm(myIgnoreNonConstrPts, nodeidx, "ignorenonconstrpts", time, 0);
198  myRemoveFromConvexHull = false;
199  if (true && ( (!(((getUseConstrEdges()==0)&&(getUseConstrPolys()==0)&&(getUseSilhouettePolys()==0)))) ) )
200  graph->evalOpParm(myRemoveFromConvexHull, nodeidx, "removefromconvexhull", time, 0);
201  myRemoveFromConstrPolys = false;
202  if (true && ( (!(((getUseConstrPolys()==0)))) ) )
203  graph->evalOpParm(myRemoveFromConstrPolys, nodeidx, "removefromconstrpolys", time, 0);
204  myRemoveOutsideSilhouette = false;
205  if (true && ( (!(((getUseSilhouettePolys()==0)))) ) )
206  graph->evalOpParm(myRemoveOutsideSilhouette, nodeidx, "removeoutsidesilhouette", time, 0);
207  myRefine = false;
208  if (true)
209  graph->evalOpParm(myRefine, nodeidx, "refine", time, 0);
210  myAllowRefineConstrSplits = true;
211  if (true)
212  graph->evalOpParm(myAllowRefineConstrSplits, nodeidx, "allowrefineonstrsplit", time, 0);
213  myEncroachAngle = 180;
214  if (true && ( (!(((getAllowRefineConstrSplits()==1)))) ) )
215  graph->evalOpParm(myEncroachAngle, nodeidx, "encroachangle", time, 0);
216  myMinAngle = 0;
217  if (true && ( (!(((getRefine()==0)))) ) )
218  graph->evalOpParm(myMinAngle, nodeidx, "minangle", time, 0);
219  myTriangleSize = 0;
220  if (true && ( (!(((getRefine()==0)))) ) )
221  graph->evalOpParm(myTriangleSize, nodeidx, "trianglesize", time, 0);
222  myMaxArea = 10000;
223  if (true && ( (!(((int64(getTriangleSize())!=1))||((getRefine()==0)))) ) )
224  graph->evalOpParm(myMaxArea, nodeidx, "maxarea", time, 0);
225  myTargetEdgeLength = 100;
226  if (true && ( (!(((int64(getTriangleSize())!=2))||((getRefine()==0)))) ) )
227  graph->evalOpParm(myTargetEdgeLength, nodeidx, "targetedgelength", time, 0);
228  myMinEdgeLength = 0.0001;
229  if (true && ( (!(((getRefine()==0)))) ) )
230  graph->evalOpParm(myMinEdgeLength, nodeidx, "minedgelength", time, 0);
231  myMaxNewPts = 5000;
232  if (true && ( (!(((getRefine()==0)))) ) )
233  graph->evalOpParm(myMaxNewPts, nodeidx, "maxnewpts", time, 0);
234  myNumLloydSteps = 0;
235  if (true && ( (!(((getRefine()==0)))) ) )
236  graph->evalOpParm(myNumLloydSteps, nodeidx, "lloydsteps", time, 0);
237  myAllowMovingInteriorInputPts = false;
238  if (true && ( (!(((getRefine()==0))||((int64(getNumLloydSteps())==0)))) ) )
239  graph->evalOpParm(myAllowMovingInteriorInputPts, nodeidx, "allowmovinginteriorpts", time, 0);
240  myRestorePos = false;
241  if (true)
242  graph->evalOpParm(myRestorePos, nodeidx, "restorepos", time, 0);
243  myKeepPrims = false;
244  if (true)
245  graph->evalOpParm(myKeepPrims, nodeidx, "keepprims", time, 0);
246  myUpdateNormals = true;
247  if (true)
248  graph->evalOpParm(myUpdateNormals, nodeidx, "updatenmls", time, 0);
249  myRemoveUnusedPts = true;
250  if (true)
251  graph->evalOpParm(myRemoveUnusedPts, nodeidx, "removeunusedpoints", time, 0);
252  myRemoveDuplicatePts = true;
253  if (true)
254  graph->evalOpParm(myRemoveDuplicatePts, nodeidx, "removeduplicatepoints", time, 0);
255  myUseConstrSplitPtsGrp = false;
256  if (true && ( (!(((getAllowConstrSplit()==0)))) ) )
257  graph->evalOpParm(myUseConstrSplitPtsGrp, nodeidx, "usecontrsplitptgrp", time, 0);
258  myConstrSplitPtsGrp = "constrsplitpts"_sh;
259  if (true && ( (!(((getUseConstrSplitPtsGrp()==0)))) ) )
260  graph->evalOpParm(myConstrSplitPtsGrp, nodeidx, "constrsplitptgrp", time, 0);
261  myUseConstrdEdges = false;
262  if (true)
263  graph->evalOpParm(myUseConstrdEdges, nodeidx, "useconstrdedges", time, 0);
264  myConstrdEdges = "constrdedges"_sh;
265  if (true && ( (!(((getUseConstrdEdges()==0)))) ) )
266  graph->evalOpParm(myConstrdEdges, nodeidx, "constrdedges", time, 0);
267  myRandomSeed = 5678;
268  if (true)
269  graph->evalOpParm(myRandomSeed, nodeidx, "randseed", time, 0);
270 
271  }
272 
273 
274  void loadFromOpSubclass(const LoadParms &loadparms) override
275  {
276  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
277  }
278 
279 
280  void copyFrom(const SOP_NodeParms *src) override
281  {
282  *this = *((const SOP_Triangulate2D_3_0Parms *)src);
283  }
284 
285  template <typename T>
286  void
287  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
288  {
289  if (idx.size() < 1)
290  return;
291  UT_ASSERT(idx.size() == instance.size()+1);
292  if (idx.size() != instance.size()+1)
293  return;
294  switch (idx[0])
295  {
296  case 0:
297  coerceValue(value, myPoints);
298  break;
299  case 1:
300  coerceValue(value, myPlanePosSrc);
301  break;
302  case 2:
303  coerceValue(value, myOrigin);
304  break;
305  case 3:
306  coerceValue(value, myDist);
307  break;
308  case 4:
309  coerceValue(value, myDir);
310  break;
311  case 5:
312  coerceValue(value, myPos2AttribName);
313  break;
314  case 6:
315  coerceValue(value, myUseConstrEdges);
316  break;
317  case 7:
318  coerceValue(value, myConstrEdges);
319  break;
320  case 8:
321  coerceValue(value, myUseConstrPolys);
322  break;
323  case 9:
324  coerceValue(value, myConstrPolys);
325  break;
326  case 10:
327  coerceValue(value, myIgnorePolyBridges);
328  break;
329  case 11:
330  coerceValue(value, myUseSilhouettePolys);
331  break;
332  case 12:
333  coerceValue(value, mySilhouettePolys);
334  break;
335  case 13:
336  coerceValue(value, myAllowConstrSplit);
337  break;
338  case 14:
339  coerceValue(value, myUseExactConstruction);
340  break;
341  case 15:
342  coerceValue(value, myIgnoreNonConstrPts);
343  break;
344  case 16:
345  coerceValue(value, myRemoveFromConvexHull);
346  break;
347  case 17:
348  coerceValue(value, myRemoveFromConstrPolys);
349  break;
350  case 18:
351  coerceValue(value, myRemoveOutsideSilhouette);
352  break;
353  case 19:
354  coerceValue(value, myRefine);
355  break;
356  case 20:
357  coerceValue(value, myAllowRefineConstrSplits);
358  break;
359  case 21:
360  coerceValue(value, myEncroachAngle);
361  break;
362  case 22:
363  coerceValue(value, myMinAngle);
364  break;
365  case 23:
366  coerceValue(value, myTriangleSize);
367  break;
368  case 24:
369  coerceValue(value, myMaxArea);
370  break;
371  case 25:
372  coerceValue(value, myTargetEdgeLength);
373  break;
374  case 26:
375  coerceValue(value, myMinEdgeLength);
376  break;
377  case 27:
378  coerceValue(value, myMaxNewPts);
379  break;
380  case 28:
381  coerceValue(value, myNumLloydSteps);
382  break;
383  case 29:
384  coerceValue(value, myAllowMovingInteriorInputPts);
385  break;
386  case 30:
387  coerceValue(value, myRestorePos);
388  break;
389  case 31:
390  coerceValue(value, myKeepPrims);
391  break;
392  case 32:
393  coerceValue(value, myUpdateNormals);
394  break;
395  case 33:
396  coerceValue(value, myRemoveUnusedPts);
397  break;
398  case 34:
399  coerceValue(value, myRemoveDuplicatePts);
400  break;
401  case 35:
402  coerceValue(value, myUseConstrSplitPtsGrp);
403  break;
404  case 36:
405  coerceValue(value, myConstrSplitPtsGrp);
406  break;
407  case 37:
408  coerceValue(value, myUseConstrdEdges);
409  break;
410  case 38:
411  coerceValue(value, myConstrdEdges);
412  break;
413  case 39:
414  coerceValue(value, myRandomSeed);
415  break;
416 
417  }
418  }
419 
420  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
421  { doGetParmValue(idx, instance, value); }
422  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
423  { doGetParmValue(idx, instance, value); }
424  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
425  { doGetParmValue(idx, instance, value); }
426  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
427  { doGetParmValue(idx, instance, value); }
428  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
429  { doGetParmValue(idx, instance, value); }
430  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
431  { doGetParmValue(idx, instance, value); }
432  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
433  { doGetParmValue(idx, instance, value); }
434  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
435  { doGetParmValue(idx, instance, value); }
436  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
437  { doGetParmValue(idx, instance, value); }
438  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
439  { doGetParmValue(idx, instance, value); }
440  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
441  { doGetParmValue(idx, instance, value); }
442 
443  template <typename T>
444  void
445  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
446  {
447  if (idx.size() < 1)
448  return;
449  UT_ASSERT(idx.size() == instance.size()+1);
450  if (idx.size() != instance.size()+1)
451  return;
452  switch (idx[0])
453  {
454  case 0:
455  coerceValue(myPoints, value);
456  break;
457  case 1:
458  coerceValue(myPlanePosSrc, value);
459  break;
460  case 2:
461  coerceValue(myOrigin, value);
462  break;
463  case 3:
464  coerceValue(myDist, value);
465  break;
466  case 4:
467  coerceValue(myDir, value);
468  break;
469  case 5:
470  coerceValue(myPos2AttribName, value);
471  break;
472  case 6:
473  coerceValue(myUseConstrEdges, value);
474  break;
475  case 7:
476  coerceValue(myConstrEdges, value);
477  break;
478  case 8:
479  coerceValue(myUseConstrPolys, value);
480  break;
481  case 9:
482  coerceValue(myConstrPolys, value);
483  break;
484  case 10:
485  coerceValue(myIgnorePolyBridges, value);
486  break;
487  case 11:
488  coerceValue(myUseSilhouettePolys, value);
489  break;
490  case 12:
491  coerceValue(mySilhouettePolys, value);
492  break;
493  case 13:
494  coerceValue(myAllowConstrSplit, value);
495  break;
496  case 14:
497  coerceValue(myUseExactConstruction, value);
498  break;
499  case 15:
500  coerceValue(myIgnoreNonConstrPts, value);
501  break;
502  case 16:
503  coerceValue(myRemoveFromConvexHull, value);
504  break;
505  case 17:
506  coerceValue(myRemoveFromConstrPolys, value);
507  break;
508  case 18:
509  coerceValue(myRemoveOutsideSilhouette, value);
510  break;
511  case 19:
512  coerceValue(myRefine, value);
513  break;
514  case 20:
515  coerceValue(myAllowRefineConstrSplits, value);
516  break;
517  case 21:
518  coerceValue(myEncroachAngle, value);
519  break;
520  case 22:
521  coerceValue(myMinAngle, value);
522  break;
523  case 23:
524  coerceValue(myTriangleSize, value);
525  break;
526  case 24:
527  coerceValue(myMaxArea, value);
528  break;
529  case 25:
530  coerceValue(myTargetEdgeLength, value);
531  break;
532  case 26:
533  coerceValue(myMinEdgeLength, value);
534  break;
535  case 27:
536  coerceValue(myMaxNewPts, value);
537  break;
538  case 28:
539  coerceValue(myNumLloydSteps, value);
540  break;
541  case 29:
542  coerceValue(myAllowMovingInteriorInputPts, value);
543  break;
544  case 30:
545  coerceValue(myRestorePos, value);
546  break;
547  case 31:
548  coerceValue(myKeepPrims, value);
549  break;
550  case 32:
551  coerceValue(myUpdateNormals, value);
552  break;
553  case 33:
554  coerceValue(myRemoveUnusedPts, value);
555  break;
556  case 34:
557  coerceValue(myRemoveDuplicatePts, value);
558  break;
559  case 35:
560  coerceValue(myUseConstrSplitPtsGrp, value);
561  break;
562  case 36:
563  coerceValue(myConstrSplitPtsGrp, value);
564  break;
565  case 37:
566  coerceValue(myUseConstrdEdges, value);
567  break;
568  case 38:
569  coerceValue(myConstrdEdges, value);
570  break;
571  case 39:
572  coerceValue(myRandomSeed, value);
573  break;
574 
575  }
576  }
577 
578  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
579  { doSetParmValue(idx, instance, value); }
580  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
581  { doSetParmValue(idx, instance, value); }
582  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
583  { doSetParmValue(idx, instance, value); }
584  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
585  { doSetParmValue(idx, instance, value); }
586  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
587  { doSetParmValue(idx, instance, value); }
588  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
589  { doSetParmValue(idx, instance, value); }
590  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
591  { doSetParmValue(idx, instance, value); }
592  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
593  { doSetParmValue(idx, instance, value); }
594  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
595  { doSetParmValue(idx, instance, value); }
596  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
597  { doSetParmValue(idx, instance, value); }
598  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
599  { doSetParmValue(idx, instance, value); }
600 
601  exint getNestNumParms(TempIndex idx) const override
602  {
603  if (idx.size() == 0)
604  return 40;
605  switch (idx[0])
606  {
607 
608  }
609  // Invalid
610  return 0;
611  }
612 
613  const char *getNestParmName(TempIndex fieldnum) const override
614  {
615  if (fieldnum.size() < 1)
616  return 0;
617  switch (fieldnum[0])
618  {
619  case 0:
620  return "points";
621  case 1:
622  return "planepossrc";
623  case 2:
624  return "origin";
625  case 3:
626  return "dist";
627  case 4:
628  return "dir";
629  case 5:
630  return "pos2attrib";
631  case 6:
632  return "useconstredges";
633  case 7:
634  return "constredges";
635  case 8:
636  return "useconstrpolys";
637  case 9:
638  return "constrpolys";
639  case 10:
640  return "ignorepolybridges";
641  case 11:
642  return "usesilhouettepolys";
643  case 12:
644  return "silhouettepolys";
645  case 13:
646  return "allowconstrsplit";
647  case 14:
648  return "useexactconstruction";
649  case 15:
650  return "ignorenonconstrpts";
651  case 16:
652  return "removefromconvexhull";
653  case 17:
654  return "removefromconstrpolys";
655  case 18:
656  return "removeoutsidesilhouette";
657  case 19:
658  return "refine";
659  case 20:
660  return "allowrefineonstrsplit";
661  case 21:
662  return "encroachangle";
663  case 22:
664  return "minangle";
665  case 23:
666  return "trianglesize";
667  case 24:
668  return "maxarea";
669  case 25:
670  return "targetedgelength";
671  case 26:
672  return "minedgelength";
673  case 27:
674  return "maxnewpts";
675  case 28:
676  return "lloydsteps";
677  case 29:
678  return "allowmovinginteriorpts";
679  case 30:
680  return "restorepos";
681  case 31:
682  return "keepprims";
683  case 32:
684  return "updatenmls";
685  case 33:
686  return "removeunusedpoints";
687  case 34:
688  return "removeduplicatepoints";
689  case 35:
690  return "usecontrsplitptgrp";
691  case 36:
692  return "constrsplitptgrp";
693  case 37:
694  return "useconstrdedges";
695  case 38:
696  return "constrdedges";
697  case 39:
698  return "randseed";
699 
700  }
701  return 0;
702  }
703 
704  ParmType getNestParmType(TempIndex fieldnum) const override
705  {
706  if (fieldnum.size() < 1)
707  return PARM_UNSUPPORTED;
708  switch (fieldnum[0])
709  {
710  case 0:
711  return PARM_STRING;
712  case 1:
713  return PARM_INTEGER;
714  case 2:
715  return PARM_VECTOR3;
716  case 3:
717  return PARM_FLOAT;
718  case 4:
719  return PARM_VECTOR3;
720  case 5:
721  return PARM_STRING;
722  case 6:
723  return PARM_INTEGER;
724  case 7:
725  return PARM_STRING;
726  case 8:
727  return PARM_INTEGER;
728  case 9:
729  return PARM_STRING;
730  case 10:
731  return PARM_INTEGER;
732  case 11:
733  return PARM_INTEGER;
734  case 12:
735  return PARM_STRING;
736  case 13:
737  return PARM_INTEGER;
738  case 14:
739  return PARM_INTEGER;
740  case 15:
741  return PARM_INTEGER;
742  case 16:
743  return PARM_INTEGER;
744  case 17:
745  return PARM_INTEGER;
746  case 18:
747  return PARM_INTEGER;
748  case 19:
749  return PARM_INTEGER;
750  case 20:
751  return PARM_INTEGER;
752  case 21:
753  return PARM_FLOAT;
754  case 22:
755  return PARM_FLOAT;
756  case 23:
757  return PARM_INTEGER;
758  case 24:
759  return PARM_FLOAT;
760  case 25:
761  return PARM_FLOAT;
762  case 26:
763  return PARM_FLOAT;
764  case 27:
765  return PARM_INTEGER;
766  case 28:
767  return PARM_INTEGER;
768  case 29:
769  return PARM_INTEGER;
770  case 30:
771  return PARM_INTEGER;
772  case 31:
773  return PARM_INTEGER;
774  case 32:
775  return PARM_INTEGER;
776  case 33:
777  return PARM_INTEGER;
778  case 34:
779  return PARM_INTEGER;
780  case 35:
781  return PARM_INTEGER;
782  case 36:
783  return PARM_STRING;
784  case 37:
785  return PARM_INTEGER;
786  case 38:
787  return PARM_STRING;
788  case 39:
789  return PARM_INTEGER;
790 
791  }
792  return PARM_UNSUPPORTED;
793  }
794 
795  // Boiler plate to load individual types.
796  static void loadData(UT_IStream &is, int64 &v)
797  { is.bread(&v, 1); }
798  static void loadData(UT_IStream &is, bool &v)
799  { int64 iv; is.bread(&iv, 1); v = iv; }
800  static void loadData(UT_IStream &is, fpreal64 &v)
801  { is.bread<fpreal64>(&v, 1); }
802  static void loadData(UT_IStream &is, UT_Vector2D &v)
803  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
804  static void loadData(UT_IStream &is, UT_Vector3D &v)
805  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
806  is.bread<fpreal64>(&v.z(), 1); }
807  static void loadData(UT_IStream &is, UT_Vector4D &v)
808  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
809  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
810  static void loadData(UT_IStream &is, UT_Matrix2D &v)
811  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
812  static void loadData(UT_IStream &is, UT_Matrix3D &v)
813  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
814  static void loadData(UT_IStream &is, UT_Matrix4D &v)
815  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
816  static void loadData(UT_IStream &is, UT_Vector2I &v)
817  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
818  static void loadData(UT_IStream &is, UT_Vector3I &v)
819  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
820  is.bread<int64>(&v.z(), 1); }
821  static void loadData(UT_IStream &is, UT_Vector4I &v)
822  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
823  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
825  { is.bread(v); }
827  { UT_StringHolder rampdata;
828  loadData(is, rampdata);
829  if (rampdata.isstring())
830  {
831  v.reset(new UT_Ramp());
832  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
833  v->load(istr);
834  }
835  else v.reset();
836  }
839  loadData(is, data);
840  if (data.isstring())
841  {
842  // Find the data type.
843  const char *colon = UT_StringWrap(data).findChar(':');
844  if (colon)
845  {
846  int typelen = colon - data.buffer();
848  type.strncpy(data.buffer(), typelen);
849  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
850 
851  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
852  }
853  }
854  else v.reset();
855  }
856 
857  static void saveData(std::ostream &os, int64 v)
858  { UTwrite(os, &v); }
859  static void saveData(std::ostream &os, bool v)
860  { int64 iv = v; UTwrite(os, &iv); }
861  static void saveData(std::ostream &os, fpreal64 v)
862  { UTwrite<fpreal64>(os, &v); }
863  static void saveData(std::ostream &os, UT_Vector2D v)
864  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
865  static void saveData(std::ostream &os, UT_Vector3D v)
866  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
867  UTwrite<fpreal64>(os, &v.z()); }
868  static void saveData(std::ostream &os, UT_Vector4D v)
869  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
870  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
871  static void saveData(std::ostream &os, UT_Matrix2D v)
873  static void saveData(std::ostream &os, UT_Matrix3D v)
875  static void saveData(std::ostream &os, UT_Matrix4D v)
877  static void saveData(std::ostream &os, UT_StringHolder s)
878  { UT_StringWrap(s).saveBinary(os); }
879  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
881  UT_OStringStream ostr;
882  if (s) s->save(ostr);
883  result = ostr.str();
884  saveData(os, result);
885  }
886  static void saveData(std::ostream &os, PRM_DataItemHandle s)
888  UT_OStringStream ostr;
889  if (s)
890  {
891  ostr << s->getDataTypeToken();
892  ostr << ":";
893  s->saveBinary(ostr);
894  }
895  result = ostr.str();
896  saveData(os, result);
897  }
898 
899 
900  void save(std::ostream &os) const
901  {
902  int32 v = version();
903  UTwrite(os, &v);
904  saveData(os, myPoints);
905  saveData(os, myPlanePosSrc);
906  saveData(os, myOrigin);
907  saveData(os, myDist);
908  saveData(os, myDir);
909  saveData(os, myPos2AttribName);
910  saveData(os, myUseConstrEdges);
911  saveData(os, myConstrEdges);
912  saveData(os, myUseConstrPolys);
913  saveData(os, myConstrPolys);
914  saveData(os, myIgnorePolyBridges);
915  saveData(os, myUseSilhouettePolys);
916  saveData(os, mySilhouettePolys);
917  saveData(os, myAllowConstrSplit);
918  saveData(os, myUseExactConstruction);
919  saveData(os, myIgnoreNonConstrPts);
920  saveData(os, myRemoveFromConvexHull);
921  saveData(os, myRemoveFromConstrPolys);
922  saveData(os, myRemoveOutsideSilhouette);
923  saveData(os, myRefine);
924  saveData(os, myAllowRefineConstrSplits);
925  saveData(os, myEncroachAngle);
926  saveData(os, myMinAngle);
927  saveData(os, myTriangleSize);
928  saveData(os, myMaxArea);
929  saveData(os, myTargetEdgeLength);
930  saveData(os, myMinEdgeLength);
931  saveData(os, myMaxNewPts);
932  saveData(os, myNumLloydSteps);
933  saveData(os, myAllowMovingInteriorInputPts);
934  saveData(os, myRestorePos);
935  saveData(os, myKeepPrims);
936  saveData(os, myUpdateNormals);
937  saveData(os, myRemoveUnusedPts);
938  saveData(os, myRemoveDuplicatePts);
939  saveData(os, myUseConstrSplitPtsGrp);
940  saveData(os, myConstrSplitPtsGrp);
941  saveData(os, myUseConstrdEdges);
942  saveData(os, myConstrdEdges);
943  saveData(os, myRandomSeed);
944 
945  }
946 
947  bool load(UT_IStream &is)
948  {
949  int32 v;
950  is.bread(&v, 1);
951  if (version() != v)
952  {
953  // Fail incompatible versions
954  return false;
955  }
956  loadData(is, myPoints);
957  loadData(is, myPlanePosSrc);
958  loadData(is, myOrigin);
959  loadData(is, myDist);
960  loadData(is, myDir);
961  loadData(is, myPos2AttribName);
962  loadData(is, myUseConstrEdges);
963  loadData(is, myConstrEdges);
964  loadData(is, myUseConstrPolys);
965  loadData(is, myConstrPolys);
966  loadData(is, myIgnorePolyBridges);
967  loadData(is, myUseSilhouettePolys);
968  loadData(is, mySilhouettePolys);
969  loadData(is, myAllowConstrSplit);
970  loadData(is, myUseExactConstruction);
971  loadData(is, myIgnoreNonConstrPts);
972  loadData(is, myRemoveFromConvexHull);
973  loadData(is, myRemoveFromConstrPolys);
974  loadData(is, myRemoveOutsideSilhouette);
975  loadData(is, myRefine);
976  loadData(is, myAllowRefineConstrSplits);
977  loadData(is, myEncroachAngle);
978  loadData(is, myMinAngle);
979  loadData(is, myTriangleSize);
980  loadData(is, myMaxArea);
981  loadData(is, myTargetEdgeLength);
982  loadData(is, myMinEdgeLength);
983  loadData(is, myMaxNewPts);
984  loadData(is, myNumLloydSteps);
985  loadData(is, myAllowMovingInteriorInputPts);
986  loadData(is, myRestorePos);
987  loadData(is, myKeepPrims);
988  loadData(is, myUpdateNormals);
989  loadData(is, myRemoveUnusedPts);
990  loadData(is, myRemoveDuplicatePts);
991  loadData(is, myUseConstrSplitPtsGrp);
992  loadData(is, myConstrSplitPtsGrp);
993  loadData(is, myUseConstrdEdges);
994  loadData(is, myConstrdEdges);
995  loadData(is, myRandomSeed);
996 
997  return true;
998  }
999 
1000  const UT_StringHolder & getPoints() const { return myPoints; }
1001  void setPoints(const UT_StringHolder & val) { myPoints = val; }
1003  {
1004  SOP_Node *thissop = cookparms.getNode();
1005  if (!thissop) return getPoints();
1007  OP_Utils::evalOpParm(result, thissop, "points", cookparms.getCookTime(), 0);
1008  return result;
1009  }
1010  PlanePosSrc getPlanePosSrc() const { return PlanePosSrc(myPlanePosSrc); }
1011  void setPlanePosSrc(PlanePosSrc val) { myPlanePosSrc = int64(val); }
1013  {
1014  SOP_Node *thissop = cookparms.getNode();
1015  if (!thissop) return getPlanePosSrc();
1016  int64 result;
1017  OP_Utils::evalOpParm(result, thissop, "planepossrc", cookparms.getCookTime(), 0);
1018  return PlanePosSrc(result);
1019  }
1020  UT_Vector3D getOrigin() const { return myOrigin; }
1021  void setOrigin(UT_Vector3D val) { myOrigin = val; }
1023  {
1024  SOP_Node *thissop = cookparms.getNode();
1025  if (!thissop) return getOrigin();
1027  OP_Utils::evalOpParm(result, thissop, "origin", cookparms.getCookTime(), 0);
1028  return result;
1029  }
1030  fpreal64 getDist() const { return myDist; }
1031  void setDist(fpreal64 val) { myDist = val; }
1032  fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
1033  {
1034  SOP_Node *thissop = cookparms.getNode();
1035  if (!thissop) return getDist();
1036  fpreal64 result;
1037  OP_Utils::evalOpParm(result, thissop, "dist", cookparms.getCookTime(), 0);
1038  return result;
1039  }
1040  UT_Vector3D getDir() const { return myDir; }
1041  void setDir(UT_Vector3D val) { myDir = val; }
1043  {
1044  SOP_Node *thissop = cookparms.getNode();
1045  if (!thissop) return getDir();
1047  OP_Utils::evalOpParm(result, thissop, "dir", cookparms.getCookTime(), 0);
1048  return result;
1049  }
1050  const UT_StringHolder & getPos2AttribName() const { return myPos2AttribName; }
1051  void setPos2AttribName(const UT_StringHolder & val) { myPos2AttribName = val; }
1053  {
1054  SOP_Node *thissop = cookparms.getNode();
1055  if (!thissop) return getPos2AttribName();
1057  OP_Utils::evalOpParm(result, thissop, "pos2attrib", cookparms.getCookTime(), 0);
1058  return result;
1059  }
1060  bool getUseConstrEdges() const { return myUseConstrEdges; }
1061  void setUseConstrEdges(bool val) { myUseConstrEdges = val; }
1062  bool opUseConstrEdges(const SOP_NodeVerb::CookParms &cookparms) const
1063  {
1064  SOP_Node *thissop = cookparms.getNode();
1065  if (!thissop) return getUseConstrEdges();
1066  bool result;
1067  OP_Utils::evalOpParm(result, thissop, "useconstredges", cookparms.getCookTime(), 0);
1068  return result;
1069  }
1070  const UT_StringHolder & getConstrEdges() const { return myConstrEdges; }
1071  void setConstrEdges(const UT_StringHolder & val) { myConstrEdges = val; }
1073  {
1074  SOP_Node *thissop = cookparms.getNode();
1075  if (!thissop) return getConstrEdges();
1077  OP_Utils::evalOpParm(result, thissop, "constredges", cookparms.getCookTime(), 0);
1078  return result;
1079  }
1080  bool getUseConstrPolys() const { return myUseConstrPolys; }
1081  void setUseConstrPolys(bool val) { myUseConstrPolys = val; }
1082  bool opUseConstrPolys(const SOP_NodeVerb::CookParms &cookparms) const
1083  {
1084  SOP_Node *thissop = cookparms.getNode();
1085  if (!thissop) return getUseConstrPolys();
1086  bool result;
1087  OP_Utils::evalOpParm(result, thissop, "useconstrpolys", cookparms.getCookTime(), 0);
1088  return result;
1089  }
1090  const UT_StringHolder & getConstrPolys() const { return myConstrPolys; }
1091  void setConstrPolys(const UT_StringHolder & val) { myConstrPolys = val; }
1093  {
1094  SOP_Node *thissop = cookparms.getNode();
1095  if (!thissop) return getConstrPolys();
1097  OP_Utils::evalOpParm(result, thissop, "constrpolys", cookparms.getCookTime(), 0);
1098  return result;
1099  }
1100  bool getIgnorePolyBridges() const { return myIgnorePolyBridges; }
1101  void setIgnorePolyBridges(bool val) { myIgnorePolyBridges = val; }
1102  bool opIgnorePolyBridges(const SOP_NodeVerb::CookParms &cookparms) const
1103  {
1104  SOP_Node *thissop = cookparms.getNode();
1105  if (!thissop) return getIgnorePolyBridges();
1106  bool result;
1107  OP_Utils::evalOpParm(result, thissop, "ignorepolybridges", cookparms.getCookTime(), 0);
1108  return result;
1109  }
1110  bool getUseSilhouettePolys() const { return myUseSilhouettePolys; }
1111  void setUseSilhouettePolys(bool val) { myUseSilhouettePolys = val; }
1112  bool opUseSilhouettePolys(const SOP_NodeVerb::CookParms &cookparms) const
1113  {
1114  SOP_Node *thissop = cookparms.getNode();
1115  if (!thissop) return getUseSilhouettePolys();
1116  bool result;
1117  OP_Utils::evalOpParm(result, thissop, "usesilhouettepolys", cookparms.getCookTime(), 0);
1118  return result;
1119  }
1120  const UT_StringHolder & getSilhouettePolys() const { return mySilhouettePolys; }
1121  void setSilhouettePolys(const UT_StringHolder & val) { mySilhouettePolys = val; }
1123  {
1124  SOP_Node *thissop = cookparms.getNode();
1125  if (!thissop) return getSilhouettePolys();
1127  OP_Utils::evalOpParm(result, thissop, "silhouettepolys", cookparms.getCookTime(), 0);
1128  return result;
1129  }
1130  bool getAllowConstrSplit() const { return myAllowConstrSplit; }
1131  void setAllowConstrSplit(bool val) { myAllowConstrSplit = val; }
1132  bool opAllowConstrSplit(const SOP_NodeVerb::CookParms &cookparms) const
1133  {
1134  SOP_Node *thissop = cookparms.getNode();
1135  if (!thissop) return getAllowConstrSplit();
1136  bool result;
1137  OP_Utils::evalOpParm(result, thissop, "allowconstrsplit", cookparms.getCookTime(), 0);
1138  return result;
1139  }
1140  bool getUseExactConstruction() const { return myUseExactConstruction; }
1141  void setUseExactConstruction(bool val) { myUseExactConstruction = val; }
1143  {
1144  SOP_Node *thissop = cookparms.getNode();
1145  if (!thissop) return getUseExactConstruction();
1146  bool result;
1147  OP_Utils::evalOpParm(result, thissop, "useexactconstruction", cookparms.getCookTime(), 0);
1148  return result;
1149  }
1150  bool getIgnoreNonConstrPts() const { return myIgnoreNonConstrPts; }
1151  void setIgnoreNonConstrPts(bool val) { myIgnoreNonConstrPts = val; }
1152  bool opIgnoreNonConstrPts(const SOP_NodeVerb::CookParms &cookparms) const
1153  {
1154  SOP_Node *thissop = cookparms.getNode();
1155  if (!thissop) return getIgnoreNonConstrPts();
1156  bool result;
1157  OP_Utils::evalOpParm(result, thissop, "ignorenonconstrpts", cookparms.getCookTime(), 0);
1158  return result;
1159  }
1160  bool getRemoveFromConvexHull() const { return myRemoveFromConvexHull; }
1161  void setRemoveFromConvexHull(bool val) { myRemoveFromConvexHull = val; }
1163  {
1164  SOP_Node *thissop = cookparms.getNode();
1165  if (!thissop) return getRemoveFromConvexHull();
1166  bool result;
1167  OP_Utils::evalOpParm(result, thissop, "removefromconvexhull", cookparms.getCookTime(), 0);
1168  return result;
1169  }
1170  bool getRemoveFromConstrPolys() const { return myRemoveFromConstrPolys; }
1171  void setRemoveFromConstrPolys(bool val) { myRemoveFromConstrPolys = val; }
1173  {
1174  SOP_Node *thissop = cookparms.getNode();
1175  if (!thissop) return getRemoveFromConstrPolys();
1176  bool result;
1177  OP_Utils::evalOpParm(result, thissop, "removefromconstrpolys", cookparms.getCookTime(), 0);
1178  return result;
1179  }
1180  bool getRemoveOutsideSilhouette() const { return myRemoveOutsideSilhouette; }
1181  void setRemoveOutsideSilhouette(bool val) { myRemoveOutsideSilhouette = val; }
1183  {
1184  SOP_Node *thissop = cookparms.getNode();
1185  if (!thissop) return getRemoveOutsideSilhouette();
1186  bool result;
1187  OP_Utils::evalOpParm(result, thissop, "removeoutsidesilhouette", cookparms.getCookTime(), 0);
1188  return result;
1189  }
1190  bool getRefine() const { return myRefine; }
1191  void setRefine(bool val) { myRefine = val; }
1192  bool opRefine(const SOP_NodeVerb::CookParms &cookparms) const
1193  {
1194  SOP_Node *thissop = cookparms.getNode();
1195  if (!thissop) return getRefine();
1196  bool result;
1197  OP_Utils::evalOpParm(result, thissop, "refine", cookparms.getCookTime(), 0);
1198  return result;
1199  }
1200  bool getAllowRefineConstrSplits() const { return myAllowRefineConstrSplits; }
1201  void setAllowRefineConstrSplits(bool val) { myAllowRefineConstrSplits = val; }
1203  {
1204  SOP_Node *thissop = cookparms.getNode();
1205  if (!thissop) return getAllowRefineConstrSplits();
1206  bool result;
1207  OP_Utils::evalOpParm(result, thissop, "allowrefineonstrsplit", cookparms.getCookTime(), 0);
1208  return result;
1209  }
1210  fpreal64 getEncroachAngle() const { return myEncroachAngle; }
1211  void setEncroachAngle(fpreal64 val) { myEncroachAngle = val; }
1213  {
1214  SOP_Node *thissop = cookparms.getNode();
1215  if (!thissop) return getEncroachAngle();
1216  fpreal64 result;
1217  OP_Utils::evalOpParm(result, thissop, "encroachangle", cookparms.getCookTime(), 0);
1218  return result;
1219  }
1220  fpreal64 getMinAngle() const { return myMinAngle; }
1221  void setMinAngle(fpreal64 val) { myMinAngle = val; }
1223  {
1224  SOP_Node *thissop = cookparms.getNode();
1225  if (!thissop) return getMinAngle();
1226  fpreal64 result;
1227  OP_Utils::evalOpParm(result, thissop, "minangle", cookparms.getCookTime(), 0);
1228  return result;
1229  }
1230  TriangleSize getTriangleSize() const { return TriangleSize(myTriangleSize); }
1231  void setTriangleSize(TriangleSize val) { myTriangleSize = int64(val); }
1233  {
1234  SOP_Node *thissop = cookparms.getNode();
1235  if (!thissop) return getTriangleSize();
1236  int64 result;
1237  OP_Utils::evalOpParm(result, thissop, "trianglesize", cookparms.getCookTime(), 0);
1238  return TriangleSize(result);
1239  }
1240  fpreal64 getMaxArea() const { return myMaxArea; }
1241  void setMaxArea(fpreal64 val) { myMaxArea = val; }
1243  {
1244  SOP_Node *thissop = cookparms.getNode();
1245  if (!thissop) return getMaxArea();
1246  fpreal64 result;
1247  OP_Utils::evalOpParm(result, thissop, "maxarea", cookparms.getCookTime(), 0);
1248  return result;
1249  }
1250  fpreal64 getTargetEdgeLength() const { return myTargetEdgeLength; }
1251  void setTargetEdgeLength(fpreal64 val) { myTargetEdgeLength = val; }
1253  {
1254  SOP_Node *thissop = cookparms.getNode();
1255  if (!thissop) return getTargetEdgeLength();
1256  fpreal64 result;
1257  OP_Utils::evalOpParm(result, thissop, "targetedgelength", cookparms.getCookTime(), 0);
1258  return result;
1259  }
1260  fpreal64 getMinEdgeLength() const { return myMinEdgeLength; }
1261  void setMinEdgeLength(fpreal64 val) { myMinEdgeLength = val; }
1263  {
1264  SOP_Node *thissop = cookparms.getNode();
1265  if (!thissop) return getMinEdgeLength();
1266  fpreal64 result;
1267  OP_Utils::evalOpParm(result, thissop, "minedgelength", cookparms.getCookTime(), 0);
1268  return result;
1269  }
1270  int64 getMaxNewPts() const { return myMaxNewPts; }
1271  void setMaxNewPts(int64 val) { myMaxNewPts = val; }
1273  {
1274  SOP_Node *thissop = cookparms.getNode();
1275  if (!thissop) return getMaxNewPts();
1276  int64 result;
1277  OP_Utils::evalOpParm(result, thissop, "maxnewpts", cookparms.getCookTime(), 0);
1278  return result;
1279  }
1280  int64 getNumLloydSteps() const { return myNumLloydSteps; }
1281  void setNumLloydSteps(int64 val) { myNumLloydSteps = val; }
1283  {
1284  SOP_Node *thissop = cookparms.getNode();
1285  if (!thissop) return getNumLloydSteps();
1286  int64 result;
1287  OP_Utils::evalOpParm(result, thissop, "lloydsteps", cookparms.getCookTime(), 0);
1288  return result;
1289  }
1290  bool getAllowMovingInteriorInputPts() const { return myAllowMovingInteriorInputPts; }
1291  void setAllowMovingInteriorInputPts(bool val) { myAllowMovingInteriorInputPts = val; }
1293  {
1294  SOP_Node *thissop = cookparms.getNode();
1295  if (!thissop) return getAllowMovingInteriorInputPts();
1296  bool result;
1297  OP_Utils::evalOpParm(result, thissop, "allowmovinginteriorpts", cookparms.getCookTime(), 0);
1298  return result;
1299  }
1300  bool getRestorePos() const { return myRestorePos; }
1301  void setRestorePos(bool val) { myRestorePos = val; }
1302  bool opRestorePos(const SOP_NodeVerb::CookParms &cookparms) const
1303  {
1304  SOP_Node *thissop = cookparms.getNode();
1305  if (!thissop) return getRestorePos();
1306  bool result;
1307  OP_Utils::evalOpParm(result, thissop, "restorepos", cookparms.getCookTime(), 0);
1308  return result;
1309  }
1310  bool getKeepPrims() const { return myKeepPrims; }
1311  void setKeepPrims(bool val) { myKeepPrims = val; }
1312  bool opKeepPrims(const SOP_NodeVerb::CookParms &cookparms) const
1313  {
1314  SOP_Node *thissop = cookparms.getNode();
1315  if (!thissop) return getKeepPrims();
1316  bool result;
1317  OP_Utils::evalOpParm(result, thissop, "keepprims", cookparms.getCookTime(), 0);
1318  return result;
1319  }
1320  bool getUpdateNormals() const { return myUpdateNormals; }
1321  void setUpdateNormals(bool val) { myUpdateNormals = val; }
1322  bool opUpdateNormals(const SOP_NodeVerb::CookParms &cookparms) const
1323  {
1324  SOP_Node *thissop = cookparms.getNode();
1325  if (!thissop) return getUpdateNormals();
1326  bool result;
1327  OP_Utils::evalOpParm(result, thissop, "updatenmls", cookparms.getCookTime(), 0);
1328  return result;
1329  }
1330  bool getRemoveUnusedPts() const { return myRemoveUnusedPts; }
1331  void setRemoveUnusedPts(bool val) { myRemoveUnusedPts = val; }
1332  bool opRemoveUnusedPts(const SOP_NodeVerb::CookParms &cookparms) const
1333  {
1334  SOP_Node *thissop = cookparms.getNode();
1335  if (!thissop) return getRemoveUnusedPts();
1336  bool result;
1337  OP_Utils::evalOpParm(result, thissop, "removeunusedpoints", cookparms.getCookTime(), 0);
1338  return result;
1339  }
1340  bool getRemoveDuplicatePts() const { return myRemoveDuplicatePts; }
1341  void setRemoveDuplicatePts(bool val) { myRemoveDuplicatePts = val; }
1342  bool opRemoveDuplicatePts(const SOP_NodeVerb::CookParms &cookparms) const
1343  {
1344  SOP_Node *thissop = cookparms.getNode();
1345  if (!thissop) return getRemoveDuplicatePts();
1346  bool result;
1347  OP_Utils::evalOpParm(result, thissop, "removeduplicatepoints", cookparms.getCookTime(), 0);
1348  return result;
1349  }
1350  bool getUseConstrSplitPtsGrp() const { return myUseConstrSplitPtsGrp; }
1351  void setUseConstrSplitPtsGrp(bool val) { myUseConstrSplitPtsGrp = val; }
1353  {
1354  SOP_Node *thissop = cookparms.getNode();
1355  if (!thissop) return getUseConstrSplitPtsGrp();
1356  bool result;
1357  OP_Utils::evalOpParm(result, thissop, "usecontrsplitptgrp", cookparms.getCookTime(), 0);
1358  return result;
1359  }
1360  const UT_StringHolder & getConstrSplitPtsGrp() const { return myConstrSplitPtsGrp; }
1361  void setConstrSplitPtsGrp(const UT_StringHolder & val) { myConstrSplitPtsGrp = val; }
1363  {
1364  SOP_Node *thissop = cookparms.getNode();
1365  if (!thissop) return getConstrSplitPtsGrp();
1367  OP_Utils::evalOpParm(result, thissop, "constrsplitptgrp", cookparms.getCookTime(), 0);
1368  return result;
1369  }
1370  bool getUseConstrdEdges() const { return myUseConstrdEdges; }
1371  void setUseConstrdEdges(bool val) { myUseConstrdEdges = val; }
1372  bool opUseConstrdEdges(const SOP_NodeVerb::CookParms &cookparms) const
1373  {
1374  SOP_Node *thissop = cookparms.getNode();
1375  if (!thissop) return getUseConstrdEdges();
1376  bool result;
1377  OP_Utils::evalOpParm(result, thissop, "useconstrdedges", cookparms.getCookTime(), 0);
1378  return result;
1379  }
1380  const UT_StringHolder & getConstrdEdges() const { return myConstrdEdges; }
1381  void setConstrdEdges(const UT_StringHolder & val) { myConstrdEdges = val; }
1383  {
1384  SOP_Node *thissop = cookparms.getNode();
1385  if (!thissop) return getConstrdEdges();
1387  OP_Utils::evalOpParm(result, thissop, "constrdedges", cookparms.getCookTime(), 0);
1388  return result;
1389  }
1390  int64 getRandomSeed() const { return myRandomSeed; }
1391  void setRandomSeed(int64 val) { myRandomSeed = val; }
1393  {
1394  SOP_Node *thissop = cookparms.getNode();
1395  if (!thissop) return getRandomSeed();
1396  int64 result;
1397  OP_Utils::evalOpParm(result, thissop, "randseed", cookparms.getCookTime(), 0);
1398  return result;
1399  }
1400 
1401 private:
1402  UT_StringHolder myPoints;
1403  int64 myPlanePosSrc;
1404  UT_Vector3D myOrigin;
1405  fpreal64 myDist;
1406  UT_Vector3D myDir;
1407  UT_StringHolder myPos2AttribName;
1408  bool myUseConstrEdges;
1409  UT_StringHolder myConstrEdges;
1410  bool myUseConstrPolys;
1411  UT_StringHolder myConstrPolys;
1412  bool myIgnorePolyBridges;
1413  bool myUseSilhouettePolys;
1414  UT_StringHolder mySilhouettePolys;
1415  bool myAllowConstrSplit;
1416  bool myUseExactConstruction;
1417  bool myIgnoreNonConstrPts;
1418  bool myRemoveFromConvexHull;
1419  bool myRemoveFromConstrPolys;
1420  bool myRemoveOutsideSilhouette;
1421  bool myRefine;
1422  bool myAllowRefineConstrSplits;
1423  fpreal64 myEncroachAngle;
1424  fpreal64 myMinAngle;
1425  int64 myTriangleSize;
1426  fpreal64 myMaxArea;
1427  fpreal64 myTargetEdgeLength;
1428  fpreal64 myMinEdgeLength;
1429  int64 myMaxNewPts;
1430  int64 myNumLloydSteps;
1431  bool myAllowMovingInteriorInputPts;
1432  bool myRestorePos;
1433  bool myKeepPrims;
1434  bool myUpdateNormals;
1435  bool myRemoveUnusedPts;
1436  bool myRemoveDuplicatePts;
1437  bool myUseConstrSplitPtsGrp;
1438  UT_StringHolder myConstrSplitPtsGrp;
1439  bool myUseConstrdEdges;
1440  UT_StringHolder myConstrdEdges;
1441  int64 myRandomSeed;
1442 
1443 };
GLdouble s
Definition: glew.h:1390
UT_StringHolder opConstrPolys(const SOP_NodeVerb::CookParms &cookparms) const
TriangleSize opTriangleSize(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opMaxArea(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opMinEdgeLength(const SOP_NodeVerb::CookParms &cookparms) const
PlanePosSrc opPlanePosSrc(const SOP_NodeVerb::CookParms &cookparms) const
void setConstrPolys(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Vector3D v)
exint nodeIdx() const
Definition: SOP_NodeVerb.h:114
bool opUseConstrEdges(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glew.h:2410
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:640
void loadFromOpSubclass(const LoadParms &loadparms) override
int64 opRandomSeed(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_StringHolder opConstrdEdges(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
const char * getNestParmName(TempIndex fieldnum) const override
bool opKeepPrims(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
static void loadData(UT_IStream &is, UT_Vector4I &v)
GT_API const UT_StringHolder time
bool opRemoveFromConvexHull(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
fpreal getTime() const
Definition: OP_Context.h:60
UT_StringHolder opPos2AttribName(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opMinAngle(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_Triangulate2D_3_0Parms &src) const
GLuint const GLfloat * val
Definition: glew.h:2794
static void saveData(std::ostream &os, UT_Matrix4D v)
const UT_StringHolder & getConstrEdges() const
bool opAllowConstrSplit(const SOP_NodeVerb::CookParms &cookparms) const
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:113
bool opUpdateNormals(const SOP_NodeVerb::CookParms &cookparms) const
void setPoints(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_Matrix3D v)
exint getNestNumParms(TempIndex idx) const override
ParmType getNestParmType(TempIndex fieldnum) const override
const GLdouble * v
Definition: glew.h:1391
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void save(std::ostream &os) const
static void loadData(UT_IStream &is, bool &v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool opAllowRefineConstrSplits(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
UT_Vector3D opOrigin(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opAllowMovingInteriorInputPts(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
fpreal64 opEncroachAngle(const SOP_NodeVerb::CookParms &cookparms) const
double fpreal64
Definition: SYS_Types.h:201
fpreal64 opTargetEdgeLength(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void saveData(std::ostream &os, UT_Matrix2D v)
const UT_StringHolder & getPoints() const
SYS_FORCE_INLINE T & y()
Definition: UT_Vector3.h:513
exint length() const
void setSilhouettePolys(const UT_StringHolder &val)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
UT_StringHolder opConstrSplitPtsGrp(const SOP_NodeVerb::CookParms &cookparms) const
bool opRemoveOutsideSilhouette(const SOP_NodeVerb::CookParms &cookparms) const
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
void setConstrdEdges(const UT_StringHolder &val)
bool opRemoveFromConstrPolys(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
SYS_FORCE_INLINE T & z()
Definition: UT_Vector3.h:515
static void loadData(UT_IStream &is, UT_Vector3D &v)
const GLfloat * c
Definition: glew.h:16296
static void loadData(UT_IStream &is, UT_Vector2D &v)
long long int64
Definition: SYS_Types.h:116
const UT_StringHolder & getSilhouettePolys() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
bool opRefine(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3T< fpreal64 > UT_Vector3D
static void loadData(UT_IStream &is, int64 &v)
const UT_StringHolder & getPos2AttribName() const
const UT_StringHolder & getConstrdEdges() const
void setConstrEdges(const UT_StringHolder &val)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const UT_StringHolder & getConstrSplitPtsGrp() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void saveData(std::ostream &os, UT_Vector4D v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
bool operator==(const SOP_Triangulate2D_3_0Parms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:121
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, UT_Vector2D v)
UT_Vector3D opDir(const SOP_NodeVerb::CookParms &cookparms) const
bool opIgnorePolyBridges(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
bool opUseExactConstruction(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPoints(const SOP_NodeVerb::CookParms &cookparms) const
bool opUseConstrSplitPtsGrp(const SOP_NodeVerb::CookParms &cookparms) const
int64 opNumLloydSteps(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool opRestorePos(const SOP_NodeVerb::CookParms &cookparms) const
void setPos2AttribName(const UT_StringHolder &val)
bool opRemoveDuplicatePts(const SOP_NodeVerb::CookParms &cookparms) const
bool opUseConstrdEdges(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opSilhouettePolys(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
bool opRemoveUnusedPts(const SOP_NodeVerb::CookParms &cookparms) const
bool opUseSilhouettePolys(const SOP_NodeVerb::CookParms &cookparms) const
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
const UT_StringHolder & getConstrPolys() const
#define SOP_API
Definition: SOP_API.h:10
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
SYS_FORCE_INLINE T & x()
Definition: UT_Vector3.h:511
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:654
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
GLuint64EXT * result
Definition: glew.h:14007
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const char * findChar(int c) const
Definition: UT_String.h:1368
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool opIgnoreNonConstrPts(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void saveData(std::ostream &os, fpreal64 v)
bool opUseConstrPolys(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
void copyFrom(const SOP_NodeParms *src) override
static void saveData(std::ostream &os, bool v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
UT_StringHolder opConstrEdges(const SOP_NodeVerb::CookParms &cookparms) const
GLsizei const GLfloat * value
Definition: glew.h:1849
int64 opMaxNewPts(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: SOP_NodeVerb.h:119
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
SYS_FORCE_INLINE bool isstring() const
void setConstrSplitPtsGrp(const UT_StringHolder &val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
type
Definition: core.h:528
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)