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