HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_SubdivideParms.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <SOP/SOP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 
25 {
26 public:
27  static int version() { return 1; }
28 
30  {
31  myGroup = ""_UTsh;
32  myCreaseGroup = ""_UTsh;
33  myDepth = 1;
34  myOverrideCreaseWeight = false;
35  myCreaseWeight = 0;
36  myOutputCreases = 0;
37  myOutputCreaseGroup = "creases"_UTsh;
38  myCloseCracks = 1;
39  myDivideChoice = 1;
40  myBias = 1;
41  mySmoothVertex = true;
42  myEnforceConsistentTopology = false;
43  myLinearCreases = false;
44  myAlgorithm = 0;
45  myBuildPolygonSoup = false;
46  myTreatCurvesIndependent = false;
47  myUpdateNormals = true;
48  myRemoveHoles = true;
49  myVtxBoundaryInterp = "corner"_UTsh;
50  myFVarLinearInterp = "corner1"_UTsh;
51  myCreasingMethod = "uniform"_UTsh;
52  myTriangleSubd = "catclark"_UTsh;
53 
54  }
55 
56  explicit SOP_SubdivideParms(const SOP_SubdivideParms &) = default;
58  SOP_SubdivideParms(SOP_SubdivideParms &&) noexcept = default;
59  SOP_SubdivideParms &operator=(SOP_SubdivideParms &&) noexcept = default;
60 
61  ~SOP_SubdivideParms() override {}
62 
63  bool operator==(const SOP_SubdivideParms &src) const
64  {
65  if (myGroup != src.myGroup) return false;
66  if (myCreaseGroup != src.myCreaseGroup) return false;
67  if (myDepth != src.myDepth) return false;
68  if (myOverrideCreaseWeight != src.myOverrideCreaseWeight) return false;
69  if (myCreaseWeight != src.myCreaseWeight) return false;
70  if (myOutputCreases != src.myOutputCreases) return false;
71  if (myOutputCreaseGroup != src.myOutputCreaseGroup) return false;
72  if (myCloseCracks != src.myCloseCracks) return false;
73  if (myDivideChoice != src.myDivideChoice) return false;
74  if (myBias != src.myBias) return false;
75  if (mySmoothVertex != src.mySmoothVertex) return false;
76  if (myEnforceConsistentTopology != src.myEnforceConsistentTopology) return false;
77  if (myLinearCreases != src.myLinearCreases) return false;
78  if (myAlgorithm != src.myAlgorithm) return false;
79  if (myBuildPolygonSoup != src.myBuildPolygonSoup) return false;
80  if (myTreatCurvesIndependent != src.myTreatCurvesIndependent) return false;
81  if (myUpdateNormals != src.myUpdateNormals) return false;
82  if (myRemoveHoles != src.myRemoveHoles) return false;
83  if (myVtxBoundaryInterp != src.myVtxBoundaryInterp) return false;
84  if (myFVarLinearInterp != src.myFVarLinearInterp) return false;
85  if (myCreasingMethod != src.myCreasingMethod) return false;
86  if (myTriangleSubd != src.myTriangleSubd) return false;
87 
88  return true;
89  }
90  bool operator!=(const SOP_SubdivideParms &src) const
91  {
92  return !operator==(src);
93  }
94 
95 
96 
97  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
98  {
99  myGroup = ""_UTsh;
100  if (true)
101  graph->evalOpParm(myGroup, nodeidx, "subdivide", time, 0);
102  myCreaseGroup = ""_UTsh;
103  if (true)
104  graph->evalOpParm(myCreaseGroup, nodeidx, "creases", time, 0);
105  myDepth = 1;
106  if (true)
107  graph->evalOpParm(myDepth, nodeidx, "iterations", time, 0);
108  myOverrideCreaseWeight = false;
109  if (true)
110  graph->evalOpParm(myOverrideCreaseWeight, nodeidx, "overridecrease", time, 0);
111  myCreaseWeight = 0;
112  if (true)
113  graph->evalOpParm(myCreaseWeight, nodeidx, "creaseweight", time, 0);
114  myOutputCreases = 0;
115  if (true)
116  graph->evalOpParm(myOutputCreases, nodeidx, "outputcrease", time, 0);
117  myOutputCreaseGroup = "creases"_UTsh;
118  if (true)
119  graph->evalOpParm(myOutputCreaseGroup, nodeidx, "outcreasegroup", time, 0);
120  myCloseCracks = 1;
121  if (true)
122  graph->evalOpParm(myCloseCracks, nodeidx, "closeholes", time, 0);
123  myDivideChoice = 1;
124  if (true)
125  graph->evalOpParm(myDivideChoice, nodeidx, "surroundpoly", time, 0);
126  myBias = 1;
127  if (true)
128  graph->evalOpParm(myBias, nodeidx, "bias", time, 0);
129  mySmoothVertex = true;
130  if (true)
131  graph->evalOpParm(mySmoothVertex, nodeidx, "smoothvertex", time, 0);
132  myEnforceConsistentTopology = false;
133  if (true)
134  graph->evalOpParm(myEnforceConsistentTopology, nodeidx, "consisttopology", time, 0);
135  myLinearCreases = false;
136  if (true)
137  graph->evalOpParm(myLinearCreases, nodeidx, "linearcreases", time, 0);
138  myAlgorithm = 0;
139  if (true)
140  graph->evalOpParm(myAlgorithm, nodeidx, "algorithm", time, 0);
141  myBuildPolygonSoup = false;
142  if (true)
143  graph->evalOpParm(myBuildPolygonSoup, nodeidx, "buildpolysoups", time, 0);
144  myTreatCurvesIndependent = false;
145  if (true)
146  graph->evalOpParm(myTreatCurvesIndependent, nodeidx, "indepcurves", time, 0);
147  myUpdateNormals = true;
148  if (true)
149  graph->evalOpParm(myUpdateNormals, nodeidx, "updatenmls", time, 0);
150  myRemoveHoles = true;
151  if (true)
152  graph->evalOpParm(myRemoveHoles, nodeidx, "removeholes", time, 0);
153  myVtxBoundaryInterp = "corner"_UTsh;
154  if (true)
155  graph->evalOpParm(myVtxBoundaryInterp, nodeidx, "vtxboundary", time, 0);
156  myFVarLinearInterp = "corner1"_UTsh;
157  if (true)
158  graph->evalOpParm(myFVarLinearInterp, nodeidx, "fvarlinear", time, 0);
159  myCreasingMethod = "uniform"_UTsh;
160  if (true)
161  graph->evalOpParm(myCreasingMethod, nodeidx, "creasemethod", time, 0);
162  myTriangleSubd = "catclark"_UTsh;
163  if (true)
164  graph->evalOpParm(myTriangleSubd, nodeidx, "trianglesubd", time, 0);
165 
166  }
167 
168 
169  void loadFromOpSubclass(const LoadParms &loadparms) override
170  {
171  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
172  }
173 
174 
175  void copyFrom(const OP_NodeParms *src) override
176  {
177  *this = *((const SOP_SubdivideParms *)src);
178  }
179 
180  template <typename T>
181  void
182  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
183  {
184  if (idx.size() < 1)
185  return;
186  UT_ASSERT(idx.size() == instance.size()+1);
187  if (idx.size() != instance.size()+1)
188  return;
189  switch (idx[0])
190  {
191  case 0:
192  coerceValue(value, myGroup);
193  break;
194  case 1:
195  coerceValue(value, myCreaseGroup);
196  break;
197  case 2:
198  coerceValue(value, myDepth);
199  break;
200  case 3:
201  coerceValue(value, myOverrideCreaseWeight);
202  break;
203  case 4:
204  coerceValue(value, myCreaseWeight);
205  break;
206  case 5:
207  coerceValue(value, myOutputCreases);
208  break;
209  case 6:
210  coerceValue(value, myOutputCreaseGroup);
211  break;
212  case 7:
213  coerceValue(value, myCloseCracks);
214  break;
215  case 8:
216  coerceValue(value, myDivideChoice);
217  break;
218  case 9:
219  coerceValue(value, myBias);
220  break;
221  case 10:
222  coerceValue(value, mySmoothVertex);
223  break;
224  case 11:
225  coerceValue(value, myEnforceConsistentTopology);
226  break;
227  case 12:
228  coerceValue(value, myLinearCreases);
229  break;
230  case 13:
231  coerceValue(value, myAlgorithm);
232  break;
233  case 14:
234  coerceValue(value, myBuildPolygonSoup);
235  break;
236  case 15:
237  coerceValue(value, myTreatCurvesIndependent);
238  break;
239  case 16:
240  coerceValue(value, myUpdateNormals);
241  break;
242  case 17:
243  coerceValue(value, myRemoveHoles);
244  break;
245  case 18:
246  coerceValue(value, myVtxBoundaryInterp);
247  break;
248  case 19:
249  coerceValue(value, myFVarLinearInterp);
250  break;
251  case 20:
252  coerceValue(value, myCreasingMethod);
253  break;
254  case 21:
255  coerceValue(value, myTriangleSubd);
256  break;
257 
258  }
259  }
260 
261  bool isParmColorRamp(exint idx) const override
262  {
263  switch (idx)
264  {
265 
266  }
267  return false;
268  }
269 
270  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
271  { doGetParmValue(idx, instance, value); }
272  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
273  { doGetParmValue(idx, instance, value); }
274  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
275  { doGetParmValue(idx, instance, value); }
276  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
277  { doGetParmValue(idx, instance, value); }
278  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
279  { doGetParmValue(idx, instance, value); }
280  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
281  { doGetParmValue(idx, instance, value); }
282  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
283  { doGetParmValue(idx, instance, value); }
284  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
285  { doGetParmValue(idx, instance, value); }
286  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
287  { doGetParmValue(idx, instance, value); }
288  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
289  { doGetParmValue(idx, instance, value); }
290  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
291  { doGetParmValue(idx, instance, value); }
292 
293  template <typename T>
294  void
295  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
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(myGroup, ( ( value ) ));
306  break;
307  case 1:
308  coerceValue(myCreaseGroup, ( ( value ) ));
309  break;
310  case 2:
311  coerceValue(myDepth, ( ( value ) ));
312  break;
313  case 3:
314  coerceValue(myOverrideCreaseWeight, ( ( value ) ));
315  break;
316  case 4:
317  coerceValue(myCreaseWeight, ( ( value ) ));
318  break;
319  case 5:
320  coerceValue(myOutputCreases, ( ( value ) ));
321  break;
322  case 6:
323  coerceValue(myOutputCreaseGroup, ( ( value ) ));
324  break;
325  case 7:
326  coerceValue(myCloseCracks, ( ( value ) ));
327  break;
328  case 8:
329  coerceValue(myDivideChoice, ( ( value ) ));
330  break;
331  case 9:
332  coerceValue(myBias, ( ( value ) ));
333  break;
334  case 10:
335  coerceValue(mySmoothVertex, ( ( value ) ));
336  break;
337  case 11:
338  coerceValue(myEnforceConsistentTopology, ( ( value ) ));
339  break;
340  case 12:
341  coerceValue(myLinearCreases, ( ( value ) ));
342  break;
343  case 13:
344  coerceValue(myAlgorithm, ( ( value ) ));
345  break;
346  case 14:
347  coerceValue(myBuildPolygonSoup, ( ( value ) ));
348  break;
349  case 15:
350  coerceValue(myTreatCurvesIndependent, ( ( value ) ));
351  break;
352  case 16:
353  coerceValue(myUpdateNormals, ( ( value ) ));
354  break;
355  case 17:
356  coerceValue(myRemoveHoles, ( ( value ) ));
357  break;
358  case 18:
359  coerceValue(myVtxBoundaryInterp, ( ( value ) ));
360  break;
361  case 19:
362  coerceValue(myFVarLinearInterp, ( ( value ) ));
363  break;
364  case 20:
365  coerceValue(myCreasingMethod, ( ( value ) ));
366  break;
367  case 21:
368  coerceValue(myTriangleSubd, ( ( value ) ));
369  break;
370 
371  }
372  }
373 
374  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
375  { doSetParmValue(idx, instance, value); }
376  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
377  { doSetParmValue(idx, instance, value); }
378  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
379  { doSetParmValue(idx, instance, value); }
380  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
381  { doSetParmValue(idx, instance, value); }
382  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
383  { doSetParmValue(idx, instance, value); }
384  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
385  { doSetParmValue(idx, instance, value); }
386  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
387  { doSetParmValue(idx, instance, value); }
388  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
389  { doSetParmValue(idx, instance, value); }
390  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
391  { doSetParmValue(idx, instance, value); }
392  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
393  { doSetParmValue(idx, instance, value); }
394  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
395  { doSetParmValue(idx, instance, value); }
396 
397  exint getNestNumParms(TempIndex idx) const override
398  {
399  if (idx.size() == 0)
400  return 22;
401  switch (idx[0])
402  {
403 
404  }
405  // Invalid
406  return 0;
407  }
408 
409  const char *getNestParmName(TempIndex fieldnum) const override
410  {
411  if (fieldnum.size() < 1)
412  return 0;
413  switch (fieldnum[0])
414  {
415  case 0:
416  return "subdivide";
417  case 1:
418  return "creases";
419  case 2:
420  return "iterations";
421  case 3:
422  return "overridecrease";
423  case 4:
424  return "creaseweight";
425  case 5:
426  return "outputcrease";
427  case 6:
428  return "outcreasegroup";
429  case 7:
430  return "closeholes";
431  case 8:
432  return "surroundpoly";
433  case 9:
434  return "bias";
435  case 10:
436  return "smoothvertex";
437  case 11:
438  return "consisttopology";
439  case 12:
440  return "linearcreases";
441  case 13:
442  return "algorithm";
443  case 14:
444  return "buildpolysoups";
445  case 15:
446  return "indepcurves";
447  case 16:
448  return "updatenmls";
449  case 17:
450  return "removeholes";
451  case 18:
452  return "vtxboundary";
453  case 19:
454  return "fvarlinear";
455  case 20:
456  return "creasemethod";
457  case 21:
458  return "trianglesubd";
459 
460  }
461  return 0;
462  }
463 
464  ParmType getNestParmType(TempIndex fieldnum) const override
465  {
466  if (fieldnum.size() < 1)
467  return PARM_UNSUPPORTED;
468  switch (fieldnum[0])
469  {
470  case 0:
471  return PARM_STRING;
472  case 1:
473  return PARM_STRING;
474  case 2:
475  return PARM_INTEGER;
476  case 3:
477  return PARM_INTEGER;
478  case 4:
479  return PARM_FLOAT;
480  case 5:
481  return PARM_INTEGER;
482  case 6:
483  return PARM_STRING;
484  case 7:
485  return PARM_INTEGER;
486  case 8:
487  return PARM_INTEGER;
488  case 9:
489  return PARM_FLOAT;
490  case 10:
491  return PARM_INTEGER;
492  case 11:
493  return PARM_INTEGER;
494  case 12:
495  return PARM_INTEGER;
496  case 13:
497  return PARM_INTEGER;
498  case 14:
499  return PARM_INTEGER;
500  case 15:
501  return PARM_INTEGER;
502  case 16:
503  return PARM_INTEGER;
504  case 17:
505  return PARM_INTEGER;
506  case 18:
507  return PARM_STRING;
508  case 19:
509  return PARM_STRING;
510  case 20:
511  return PARM_STRING;
512  case 21:
513  return PARM_STRING;
514 
515  }
516  return PARM_UNSUPPORTED;
517  }
518 
519  // Boiler plate to load individual types.
520  static void loadData(UT_IStream &is, int64 &v)
521  { is.bread(&v, 1); }
522  static void loadData(UT_IStream &is, bool &v)
523  { int64 iv; is.bread(&iv, 1); v = iv; }
524  static void loadData(UT_IStream &is, fpreal64 &v)
525  { is.bread<fpreal64>(&v, 1); }
526  static void loadData(UT_IStream &is, UT_Vector2D &v)
527  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
528  static void loadData(UT_IStream &is, UT_Vector3D &v)
529  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
530  is.bread<fpreal64>(&v.z(), 1); }
531  static void loadData(UT_IStream &is, UT_Vector4D &v)
532  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
533  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
534  static void loadData(UT_IStream &is, UT_Matrix2D &v)
535  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
536  static void loadData(UT_IStream &is, UT_Matrix3D &v)
537  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
538  static void loadData(UT_IStream &is, UT_Matrix4D &v)
539  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
540  static void loadData(UT_IStream &is, UT_Vector2I &v)
541  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
542  static void loadData(UT_IStream &is, UT_Vector3I &v)
543  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
544  is.bread<int64>(&v.z(), 1); }
545  static void loadData(UT_IStream &is, UT_Vector4I &v)
546  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
547  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
549  { is.bread(v); }
551  { UT_StringHolder rampdata;
552  loadData(is, rampdata);
553  if (rampdata.isstring())
554  {
555  v.reset(new UT_Ramp());
556  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
557  v->load(istr);
558  }
559  else v.reset();
560  }
563  loadData(is, data);
564  if (data.isstring())
565  {
566  // Find the data type.
567  const char *colon = UT_StringWrap(data).findChar(':');
568  if (colon)
569  {
570  int typelen = colon - data.buffer();
572  type.strncpy(data.buffer(), typelen);
573  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
574 
575  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
576  }
577  }
578  else v.reset();
579  }
580 
581  static void saveData(std::ostream &os, int64 v)
582  { UTwrite(os, &v); }
583  static void saveData(std::ostream &os, bool v)
584  { int64 iv = v; UTwrite(os, &iv); }
585  static void saveData(std::ostream &os, fpreal64 v)
586  { UTwrite<fpreal64>(os, &v); }
587  static void saveData(std::ostream &os, UT_Vector2D v)
588  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
589  static void saveData(std::ostream &os, UT_Vector3D v)
590  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
591  UTwrite<fpreal64>(os, &v.z()); }
592  static void saveData(std::ostream &os, UT_Vector4D v)
593  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
594  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
595  static void saveData(std::ostream &os, UT_Matrix2D v)
597  static void saveData(std::ostream &os, UT_Matrix3D v)
599  static void saveData(std::ostream &os, UT_Matrix4D v)
601  static void saveData(std::ostream &os, UT_StringHolder s)
602  { UT_StringWrap(s).saveBinary(os); }
603  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
605  UT_OStringStream ostr;
606  if (s) s->save(ostr);
607  result = ostr.str();
608  saveData(os, result);
609  }
610  static void saveData(std::ostream &os, PRM_DataItemHandle s)
612  UT_OStringStream ostr;
613  if (s)
614  {
615  ostr << s->getDataTypeToken();
616  ostr << ":";
617  s->saveBinary(ostr);
618  }
619  result = ostr.str();
620  saveData(os, result);
621  }
622 
623 
624  void save(std::ostream &os) const
625  {
626  int32 v = version();
627  UTwrite(os, &v);
628  saveData(os, myGroup);
629  saveData(os, myCreaseGroup);
630  saveData(os, myDepth);
631  saveData(os, myOverrideCreaseWeight);
632  saveData(os, myCreaseWeight);
633  saveData(os, myOutputCreases);
634  saveData(os, myOutputCreaseGroup);
635  saveData(os, myCloseCracks);
636  saveData(os, myDivideChoice);
637  saveData(os, myBias);
638  saveData(os, mySmoothVertex);
639  saveData(os, myEnforceConsistentTopology);
640  saveData(os, myLinearCreases);
641  saveData(os, myAlgorithm);
642  saveData(os, myBuildPolygonSoup);
643  saveData(os, myTreatCurvesIndependent);
644  saveData(os, myUpdateNormals);
645  saveData(os, myRemoveHoles);
646  saveData(os, myVtxBoundaryInterp);
647  saveData(os, myFVarLinearInterp);
648  saveData(os, myCreasingMethod);
649  saveData(os, myTriangleSubd);
650 
651  }
652 
653  bool load(UT_IStream &is)
654  {
655  int32 v;
656  is.bread(&v, 1);
657  if (version() != v)
658  {
659  // Fail incompatible versions
660  return false;
661  }
662  loadData(is, myGroup);
663  loadData(is, myCreaseGroup);
664  loadData(is, myDepth);
665  loadData(is, myOverrideCreaseWeight);
666  loadData(is, myCreaseWeight);
667  loadData(is, myOutputCreases);
668  loadData(is, myOutputCreaseGroup);
669  loadData(is, myCloseCracks);
670  loadData(is, myDivideChoice);
671  loadData(is, myBias);
672  loadData(is, mySmoothVertex);
673  loadData(is, myEnforceConsistentTopology);
674  loadData(is, myLinearCreases);
675  loadData(is, myAlgorithm);
676  loadData(is, myBuildPolygonSoup);
677  loadData(is, myTreatCurvesIndependent);
678  loadData(is, myUpdateNormals);
679  loadData(is, myRemoveHoles);
680  loadData(is, myVtxBoundaryInterp);
681  loadData(is, myFVarLinearInterp);
682  loadData(is, myCreasingMethod);
683  loadData(is, myTriangleSubd);
684 
685  return true;
686  }
687 
688  const UT_StringHolder & getGroup() const { return myGroup; }
689  void setGroup(const UT_StringHolder & val) { myGroup = val; }
691  {
692  SOP_Node *thissop = cookparms.getNode();
693  if (!thissop) return getGroup();
695  OP_Utils::evalOpParm(result, thissop, "subdivide", cookparms.getCookTime(), 0);
696  return result;
697  }
698  const UT_StringHolder & getCreaseGroup() const { return myCreaseGroup; }
699  void setCreaseGroup(const UT_StringHolder & val) { myCreaseGroup = val; }
701  {
702  SOP_Node *thissop = cookparms.getNode();
703  if (!thissop) return getCreaseGroup();
705  OP_Utils::evalOpParm(result, thissop, "creases", cookparms.getCookTime(), 0);
706  return result;
707  }
708  int64 getDepth() const { return myDepth; }
709  void setDepth(int64 val) { myDepth = val; }
710  int64 opDepth(const SOP_NodeVerb::CookParms &cookparms) const
711  {
712  SOP_Node *thissop = cookparms.getNode();
713  if (!thissop) return getDepth();
714  int64 result;
715  OP_Utils::evalOpParm(result, thissop, "iterations", cookparms.getCookTime(), 0);
716  return result;
717  }
718  bool getOverrideCreaseWeight() const { return myOverrideCreaseWeight; }
719  void setOverrideCreaseWeight(bool val) { myOverrideCreaseWeight = val; }
720  bool opOverrideCreaseWeight(const SOP_NodeVerb::CookParms &cookparms) const
721  {
722  SOP_Node *thissop = cookparms.getNode();
723  if (!thissop) return getOverrideCreaseWeight();
724  bool result;
725  OP_Utils::evalOpParm(result, thissop, "overridecrease", cookparms.getCookTime(), 0);
726  return result;
727  }
728  fpreal64 getCreaseWeight() const { return myCreaseWeight; }
729  void setCreaseWeight(fpreal64 val) { myCreaseWeight = val; }
731  {
732  SOP_Node *thissop = cookparms.getNode();
733  if (!thissop) return getCreaseWeight();
735  OP_Utils::evalOpParm(result, thissop, "creaseweight", cookparms.getCookTime(), 0);
736  return result;
737  }
738  bool getOutputCreases() const { return myOutputCreases; }
739  void setOutputCreases(bool val) { myOutputCreases = val; }
740  bool opOutputCreases(const SOP_NodeVerb::CookParms &cookparms) const
741  {
742  SOP_Node *thissop = cookparms.getNode();
743  if (!thissop) return getOutputCreases();
744  bool result;
745  OP_Utils::evalOpParm(result, thissop, "outputcrease", cookparms.getCookTime(), 0);
746  return result;
747  }
748  const UT_StringHolder & getOutputCreaseGroup() const { return myOutputCreaseGroup; }
749  void setOutputCreaseGroup(const UT_StringHolder & val) { myOutputCreaseGroup = val; }
751  {
752  SOP_Node *thissop = cookparms.getNode();
753  if (!thissop) return getOutputCreaseGroup();
755  OP_Utils::evalOpParm(result, thissop, "outcreasegroup", cookparms.getCookTime(), 0);
756  return result;
757  }
758  int64 getCloseCracks() const { return myCloseCracks; }
759  void setCloseCracks(int64 val) { myCloseCracks = val; }
761  {
762  SOP_Node *thissop = cookparms.getNode();
763  if (!thissop) return getCloseCracks();
764  int64 result;
765  OP_Utils::evalOpParm(result, thissop, "closeholes", cookparms.getCookTime(), 0);
766  return result;
767  }
768  int64 getDivideChoice() const { return myDivideChoice; }
769  void setDivideChoice(int64 val) { myDivideChoice = val; }
771  {
772  SOP_Node *thissop = cookparms.getNode();
773  if (!thissop) return getDivideChoice();
774  int64 result;
775  OP_Utils::evalOpParm(result, thissop, "surroundpoly", cookparms.getCookTime(), 0);
776  return result;
777  }
778  fpreal64 getBias() const { return myBias; }
779  void setBias(fpreal64 val) { myBias = val; }
780  fpreal64 opBias(const SOP_NodeVerb::CookParms &cookparms) const
781  {
782  SOP_Node *thissop = cookparms.getNode();
783  if (!thissop) return getBias();
785  OP_Utils::evalOpParm(result, thissop, "bias", cookparms.getCookTime(), 0);
786  return result;
787  }
788  bool getSmoothVertex() const { return mySmoothVertex; }
789  void setSmoothVertex(bool val) { mySmoothVertex = val; }
790  bool opSmoothVertex(const SOP_NodeVerb::CookParms &cookparms) const
791  {
792  SOP_Node *thissop = cookparms.getNode();
793  if (!thissop) return getSmoothVertex();
794  bool result;
795  OP_Utils::evalOpParm(result, thissop, "smoothvertex", cookparms.getCookTime(), 0);
796  return result;
797  }
798  bool getEnforceConsistentTopology() const { return myEnforceConsistentTopology; }
799  void setEnforceConsistentTopology(bool val) { myEnforceConsistentTopology = val; }
801  {
802  SOP_Node *thissop = cookparms.getNode();
803  if (!thissop) return getEnforceConsistentTopology();
804  bool result;
805  OP_Utils::evalOpParm(result, thissop, "consisttopology", cookparms.getCookTime(), 0);
806  return result;
807  }
808  bool getLinearCreases() const { return myLinearCreases; }
809  void setLinearCreases(bool val) { myLinearCreases = val; }
810  bool opLinearCreases(const SOP_NodeVerb::CookParms &cookparms) const
811  {
812  SOP_Node *thissop = cookparms.getNode();
813  if (!thissop) return getLinearCreases();
814  bool result;
815  OP_Utils::evalOpParm(result, thissop, "linearcreases", cookparms.getCookTime(), 0);
816  return result;
817  }
818  int64 getAlgorithm() const { return myAlgorithm; }
819  void setAlgorithm(int64 val) { myAlgorithm = val; }
820  int64 opAlgorithm(const SOP_NodeVerb::CookParms &cookparms) const
821  {
822  SOP_Node *thissop = cookparms.getNode();
823  if (!thissop) return getAlgorithm();
824  int64 result;
825  OP_Utils::evalOpParm(result, thissop, "algorithm", cookparms.getCookTime(), 0);
826  return result;
827  }
828  bool getBuildPolygonSoup() const { return myBuildPolygonSoup; }
829  void setBuildPolygonSoup(bool val) { myBuildPolygonSoup = val; }
830  bool opBuildPolygonSoup(const SOP_NodeVerb::CookParms &cookparms) const
831  {
832  SOP_Node *thissop = cookparms.getNode();
833  if (!thissop) return getBuildPolygonSoup();
834  bool result;
835  OP_Utils::evalOpParm(result, thissop, "buildpolysoups", cookparms.getCookTime(), 0);
836  return result;
837  }
838  bool getTreatCurvesIndependent() const { return myTreatCurvesIndependent; }
839  void setTreatCurvesIndependent(bool val) { myTreatCurvesIndependent = val; }
841  {
842  SOP_Node *thissop = cookparms.getNode();
843  if (!thissop) return getTreatCurvesIndependent();
844  bool result;
845  OP_Utils::evalOpParm(result, thissop, "indepcurves", cookparms.getCookTime(), 0);
846  return result;
847  }
848  bool getUpdateNormals() const { return myUpdateNormals; }
849  void setUpdateNormals(bool val) { myUpdateNormals = val; }
850  bool opUpdateNormals(const SOP_NodeVerb::CookParms &cookparms) const
851  {
852  SOP_Node *thissop = cookparms.getNode();
853  if (!thissop) return getUpdateNormals();
854  bool result;
855  OP_Utils::evalOpParm(result, thissop, "updatenmls", cookparms.getCookTime(), 0);
856  return result;
857  }
858  bool getRemoveHoles() const { return myRemoveHoles; }
859  void setRemoveHoles(bool val) { myRemoveHoles = val; }
860  bool opRemoveHoles(const SOP_NodeVerb::CookParms &cookparms) const
861  {
862  SOP_Node *thissop = cookparms.getNode();
863  if (!thissop) return getRemoveHoles();
864  bool result;
865  OP_Utils::evalOpParm(result, thissop, "removeholes", cookparms.getCookTime(), 0);
866  return result;
867  }
868  const UT_StringHolder & getVtxBoundaryInterp() const { return myVtxBoundaryInterp; }
869  void setVtxBoundaryInterp(const UT_StringHolder & val) { myVtxBoundaryInterp = val; }
871  {
872  SOP_Node *thissop = cookparms.getNode();
873  if (!thissop) return getVtxBoundaryInterp();
875  OP_Utils::evalOpParm(result, thissop, "vtxboundary", cookparms.getCookTime(), 0);
876  return result;
877  }
878  const UT_StringHolder & getFVarLinearInterp() const { return myFVarLinearInterp; }
879  void setFVarLinearInterp(const UT_StringHolder & val) { myFVarLinearInterp = val; }
881  {
882  SOP_Node *thissop = cookparms.getNode();
883  if (!thissop) return getFVarLinearInterp();
885  OP_Utils::evalOpParm(result, thissop, "fvarlinear", cookparms.getCookTime(), 0);
886  return result;
887  }
888  const UT_StringHolder & getCreasingMethod() const { return myCreasingMethod; }
889  void setCreasingMethod(const UT_StringHolder & val) { myCreasingMethod = val; }
891  {
892  SOP_Node *thissop = cookparms.getNode();
893  if (!thissop) return getCreasingMethod();
895  OP_Utils::evalOpParm(result, thissop, "creasemethod", cookparms.getCookTime(), 0);
896  return result;
897  }
898  const UT_StringHolder & getTriangleSubd() const { return myTriangleSubd; }
899  void setTriangleSubd(const UT_StringHolder & val) { myTriangleSubd = val; }
901  {
902  SOP_Node *thissop = cookparms.getNode();
903  if (!thissop) return getTriangleSubd();
905  OP_Utils::evalOpParm(result, thissop, "trianglesubd", cookparms.getCookTime(), 0);
906  return result;
907  }
908 
909 private:
910  UT_StringHolder myGroup;
911  UT_StringHolder myCreaseGroup;
912  int64 myDepth;
913  bool myOverrideCreaseWeight;
914  fpreal64 myCreaseWeight;
915  bool myOutputCreases;
916  UT_StringHolder myOutputCreaseGroup;
917  int64 myCloseCracks;
918  int64 myDivideChoice;
919  fpreal64 myBias;
920  bool mySmoothVertex;
921  bool myEnforceConsistentTopology;
922  bool myLinearCreases;
923  int64 myAlgorithm;
924  bool myBuildPolygonSoup;
925  bool myTreatCurvesIndependent;
926  bool myUpdateNormals;
927  bool myRemoveHoles;
928  UT_StringHolder myVtxBoundaryInterp;
929  UT_StringHolder myFVarLinearInterp;
930  UT_StringHolder myCreasingMethod;
931  UT_StringHolder myTriangleSubd;
932 
933 };
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
bool getTreatCurvesIndependent() const
static void saveData(std::ostream &os, bool v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
int64 opCloseCracks(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getTriangleSubd() const
fpreal64 getCreaseWeight() const
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool operator==(const SOP_SubdivideParms &src) const
bool opUpdateNormals(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
bool getOverrideCreaseWeight() const
static void saveData(std::ostream &os, UT_Vector3D v)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
bool opBuildPolygonSoup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
SYS_FORCE_INLINE const char * buffer() const
void save(std::ostream &os) const
GLdouble s
Definition: glad.h:3009
An output stream object that owns its own string buffer storage.
**But if you need a result
Definition: thread.h:613
int64 opDivideChoice(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opCreaseGroup(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setCreaseGroup(const UT_StringHolder &val)
UT_StringHolder opTriangleSubd(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setBuildPolygonSoup(bool val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool opTreatCurvesIndependent(const SOP_NodeVerb::CookParms &cookparms) const
bool opEnforceConsistentTopology(const SOP_NodeVerb::CookParms &cookparms) const
void setTriangleSubd(const UT_StringHolder &val)
bool opOverrideCreaseWeight(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, int64 &v)
exint length() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
bool isParmColorRamp(exint idx) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
static void saveData(std::ostream &os, UT_Matrix4D v)
const UT_StringHolder & getCreasingMethod() const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
UT_StringHolder opCreasingMethod(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void setFVarLinearInterp(const UT_StringHolder &val)
bool opSmoothVertex(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getOutputCreaseGroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void setTreatCurvesIndependent(bool val)
const UT_StringHolder & getFVarLinearInterp() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setEnforceConsistentTopology(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
long long int64
Definition: SYS_Types.h:116
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool opLinearCreases(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getGroup() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setOutputCreaseGroup(const UT_StringHolder &val)
void setOverrideCreaseWeight(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setVtxBoundaryInterp(const UT_StringHolder &val)
exint getNestNumParms(TempIndex idx) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void saveData(std::ostream &os, UT_Matrix3D v)
void setBias(fpreal64 val)
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, int64 v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
int64 opDepth(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opCreaseWeight(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
const UT_StringHolder & getCreaseGroup() const
static void saveData(std::ostream &os, UT_Matrix2D v)
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
static void saveData(std::ostream &os, UT_StringHolder s)
int64 opAlgorithm(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
void setCreasingMethod(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
bool opOutputCreases(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, fpreal64 v)
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool load(UT_IStream &is)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool getEnforceConsistentTopology() const
void setCreaseWeight(fpreal64 val)
static void loadData(UT_IStream &is, bool &v)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
const UT_StringHolder & getVtxBoundaryInterp() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
UT_StringHolder opVtxBoundaryInterp(const SOP_NodeVerb::CookParms &cookparms) const
GLboolean r
Definition: glcorearb.h:1222
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
UT_StringHolder opOutputCreaseGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
bool opRemoveHoles(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
bool operator!=(const SOP_SubdivideParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
UT_StringHolder opFVarLinearInterp(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
fpreal64 opBias(const SOP_NodeVerb::CookParms &cookparms) const
OP_NodeParms & operator=(const OP_NodeParms &)=default
void setGroup(const UT_StringHolder &val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, fpreal64 &v)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663