HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_PolyFill.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_NodeVerb.h>
7 #include <SOP/SOP_GraphProxy.h>
8 
9 #include <OP/OP_Utils.h>
10 #include <PRM/PRM_Parm.h>
11 #include <UT/UT_IStream.h>
12 #include <UT/UT_NTStreamUtil.h>
13 #include <UT/UT_Ramp.h>
14 #include <UT/UT_SharedPtr.h>
15 #include <UT/UT_StringHolder.h>
16 #include <UT/UT_StringStream.h>
17 #include <UT/UT_VectorTypes.h>
18 #include <SYS/SYS_Types.h>
19 
20 using namespace UT::Literal;
21 
22 class DEP_MicroNode;
23 namespace SOP_PolyFillEnums
24 {
25  enum class Fillmode
26  {
27  NONE = 0,
28  TRIS,
29  TRIFAN,
30  QUADFAN,
31  QUADS,
32  GRIDQUADS
33  };
34 }
35 
36 
38 {
39 public:
40  static int version() { return 1; }
41 
43  {
44  myGroup = ""_sh;
45  myFillmode = 4;
46  myCompleteloops = true;
47  myReverse = false;
48  myUniquepoints = false;
49  myUpdatenorms = true;
50  myLooptoggle = false;
51  myLoopdistance = 0.25;
52  mySmoothtoggle = true;
53  mySmoothstrength = 50;
54  myCorneroffset = 0;
55  myCustomcornerstoggle = false;
56  myCustomcorners = ""_sh;
57  mySubdivtoggle = true;
58  myTranslate = 0.25;
59  myTangentstrength = 0.4;
60  myPatchgrouptoggle = false;
61  myPatchgroup = "patch"_sh;
62  myLoopgrouptoggle = false;
63  myLoopgroup = "loopgroup"_sh;
64  myGroupappend = false;
65 
66  }
67 
68  explicit SOP_PolyFillParms(const SOP_PolyFillParms &) = default;
69 
70  ~SOP_PolyFillParms() override {}
71 
72  bool operator==(const SOP_PolyFillParms &src) const
73  {
74  if (myGroup != src.myGroup) return false;
75  if (myFillmode != src.myFillmode) return false;
76  if (myCompleteloops != src.myCompleteloops) return false;
77  if (myReverse != src.myReverse) return false;
78  if (myUniquepoints != src.myUniquepoints) return false;
79  if (myUpdatenorms != src.myUpdatenorms) return false;
80  if (myLooptoggle != src.myLooptoggle) return false;
81  if (myLoopdistance != src.myLoopdistance) return false;
82  if (mySmoothtoggle != src.mySmoothtoggle) return false;
83  if (mySmoothstrength != src.mySmoothstrength) return false;
84  if (myCorneroffset != src.myCorneroffset) return false;
85  if (myCustomcornerstoggle != src.myCustomcornerstoggle) return false;
86  if (myCustomcorners != src.myCustomcorners) return false;
87  if (mySubdivtoggle != src.mySubdivtoggle) return false;
88  if (myTranslate != src.myTranslate) return false;
89  if (myTangentstrength != src.myTangentstrength) return false;
90  if (myPatchgrouptoggle != src.myPatchgrouptoggle) return false;
91  if (myPatchgroup != src.myPatchgroup) return false;
92  if (myLoopgrouptoggle != src.myLoopgrouptoggle) return false;
93  if (myLoopgroup != src.myLoopgroup) return false;
94  if (myGroupappend != src.myGroupappend) return false;
95 
96  return true;
97  }
98  bool operator!=(const SOP_PolyFillParms &src) const
99  {
100  return !operator==(src);
101  }
103 
104 
105 
106  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
107  {
108  myGroup = ""_sh;
109  if (true)
110  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
111  myFillmode = 4;
112  if (true)
113  graph->evalOpParm(myFillmode, nodeidx, "fillmode", time, 0);
114  myCompleteloops = true;
115  if (true)
116  graph->evalOpParm(myCompleteloops, nodeidx, "completeloops", time, 0);
117  myReverse = false;
118  if (true)
119  graph->evalOpParm(myReverse, nodeidx, "reverse", time, 0);
120  myUniquepoints = false;
121  if (true)
122  graph->evalOpParm(myUniquepoints, nodeidx, "uniquepoints", time, 0);
123  myUpdatenorms = true;
124  if (true)
125  graph->evalOpParm(myUpdatenorms, nodeidx, "updatenorms", time, 0);
126  myLooptoggle = false;
127  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1)))) ) )
128  graph->evalOpParm(myLooptoggle, nodeidx, "looptoggle", time, 0);
129  myLoopdistance = 0.25;
130  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((getLooptoggle()==0)))) ) )
131  graph->evalOpParm(myLoopdistance, nodeidx, "loopdistance", time, 0);
132  mySmoothtoggle = true;
133  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((int64(getFillmode())==2))||((int64(getFillmode())==3)))) ) )
134  graph->evalOpParm(mySmoothtoggle, nodeidx, "smoothtoggle", time, 0);
135  mySmoothstrength = 50;
136  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((int64(getFillmode())==2))||((int64(getFillmode())==3))||((getSmoothtoggle()==0)))) ) )
137  graph->evalOpParm(mySmoothstrength, nodeidx, "smoothstrength", time, 0);
138  myCorneroffset = 0;
139  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((int64(getFillmode())==4))||((int64(getFillmode())==2)))) ) )
140  graph->evalOpParm(myCorneroffset, nodeidx, "corneroffset", time, 0);
141  myCustomcornerstoggle = false;
142  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((int64(getFillmode())==4))||((int64(getFillmode())==2)))) ) )
143  graph->evalOpParm(myCustomcornerstoggle, nodeidx, "customcornerstoggle", time, 0);
144  myCustomcorners = ""_sh;
145  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((int64(getFillmode())==4))||((int64(getFillmode())==2))||((getCustomcornerstoggle()==0)))) ) )
146  graph->evalOpParm(myCustomcorners, nodeidx, "customcorners", time, 0);
147  mySubdivtoggle = true;
148  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((int64(getFillmode())==4)))) ) )
149  graph->evalOpParm(mySubdivtoggle, nodeidx, "subdivtoggle", time, 0);
150  myTranslate = 0.25;
151  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((int64(getFillmode())==4))||((getSubdivtoggle()==0)))) ) )
152  graph->evalOpParm(myTranslate, nodeidx, "translate", time, 0);
153  myTangentstrength = 0.4;
154  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((int64(getFillmode())==4))||((int64(getFillmode())==2))||((int64(getFillmode())==3))||((getSubdivtoggle()==0)))) ) )
155  graph->evalOpParm(myTangentstrength, nodeidx, "tangentstrength", time, 0);
156  myPatchgrouptoggle = false;
157  if (true)
158  graph->evalOpParm(myPatchgrouptoggle, nodeidx, "patchgrouptoggle", time, 0);
159  myPatchgroup = "patch"_sh;
160  if (true && ( (!(((getPatchgrouptoggle()==0)))) ) )
161  graph->evalOpParm(myPatchgroup, nodeidx, "patchgroup", time, 0);
162  myLoopgrouptoggle = false;
163  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((getLooptoggle()==0)))) ) )
164  graph->evalOpParm(myLoopgrouptoggle, nodeidx, "loopgrouptoggle", time, 0);
165  myLoopgroup = "loopgroup"_sh;
166  if (true && ( (!(((int64(getFillmode())==0))||((int64(getFillmode())==1))||((getLooptoggle()==0))||((getLoopgrouptoggle()==0)))) ) )
167  graph->evalOpParm(myLoopgroup, nodeidx, "loopgroup", time, 0);
168  myGroupappend = false;
169  if (true)
170  graph->evalOpParm(myGroupappend, nodeidx, "groupappend", time, 0);
171 
172  }
173 
174 
175  void loadFromOpSubclass(const LoadParms &loadparms) override
176  {
177  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
178  }
179 
180 
181  void copyFrom(const SOP_NodeParms *src) override
182  {
183  *this = *((const SOP_PolyFillParms *)src);
184  }
185 
186  template <typename T>
187  void
188  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
189  {
190  if (idx.size() < 1)
191  return;
192  UT_ASSERT(idx.size() == instance.size()+1);
193  if (idx.size() != instance.size()+1)
194  return;
195  switch (idx[0])
196  {
197  case 0:
198  coerceValue(value, myGroup);
199  break;
200  case 1:
201  coerceValue(value, myFillmode);
202  break;
203  case 2:
204  coerceValue(value, myCompleteloops);
205  break;
206  case 3:
207  coerceValue(value, myReverse);
208  break;
209  case 4:
210  coerceValue(value, myUniquepoints);
211  break;
212  case 5:
213  coerceValue(value, myUpdatenorms);
214  break;
215  case 6:
216  coerceValue(value, myLooptoggle);
217  break;
218  case 7:
219  coerceValue(value, myLoopdistance);
220  break;
221  case 8:
222  coerceValue(value, mySmoothtoggle);
223  break;
224  case 9:
225  coerceValue(value, mySmoothstrength);
226  break;
227  case 10:
228  coerceValue(value, myCorneroffset);
229  break;
230  case 11:
231  coerceValue(value, myCustomcornerstoggle);
232  break;
233  case 12:
234  coerceValue(value, myCustomcorners);
235  break;
236  case 13:
237  coerceValue(value, mySubdivtoggle);
238  break;
239  case 14:
240  coerceValue(value, myTranslate);
241  break;
242  case 15:
243  coerceValue(value, myTangentstrength);
244  break;
245  case 16:
246  coerceValue(value, myPatchgrouptoggle);
247  break;
248  case 17:
249  coerceValue(value, myPatchgroup);
250  break;
251  case 18:
252  coerceValue(value, myLoopgrouptoggle);
253  break;
254  case 19:
255  coerceValue(value, myLoopgroup);
256  break;
257  case 20:
258  coerceValue(value, myGroupappend);
259  break;
260 
261  }
262  }
263 
264  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
265  { doGetParmValue(idx, instance, value); }
266  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
267  { doGetParmValue(idx, instance, value); }
268  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
269  { doGetParmValue(idx, instance, value); }
270  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
271  { doGetParmValue(idx, instance, value); }
272  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
273  { doGetParmValue(idx, instance, value); }
274  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
275  { doGetParmValue(idx, instance, value); }
276  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
277  { doGetParmValue(idx, instance, value); }
278  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
279  { doGetParmValue(idx, instance, value); }
280  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
281  { doGetParmValue(idx, instance, value); }
282  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
283  { doGetParmValue(idx, instance, value); }
284  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
285  { doGetParmValue(idx, instance, value); }
286 
287  template <typename T>
288  void
289  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
290  {
291  if (idx.size() < 1)
292  return;
293  UT_ASSERT(idx.size() == instance.size()+1);
294  if (idx.size() != instance.size()+1)
295  return;
296  switch (idx[0])
297  {
298  case 0:
299  coerceValue(myGroup, value);
300  break;
301  case 1:
302  coerceValue(myFillmode, value);
303  break;
304  case 2:
305  coerceValue(myCompleteloops, value);
306  break;
307  case 3:
308  coerceValue(myReverse, value);
309  break;
310  case 4:
311  coerceValue(myUniquepoints, value);
312  break;
313  case 5:
314  coerceValue(myUpdatenorms, value);
315  break;
316  case 6:
317  coerceValue(myLooptoggle, value);
318  break;
319  case 7:
320  coerceValue(myLoopdistance, value);
321  break;
322  case 8:
323  coerceValue(mySmoothtoggle, value);
324  break;
325  case 9:
326  coerceValue(mySmoothstrength, value);
327  break;
328  case 10:
329  coerceValue(myCorneroffset, value);
330  break;
331  case 11:
332  coerceValue(myCustomcornerstoggle, value);
333  break;
334  case 12:
335  coerceValue(myCustomcorners, value);
336  break;
337  case 13:
338  coerceValue(mySubdivtoggle, value);
339  break;
340  case 14:
341  coerceValue(myTranslate, value);
342  break;
343  case 15:
344  coerceValue(myTangentstrength, value);
345  break;
346  case 16:
347  coerceValue(myPatchgrouptoggle, value);
348  break;
349  case 17:
350  coerceValue(myPatchgroup, value);
351  break;
352  case 18:
353  coerceValue(myLoopgrouptoggle, value);
354  break;
355  case 19:
356  coerceValue(myLoopgroup, value);
357  break;
358  case 20:
359  coerceValue(myGroupappend, value);
360  break;
361 
362  }
363  }
364 
365  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
366  { doSetParmValue(idx, instance, value); }
367  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
368  { doSetParmValue(idx, instance, value); }
369  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
370  { doSetParmValue(idx, instance, value); }
371  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
372  { doSetParmValue(idx, instance, value); }
373  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
374  { doSetParmValue(idx, instance, value); }
375  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
376  { doSetParmValue(idx, instance, value); }
377  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
378  { doSetParmValue(idx, instance, value); }
379  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
380  { doSetParmValue(idx, instance, value); }
381  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
382  { doSetParmValue(idx, instance, value); }
383  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
384  { doSetParmValue(idx, instance, value); }
385  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
386  { doSetParmValue(idx, instance, value); }
387 
388  exint getNestNumParms(TempIndex idx) const override
389  {
390  if (idx.size() == 0)
391  return 21;
392  switch (idx[0])
393  {
394 
395  }
396  // Invalid
397  return 0;
398  }
399 
400  const char *getNestParmName(TempIndex fieldnum) const override
401  {
402  if (fieldnum.size() < 1)
403  return 0;
404  switch (fieldnum[0])
405  {
406  case 0:
407  return "group";
408  case 1:
409  return "fillmode";
410  case 2:
411  return "completeloops";
412  case 3:
413  return "reverse";
414  case 4:
415  return "uniquepoints";
416  case 5:
417  return "updatenorms";
418  case 6:
419  return "looptoggle";
420  case 7:
421  return "loopdistance";
422  case 8:
423  return "smoothtoggle";
424  case 9:
425  return "smoothstrength";
426  case 10:
427  return "corneroffset";
428  case 11:
429  return "customcornerstoggle";
430  case 12:
431  return "customcorners";
432  case 13:
433  return "subdivtoggle";
434  case 14:
435  return "translate";
436  case 15:
437  return "tangentstrength";
438  case 16:
439  return "patchgrouptoggle";
440  case 17:
441  return "patchgroup";
442  case 18:
443  return "loopgrouptoggle";
444  case 19:
445  return "loopgroup";
446  case 20:
447  return "groupappend";
448 
449  }
450  return 0;
451  }
452 
453  ParmType getNestParmType(TempIndex fieldnum) const override
454  {
455  if (fieldnum.size() < 1)
456  return PARM_UNSUPPORTED;
457  switch (fieldnum[0])
458  {
459  case 0:
460  return PARM_STRING;
461  case 1:
462  return PARM_INTEGER;
463  case 2:
464  return PARM_INTEGER;
465  case 3:
466  return PARM_INTEGER;
467  case 4:
468  return PARM_INTEGER;
469  case 5:
470  return PARM_INTEGER;
471  case 6:
472  return PARM_INTEGER;
473  case 7:
474  return PARM_FLOAT;
475  case 8:
476  return PARM_INTEGER;
477  case 9:
478  return PARM_FLOAT;
479  case 10:
480  return PARM_INTEGER;
481  case 11:
482  return PARM_INTEGER;
483  case 12:
484  return PARM_STRING;
485  case 13:
486  return PARM_INTEGER;
487  case 14:
488  return PARM_FLOAT;
489  case 15:
490  return PARM_FLOAT;
491  case 16:
492  return PARM_INTEGER;
493  case 17:
494  return PARM_STRING;
495  case 18:
496  return PARM_INTEGER;
497  case 19:
498  return PARM_STRING;
499  case 20:
500  return PARM_INTEGER;
501 
502  }
503  return PARM_UNSUPPORTED;
504  }
505 
506  // Boiler plate to load individual types.
507  static void loadData(UT_IStream &is, int64 &v)
508  { is.bread(&v, 1); }
509  static void loadData(UT_IStream &is, bool &v)
510  { int64 iv; is.bread(&iv, 1); v = iv; }
511  static void loadData(UT_IStream &is, fpreal64 &v)
512  { is.bread<fpreal64>(&v, 1); }
513  static void loadData(UT_IStream &is, UT_Vector2D &v)
514  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
515  static void loadData(UT_IStream &is, UT_Vector3D &v)
516  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
517  is.bread<fpreal64>(&v.z(), 1); }
518  static void loadData(UT_IStream &is, UT_Vector4D &v)
519  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
520  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
521  static void loadData(UT_IStream &is, UT_Matrix2D &v)
522  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
523  static void loadData(UT_IStream &is, UT_Matrix3D &v)
524  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
525  static void loadData(UT_IStream &is, UT_Matrix4D &v)
526  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
527  static void loadData(UT_IStream &is, UT_Vector2I &v)
528  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
529  static void loadData(UT_IStream &is, UT_Vector3I &v)
530  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
531  is.bread<int64>(&v.z(), 1); }
532  static void loadData(UT_IStream &is, UT_Vector4I &v)
533  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
534  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
536  { is.bread(v); }
538  { UT_StringHolder rampdata;
539  loadData(is, rampdata);
540  if (rampdata.isstring())
541  {
542  v.reset(new UT_Ramp());
543  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
544  v->load(istr);
545  }
546  else v.reset();
547  }
550  loadData(is, data);
551  if (data.isstring())
552  {
553  // Find the data type.
554  const char *colon = UT_StringWrap(data).findChar(':');
555  if (colon)
556  {
557  int typelen = colon - data.buffer();
559  type.strncpy(data.buffer(), typelen);
560  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
561 
562  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
563  }
564  }
565  else v.reset();
566  }
567 
568  static void saveData(std::ostream &os, int64 v)
569  { UTwrite(os, &v); }
570  static void saveData(std::ostream &os, bool v)
571  { int64 iv = v; UTwrite(os, &iv); }
572  static void saveData(std::ostream &os, fpreal64 v)
573  { UTwrite<fpreal64>(os, &v); }
574  static void saveData(std::ostream &os, UT_Vector2D v)
575  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
576  static void saveData(std::ostream &os, UT_Vector3D v)
577  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
578  UTwrite<fpreal64>(os, &v.z()); }
579  static void saveData(std::ostream &os, UT_Vector4D v)
580  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
581  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
582  static void saveData(std::ostream &os, UT_Matrix2D v)
584  static void saveData(std::ostream &os, UT_Matrix3D v)
586  static void saveData(std::ostream &os, UT_Matrix4D v)
588  static void saveData(std::ostream &os, UT_StringHolder s)
589  { UT_StringWrap(s).saveBinary(os); }
590  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
592  UT_OStringStream ostr;
593  if (s) s->save(ostr);
594  result = ostr.str();
595  saveData(os, result);
596  }
597  static void saveData(std::ostream &os, PRM_DataItemHandle s)
599  UT_OStringStream ostr;
600  if (s)
601  {
602  ostr << s->getDataTypeToken();
603  ostr << ":";
604  s->saveBinary(ostr);
605  }
606  result = ostr.str();
607  saveData(os, result);
608  }
609 
610 
611  void save(std::ostream &os) const
612  {
613  int32 v = version();
614  UTwrite(os, &v);
615  saveData(os, myGroup);
616  saveData(os, myFillmode);
617  saveData(os, myCompleteloops);
618  saveData(os, myReverse);
619  saveData(os, myUniquepoints);
620  saveData(os, myUpdatenorms);
621  saveData(os, myLooptoggle);
622  saveData(os, myLoopdistance);
623  saveData(os, mySmoothtoggle);
624  saveData(os, mySmoothstrength);
625  saveData(os, myCorneroffset);
626  saveData(os, myCustomcornerstoggle);
627  saveData(os, myCustomcorners);
628  saveData(os, mySubdivtoggle);
629  saveData(os, myTranslate);
630  saveData(os, myTangentstrength);
631  saveData(os, myPatchgrouptoggle);
632  saveData(os, myPatchgroup);
633  saveData(os, myLoopgrouptoggle);
634  saveData(os, myLoopgroup);
635  saveData(os, myGroupappend);
636 
637  }
638 
639  bool load(UT_IStream &is)
640  {
641  int32 v;
642  is.bread(&v, 1);
643  if (version() != v)
644  {
645  // Fail incompatible versions
646  return false;
647  }
648  loadData(is, myGroup);
649  loadData(is, myFillmode);
650  loadData(is, myCompleteloops);
651  loadData(is, myReverse);
652  loadData(is, myUniquepoints);
653  loadData(is, myUpdatenorms);
654  loadData(is, myLooptoggle);
655  loadData(is, myLoopdistance);
656  loadData(is, mySmoothtoggle);
657  loadData(is, mySmoothstrength);
658  loadData(is, myCorneroffset);
659  loadData(is, myCustomcornerstoggle);
660  loadData(is, myCustomcorners);
661  loadData(is, mySubdivtoggle);
662  loadData(is, myTranslate);
663  loadData(is, myTangentstrength);
664  loadData(is, myPatchgrouptoggle);
665  loadData(is, myPatchgroup);
666  loadData(is, myLoopgrouptoggle);
667  loadData(is, myLoopgroup);
668  loadData(is, myGroupappend);
669 
670  return true;
671  }
672 
673  const UT_StringHolder & getGroup() const { return myGroup; }
674  void setGroup(const UT_StringHolder & val) { myGroup = val; }
676  {
677  SOP_Node *thissop = cookparms.getNode();
678  if (!thissop) return getGroup();
680  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
681  return result;
682  }
683  Fillmode getFillmode() const { return Fillmode(myFillmode); }
684  void setFillmode(Fillmode val) { myFillmode = int64(val); }
686  {
687  SOP_Node *thissop = cookparms.getNode();
688  if (!thissop) return getFillmode();
689  int64 result;
690  OP_Utils::evalOpParm(result, thissop, "fillmode", cookparms.getCookTime(), 0);
691  return Fillmode(result);
692  }
693  bool getCompleteloops() const { return myCompleteloops; }
694  void setCompleteloops(bool val) { myCompleteloops = val; }
695  bool opCompleteloops(const SOP_NodeVerb::CookParms &cookparms) const
696  {
697  SOP_Node *thissop = cookparms.getNode();
698  if (!thissop) return getCompleteloops();
699  bool result;
700  OP_Utils::evalOpParm(result, thissop, "completeloops", cookparms.getCookTime(), 0);
701  return result;
702  }
703  bool getReverse() const { return myReverse; }
704  void setReverse(bool val) { myReverse = val; }
705  bool opReverse(const SOP_NodeVerb::CookParms &cookparms) const
706  {
707  SOP_Node *thissop = cookparms.getNode();
708  if (!thissop) return getReverse();
709  bool result;
710  OP_Utils::evalOpParm(result, thissop, "reverse", cookparms.getCookTime(), 0);
711  return result;
712  }
713  bool getUniquepoints() const { return myUniquepoints; }
714  void setUniquepoints(bool val) { myUniquepoints = val; }
715  bool opUniquepoints(const SOP_NodeVerb::CookParms &cookparms) const
716  {
717  SOP_Node *thissop = cookparms.getNode();
718  if (!thissop) return getUniquepoints();
719  bool result;
720  OP_Utils::evalOpParm(result, thissop, "uniquepoints", cookparms.getCookTime(), 0);
721  return result;
722  }
723  bool getUpdatenorms() const { return myUpdatenorms; }
724  void setUpdatenorms(bool val) { myUpdatenorms = val; }
725  bool opUpdatenorms(const SOP_NodeVerb::CookParms &cookparms) const
726  {
727  SOP_Node *thissop = cookparms.getNode();
728  if (!thissop) return getUpdatenorms();
729  bool result;
730  OP_Utils::evalOpParm(result, thissop, "updatenorms", cookparms.getCookTime(), 0);
731  return result;
732  }
733  bool getLooptoggle() const { return myLooptoggle; }
734  void setLooptoggle(bool val) { myLooptoggle = val; }
735  bool opLooptoggle(const SOP_NodeVerb::CookParms &cookparms) const
736  {
737  SOP_Node *thissop = cookparms.getNode();
738  if (!thissop) return getLooptoggle();
739  bool result;
740  OP_Utils::evalOpParm(result, thissop, "looptoggle", cookparms.getCookTime(), 0);
741  return result;
742  }
743  fpreal64 getLoopdistance() const { return myLoopdistance; }
744  void setLoopdistance(fpreal64 val) { myLoopdistance = val; }
746  {
747  SOP_Node *thissop = cookparms.getNode();
748  if (!thissop) return getLoopdistance();
750  OP_Utils::evalOpParm(result, thissop, "loopdistance", cookparms.getCookTime(), 0);
751  return result;
752  }
753  bool getSmoothtoggle() const { return mySmoothtoggle; }
754  void setSmoothtoggle(bool val) { mySmoothtoggle = val; }
755  bool opSmoothtoggle(const SOP_NodeVerb::CookParms &cookparms) const
756  {
757  SOP_Node *thissop = cookparms.getNode();
758  if (!thissop) return getSmoothtoggle();
759  bool result;
760  OP_Utils::evalOpParm(result, thissop, "smoothtoggle", cookparms.getCookTime(), 0);
761  return result;
762  }
763  fpreal64 getSmoothstrength() const { return mySmoothstrength; }
764  void setSmoothstrength(fpreal64 val) { mySmoothstrength = val; }
766  {
767  SOP_Node *thissop = cookparms.getNode();
768  if (!thissop) return getSmoothstrength();
770  OP_Utils::evalOpParm(result, thissop, "smoothstrength", cookparms.getCookTime(), 0);
771  return result;
772  }
773  int64 getCorneroffset() const { return myCorneroffset; }
774  void setCorneroffset(int64 val) { myCorneroffset = val; }
776  {
777  SOP_Node *thissop = cookparms.getNode();
778  if (!thissop) return getCorneroffset();
779  int64 result;
780  OP_Utils::evalOpParm(result, thissop, "corneroffset", cookparms.getCookTime(), 0);
781  return result;
782  }
783  bool getCustomcornerstoggle() const { return myCustomcornerstoggle; }
784  void setCustomcornerstoggle(bool val) { myCustomcornerstoggle = val; }
785  bool opCustomcornerstoggle(const SOP_NodeVerb::CookParms &cookparms) const
786  {
787  SOP_Node *thissop = cookparms.getNode();
788  if (!thissop) return getCustomcornerstoggle();
789  bool result;
790  OP_Utils::evalOpParm(result, thissop, "customcornerstoggle", cookparms.getCookTime(), 0);
791  return result;
792  }
793  const UT_StringHolder & getCustomcorners() const { return myCustomcorners; }
794  void setCustomcorners(const UT_StringHolder & val) { myCustomcorners = val; }
796  {
797  SOP_Node *thissop = cookparms.getNode();
798  if (!thissop) return getCustomcorners();
800  OP_Utils::evalOpParm(result, thissop, "customcorners", cookparms.getCookTime(), 0);
801  return result;
802  }
803  bool getSubdivtoggle() const { return mySubdivtoggle; }
804  void setSubdivtoggle(bool val) { mySubdivtoggle = val; }
805  bool opSubdivtoggle(const SOP_NodeVerb::CookParms &cookparms) const
806  {
807  SOP_Node *thissop = cookparms.getNode();
808  if (!thissop) return getSubdivtoggle();
809  bool result;
810  OP_Utils::evalOpParm(result, thissop, "subdivtoggle", cookparms.getCookTime(), 0);
811  return result;
812  }
813  fpreal64 getTranslate() const { return myTranslate; }
814  void setTranslate(fpreal64 val) { myTranslate = val; }
816  {
817  SOP_Node *thissop = cookparms.getNode();
818  if (!thissop) return getTranslate();
820  OP_Utils::evalOpParm(result, thissop, "translate", cookparms.getCookTime(), 0);
821  return result;
822  }
823  fpreal64 getTangentstrength() const { return myTangentstrength; }
824  void setTangentstrength(fpreal64 val) { myTangentstrength = val; }
826  {
827  SOP_Node *thissop = cookparms.getNode();
828  if (!thissop) return getTangentstrength();
830  OP_Utils::evalOpParm(result, thissop, "tangentstrength", cookparms.getCookTime(), 0);
831  return result;
832  }
833  bool getPatchgrouptoggle() const { return myPatchgrouptoggle; }
834  void setPatchgrouptoggle(bool val) { myPatchgrouptoggle = val; }
835  bool opPatchgrouptoggle(const SOP_NodeVerb::CookParms &cookparms) const
836  {
837  SOP_Node *thissop = cookparms.getNode();
838  if (!thissop) return getPatchgrouptoggle();
839  bool result;
840  OP_Utils::evalOpParm(result, thissop, "patchgrouptoggle", cookparms.getCookTime(), 0);
841  return result;
842  }
843  const UT_StringHolder & getPatchgroup() const { return myPatchgroup; }
844  void setPatchgroup(const UT_StringHolder & val) { myPatchgroup = val; }
846  {
847  SOP_Node *thissop = cookparms.getNode();
848  if (!thissop) return getPatchgroup();
850  OP_Utils::evalOpParm(result, thissop, "patchgroup", cookparms.getCookTime(), 0);
851  return result;
852  }
853  bool getLoopgrouptoggle() const { return myLoopgrouptoggle; }
854  void setLoopgrouptoggle(bool val) { myLoopgrouptoggle = val; }
855  bool opLoopgrouptoggle(const SOP_NodeVerb::CookParms &cookparms) const
856  {
857  SOP_Node *thissop = cookparms.getNode();
858  if (!thissop) return getLoopgrouptoggle();
859  bool result;
860  OP_Utils::evalOpParm(result, thissop, "loopgrouptoggle", cookparms.getCookTime(), 0);
861  return result;
862  }
863  const UT_StringHolder & getLoopgroup() const { return myLoopgroup; }
864  void setLoopgroup(const UT_StringHolder & val) { myLoopgroup = val; }
866  {
867  SOP_Node *thissop = cookparms.getNode();
868  if (!thissop) return getLoopgroup();
870  OP_Utils::evalOpParm(result, thissop, "loopgroup", cookparms.getCookTime(), 0);
871  return result;
872  }
873  bool getGroupappend() const { return myGroupappend; }
874  void setGroupappend(bool val) { myGroupappend = val; }
875  bool opGroupappend(const SOP_NodeVerb::CookParms &cookparms) const
876  {
877  SOP_Node *thissop = cookparms.getNode();
878  if (!thissop) return getGroupappend();
879  bool result;
880  OP_Utils::evalOpParm(result, thissop, "groupappend", cookparms.getCookTime(), 0);
881  return result;
882  }
883 
884 private:
885  UT_StringHolder myGroup;
886  int64 myFillmode;
887  bool myCompleteloops;
888  bool myReverse;
889  bool myUniquepoints;
890  bool myUpdatenorms;
891  bool myLooptoggle;
892  fpreal64 myLoopdistance;
893  bool mySmoothtoggle;
894  fpreal64 mySmoothstrength;
895  int64 myCorneroffset;
896  bool myCustomcornerstoggle;
897  UT_StringHolder myCustomcorners;
898  bool mySubdivtoggle;
899  fpreal64 myTranslate;
900  fpreal64 myTangentstrength;
901  bool myPatchgrouptoggle;
902  UT_StringHolder myPatchgroup;
903  bool myLoopgrouptoggle;
904  UT_StringHolder myLoopgroup;
905  bool myGroupappend;
906 
907 };
void setSubdivtoggle(bool val)
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
GLdouble s
Definition: glew.h:1390
bool opCompleteloops(const SOP_NodeVerb::CookParms &cookparms) const
void setFillmode(Fillmode val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
const UT_StringHolder & getLoopgroup() const
static void loadData(UT_IStream &is, int64 &v)
fpreal64 getSmoothstrength() const
bool operator!=(const SOP_PolyFillParms &src) const
bool operator==(const SOP_PolyFillParms &src) const
void loadFromOpSubclass(const LoadParms &loadparms) override
exint nodeIdx() const
Definition: SOP_NodeVerb.h:114
fpreal64 getLoopdistance() const
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:640
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool opLoopgrouptoggle(const SOP_NodeVerb::CookParms &cookparms) const
bool getSmoothtoggle() const
const UT_StringHolder & getPatchgroup() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
fpreal getTime() const
Definition: OP_Context.h:60
GLuint const GLfloat * val
Definition: glew.h:2794
const UT_StringHolder & getCustomcorners() const
static void loadData(UT_IStream &is, fpreal64 &v)
void setLoopdistance(fpreal64 val)
int64 exint
Definition: SYS_Types.h:125
bool opCustomcornerstoggle(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:113
exint getNestNumParms(TempIndex idx) const override
~SOP_PolyFillParms() override
An output stream object that owns its own string buffer storage.
void setPatchgrouptoggle(bool val)
static void saveData(std::ostream &os, bool v)
static void saveData(std::ostream &os, UT_StringHolder s)
const GLdouble * v
Definition: glew.h:1391
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool getUniquepoints() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
bool load(UT_IStream &is)
bool getSubdivtoggle() const
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setCustomcornerstoggle(bool val)
bool getGroupappend() const
bool opLooptoggle(const SOP_NodeVerb::CookParms &cookparms) const
bool opSmoothtoggle(const SOP_NodeVerb::CookParms &cookparms) const
int64 getCorneroffset() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
double fpreal64
Definition: SYS_Types.h:201
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setUniquepoints(bool val)
bool getLoopgrouptoggle() const
void setTranslate(fpreal64 val)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setSmoothtoggle(bool val)
bool getCustomcornerstoggle() const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setLoopgrouptoggle(bool val)
bool getCompleteloops() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool getReverse() const
SYS_FORCE_INLINE T & y()
Definition: UT_Vector3.h:513
UT_StringHolder opCustomcorners(const SOP_NodeVerb::CookParms &cookparms) const
void setReverse(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
exint length() const
bool opUniquepoints(const SOP_NodeVerb::CookParms &cookparms) 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 loadData(UT_IStream &is, UT_Vector4D &v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
bool opSubdivtoggle(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void copyFrom(const SOP_NodeParms *src) override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
fpreal64 opSmoothstrength(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix3D v)
bool opReverse(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opLoopdistance(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
SYS_FORCE_INLINE T & z()
Definition: UT_Vector3.h:515
static void loadData(UT_IStream &is, bool &v)
UT_StringHolder opLoopgroup(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getGroup() const
const GLfloat * c
Definition: glew.h:16296
static void saveData(std::ostream &os, UT_Matrix2D v)
void setCorneroffset(int64 val)
const char * getNestParmName(TempIndex fieldnum) const override
Fillmode getFillmode() const
long long int64
Definition: SYS_Types.h:116
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, int64 v)
void setPatchgroup(const UT_StringHolder &val)
void setLooptoggle(bool val)
fpreal64 opTranslate(const SOP_NodeVerb::CookParms &cookparms) const
void setSmoothstrength(fpreal64 val)
void setLoopgroup(const UT_StringHolder &val)
UT_StringHolder opPatchgroup(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
ParmType getNestParmType(TempIndex fieldnum) const override
void setUpdatenorms(bool val)
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:121
void setGroupappend(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
int64 opCorneroffset(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getTangentstrength() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setCustomcorners(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_Vector3D v)
fpreal64 getTranslate() const
bool opPatchgrouptoggle(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
bool opUpdatenorms(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
bool getPatchgrouptoggle() const
Fillmode opFillmode(const SOP_NodeVerb::CookParms &cookparms) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
#define SOP_API
Definition: SOP_API.h:10
void setTangentstrength(fpreal64 val)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Matrix4D &v)
SYS_FORCE_INLINE T & x()
Definition: UT_Vector3.h:511
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:654
GLuint64EXT * result
Definition: glew.h:14007
static void saveData(std::ostream &os, UT_Vector2D v)
const char * findChar(int c) const
Definition: UT_String.h:1367
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
void setCompleteloops(bool val)
bool getLooptoggle() const
bool opGroupappend(const SOP_NodeVerb::CookParms &cookparms) const
bool getUpdatenorms() const
GLsizei const GLfloat * value
Definition: glew.h:1849
static void loadData(UT_IStream &is, UT_StringHolder &v)
fpreal64 opTangentstrength(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: SOP_NodeVerb.h:119
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void save(std::ostream &os) const
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
type
Definition: core.h:528
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)