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 <OP/OP_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  myTol = 0;
96  myUsecolgroup = false;
97  myColgroup = ""_UTsh;
98  myColgrouptype = 0;
99  myColgroupinvert = false;
100  myColgroupallowonbound = false;
101 
102  }
103 
104  explicit SOP_GroupExpandParms(const SOP_GroupExpandParms &) = default;
106  SOP_GroupExpandParms(SOP_GroupExpandParms &&) noexcept = default;
107  SOP_GroupExpandParms &operator=(SOP_GroupExpandParms &&) noexcept = default;
108 
109  ~SOP_GroupExpandParms() override {}
110 
112  {
113  if (myOutputgroup != src.myOutputgroup) return false;
114  if (myGroup != src.myGroup) return false;
115  if (myGrouptype != src.myGrouptype) return false;
116  if (myPrimshareedge != src.myPrimshareedge) return false;
117  if (myFloodfill != src.myFloodfill) return false;
118  if (myNumsteps != src.myNumsteps) return false;
119  if (myUsestepattrib != src.myUsestepattrib) return false;
120  if (myStepattrib != src.myStepattrib) return false;
121  if (myBynormal != src.myBynormal) return false;
122  if (myNormalangle != src.myNormalangle) return false;
123  if (myOverridenormal != src.myOverridenormal) return false;
124  if (myNormalattrib != src.myNormalattrib) return false;
125  if (myUseconnectivityattrib != src.myUseconnectivityattrib) return false;
126  if (myConnectivityattrib != src.myConnectivityattrib) return false;
127  if (myTol != src.myTol) return false;
128  if (myUsecolgroup != src.myUsecolgroup) return false;
129  if (myColgroup != src.myColgroup) return false;
130  if (myColgrouptype != src.myColgrouptype) return false;
131  if (myColgroupinvert != src.myColgroupinvert) return false;
132  if (myColgroupallowonbound != src.myColgroupallowonbound) return false;
133 
134 
135  if (baseGetSignature() != src.baseGetSignature()) return false;
136 
137  return true;
138  }
140  {
141  return !operator==(src);
142  }
145 
146 
147 
148  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
149  {
150  myOutputgroup = ""_UTsh;
151  if (true)
152  graph->evalOpParm(myOutputgroup, nodeidx, "outputgroup", time, graph->isDirect()?nullptr:depnode);
153  myGroup = ""_UTsh;
154  if (true)
155  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
156  myGrouptype = 0;
157  if (true)
158  graph->evalOpParm(myGrouptype, nodeidx, "grouptype", time, graph->isDirect()?nullptr:depnode);
159  myPrimshareedge = false;
160  if (true && ( (true&&!(((int64(getGrouptype())==1))||((int64(getGrouptype())==2))||((int64(getGrouptype())==3)))) ) )
161  graph->evalOpParm(myPrimshareedge, nodeidx, "primshareedge", time, graph->isDirect()?nullptr:depnode);
162  myFloodfill = false;
163  if (true)
164  graph->evalOpParm(myFloodfill, nodeidx, "floodfill", time, graph->isDirect()?nullptr:depnode);
165  myNumsteps = 1;
166  if (true && ( (true&&!(((getFloodfill()==1)))) ) )
167  graph->evalOpParm(myNumsteps, nodeidx, "numsteps", time, graph->isDirect()?nullptr:depnode);
168  myUsestepattrib = false;
169  if (true)
170  graph->evalOpParm(myUsestepattrib, nodeidx, "usestepattrib", time, graph->isDirect()?nullptr:depnode);
171  myStepattrib = "step"_UTsh;
172  if (true && ( (true&&!(((getUsestepattrib()==0)))) ) )
173  graph->evalOpParm(myStepattrib, nodeidx, "stepattrib", time, graph->isDirect()?nullptr:depnode);
174  myBynormal = false;
175  if (true)
176  graph->evalOpParm(myBynormal, nodeidx, "bynormal", time, graph->isDirect()?nullptr:depnode);
177  myNormalangle = 60;
178  if (true && ( (true&&!(((getBynormal()==0)))) ) )
179  graph->evalOpParm(myNormalangle, nodeidx, "normalangle", time, graph->isDirect()?nullptr:depnode);
180  myOverridenormal = false;
181  if (true && ( (true&&!(((getBynormal()==0)))) ) )
182  graph->evalOpParm(myOverridenormal, nodeidx, "overridenormal", time, graph->isDirect()?nullptr:depnode);
183  myNormalattrib = "N"_UTsh;
184  if (true && ( (true&&!(((getBynormal()==0))||((getOverridenormal()==0)))) ) )
185  graph->evalOpParm(myNormalattrib, nodeidx, "normalattrib", time, graph->isDirect()?nullptr:depnode);
186  myUseconnectivityattrib = false;
187  if (true)
188  graph->evalOpParm(myUseconnectivityattrib, nodeidx, "useconnectivityattrib", time, graph->isDirect()?nullptr:depnode);
189  myConnectivityattrib = "uv"_UTsh;
190  if (true && ( (true&&!(((getUseconnectivityattrib()==0)))) ) )
191  graph->evalOpParm(myConnectivityattrib, nodeidx, "connectivityattrib", time, graph->isDirect()?nullptr:depnode);
192  myTol = 0;
193  if (true && ( (true&&!(((getUseconnectivityattrib()==0)))) ) )
194  graph->evalOpParm(myTol, nodeidx, "tol", time, graph->isDirect()?nullptr:depnode);
195  myUsecolgroup = false;
196  if (true)
197  graph->evalOpParm(myUsecolgroup, nodeidx, "usecolgroup", time, graph->isDirect()?nullptr:depnode);
198  myColgroup = ""_UTsh;
199  if (true && ( (true&&!(((getUsecolgroup()==0)))) ) )
200  graph->evalOpParm(myColgroup, nodeidx, "colgroup", time, graph->isDirect()?nullptr:depnode);
201  myColgrouptype = 0;
202  if (true && ( (true&&!(((getUsecolgroup()==0)))) ) )
203  graph->evalOpParm(myColgrouptype, nodeidx, "colgrouptype", time, graph->isDirect()?nullptr:depnode);
204  myColgroupinvert = false;
205  if (true && ( (true&&!(((getUsecolgroup()==0)))) ) )
206  graph->evalOpParm(myColgroupinvert, nodeidx, "colgroupinvert", time, graph->isDirect()?nullptr:depnode);
207  myColgroupallowonbound = false;
208  if (true && ( (true&&!(((getUsecolgroup()==0))||((getColgroupinvert()==1)))) ) )
209  graph->evalOpParm(myColgroupallowonbound, nodeidx, "colgroupallowonbound", time, graph->isDirect()?nullptr:depnode);
210 
211  }
212 
213 
214  void loadFromOpSubclass(const LoadParms &loadparms) override
215  {
216  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
217  }
218 
219 
220  void copyFrom(const OP_NodeParms *src) override
221  {
222  *this = *((const SOP_GroupExpandParms *)src);
223  }
224 
225  template <typename T>
226  void
227  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
228  {
229  if (idx.size() < 1)
230  return;
231  UT_ASSERT(idx.size() == instance.size()+1);
232  if (idx.size() != instance.size()+1)
233  return;
234  switch (idx[0])
235  {
236  case 0:
237  coerceValue(value, myOutputgroup);
238  break;
239  case 1:
240  coerceValue(value, myGroup);
241  break;
242  case 2:
243  coerceValue(value, myGrouptype);
244  break;
245  case 3:
246  coerceValue(value, myPrimshareedge);
247  break;
248  case 4:
249  coerceValue(value, myFloodfill);
250  break;
251  case 5:
252  coerceValue(value, myNumsteps);
253  break;
254  case 6:
255  coerceValue(value, myUsestepattrib);
256  break;
257  case 7:
258  coerceValue(value, myStepattrib);
259  break;
260  case 8:
261  coerceValue(value, myBynormal);
262  break;
263  case 9:
264  coerceValue(value, myNormalangle);
265  break;
266  case 10:
267  coerceValue(value, myOverridenormal);
268  break;
269  case 11:
270  coerceValue(value, myNormalattrib);
271  break;
272  case 12:
273  coerceValue(value, myUseconnectivityattrib);
274  break;
275  case 13:
276  coerceValue(value, myConnectivityattrib);
277  break;
278  case 14:
279  coerceValue(value, myTol);
280  break;
281  case 15:
282  coerceValue(value, myUsecolgroup);
283  break;
284  case 16:
285  coerceValue(value, myColgroup);
286  break;
287  case 17:
288  coerceValue(value, myColgrouptype);
289  break;
290  case 18:
291  coerceValue(value, myColgroupinvert);
292  break;
293  case 19:
294  coerceValue(value, myColgroupallowonbound);
295  break;
296 
297  }
298  }
299 
300  bool isParmColorRamp(exint idx) const override
301  {
302  switch (idx)
303  {
304 
305  }
306  return false;
307  }
308 
309  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
310  { doGetParmValue(idx, instance, value); }
311  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
312  { doGetParmValue(idx, instance, value); }
313  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
314  { doGetParmValue(idx, instance, value); }
315  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
316  { doGetParmValue(idx, instance, value); }
317  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
318  { doGetParmValue(idx, instance, value); }
319  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
320  { doGetParmValue(idx, instance, value); }
321  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
322  { doGetParmValue(idx, instance, value); }
323  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
324  { doGetParmValue(idx, instance, value); }
325  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
326  { doGetParmValue(idx, instance, value); }
327  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
328  { doGetParmValue(idx, instance, value); }
329  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
330  { doGetParmValue(idx, instance, value); }
331 
332  template <typename T>
333  void
334  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
335  {
336  if (idx.size() < 1)
337  return;
338  UT_ASSERT(idx.size() == instance.size()+1);
339  if (idx.size() != instance.size()+1)
340  return;
341  switch (idx[0])
342  {
343  case 0:
344  coerceValue(myOutputgroup, ( ( value ) ));
345  break;
346  case 1:
347  coerceValue(myGroup, ( ( value ) ));
348  break;
349  case 2:
350  coerceValue(myGrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
351  break;
352  case 3:
353  coerceValue(myPrimshareedge, ( ( value ) ));
354  break;
355  case 4:
356  coerceValue(myFloodfill, ( ( value ) ));
357  break;
358  case 5:
359  coerceValue(myNumsteps, ( ( value ) ));
360  break;
361  case 6:
362  coerceValue(myUsestepattrib, ( ( value ) ));
363  break;
364  case 7:
365  coerceValue(myStepattrib, ( ( value ) ));
366  break;
367  case 8:
368  coerceValue(myBynormal, ( ( value ) ));
369  break;
370  case 9:
371  coerceValue(myNormalangle, ( ( value ) ));
372  break;
373  case 10:
374  coerceValue(myOverridenormal, ( ( value ) ));
375  break;
376  case 11:
377  coerceValue(myNormalattrib, ( ( value ) ));
378  break;
379  case 12:
380  coerceValue(myUseconnectivityattrib, ( ( value ) ));
381  break;
382  case 13:
383  coerceValue(myConnectivityattrib, ( ( value ) ));
384  break;
385  case 14:
386  coerceValue(myTol, ( ( value ) ));
387  break;
388  case 15:
389  coerceValue(myUsecolgroup, ( ( value ) ));
390  break;
391  case 16:
392  coerceValue(myColgroup, ( ( value ) ));
393  break;
394  case 17:
395  coerceValue(myColgrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
396  break;
397  case 18:
398  coerceValue(myColgroupinvert, ( ( value ) ));
399  break;
400  case 19:
401  coerceValue(myColgroupallowonbound, ( ( value ) ));
402  break;
403 
404  }
405  }
406 
407  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
408  { doSetParmValue(idx, instance, value); }
409  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
410  { doSetParmValue(idx, instance, value); }
411  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
412  { doSetParmValue(idx, instance, value); }
413  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
414  { doSetParmValue(idx, instance, value); }
415  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
416  { doSetParmValue(idx, instance, value); }
417  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
418  { doSetParmValue(idx, instance, value); }
419  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
420  { doSetParmValue(idx, instance, value); }
421  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
422  { doSetParmValue(idx, instance, value); }
423  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
424  { doSetParmValue(idx, instance, value); }
425  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
426  { doSetParmValue(idx, instance, value); }
427  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
428  { doSetParmValue(idx, instance, value); }
429 
430  exint getNestNumParms(TempIndex idx) const override
431  {
432  if (idx.size() == 0)
433  return 20;
434  switch (idx[0])
435  {
436 
437  }
438  // Invalid
439  return 0;
440  }
441 
442  const char *getNestParmName(TempIndex fieldnum) const override
443  {
444  if (fieldnum.size() < 1)
445  return 0;
446  switch (fieldnum[0])
447  {
448  case 0:
449  return "outputgroup";
450  case 1:
451  return "group";
452  case 2:
453  return "grouptype";
454  case 3:
455  return "primshareedge";
456  case 4:
457  return "floodfill";
458  case 5:
459  return "numsteps";
460  case 6:
461  return "usestepattrib";
462  case 7:
463  return "stepattrib";
464  case 8:
465  return "bynormal";
466  case 9:
467  return "normalangle";
468  case 10:
469  return "overridenormal";
470  case 11:
471  return "normalattrib";
472  case 12:
473  return "useconnectivityattrib";
474  case 13:
475  return "connectivityattrib";
476  case 14:
477  return "tol";
478  case 15:
479  return "usecolgroup";
480  case 16:
481  return "colgroup";
482  case 17:
483  return "colgrouptype";
484  case 18:
485  return "colgroupinvert";
486  case 19:
487  return "colgroupallowonbound";
488 
489  }
490  return 0;
491  }
492 
493  ParmType getNestParmType(TempIndex fieldnum) const override
494  {
495  if (fieldnum.size() < 1)
496  return PARM_UNSUPPORTED;
497  switch (fieldnum[0])
498  {
499  case 0:
500  return PARM_STRING;
501  case 1:
502  return PARM_STRING;
503  case 2:
504  return PARM_INTEGER;
505  case 3:
506  return PARM_INTEGER;
507  case 4:
508  return PARM_INTEGER;
509  case 5:
510  return PARM_INTEGER;
511  case 6:
512  return PARM_INTEGER;
513  case 7:
514  return PARM_STRING;
515  case 8:
516  return PARM_INTEGER;
517  case 9:
518  return PARM_FLOAT;
519  case 10:
520  return PARM_INTEGER;
521  case 11:
522  return PARM_STRING;
523  case 12:
524  return PARM_INTEGER;
525  case 13:
526  return PARM_STRING;
527  case 14:
528  return PARM_FLOAT;
529  case 15:
530  return PARM_INTEGER;
531  case 16:
532  return PARM_STRING;
533  case 17:
534  return PARM_INTEGER;
535  case 18:
536  return PARM_INTEGER;
537  case 19:
538  return PARM_INTEGER;
539 
540  }
541  return PARM_UNSUPPORTED;
542  }
543 
544  // Boiler plate to load individual types.
545  static void loadData(UT_IStream &is, int64 &v)
546  { is.bread(&v, 1); }
547  static void loadData(UT_IStream &is, bool &v)
548  { int64 iv; is.bread(&iv, 1); v = iv; }
549  static void loadData(UT_IStream &is, fpreal64 &v)
550  { is.bread<fpreal64>(&v, 1); }
551  static void loadData(UT_IStream &is, UT_Vector2D &v)
552  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
553  static void loadData(UT_IStream &is, UT_Vector3D &v)
554  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
555  is.bread<fpreal64>(&v.z(), 1); }
556  static void loadData(UT_IStream &is, UT_Vector4D &v)
557  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
558  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
559  static void loadData(UT_IStream &is, UT_Matrix2D &v)
560  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
561  static void loadData(UT_IStream &is, UT_Matrix3D &v)
562  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
563  static void loadData(UT_IStream &is, UT_Matrix4D &v)
564  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
565  static void loadData(UT_IStream &is, UT_Vector2I &v)
566  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
567  static void loadData(UT_IStream &is, UT_Vector3I &v)
568  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
569  is.bread<int64>(&v.z(), 1); }
570  static void loadData(UT_IStream &is, UT_Vector4I &v)
571  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
572  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
574  { is.bread(v); }
576  { UT_StringHolder rampdata;
577  loadData(is, rampdata);
578  if (rampdata.isstring())
579  {
580  v.reset(new UT_Ramp());
581  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
582  v->load(istr);
583  }
584  else v.reset();
585  }
588  loadData(is, data);
589  if (data.isstring())
590  {
591  // Find the data type.
592  const char *colon = UT_StringWrap(data).findChar(':');
593  if (colon)
594  {
595  int typelen = colon - data.buffer();
597  type.strncpy(data.buffer(), typelen);
598  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
599 
600  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
601  }
602  }
603  else v.reset();
604  }
605 
606  static void saveData(std::ostream &os, int64 v)
607  { UTwrite(os, &v); }
608  static void saveData(std::ostream &os, bool v)
609  { int64 iv = v; UTwrite(os, &iv); }
610  static void saveData(std::ostream &os, fpreal64 v)
611  { UTwrite<fpreal64>(os, &v); }
612  static void saveData(std::ostream &os, UT_Vector2D v)
613  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
614  static void saveData(std::ostream &os, UT_Vector3D v)
615  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
616  UTwrite<fpreal64>(os, &v.z()); }
617  static void saveData(std::ostream &os, UT_Vector4D v)
618  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
619  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
620  static void saveData(std::ostream &os, UT_Matrix2D v)
622  static void saveData(std::ostream &os, UT_Matrix3D v)
624  static void saveData(std::ostream &os, UT_Matrix4D v)
626  static void saveData(std::ostream &os, UT_StringHolder s)
627  { UT_StringWrap(s).saveBinary(os); }
628  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
630  UT_OStringStream ostr;
631  if (s) s->save(ostr);
632  result = ostr.str();
633  saveData(os, result);
634  }
635  static void saveData(std::ostream &os, PRM_DataItemHandle s)
637  UT_OStringStream ostr;
638  if (s)
639  {
640  ostr << s->getDataTypeToken();
641  ostr << ":";
642  s->saveBinary(ostr);
643  }
644  result = ostr.str();
645  saveData(os, result);
646  }
647 
648 
649  void save(std::ostream &os) const
650  {
651  int32 v = version();
652  UTwrite(os, &v);
653  saveData(os, myOutputgroup);
654  saveData(os, myGroup);
655  saveData(os, myGrouptype);
656  saveData(os, myPrimshareedge);
657  saveData(os, myFloodfill);
658  saveData(os, myNumsteps);
659  saveData(os, myUsestepattrib);
660  saveData(os, myStepattrib);
661  saveData(os, myBynormal);
662  saveData(os, myNormalangle);
663  saveData(os, myOverridenormal);
664  saveData(os, myNormalattrib);
665  saveData(os, myUseconnectivityattrib);
666  saveData(os, myConnectivityattrib);
667  saveData(os, myTol);
668  saveData(os, myUsecolgroup);
669  saveData(os, myColgroup);
670  saveData(os, myColgrouptype);
671  saveData(os, myColgroupinvert);
672  saveData(os, myColgroupallowonbound);
673 
674  }
675 
676  bool load(UT_IStream &is)
677  {
678  int32 v;
679  is.bread(&v, 1);
680  if (version() != v)
681  {
682  // Fail incompatible versions
683  return false;
684  }
685  loadData(is, myOutputgroup);
686  loadData(is, myGroup);
687  loadData(is, myGrouptype);
688  loadData(is, myPrimshareedge);
689  loadData(is, myFloodfill);
690  loadData(is, myNumsteps);
691  loadData(is, myUsestepattrib);
692  loadData(is, myStepattrib);
693  loadData(is, myBynormal);
694  loadData(is, myNormalangle);
695  loadData(is, myOverridenormal);
696  loadData(is, myNormalattrib);
697  loadData(is, myUseconnectivityattrib);
698  loadData(is, myConnectivityattrib);
699  loadData(is, myTol);
700  loadData(is, myUsecolgroup);
701  loadData(is, myColgroup);
702  loadData(is, myColgrouptype);
703  loadData(is, myColgroupinvert);
704  loadData(is, myColgroupallowonbound);
705 
706  return true;
707  }
708 
709  const UT_StringHolder & getOutputgroup() const { return myOutputgroup; }
710  void setOutputgroup(const UT_StringHolder & val) { myOutputgroup = val; }
712  {
713  SOP_Node *thissop = cookparms.getNode();
714  if (!thissop) return getOutputgroup();
716  OP_Utils::evalOpParm(result, thissop, "outputgroup", cookparms.getCookTime(), 0);
717  return result;
718  }
719  const UT_StringHolder & getGroup() const { return myGroup; }
720  void setGroup(const UT_StringHolder & val) { myGroup = val; }
722  {
723  SOP_Node *thissop = cookparms.getNode();
724  if (!thissop) return getGroup();
726  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
727  return result;
728  }
729  Grouptype getGrouptype() const { return Grouptype(myGrouptype); }
730  void setGrouptype(Grouptype val) { myGrouptype = int64(val); }
732  {
733  SOP_Node *thissop = cookparms.getNode();
734  if (!thissop) return getGrouptype();
735  int64 result;
736  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
737  return Grouptype(result);
738  }
739  bool getPrimshareedge() const { return myPrimshareedge; }
740  void setPrimshareedge(bool val) { myPrimshareedge = val; }
741  bool opPrimshareedge(const SOP_NodeVerb::CookParms &cookparms) const
742  {
743  SOP_Node *thissop = cookparms.getNode();
744  if (!thissop) return getPrimshareedge();
745  bool result;
746  OP_Utils::evalOpParm(result, thissop, "primshareedge", cookparms.getCookTime(), 0);
747  return result;
748  }
749  bool getFloodfill() const { return myFloodfill; }
750  void setFloodfill(bool val) { myFloodfill = val; }
751  bool opFloodfill(const SOP_NodeVerb::CookParms &cookparms) const
752  {
753  SOP_Node *thissop = cookparms.getNode();
754  if (!thissop) return getFloodfill();
755  bool result;
756  OP_Utils::evalOpParm(result, thissop, "floodfill", cookparms.getCookTime(), 0);
757  return result;
758  }
759  int64 getNumsteps() const { return myNumsteps; }
760  void setNumsteps(int64 val) { myNumsteps = val; }
761  int64 opNumsteps(const SOP_NodeVerb::CookParms &cookparms) const
762  {
763  SOP_Node *thissop = cookparms.getNode();
764  if (!thissop) return getNumsteps();
765  int64 result;
766  OP_Utils::evalOpParm(result, thissop, "numsteps", cookparms.getCookTime(), 0);
767  return result;
768  }
769  bool getUsestepattrib() const { return myUsestepattrib; }
770  void setUsestepattrib(bool val) { myUsestepattrib = val; }
771  bool opUsestepattrib(const SOP_NodeVerb::CookParms &cookparms) const
772  {
773  SOP_Node *thissop = cookparms.getNode();
774  if (!thissop) return getUsestepattrib();
775  bool result;
776  OP_Utils::evalOpParm(result, thissop, "usestepattrib", cookparms.getCookTime(), 0);
777  return result;
778  }
779  const UT_StringHolder & getStepattrib() const { return myStepattrib; }
780  void setStepattrib(const UT_StringHolder & val) { myStepattrib = val; }
782  {
783  SOP_Node *thissop = cookparms.getNode();
784  if (!thissop) return getStepattrib();
786  OP_Utils::evalOpParm(result, thissop, "stepattrib", cookparms.getCookTime(), 0);
787  return result;
788  }
789  bool getBynormal() const { return myBynormal; }
790  void setBynormal(bool val) { myBynormal = val; }
791  bool opBynormal(const SOP_NodeVerb::CookParms &cookparms) const
792  {
793  SOP_Node *thissop = cookparms.getNode();
794  if (!thissop) return getBynormal();
795  bool result;
796  OP_Utils::evalOpParm(result, thissop, "bynormal", cookparms.getCookTime(), 0);
797  return result;
798  }
799  fpreal64 getNormalangle() const { return myNormalangle; }
800  void setNormalangle(fpreal64 val) { myNormalangle = val; }
802  {
803  SOP_Node *thissop = cookparms.getNode();
804  if (!thissop) return getNormalangle();
806  OP_Utils::evalOpParm(result, thissop, "normalangle", cookparms.getCookTime(), 0);
807  return result;
808  }
809  bool getOverridenormal() const { return myOverridenormal; }
810  void setOverridenormal(bool val) { myOverridenormal = val; }
811  bool opOverridenormal(const SOP_NodeVerb::CookParms &cookparms) const
812  {
813  SOP_Node *thissop = cookparms.getNode();
814  if (!thissop) return getOverridenormal();
815  bool result;
816  OP_Utils::evalOpParm(result, thissop, "overridenormal", cookparms.getCookTime(), 0);
817  return result;
818  }
819  const UT_StringHolder & getNormalattrib() const { return myNormalattrib; }
820  void setNormalattrib(const UT_StringHolder & val) { myNormalattrib = val; }
822  {
823  SOP_Node *thissop = cookparms.getNode();
824  if (!thissop) return getNormalattrib();
826  OP_Utils::evalOpParm(result, thissop, "normalattrib", cookparms.getCookTime(), 0);
827  return result;
828  }
829  bool getUseconnectivityattrib() const { return myUseconnectivityattrib; }
830  void setUseconnectivityattrib(bool val) { myUseconnectivityattrib = val; }
832  {
833  SOP_Node *thissop = cookparms.getNode();
834  if (!thissop) return getUseconnectivityattrib();
835  bool result;
836  OP_Utils::evalOpParm(result, thissop, "useconnectivityattrib", cookparms.getCookTime(), 0);
837  return result;
838  }
839  const UT_StringHolder & getConnectivityattrib() const { return myConnectivityattrib; }
840  void setConnectivityattrib(const UT_StringHolder & val) { myConnectivityattrib = val; }
842  {
843  SOP_Node *thissop = cookparms.getNode();
844  if (!thissop) return getConnectivityattrib();
846  OP_Utils::evalOpParm(result, thissop, "connectivityattrib", cookparms.getCookTime(), 0);
847  return result;
848  }
849  fpreal64 getTol() const { return myTol; }
850  void setTol(fpreal64 val) { myTol = val; }
851  fpreal64 opTol(const SOP_NodeVerb::CookParms &cookparms) const
852  {
853  SOP_Node *thissop = cookparms.getNode();
854  if (!thissop) return getTol();
856  OP_Utils::evalOpParm(result, thissop, "tol", cookparms.getCookTime(), 0);
857  return result;
858  }
859  bool getUsecolgroup() const { return myUsecolgroup; }
860  void setUsecolgroup(bool val) { myUsecolgroup = val; }
861  bool opUsecolgroup(const SOP_NodeVerb::CookParms &cookparms) const
862  {
863  SOP_Node *thissop = cookparms.getNode();
864  if (!thissop) return getUsecolgroup();
865  bool result;
866  OP_Utils::evalOpParm(result, thissop, "usecolgroup", cookparms.getCookTime(), 0);
867  return result;
868  }
869  const UT_StringHolder & getColgroup() const { return myColgroup; }
870  void setColgroup(const UT_StringHolder & val) { myColgroup = val; }
872  {
873  SOP_Node *thissop = cookparms.getNode();
874  if (!thissop) return getColgroup();
876  OP_Utils::evalOpParm(result, thissop, "colgroup", cookparms.getCookTime(), 0);
877  return result;
878  }
879  Colgrouptype getColgrouptype() const { return Colgrouptype(myColgrouptype); }
880  void setColgrouptype(Colgrouptype val) { myColgrouptype = int64(val); }
882  {
883  SOP_Node *thissop = cookparms.getNode();
884  if (!thissop) return getColgrouptype();
885  int64 result;
886  OP_Utils::evalOpParm(result, thissop, "colgrouptype", cookparms.getCookTime(), 0);
887  return Colgrouptype(result);
888  }
889  bool getColgroupinvert() const { return myColgroupinvert; }
890  void setColgroupinvert(bool val) { myColgroupinvert = val; }
891  bool opColgroupinvert(const SOP_NodeVerb::CookParms &cookparms) const
892  {
893  SOP_Node *thissop = cookparms.getNode();
894  if (!thissop) return getColgroupinvert();
895  bool result;
896  OP_Utils::evalOpParm(result, thissop, "colgroupinvert", cookparms.getCookTime(), 0);
897  return result;
898  }
899  bool getColgroupallowonbound() const { return myColgroupallowonbound; }
900  void setColgroupallowonbound(bool val) { myColgroupallowonbound = val; }
901  bool opColgroupallowonbound(const SOP_NodeVerb::CookParms &cookparms) const
902  {
903  SOP_Node *thissop = cookparms.getNode();
904  if (!thissop) return getColgroupallowonbound();
905  bool result;
906  OP_Utils::evalOpParm(result, thissop, "colgroupallowonbound", cookparms.getCookTime(), 0);
907  return result;
908  }
909 
910 private:
911  UT_StringHolder myOutputgroup;
912  UT_StringHolder myGroup;
913  int64 myGrouptype;
914  bool myPrimshareedge;
915  bool myFloodfill;
916  int64 myNumsteps;
917  bool myUsestepattrib;
918  UT_StringHolder myStepattrib;
919  bool myBynormal;
920  fpreal64 myNormalangle;
921  bool myOverridenormal;
922  UT_StringHolder myNormalattrib;
923  bool myUseconnectivityattrib;
924  UT_StringHolder myConnectivityattrib;
925  fpreal64 myTol;
926  bool myUsecolgroup;
927  UT_StringHolder myColgroup;
928  int64 myColgrouptype;
929  bool myColgroupinvert;
930  bool myColgroupallowonbound;
931 
932 };
type
Definition: core.h:556
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:63
fpreal64 getNormalangle() const
void setColgroupinvert(bool val)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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 setTol(fpreal64 val)
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:303
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:278
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:96
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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
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
fpreal64 opTol(const SOP_NodeVerb::CookParms &cookparms) 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