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