HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_GroupExpand.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <SOP/SOP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_GroupExpandEnums
24 {
25  enum class Grouptype
26  {
27  AUTO = 0,
28  VERTICES,
29  EDGES,
30  POINTS,
31  PRIMS
32  };
33 
35  getToken(Grouptype enum_value)
36  {
37  using namespace UT::Literal;
38  switch (enum_value) {
39  case Grouptype::AUTO: return "auto"_sh;
40  case Grouptype::VERTICES: return "vertices"_sh;
41  case Grouptype::EDGES: return "edges"_sh;
42  case Grouptype::POINTS: return "points"_sh;
43  case Grouptype::PRIMS: return "prims"_sh;
44  default: UT_ASSERT(false); return ""_sh;
45  }
46  }
47 
48  enum class Colgrouptype
49  {
50  AUTO = 0,
51  EDGES,
52  POINTS,
53  PRIMS,
54  VERTICES
55  };
56 
58  getToken(Colgrouptype enum_value)
59  {
60  using namespace UT::Literal;
61  switch (enum_value) {
62  case Colgrouptype::AUTO: return "auto"_sh;
63  case Colgrouptype::EDGES: return "edges"_sh;
64  case Colgrouptype::POINTS: return "points"_sh;
65  case Colgrouptype::PRIMS: return "prims"_sh;
66  case Colgrouptype::VERTICES: return "vertices"_sh;
67  default: UT_ASSERT(false); return ""_sh;
68  }
69  }
70 
71 }
72 
73 
75 {
76 public:
77  static int version() { return 1; }
78 
80  {
81  myOutputgroup = ""_UTsh;
82  myGroup = ""_UTsh;
83  myGrouptype = 0;
84  myPrimshareedge = false;
85  myFloodfill = false;
86  myNumsteps = 1;
87  myUsestepattrib = false;
88  myStepattrib = "step"_UTsh;
89  myBynormal = false;
90  myNormalangle = 60;
91  myOverridenormal = false;
92  myNormalattrib = "N"_UTsh;
93  myUseconnectivityattrib = false;
94  myConnectivityattrib = "uv"_UTsh;
95  myUsecolgroup = false;
96  myColgroup = ""_UTsh;
97  myColgrouptype = 0;
98  myColgroupinvert = false;
99  myColgroupallowonbound = false;
100 
101  }
102 
103  explicit SOP_GroupExpandParms(const SOP_GroupExpandParms &) = default;
105  SOP_GroupExpandParms(SOP_GroupExpandParms &&) noexcept = default;
106  SOP_GroupExpandParms &operator=(SOP_GroupExpandParms &&) noexcept = default;
107 
108  ~SOP_GroupExpandParms() override {}
109 
111  {
112  if (myOutputgroup != src.myOutputgroup) return false;
113  if (myGroup != src.myGroup) return false;
114  if (myGrouptype != src.myGrouptype) return false;
115  if (myPrimshareedge != src.myPrimshareedge) return false;
116  if (myFloodfill != src.myFloodfill) return false;
117  if (myNumsteps != src.myNumsteps) return false;
118  if (myUsestepattrib != src.myUsestepattrib) return false;
119  if (myStepattrib != src.myStepattrib) return false;
120  if (myBynormal != src.myBynormal) return false;
121  if (myNormalangle != src.myNormalangle) return false;
122  if (myOverridenormal != src.myOverridenormal) return false;
123  if (myNormalattrib != src.myNormalattrib) return false;
124  if (myUseconnectivityattrib != src.myUseconnectivityattrib) return false;
125  if (myConnectivityattrib != src.myConnectivityattrib) return false;
126  if (myUsecolgroup != src.myUsecolgroup) return false;
127  if (myColgroup != src.myColgroup) return false;
128  if (myColgrouptype != src.myColgrouptype) return false;
129  if (myColgroupinvert != src.myColgroupinvert) return false;
130  if (myColgroupallowonbound != src.myColgroupallowonbound) return false;
131 
132  return true;
133  }
135  {
136  return !operator==(src);
137  }
140 
141 
142 
143  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
144  {
145  myOutputgroup = ""_UTsh;
146  if (true)
147  graph->evalOpParm(myOutputgroup, nodeidx, "outputgroup", time, 0);
148  myGroup = ""_UTsh;
149  if (true)
150  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
151  myGrouptype = 0;
152  if (true)
153  graph->evalOpParm(myGrouptype, nodeidx, "grouptype", time, 0);
154  myPrimshareedge = false;
155  if (true && ( (true&&!(((int64(getGrouptype())==1))||((int64(getGrouptype())==2))||((int64(getGrouptype())==3)))) ) )
156  graph->evalOpParm(myPrimshareedge, nodeidx, "primshareedge", time, 0);
157  myFloodfill = false;
158  if (true)
159  graph->evalOpParm(myFloodfill, nodeidx, "floodfill", time, 0);
160  myNumsteps = 1;
161  if (true && ( (true&&!(((getFloodfill()==1)))) ) )
162  graph->evalOpParm(myNumsteps, nodeidx, "numsteps", time, 0);
163  myUsestepattrib = false;
164  if (true)
165  graph->evalOpParm(myUsestepattrib, nodeidx, "usestepattrib", time, 0);
166  myStepattrib = "step"_UTsh;
167  if (true && ( (true&&!(((getUsestepattrib()==0)))) ) )
168  graph->evalOpParm(myStepattrib, nodeidx, "stepattrib", time, 0);
169  myBynormal = false;
170  if (true)
171  graph->evalOpParm(myBynormal, nodeidx, "bynormal", time, 0);
172  myNormalangle = 60;
173  if (true && ( (true&&!(((getBynormal()==0)))) ) )
174  graph->evalOpParm(myNormalangle, nodeidx, "normalangle", time, 0);
175  myOverridenormal = false;
176  if (true && ( (true&&!(((getBynormal()==0)))) ) )
177  graph->evalOpParm(myOverridenormal, nodeidx, "overridenormal", time, 0);
178  myNormalattrib = "N"_UTsh;
179  if (true && ( (true&&!(((getBynormal()==0))||((getOverridenormal()==0)))) ) )
180  graph->evalOpParm(myNormalattrib, nodeidx, "normalattrib", time, 0);
181  myUseconnectivityattrib = false;
182  if (true)
183  graph->evalOpParm(myUseconnectivityattrib, nodeidx, "useconnectivityattrib", time, 0);
184  myConnectivityattrib = "uv"_UTsh;
185  if (true && ( (true&&!(((getUseconnectivityattrib()==0)))) ) )
186  graph->evalOpParm(myConnectivityattrib, nodeidx, "connectivityattrib", time, 0);
187  myUsecolgroup = false;
188  if (true)
189  graph->evalOpParm(myUsecolgroup, nodeidx, "usecolgroup", time, 0);
190  myColgroup = ""_UTsh;
191  if (true && ( (true&&!(((getUsecolgroup()==0)))) ) )
192  graph->evalOpParm(myColgroup, nodeidx, "colgroup", time, 0);
193  myColgrouptype = 0;
194  if (true && ( (true&&!(((getUsecolgroup()==0)))) ) )
195  graph->evalOpParm(myColgrouptype, nodeidx, "colgrouptype", time, 0);
196  myColgroupinvert = false;
197  if (true && ( (true&&!(((getUsecolgroup()==0)))) ) )
198  graph->evalOpParm(myColgroupinvert, nodeidx, "colgroupinvert", time, 0);
199  myColgroupallowonbound = false;
200  if (true && ( (true&&!(((getUsecolgroup()==0))||((getColgroupinvert()==1)))) ) )
201  graph->evalOpParm(myColgroupallowonbound, nodeidx, "colgroupallowonbound", time, 0);
202 
203  }
204 
205 
206  void loadFromOpSubclass(const LoadParms &loadparms) override
207  {
208  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
209  }
210 
211 
212  void copyFrom(const OP_NodeParms *src) override
213  {
214  *this = *((const SOP_GroupExpandParms *)src);
215  }
216 
217  template <typename T>
218  void
219  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
220  {
221  if (idx.size() < 1)
222  return;
223  UT_ASSERT(idx.size() == instance.size()+1);
224  if (idx.size() != instance.size()+1)
225  return;
226  switch (idx[0])
227  {
228  case 0:
229  coerceValue(value, myOutputgroup);
230  break;
231  case 1:
232  coerceValue(value, myGroup);
233  break;
234  case 2:
235  coerceValue(value, myGrouptype);
236  break;
237  case 3:
238  coerceValue(value, myPrimshareedge);
239  break;
240  case 4:
241  coerceValue(value, myFloodfill);
242  break;
243  case 5:
244  coerceValue(value, myNumsteps);
245  break;
246  case 6:
247  coerceValue(value, myUsestepattrib);
248  break;
249  case 7:
250  coerceValue(value, myStepattrib);
251  break;
252  case 8:
253  coerceValue(value, myBynormal);
254  break;
255  case 9:
256  coerceValue(value, myNormalangle);
257  break;
258  case 10:
259  coerceValue(value, myOverridenormal);
260  break;
261  case 11:
262  coerceValue(value, myNormalattrib);
263  break;
264  case 12:
265  coerceValue(value, myUseconnectivityattrib);
266  break;
267  case 13:
268  coerceValue(value, myConnectivityattrib);
269  break;
270  case 14:
271  coerceValue(value, myUsecolgroup);
272  break;
273  case 15:
274  coerceValue(value, myColgroup);
275  break;
276  case 16:
277  coerceValue(value, myColgrouptype);
278  break;
279  case 17:
280  coerceValue(value, myColgroupinvert);
281  break;
282  case 18:
283  coerceValue(value, myColgroupallowonbound);
284  break;
285 
286  }
287  }
288 
289  bool isParmColorRamp(exint idx) const override
290  {
291  switch (idx)
292  {
293 
294  }
295  return false;
296  }
297 
298  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
299  { doGetParmValue(idx, instance, value); }
300  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
305  { doGetParmValue(idx, instance, value); }
306  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
307  { doGetParmValue(idx, instance, value); }
308  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
309  { doGetParmValue(idx, instance, value); }
310  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
311  { doGetParmValue(idx, instance, value); }
312  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
313  { doGetParmValue(idx, instance, value); }
314  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
315  { doGetParmValue(idx, instance, value); }
316  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
317  { doGetParmValue(idx, instance, value); }
318  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
319  { doGetParmValue(idx, instance, value); }
320 
321  template <typename T>
322  void
323  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
324  {
325  if (idx.size() < 1)
326  return;
327  UT_ASSERT(idx.size() == instance.size()+1);
328  if (idx.size() != instance.size()+1)
329  return;
330  switch (idx[0])
331  {
332  case 0:
333  coerceValue(myOutputgroup, ( ( value ) ));
334  break;
335  case 1:
336  coerceValue(myGroup, ( ( value ) ));
337  break;
338  case 2:
339  coerceValue(myGrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
340  break;
341  case 3:
342  coerceValue(myPrimshareedge, ( ( value ) ));
343  break;
344  case 4:
345  coerceValue(myFloodfill, ( ( value ) ));
346  break;
347  case 5:
348  coerceValue(myNumsteps, ( ( value ) ));
349  break;
350  case 6:
351  coerceValue(myUsestepattrib, ( ( value ) ));
352  break;
353  case 7:
354  coerceValue(myStepattrib, ( ( value ) ));
355  break;
356  case 8:
357  coerceValue(myBynormal, ( ( value ) ));
358  break;
359  case 9:
360  coerceValue(myNormalangle, ( ( value ) ));
361  break;
362  case 10:
363  coerceValue(myOverridenormal, ( ( value ) ));
364  break;
365  case 11:
366  coerceValue(myNormalattrib, ( ( value ) ));
367  break;
368  case 12:
369  coerceValue(myUseconnectivityattrib, ( ( value ) ));
370  break;
371  case 13:
372  coerceValue(myConnectivityattrib, ( ( value ) ));
373  break;
374  case 14:
375  coerceValue(myUsecolgroup, ( ( value ) ));
376  break;
377  case 15:
378  coerceValue(myColgroup, ( ( value ) ));
379  break;
380  case 16:
381  coerceValue(myColgrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
382  break;
383  case 17:
384  coerceValue(myColgroupinvert, ( ( value ) ));
385  break;
386  case 18:
387  coerceValue(myColgroupallowonbound, ( ( value ) ));
388  break;
389 
390  }
391  }
392 
393  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
394  { doSetParmValue(idx, instance, value); }
395  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
396  { doSetParmValue(idx, instance, value); }
397  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
398  { doSetParmValue(idx, instance, value); }
399  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
400  { doSetParmValue(idx, instance, value); }
401  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
402  { doSetParmValue(idx, instance, value); }
403  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
404  { doSetParmValue(idx, instance, value); }
405  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
406  { doSetParmValue(idx, instance, value); }
407  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
408  { doSetParmValue(idx, instance, value); }
409  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
410  { doSetParmValue(idx, instance, value); }
411  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
412  { doSetParmValue(idx, instance, value); }
413  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
414  { doSetParmValue(idx, instance, value); }
415 
416  exint getNestNumParms(TempIndex idx) const override
417  {
418  if (idx.size() == 0)
419  return 19;
420  switch (idx[0])
421  {
422 
423  }
424  // Invalid
425  return 0;
426  }
427 
428  const char *getNestParmName(TempIndex fieldnum) const override
429  {
430  if (fieldnum.size() < 1)
431  return 0;
432  switch (fieldnum[0])
433  {
434  case 0:
435  return "outputgroup";
436  case 1:
437  return "group";
438  case 2:
439  return "grouptype";
440  case 3:
441  return "primshareedge";
442  case 4:
443  return "floodfill";
444  case 5:
445  return "numsteps";
446  case 6:
447  return "usestepattrib";
448  case 7:
449  return "stepattrib";
450  case 8:
451  return "bynormal";
452  case 9:
453  return "normalangle";
454  case 10:
455  return "overridenormal";
456  case 11:
457  return "normalattrib";
458  case 12:
459  return "useconnectivityattrib";
460  case 13:
461  return "connectivityattrib";
462  case 14:
463  return "usecolgroup";
464  case 15:
465  return "colgroup";
466  case 16:
467  return "colgrouptype";
468  case 17:
469  return "colgroupinvert";
470  case 18:
471  return "colgroupallowonbound";
472 
473  }
474  return 0;
475  }
476 
477  ParmType getNestParmType(TempIndex fieldnum) const override
478  {
479  if (fieldnum.size() < 1)
480  return PARM_UNSUPPORTED;
481  switch (fieldnum[0])
482  {
483  case 0:
484  return PARM_STRING;
485  case 1:
486  return PARM_STRING;
487  case 2:
488  return PARM_INTEGER;
489  case 3:
490  return PARM_INTEGER;
491  case 4:
492  return PARM_INTEGER;
493  case 5:
494  return PARM_INTEGER;
495  case 6:
496  return PARM_INTEGER;
497  case 7:
498  return PARM_STRING;
499  case 8:
500  return PARM_INTEGER;
501  case 9:
502  return PARM_FLOAT;
503  case 10:
504  return PARM_INTEGER;
505  case 11:
506  return PARM_STRING;
507  case 12:
508  return PARM_INTEGER;
509  case 13:
510  return PARM_STRING;
511  case 14:
512  return PARM_INTEGER;
513  case 15:
514  return PARM_STRING;
515  case 16:
516  return PARM_INTEGER;
517  case 17:
518  return PARM_INTEGER;
519  case 18:
520  return PARM_INTEGER;
521 
522  }
523  return PARM_UNSUPPORTED;
524  }
525 
526  // Boiler plate to load individual types.
527  static void loadData(UT_IStream &is, int64 &v)
528  { is.bread(&v, 1); }
529  static void loadData(UT_IStream &is, bool &v)
530  { int64 iv; is.bread(&iv, 1); v = iv; }
531  static void loadData(UT_IStream &is, fpreal64 &v)
532  { is.bread<fpreal64>(&v, 1); }
533  static void loadData(UT_IStream &is, UT_Vector2D &v)
534  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
535  static void loadData(UT_IStream &is, UT_Vector3D &v)
536  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
537  is.bread<fpreal64>(&v.z(), 1); }
538  static void loadData(UT_IStream &is, UT_Vector4D &v)
539  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
540  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
541  static void loadData(UT_IStream &is, UT_Matrix2D &v)
542  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
543  static void loadData(UT_IStream &is, UT_Matrix3D &v)
544  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
545  static void loadData(UT_IStream &is, UT_Matrix4D &v)
546  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
547  static void loadData(UT_IStream &is, UT_Vector2I &v)
548  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
549  static void loadData(UT_IStream &is, UT_Vector3I &v)
550  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
551  is.bread<int64>(&v.z(), 1); }
552  static void loadData(UT_IStream &is, UT_Vector4I &v)
553  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
554  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
556  { is.bread(v); }
558  { UT_StringHolder rampdata;
559  loadData(is, rampdata);
560  if (rampdata.isstring())
561  {
562  v.reset(new UT_Ramp());
563  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
564  v->load(istr);
565  }
566  else v.reset();
567  }
570  loadData(is, data);
571  if (data.isstring())
572  {
573  // Find the data type.
574  const char *colon = UT_StringWrap(data).findChar(':');
575  if (colon)
576  {
577  int typelen = colon - data.buffer();
579  type.strncpy(data.buffer(), typelen);
580  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
581 
582  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
583  }
584  }
585  else v.reset();
586  }
587 
588  static void saveData(std::ostream &os, int64 v)
589  { UTwrite(os, &v); }
590  static void saveData(std::ostream &os, bool v)
591  { int64 iv = v; UTwrite(os, &iv); }
592  static void saveData(std::ostream &os, fpreal64 v)
593  { UTwrite<fpreal64>(os, &v); }
594  static void saveData(std::ostream &os, UT_Vector2D v)
595  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
596  static void saveData(std::ostream &os, UT_Vector3D v)
597  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
598  UTwrite<fpreal64>(os, &v.z()); }
599  static void saveData(std::ostream &os, UT_Vector4D v)
600  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
601  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
602  static void saveData(std::ostream &os, UT_Matrix2D v)
604  static void saveData(std::ostream &os, UT_Matrix3D v)
606  static void saveData(std::ostream &os, UT_Matrix4D v)
608  static void saveData(std::ostream &os, UT_StringHolder s)
609  { UT_StringWrap(s).saveBinary(os); }
610  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
612  UT_OStringStream ostr;
613  if (s) s->save(ostr);
614  result = ostr.str();
615  saveData(os, result);
616  }
617  static void saveData(std::ostream &os, PRM_DataItemHandle s)
619  UT_OStringStream ostr;
620  if (s)
621  {
622  ostr << s->getDataTypeToken();
623  ostr << ":";
624  s->saveBinary(ostr);
625  }
626  result = ostr.str();
627  saveData(os, result);
628  }
629 
630 
631  void save(std::ostream &os) const
632  {
633  int32 v = version();
634  UTwrite(os, &v);
635  saveData(os, myOutputgroup);
636  saveData(os, myGroup);
637  saveData(os, myGrouptype);
638  saveData(os, myPrimshareedge);
639  saveData(os, myFloodfill);
640  saveData(os, myNumsteps);
641  saveData(os, myUsestepattrib);
642  saveData(os, myStepattrib);
643  saveData(os, myBynormal);
644  saveData(os, myNormalangle);
645  saveData(os, myOverridenormal);
646  saveData(os, myNormalattrib);
647  saveData(os, myUseconnectivityattrib);
648  saveData(os, myConnectivityattrib);
649  saveData(os, myUsecolgroup);
650  saveData(os, myColgroup);
651  saveData(os, myColgrouptype);
652  saveData(os, myColgroupinvert);
653  saveData(os, myColgroupallowonbound);
654 
655  }
656 
657  bool load(UT_IStream &is)
658  {
659  int32 v;
660  is.bread(&v, 1);
661  if (version() != v)
662  {
663  // Fail incompatible versions
664  return false;
665  }
666  loadData(is, myOutputgroup);
667  loadData(is, myGroup);
668  loadData(is, myGrouptype);
669  loadData(is, myPrimshareedge);
670  loadData(is, myFloodfill);
671  loadData(is, myNumsteps);
672  loadData(is, myUsestepattrib);
673  loadData(is, myStepattrib);
674  loadData(is, myBynormal);
675  loadData(is, myNormalangle);
676  loadData(is, myOverridenormal);
677  loadData(is, myNormalattrib);
678  loadData(is, myUseconnectivityattrib);
679  loadData(is, myConnectivityattrib);
680  loadData(is, myUsecolgroup);
681  loadData(is, myColgroup);
682  loadData(is, myColgrouptype);
683  loadData(is, myColgroupinvert);
684  loadData(is, myColgroupallowonbound);
685 
686  return true;
687  }
688 
689  const UT_StringHolder & getOutputgroup() const { return myOutputgroup; }
690  void setOutputgroup(const UT_StringHolder & val) { myOutputgroup = val; }
692  {
693  SOP_Node *thissop = cookparms.getNode();
694  if (!thissop) return getOutputgroup();
696  OP_Utils::evalOpParm(result, thissop, "outputgroup", cookparms.getCookTime(), 0);
697  return result;
698  }
699  const UT_StringHolder & getGroup() const { return myGroup; }
700  void setGroup(const UT_StringHolder & val) { myGroup = val; }
702  {
703  SOP_Node *thissop = cookparms.getNode();
704  if (!thissop) return getGroup();
706  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
707  return result;
708  }
709  Grouptype getGrouptype() const { return Grouptype(myGrouptype); }
710  void setGrouptype(Grouptype val) { myGrouptype = int64(val); }
712  {
713  SOP_Node *thissop = cookparms.getNode();
714  if (!thissop) return getGrouptype();
715  int64 result;
716  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
717  return Grouptype(result);
718  }
719  bool getPrimshareedge() const { return myPrimshareedge; }
720  void setPrimshareedge(bool val) { myPrimshareedge = val; }
721  bool opPrimshareedge(const SOP_NodeVerb::CookParms &cookparms) const
722  {
723  SOP_Node *thissop = cookparms.getNode();
724  if (!thissop) return getPrimshareedge();
725  bool result;
726  OP_Utils::evalOpParm(result, thissop, "primshareedge", cookparms.getCookTime(), 0);
727  return result;
728  }
729  bool getFloodfill() const { return myFloodfill; }
730  void setFloodfill(bool val) { myFloodfill = val; }
731  bool opFloodfill(const SOP_NodeVerb::CookParms &cookparms) const
732  {
733  SOP_Node *thissop = cookparms.getNode();
734  if (!thissop) return getFloodfill();
735  bool result;
736  OP_Utils::evalOpParm(result, thissop, "floodfill", cookparms.getCookTime(), 0);
737  return result;
738  }
739  int64 getNumsteps() const { return myNumsteps; }
740  void setNumsteps(int64 val) { myNumsteps = val; }
741  int64 opNumsteps(const SOP_NodeVerb::CookParms &cookparms) const
742  {
743  SOP_Node *thissop = cookparms.getNode();
744  if (!thissop) return getNumsteps();
745  int64 result;
746  OP_Utils::evalOpParm(result, thissop, "numsteps", cookparms.getCookTime(), 0);
747  return result;
748  }
749  bool getUsestepattrib() const { return myUsestepattrib; }
750  void setUsestepattrib(bool val) { myUsestepattrib = val; }
751  bool opUsestepattrib(const SOP_NodeVerb::CookParms &cookparms) const
752  {
753  SOP_Node *thissop = cookparms.getNode();
754  if (!thissop) return getUsestepattrib();
755  bool result;
756  OP_Utils::evalOpParm(result, thissop, "usestepattrib", cookparms.getCookTime(), 0);
757  return result;
758  }
759  const UT_StringHolder & getStepattrib() const { return myStepattrib; }
760  void setStepattrib(const UT_StringHolder & val) { myStepattrib = val; }
762  {
763  SOP_Node *thissop = cookparms.getNode();
764  if (!thissop) return getStepattrib();
766  OP_Utils::evalOpParm(result, thissop, "stepattrib", cookparms.getCookTime(), 0);
767  return result;
768  }
769  bool getBynormal() const { return myBynormal; }
770  void setBynormal(bool val) { myBynormal = val; }
771  bool opBynormal(const SOP_NodeVerb::CookParms &cookparms) const
772  {
773  SOP_Node *thissop = cookparms.getNode();
774  if (!thissop) return getBynormal();
775  bool result;
776  OP_Utils::evalOpParm(result, thissop, "bynormal", cookparms.getCookTime(), 0);
777  return result;
778  }
779  fpreal64 getNormalangle() const { return myNormalangle; }
780  void setNormalangle(fpreal64 val) { myNormalangle = val; }
782  {
783  SOP_Node *thissop = cookparms.getNode();
784  if (!thissop) return getNormalangle();
786  OP_Utils::evalOpParm(result, thissop, "normalangle", cookparms.getCookTime(), 0);
787  return result;
788  }
789  bool getOverridenormal() const { return myOverridenormal; }
790  void setOverridenormal(bool val) { myOverridenormal = val; }
791  bool opOverridenormal(const SOP_NodeVerb::CookParms &cookparms) const
792  {
793  SOP_Node *thissop = cookparms.getNode();
794  if (!thissop) return getOverridenormal();
795  bool result;
796  OP_Utils::evalOpParm(result, thissop, "overridenormal", cookparms.getCookTime(), 0);
797  return result;
798  }
799  const UT_StringHolder & getNormalattrib() const { return myNormalattrib; }
800  void setNormalattrib(const UT_StringHolder & val) { myNormalattrib = val; }
802  {
803  SOP_Node *thissop = cookparms.getNode();
804  if (!thissop) return getNormalattrib();
806  OP_Utils::evalOpParm(result, thissop, "normalattrib", cookparms.getCookTime(), 0);
807  return result;
808  }
809  bool getUseconnectivityattrib() const { return myUseconnectivityattrib; }
810  void setUseconnectivityattrib(bool val) { myUseconnectivityattrib = val; }
812  {
813  SOP_Node *thissop = cookparms.getNode();
814  if (!thissop) return getUseconnectivityattrib();
815  bool result;
816  OP_Utils::evalOpParm(result, thissop, "useconnectivityattrib", cookparms.getCookTime(), 0);
817  return result;
818  }
819  const UT_StringHolder & getConnectivityattrib() const { return myConnectivityattrib; }
820  void setConnectivityattrib(const UT_StringHolder & val) { myConnectivityattrib = val; }
822  {
823  SOP_Node *thissop = cookparms.getNode();
824  if (!thissop) return getConnectivityattrib();
826  OP_Utils::evalOpParm(result, thissop, "connectivityattrib", cookparms.getCookTime(), 0);
827  return result;
828  }
829  bool getUsecolgroup() const { return myUsecolgroup; }
830  void setUsecolgroup(bool val) { myUsecolgroup = val; }
831  bool opUsecolgroup(const SOP_NodeVerb::CookParms &cookparms) const
832  {
833  SOP_Node *thissop = cookparms.getNode();
834  if (!thissop) return getUsecolgroup();
835  bool result;
836  OP_Utils::evalOpParm(result, thissop, "usecolgroup", cookparms.getCookTime(), 0);
837  return result;
838  }
839  const UT_StringHolder & getColgroup() const { return myColgroup; }
840  void setColgroup(const UT_StringHolder & val) { myColgroup = val; }
842  {
843  SOP_Node *thissop = cookparms.getNode();
844  if (!thissop) return getColgroup();
846  OP_Utils::evalOpParm(result, thissop, "colgroup", cookparms.getCookTime(), 0);
847  return result;
848  }
849  Colgrouptype getColgrouptype() const { return Colgrouptype(myColgrouptype); }
850  void setColgrouptype(Colgrouptype val) { myColgrouptype = int64(val); }
852  {
853  SOP_Node *thissop = cookparms.getNode();
854  if (!thissop) return getColgrouptype();
855  int64 result;
856  OP_Utils::evalOpParm(result, thissop, "colgrouptype", cookparms.getCookTime(), 0);
857  return Colgrouptype(result);
858  }
859  bool getColgroupinvert() const { return myColgroupinvert; }
860  void setColgroupinvert(bool val) { myColgroupinvert = val; }
861  bool opColgroupinvert(const SOP_NodeVerb::CookParms &cookparms) const
862  {
863  SOP_Node *thissop = cookparms.getNode();
864  if (!thissop) return getColgroupinvert();
865  bool result;
866  OP_Utils::evalOpParm(result, thissop, "colgroupinvert", cookparms.getCookTime(), 0);
867  return result;
868  }
869  bool getColgroupallowonbound() const { return myColgroupallowonbound; }
870  void setColgroupallowonbound(bool val) { myColgroupallowonbound = val; }
871  bool opColgroupallowonbound(const SOP_NodeVerb::CookParms &cookparms) const
872  {
873  SOP_Node *thissop = cookparms.getNode();
874  if (!thissop) return getColgroupallowonbound();
875  bool result;
876  OP_Utils::evalOpParm(result, thissop, "colgroupallowonbound", cookparms.getCookTime(), 0);
877  return result;
878  }
879 
880 private:
881  UT_StringHolder myOutputgroup;
882  UT_StringHolder myGroup;
883  int64 myGrouptype;
884  bool myPrimshareedge;
885  bool myFloodfill;
886  int64 myNumsteps;
887  bool myUsestepattrib;
888  UT_StringHolder myStepattrib;
889  bool myBynormal;
890  fpreal64 myNormalangle;
891  bool myOverridenormal;
892  UT_StringHolder myNormalattrib;
893  bool myUseconnectivityattrib;
894  UT_StringHolder myConnectivityattrib;
895  bool myUsecolgroup;
896  UT_StringHolder myColgroup;
897  int64 myColgrouptype;
898  bool myColgroupinvert;
899  bool myColgroupallowonbound;
900 
901 };
void loadFromOpSubclass(const LoadParms &loadparms) override
UT_StringHolder opOutputgroup(const SOP_NodeVerb::CookParms &cookparms) const
void setConnectivityattrib(const UT_StringHolder &val)
const UT_StringHolder & getConnectivityattrib() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool opColgroupinvert(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:39
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
const UT_StringHolder & getColgroup() const
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, int64 &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const UT_StringHolder & getGroup() const
SYS_FORCE_INLINE UT_StringHolder getToken(Grouptype enum_value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool load(UT_IStream &is)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
fpreal64 getNormalangle() const
void setColgroupinvert(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool getUseconnectivityattrib() const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
const UT_StringHolder & getStepattrib() const
bool opOverridenormal(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, UT_Matrix3D v)
GLdouble s
Definition: glad.h:3009
Colgrouptype opColgrouptype(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setStepattrib(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
**But if you need a result
Definition: thread.h:613
bool opPrimshareedge(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setOverridenormal(bool val)
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
Colgrouptype getColgrouptype() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
bool opUseconnectivityattrib(const SOP_NodeVerb::CookParms &cookparms) const
bool opColgroupallowonbound(const SOP_NodeVerb::CookParms &cookparms) const
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
exint length() const
UT_StringHolder opColgroup(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void setOutputgroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix4D v)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
static void saveData(std::ostream &os, int64 v)
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void loadData(UT_IStream &is, UT_StringHolder &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setColgrouptype(Colgrouptype val)
long long int64
Definition: SYS_Types.h:116
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
const UT_StringHolder & getOutputgroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
Grouptype opGrouptype(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
Grouptype getGrouptype() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setUseconnectivityattrib(bool val)
UT_StringHolder opConnectivityattrib(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getNormalattrib() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_Vector4D v)
bool operator==(const SOP_GroupExpandParms &src) const
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, bool &v)
void setColgroupallowonbound(bool val)
void setNormalattrib(const UT_StringHolder &val)
void setColgroup(const UT_StringHolder &val)
bool opUsestepattrib(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
UT_StringHolder opNormalattrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void save(std::ostream &os) const
LeafData & operator=(const LeafData &)=delete
bool opUsecolgroup(const SOP_NodeVerb::CookParms &cookparms) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
void setGrouptype(Grouptype val)
#define SOP_API
Definition: SOP_API.h:10
static void loadData(UT_IStream &is, UT_Vector4I &v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
bool getColgroupallowonbound() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
int64 opNumsteps(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
ParmType getNestParmType(TempIndex fieldnum) const override
GLboolean r
Definition: glcorearb.h:1222
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
fpreal64 opNormalangle(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
void setNormalangle(fpreal64 val)
bool opBynormal(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
bool opFloodfill(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
type
Definition: core.h:1059
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
UT_StringHolder opStepattrib(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, bool v)
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool operator!=(const SOP_GroupExpandParms &src) const
GLenum src
Definition: glcorearb.h:1793
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663