HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Bound.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_BoundEnums
24 {
25  enum class Grouptype
26  {
27  GUESS = 0,
28  BREAKPOINTS,
29  EDGES,
30  POINTS,
31  PRIMS
32  };
33  enum class BoundType
34  {
35  OFF = 0,
36  ON,
37  RECTANGLE
38  };
39  enum class Orient
40  {
41  X = 0,
42  Y,
43  Z
44  };
45 }
46 
47 
49 {
50 public:
51  static int version() { return 1; }
52 
54  {
55  myGroup = ""_sh;
56  myGrouptype = 0;
57  myKeeporiginal = false;
58  myCreateempty = true;
59  myBoundType = 0;
60  myOrientedbbox = false;
61  myDodivs = false;
62  myDivs = UT_Vector3I(3,3,3);
63  myRebar = false;
64  myMinsize = UT_Vector3D(0,0,0);
65  myOrient = 1;
66  myAccurate = false;
67  myMinradius = 0;
68  myOrientedBRect = false;
69  myOrigin = UT_Vector3D(0,0,0);
70  myDistance = 0;
71  myDirection = UT_Vector3D(0,1,0);
72  myMinpad = UT_Vector3D(0,0,0);
73  myMaxpad = UT_Vector3D(0,0,0);
74  myAddXformAttrib = false;
75  myXformAttrib = "xform"_sh;
76  myAddRadiiAttrib = false;
77  myRadiiAttrib = "radii"_sh;
78 
79  }
80 
81  explicit SOP_BoundParms(const SOP_BoundParms &) = default;
82 
83  ~SOP_BoundParms() override {}
84 
85  bool operator==(const SOP_BoundParms &src) const
86  {
87  if (myGroup != src.myGroup) return false;
88  if (myGrouptype != src.myGrouptype) return false;
89  if (myKeeporiginal != src.myKeeporiginal) return false;
90  if (myCreateempty != src.myCreateempty) return false;
91  if (myBoundType != src.myBoundType) return false;
92  if (myOrientedbbox != src.myOrientedbbox) return false;
93  if (myDodivs != src.myDodivs) return false;
94  if (myDivs != src.myDivs) return false;
95  if (myRebar != src.myRebar) return false;
96  if (myMinsize != src.myMinsize) return false;
97  if (myOrient != src.myOrient) return false;
98  if (myAccurate != src.myAccurate) return false;
99  if (myMinradius != src.myMinradius) return false;
100  if (myOrientedBRect != src.myOrientedBRect) return false;
101  if (myOrigin != src.myOrigin) return false;
102  if (myDistance != src.myDistance) return false;
103  if (myDirection != src.myDirection) return false;
104  if (myMinpad != src.myMinpad) return false;
105  if (myMaxpad != src.myMaxpad) return false;
106  if (myAddXformAttrib != src.myAddXformAttrib) return false;
107  if (myXformAttrib != src.myXformAttrib) return false;
108  if (myAddRadiiAttrib != src.myAddRadiiAttrib) return false;
109  if (myRadiiAttrib != src.myRadiiAttrib) return false;
110 
111  return true;
112  }
113  bool operator!=(const SOP_BoundParms &src) const
114  {
115  return !operator==(src);
116  }
120 
121 
122 
123  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
124  {
125  myGroup = ""_sh;
126  if (true)
127  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
128  myGrouptype = 0;
129  if (true)
130  graph->evalOpParm(myGrouptype, nodeidx, "grouptype", time, 0);
131  myKeeporiginal = false;
132  if (true)
133  graph->evalOpParm(myKeeporiginal, nodeidx, "keepOriginal", time, 0);
134  myCreateempty = true;
135  if (true)
136  graph->evalOpParm(myCreateempty, nodeidx, "createempty", time, 0);
137  myBoundType = 0;
138  if (true)
139  graph->evalOpParm(myBoundType, nodeidx, "boundtype", time, 0);
140  myOrientedbbox = false;
141  if (true && ( (!(((int64(getBoundType())!=0)))) ) )
142  graph->evalOpParm(myOrientedbbox, nodeidx, "orientedbbox", time, 0);
143  myDodivs = false;
144  if (true && ( (!(((int64(getBoundType())!=0)))) ) )
145  graph->evalOpParm(myDodivs, nodeidx, "dodivs", time, 0);
146  myDivs = UT_Vector3I(3,3,3);
147  if (true && ( (!(((getDodivs()==0))||((int64(getBoundType())!=0)))) ) )
148  graph->evalOpParm(myDivs, nodeidx, "divs", time, 0);
149  myRebar = false;
150  if (true && ( (!(((getDodivs()==0))||((int64(getBoundType())!=0)))) ) )
151  graph->evalOpParm(myRebar, nodeidx, "rebar", time, 0);
152  myMinsize = UT_Vector3D(0,0,0);
153  if (true && ( (!(((int64(getBoundType())!=0)))) ) )
154  graph->evalOpParm(myMinsize, nodeidx, "minsize", time, 0);
155  myOrient = 1;
156  if (true && ( (!(((int64(getBoundType())!=1)))) ) )
157  graph->evalOpParm(myOrient, nodeidx, "orient", time, 0);
158  myAccurate = false;
159  if (true && ( (!(((int64(getBoundType())!=1)))) ) )
160  graph->evalOpParm(myAccurate, nodeidx, "accurate", time, 0);
161  myMinradius = 0;
162  if (true && ( (!(((int64(getBoundType())!=1)))) ) )
163  graph->evalOpParm(myMinradius, nodeidx, "minradius", time, 0);
164  myOrientedBRect = false;
165  if (true && ( (!(((int64(getBoundType())!=2)))) ) )
166  graph->evalOpParm(myOrientedBRect, nodeidx, "orientedbrect", time, 0);
167  myOrigin = UT_Vector3D(0,0,0);
168  if (true && ( (!(((int64(getBoundType())!=2)))) ) )
169  graph->evalOpParm(myOrigin, nodeidx, "origin", time, 0);
170  myDistance = 0;
171  if (true && ( (!(((int64(getBoundType())!=2)))) ) )
172  graph->evalOpParm(myDistance, nodeidx, "dist", time, 0);
173  myDirection = UT_Vector3D(0,1,0);
174  if (true && ( (!(((int64(getBoundType())!=2)))) ) )
175  graph->evalOpParm(myDirection, nodeidx, "dir", time, 0);
176  myMinpad = UT_Vector3D(0,0,0);
177  if (true)
178  graph->evalOpParm(myMinpad, nodeidx, "minpad", time, 0);
179  myMaxpad = UT_Vector3D(0,0,0);
180  if (true)
181  graph->evalOpParm(myMaxpad, nodeidx, "maxpad", time, 0);
182  myAddXformAttrib = false;
183  if (true)
184  graph->evalOpParm(myAddXformAttrib, nodeidx, "addxformattrib", time, 0);
185  myXformAttrib = "xform"_sh;
186  if (true && ( (!(((getAddXformAttrib()==0)))) ) )
187  graph->evalOpParm(myXformAttrib, nodeidx, "xformattrib", time, 0);
188  myAddRadiiAttrib = false;
189  if (true)
190  graph->evalOpParm(myAddRadiiAttrib, nodeidx, "addradiiattrib", time, 0);
191  myRadiiAttrib = "radii"_sh;
192  if (true && ( (!(((getAddRadiiAttrib()==0)))) ) )
193  graph->evalOpParm(myRadiiAttrib, nodeidx, "radiiattrib", time, 0);
194 
195  }
196 
197 
198  void loadFromOpSubclass(const LoadParms &loadparms) override
199  {
200  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
201  }
202 
203 
204  void copyFrom(const SOP_NodeParms *src) override
205  {
206  *this = *((const SOP_BoundParms *)src);
207  }
208 
209  template <typename T>
210  void
211  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
212  {
213  if (idx.size() < 1)
214  return;
215  UT_ASSERT(idx.size() == instance.size()+1);
216  if (idx.size() != instance.size()+1)
217  return;
218  switch (idx[0])
219  {
220  case 0:
221  coerceValue(value, myGroup);
222  break;
223  case 1:
224  coerceValue(value, myGrouptype);
225  break;
226  case 2:
227  coerceValue(value, myKeeporiginal);
228  break;
229  case 3:
230  coerceValue(value, myCreateempty);
231  break;
232  case 4:
233  coerceValue(value, myBoundType);
234  break;
235  case 5:
236  coerceValue(value, myOrientedbbox);
237  break;
238  case 6:
239  coerceValue(value, myDodivs);
240  break;
241  case 7:
242  coerceValue(value, myDivs);
243  break;
244  case 8:
245  coerceValue(value, myRebar);
246  break;
247  case 9:
248  coerceValue(value, myMinsize);
249  break;
250  case 10:
251  coerceValue(value, myOrient);
252  break;
253  case 11:
254  coerceValue(value, myAccurate);
255  break;
256  case 12:
257  coerceValue(value, myMinradius);
258  break;
259  case 13:
260  coerceValue(value, myOrientedBRect);
261  break;
262  case 14:
263  coerceValue(value, myOrigin);
264  break;
265  case 15:
266  coerceValue(value, myDistance);
267  break;
268  case 16:
269  coerceValue(value, myDirection);
270  break;
271  case 17:
272  coerceValue(value, myMinpad);
273  break;
274  case 18:
275  coerceValue(value, myMaxpad);
276  break;
277  case 19:
278  coerceValue(value, myAddXformAttrib);
279  break;
280  case 20:
281  coerceValue(value, myXformAttrib);
282  break;
283  case 21:
284  coerceValue(value, myAddRadiiAttrib);
285  break;
286  case 22:
287  coerceValue(value, myRadiiAttrib);
288  break;
289 
290  }
291  }
292 
293  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
294  { doGetParmValue(idx, instance, value); }
295  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
296  { doGetParmValue(idx, instance, value); }
297  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
298  { doGetParmValue(idx, instance, value); }
299  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
300  { doGetParmValue(idx, instance, value); }
301  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
302  { doGetParmValue(idx, instance, value); }
303  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
304  { doGetParmValue(idx, instance, value); }
305  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
306  { doGetParmValue(idx, instance, value); }
307  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
308  { doGetParmValue(idx, instance, value); }
309  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
310  { doGetParmValue(idx, instance, value); }
311  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
312  { doGetParmValue(idx, instance, value); }
313  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
314  { doGetParmValue(idx, instance, value); }
315 
316  template <typename T>
317  void
318  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
319  {
320  if (idx.size() < 1)
321  return;
322  UT_ASSERT(idx.size() == instance.size()+1);
323  if (idx.size() != instance.size()+1)
324  return;
325  switch (idx[0])
326  {
327  case 0:
328  coerceValue(myGroup, value);
329  break;
330  case 1:
331  coerceValue(myGrouptype, value);
332  break;
333  case 2:
334  coerceValue(myKeeporiginal, value);
335  break;
336  case 3:
337  coerceValue(myCreateempty, value);
338  break;
339  case 4:
340  coerceValue(myBoundType, value);
341  break;
342  case 5:
343  coerceValue(myOrientedbbox, value);
344  break;
345  case 6:
346  coerceValue(myDodivs, value);
347  break;
348  case 7:
349  coerceValue(myDivs, value);
350  break;
351  case 8:
352  coerceValue(myRebar, value);
353  break;
354  case 9:
355  coerceValue(myMinsize, value);
356  break;
357  case 10:
358  coerceValue(myOrient, value);
359  break;
360  case 11:
361  coerceValue(myAccurate, value);
362  break;
363  case 12:
364  coerceValue(myMinradius, value);
365  break;
366  case 13:
367  coerceValue(myOrientedBRect, value);
368  break;
369  case 14:
370  coerceValue(myOrigin, value);
371  break;
372  case 15:
373  coerceValue(myDistance, value);
374  break;
375  case 16:
376  coerceValue(myDirection, value);
377  break;
378  case 17:
379  coerceValue(myMinpad, value);
380  break;
381  case 18:
382  coerceValue(myMaxpad, value);
383  break;
384  case 19:
385  coerceValue(myAddXformAttrib, value);
386  break;
387  case 20:
388  coerceValue(myXformAttrib, value);
389  break;
390  case 21:
391  coerceValue(myAddRadiiAttrib, value);
392  break;
393  case 22:
394  coerceValue(myRadiiAttrib, value);
395  break;
396 
397  }
398  }
399 
400  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
401  { doSetParmValue(idx, instance, value); }
402  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
403  { doSetParmValue(idx, instance, value); }
404  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
405  { doSetParmValue(idx, instance, value); }
406  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
407  { doSetParmValue(idx, instance, value); }
408  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
409  { doSetParmValue(idx, instance, value); }
410  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
411  { doSetParmValue(idx, instance, value); }
412  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
413  { doSetParmValue(idx, instance, value); }
414  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
415  { doSetParmValue(idx, instance, value); }
416  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
417  { doSetParmValue(idx, instance, value); }
418  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
419  { doSetParmValue(idx, instance, value); }
420  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
421  { doSetParmValue(idx, instance, value); }
422 
423  exint getNestNumParms(TempIndex idx) const override
424  {
425  if (idx.size() == 0)
426  return 23;
427  switch (idx[0])
428  {
429 
430  }
431  // Invalid
432  return 0;
433  }
434 
435  const char *getNestParmName(TempIndex fieldnum) const override
436  {
437  if (fieldnum.size() < 1)
438  return 0;
439  switch (fieldnum[0])
440  {
441  case 0:
442  return "group";
443  case 1:
444  return "grouptype";
445  case 2:
446  return "keepOriginal";
447  case 3:
448  return "createempty";
449  case 4:
450  return "boundtype";
451  case 5:
452  return "orientedbbox";
453  case 6:
454  return "dodivs";
455  case 7:
456  return "divs";
457  case 8:
458  return "rebar";
459  case 9:
460  return "minsize";
461  case 10:
462  return "orient";
463  case 11:
464  return "accurate";
465  case 12:
466  return "minradius";
467  case 13:
468  return "orientedbrect";
469  case 14:
470  return "origin";
471  case 15:
472  return "dist";
473  case 16:
474  return "dir";
475  case 17:
476  return "minpad";
477  case 18:
478  return "maxpad";
479  case 19:
480  return "addxformattrib";
481  case 20:
482  return "xformattrib";
483  case 21:
484  return "addradiiattrib";
485  case 22:
486  return "radiiattrib";
487 
488  }
489  return 0;
490  }
491 
492  ParmType getNestParmType(TempIndex fieldnum) const override
493  {
494  if (fieldnum.size() < 1)
495  return PARM_UNSUPPORTED;
496  switch (fieldnum[0])
497  {
498  case 0:
499  return PARM_STRING;
500  case 1:
501  return PARM_INTEGER;
502  case 2:
503  return PARM_INTEGER;
504  case 3:
505  return PARM_INTEGER;
506  case 4:
507  return PARM_INTEGER;
508  case 5:
509  return PARM_INTEGER;
510  case 6:
511  return PARM_INTEGER;
512  case 7:
513  return PARM_VECTOR3;
514  case 8:
515  return PARM_INTEGER;
516  case 9:
517  return PARM_VECTOR3;
518  case 10:
519  return PARM_INTEGER;
520  case 11:
521  return PARM_INTEGER;
522  case 12:
523  return PARM_FLOAT;
524  case 13:
525  return PARM_INTEGER;
526  case 14:
527  return PARM_VECTOR3;
528  case 15:
529  return PARM_FLOAT;
530  case 16:
531  return PARM_VECTOR3;
532  case 17:
533  return PARM_VECTOR3;
534  case 18:
535  return PARM_VECTOR3;
536  case 19:
537  return PARM_INTEGER;
538  case 20:
539  return PARM_STRING;
540  case 21:
541  return PARM_INTEGER;
542  case 22:
543  return PARM_STRING;
544 
545  }
546  return PARM_UNSUPPORTED;
547  }
548 
549  // Boiler plate to load individual types.
550  static void loadData(UT_IStream &is, int64 &v)
551  { is.bread(&v, 1); }
552  static void loadData(UT_IStream &is, bool &v)
553  { int64 iv; is.bread(&iv, 1); v = iv; }
554  static void loadData(UT_IStream &is, fpreal64 &v)
555  { is.bread<fpreal64>(&v, 1); }
556  static void loadData(UT_IStream &is, UT_Vector2D &v)
557  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
558  static void loadData(UT_IStream &is, UT_Vector3D &v)
559  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
560  is.bread<fpreal64>(&v.z(), 1); }
561  static void loadData(UT_IStream &is, UT_Vector4D &v)
562  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
563  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
564  static void loadData(UT_IStream &is, UT_Matrix2D &v)
565  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
566  static void loadData(UT_IStream &is, UT_Matrix3D &v)
567  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
568  static void loadData(UT_IStream &is, UT_Matrix4D &v)
569  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
570  static void loadData(UT_IStream &is, UT_Vector2I &v)
571  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
572  static void loadData(UT_IStream &is, UT_Vector3I &v)
573  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
574  is.bread<int64>(&v.z(), 1); }
575  static void loadData(UT_IStream &is, UT_Vector4I &v)
576  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
577  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
579  { is.bread(v); }
581  { UT_StringHolder rampdata;
582  loadData(is, rampdata);
583  if (rampdata.isstring())
584  {
585  v.reset(new UT_Ramp());
586  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
587  v->load(istr);
588  }
589  else v.reset();
590  }
593  loadData(is, data);
594  if (data.isstring())
595  {
596  // Find the data type.
597  const char *colon = UT_StringWrap(data).findChar(':');
598  if (colon)
599  {
600  int typelen = colon - data.buffer();
602  type.strncpy(data.buffer(), typelen);
603  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
604 
605  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
606  }
607  }
608  else v.reset();
609  }
610 
611  static void saveData(std::ostream &os, int64 v)
612  { UTwrite(os, &v); }
613  static void saveData(std::ostream &os, bool v)
614  { int64 iv = v; UTwrite(os, &iv); }
615  static void saveData(std::ostream &os, fpreal64 v)
616  { UTwrite<fpreal64>(os, &v); }
617  static void saveData(std::ostream &os, UT_Vector2D v)
618  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
619  static void saveData(std::ostream &os, UT_Vector3D v)
620  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
621  UTwrite<fpreal64>(os, &v.z()); }
622  static void saveData(std::ostream &os, UT_Vector4D v)
623  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
624  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
625  static void saveData(std::ostream &os, UT_Matrix2D v)
627  static void saveData(std::ostream &os, UT_Matrix3D v)
629  static void saveData(std::ostream &os, UT_Matrix4D v)
631  static void saveData(std::ostream &os, UT_StringHolder s)
632  { UT_StringWrap(s).saveBinary(os); }
633  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
635  UT_OStringStream ostr;
636  if (s) s->save(ostr);
637  result = ostr.str();
638  saveData(os, result);
639  }
640  static void saveData(std::ostream &os, PRM_DataItemHandle s)
642  UT_OStringStream ostr;
643  if (s)
644  {
645  ostr << s->getDataTypeToken();
646  ostr << ":";
647  s->saveBinary(ostr);
648  }
649  result = ostr.str();
650  saveData(os, result);
651  }
652 
653 
654  void save(std::ostream &os) const
655  {
656  int32 v = version();
657  UTwrite(os, &v);
658  saveData(os, myGroup);
659  saveData(os, myGrouptype);
660  saveData(os, myKeeporiginal);
661  saveData(os, myCreateempty);
662  saveData(os, myBoundType);
663  saveData(os, myOrientedbbox);
664  saveData(os, myDodivs);
665  saveData(os, myDivs);
666  saveData(os, myRebar);
667  saveData(os, myMinsize);
668  saveData(os, myOrient);
669  saveData(os, myAccurate);
670  saveData(os, myMinradius);
671  saveData(os, myOrientedBRect);
672  saveData(os, myOrigin);
673  saveData(os, myDistance);
674  saveData(os, myDirection);
675  saveData(os, myMinpad);
676  saveData(os, myMaxpad);
677  saveData(os, myAddXformAttrib);
678  saveData(os, myXformAttrib);
679  saveData(os, myAddRadiiAttrib);
680  saveData(os, myRadiiAttrib);
681 
682  }
683 
684  bool load(UT_IStream &is)
685  {
686  int32 v;
687  is.bread(&v, 1);
688  if (version() != v)
689  {
690  // Fail incompatible versions
691  return false;
692  }
693  loadData(is, myGroup);
694  loadData(is, myGrouptype);
695  loadData(is, myKeeporiginal);
696  loadData(is, myCreateempty);
697  loadData(is, myBoundType);
698  loadData(is, myOrientedbbox);
699  loadData(is, myDodivs);
700  loadData(is, myDivs);
701  loadData(is, myRebar);
702  loadData(is, myMinsize);
703  loadData(is, myOrient);
704  loadData(is, myAccurate);
705  loadData(is, myMinradius);
706  loadData(is, myOrientedBRect);
707  loadData(is, myOrigin);
708  loadData(is, myDistance);
709  loadData(is, myDirection);
710  loadData(is, myMinpad);
711  loadData(is, myMaxpad);
712  loadData(is, myAddXformAttrib);
713  loadData(is, myXformAttrib);
714  loadData(is, myAddRadiiAttrib);
715  loadData(is, myRadiiAttrib);
716 
717  return true;
718  }
719 
720  const UT_StringHolder & getGroup() const { return myGroup; }
721  void setGroup(const UT_StringHolder & val) { myGroup = val; }
723  {
724  SOP_Node *thissop = cookparms.getNode();
725  if (!thissop) return getGroup();
727  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
728  return result;
729  }
730  Grouptype getGrouptype() const { return Grouptype(myGrouptype); }
731  void setGrouptype(Grouptype val) { myGrouptype = int64(val); }
733  {
734  SOP_Node *thissop = cookparms.getNode();
735  if (!thissop) return getGrouptype();
736  int64 result;
737  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
738  return Grouptype(result);
739  }
740  bool getKeeporiginal() const { return myKeeporiginal; }
741  void setKeeporiginal(bool val) { myKeeporiginal = val; }
742  bool opKeeporiginal(const SOP_NodeVerb::CookParms &cookparms) const
743  {
744  SOP_Node *thissop = cookparms.getNode();
745  if (!thissop) return getKeeporiginal();
746  bool result;
747  OP_Utils::evalOpParm(result, thissop, "keepOriginal", cookparms.getCookTime(), 0);
748  return result;
749  }
750  bool getCreateempty() const { return myCreateempty; }
751  void setCreateempty(bool val) { myCreateempty = val; }
752  bool opCreateempty(const SOP_NodeVerb::CookParms &cookparms) const
753  {
754  SOP_Node *thissop = cookparms.getNode();
755  if (!thissop) return getCreateempty();
756  bool result;
757  OP_Utils::evalOpParm(result, thissop, "createempty", cookparms.getCookTime(), 0);
758  return result;
759  }
760  BoundType getBoundType() const { return BoundType(myBoundType); }
761  void setBoundType(BoundType val) { myBoundType = int64(val); }
763  {
764  SOP_Node *thissop = cookparms.getNode();
765  if (!thissop) return getBoundType();
766  int64 result;
767  OP_Utils::evalOpParm(result, thissop, "boundtype", cookparms.getCookTime(), 0);
768  return BoundType(result);
769  }
770  bool getOrientedbbox() const { return myOrientedbbox; }
771  void setOrientedbbox(bool val) { myOrientedbbox = val; }
772  bool opOrientedbbox(const SOP_NodeVerb::CookParms &cookparms) const
773  {
774  SOP_Node *thissop = cookparms.getNode();
775  if (!thissop) return getOrientedbbox();
776  bool result;
777  OP_Utils::evalOpParm(result, thissop, "orientedbbox", cookparms.getCookTime(), 0);
778  return result;
779  }
780  bool getDodivs() const { return myDodivs; }
781  void setDodivs(bool val) { myDodivs = val; }
782  bool opDodivs(const SOP_NodeVerb::CookParms &cookparms) const
783  {
784  SOP_Node *thissop = cookparms.getNode();
785  if (!thissop) return getDodivs();
786  bool result;
787  OP_Utils::evalOpParm(result, thissop, "dodivs", cookparms.getCookTime(), 0);
788  return result;
789  }
790  UT_Vector3I getDivs() const { return myDivs; }
791  void setDivs(UT_Vector3I val) { myDivs = val; }
793  {
794  SOP_Node *thissop = cookparms.getNode();
795  if (!thissop) return getDivs();
797  OP_Utils::evalOpParm(result, thissop, "divs", cookparms.getCookTime(), 0);
798  return result;
799  }
800  bool getRebar() const { return myRebar; }
801  void setRebar(bool val) { myRebar = val; }
802  bool opRebar(const SOP_NodeVerb::CookParms &cookparms) const
803  {
804  SOP_Node *thissop = cookparms.getNode();
805  if (!thissop) return getRebar();
806  bool result;
807  OP_Utils::evalOpParm(result, thissop, "rebar", cookparms.getCookTime(), 0);
808  return result;
809  }
810  UT_Vector3D getMinsize() const { return myMinsize; }
811  void setMinsize(UT_Vector3D val) { myMinsize = val; }
813  {
814  SOP_Node *thissop = cookparms.getNode();
815  if (!thissop) return getMinsize();
817  OP_Utils::evalOpParm(result, thissop, "minsize", cookparms.getCookTime(), 0);
818  return result;
819  }
820  Orient getOrient() const { return Orient(myOrient); }
821  void setOrient(Orient val) { myOrient = int64(val); }
822  Orient opOrient(const SOP_NodeVerb::CookParms &cookparms) const
823  {
824  SOP_Node *thissop = cookparms.getNode();
825  if (!thissop) return getOrient();
826  int64 result;
827  OP_Utils::evalOpParm(result, thissop, "orient", cookparms.getCookTime(), 0);
828  return Orient(result);
829  }
830  bool getAccurate() const { return myAccurate; }
831  void setAccurate(bool val) { myAccurate = val; }
832  bool opAccurate(const SOP_NodeVerb::CookParms &cookparms) const
833  {
834  SOP_Node *thissop = cookparms.getNode();
835  if (!thissop) return getAccurate();
836  bool result;
837  OP_Utils::evalOpParm(result, thissop, "accurate", cookparms.getCookTime(), 0);
838  return result;
839  }
840  fpreal64 getMinradius() const { return myMinradius; }
841  void setMinradius(fpreal64 val) { myMinradius = val; }
843  {
844  SOP_Node *thissop = cookparms.getNode();
845  if (!thissop) return getMinradius();
847  OP_Utils::evalOpParm(result, thissop, "minradius", cookparms.getCookTime(), 0);
848  return result;
849  }
850  bool getOrientedBRect() const { return myOrientedBRect; }
851  void setOrientedBRect(bool val) { myOrientedBRect = val; }
852  bool opOrientedBRect(const SOP_NodeVerb::CookParms &cookparms) const
853  {
854  SOP_Node *thissop = cookparms.getNode();
855  if (!thissop) return getOrientedBRect();
856  bool result;
857  OP_Utils::evalOpParm(result, thissop, "orientedbrect", cookparms.getCookTime(), 0);
858  return result;
859  }
860  UT_Vector3D getOrigin() const { return myOrigin; }
861  void setOrigin(UT_Vector3D val) { myOrigin = val; }
863  {
864  SOP_Node *thissop = cookparms.getNode();
865  if (!thissop) return getOrigin();
867  OP_Utils::evalOpParm(result, thissop, "origin", cookparms.getCookTime(), 0);
868  return result;
869  }
870  fpreal64 getDistance() const { return myDistance; }
871  void setDistance(fpreal64 val) { myDistance = val; }
873  {
874  SOP_Node *thissop = cookparms.getNode();
875  if (!thissop) return getDistance();
877  OP_Utils::evalOpParm(result, thissop, "dist", cookparms.getCookTime(), 0);
878  return result;
879  }
880  UT_Vector3D getDirection() const { return myDirection; }
881  void setDirection(UT_Vector3D val) { myDirection = val; }
883  {
884  SOP_Node *thissop = cookparms.getNode();
885  if (!thissop) return getDirection();
887  OP_Utils::evalOpParm(result, thissop, "dir", cookparms.getCookTime(), 0);
888  return result;
889  }
890  UT_Vector3D getMinpad() const { return myMinpad; }
891  void setMinpad(UT_Vector3D val) { myMinpad = val; }
893  {
894  SOP_Node *thissop = cookparms.getNode();
895  if (!thissop) return getMinpad();
897  OP_Utils::evalOpParm(result, thissop, "minpad", cookparms.getCookTime(), 0);
898  return result;
899  }
900  UT_Vector3D getMaxpad() const { return myMaxpad; }
901  void setMaxpad(UT_Vector3D val) { myMaxpad = val; }
903  {
904  SOP_Node *thissop = cookparms.getNode();
905  if (!thissop) return getMaxpad();
907  OP_Utils::evalOpParm(result, thissop, "maxpad", cookparms.getCookTime(), 0);
908  return result;
909  }
910  bool getAddXformAttrib() const { return myAddXformAttrib; }
911  void setAddXformAttrib(bool val) { myAddXformAttrib = val; }
912  bool opAddXformAttrib(const SOP_NodeVerb::CookParms &cookparms) const
913  {
914  SOP_Node *thissop = cookparms.getNode();
915  if (!thissop) return getAddXformAttrib();
916  bool result;
917  OP_Utils::evalOpParm(result, thissop, "addxformattrib", cookparms.getCookTime(), 0);
918  return result;
919  }
920  const UT_StringHolder & getXformAttrib() const { return myXformAttrib; }
921  void setXformAttrib(const UT_StringHolder & val) { myXformAttrib = val; }
923  {
924  SOP_Node *thissop = cookparms.getNode();
925  if (!thissop) return getXformAttrib();
927  OP_Utils::evalOpParm(result, thissop, "xformattrib", cookparms.getCookTime(), 0);
928  return result;
929  }
930  bool getAddRadiiAttrib() const { return myAddRadiiAttrib; }
931  void setAddRadiiAttrib(bool val) { myAddRadiiAttrib = val; }
932  bool opAddRadiiAttrib(const SOP_NodeVerb::CookParms &cookparms) const
933  {
934  SOP_Node *thissop = cookparms.getNode();
935  if (!thissop) return getAddRadiiAttrib();
936  bool result;
937  OP_Utils::evalOpParm(result, thissop, "addradiiattrib", cookparms.getCookTime(), 0);
938  return result;
939  }
940  const UT_StringHolder & getRadiiAttrib() const { return myRadiiAttrib; }
941  void setRadiiAttrib(const UT_StringHolder & val) { myRadiiAttrib = val; }
943  {
944  SOP_Node *thissop = cookparms.getNode();
945  if (!thissop) return getRadiiAttrib();
947  OP_Utils::evalOpParm(result, thissop, "radiiattrib", cookparms.getCookTime(), 0);
948  return result;
949  }
950 
951 private:
952  UT_StringHolder myGroup;
953  int64 myGrouptype;
954  bool myKeeporiginal;
955  bool myCreateempty;
956  int64 myBoundType;
957  bool myOrientedbbox;
958  bool myDodivs;
959  UT_Vector3I myDivs;
960  bool myRebar;
961  UT_Vector3D myMinsize;
962  int64 myOrient;
963  bool myAccurate;
964  fpreal64 myMinradius;
965  bool myOrientedBRect;
966  UT_Vector3D myOrigin;
967  fpreal64 myDistance;
968  UT_Vector3D myDirection;
969  UT_Vector3D myMinpad;
970  UT_Vector3D myMaxpad;
971  bool myAddXformAttrib;
972  UT_StringHolder myXformAttrib;
973  bool myAddRadiiAttrib;
974  UT_StringHolder myRadiiAttrib;
975 
976 };
bool getKeeporiginal() const
GLdouble s
Definition: glew.h:1390
bool getAddXformAttrib() const
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setMaxpad(UT_Vector3D val)
bool load(UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static int version()
exint nodeIdx() const
Definition: SOP_NodeVerb.h:114
Orient getOrient() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) 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_Matrix4D &value) const override
bool opCreateempty(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
UT_StringHolder opXformAttrib(const SOP_NodeVerb::CookParms &cookparms) const
bool getOrientedbbox() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
bool opDodivs(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
Orient opOrient(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
fpreal getTime() const
Definition: OP_Context.h:60
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_Vector3D getOrigin() const
GLuint const GLfloat * val
Definition: glew.h:2794
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool getAddRadiiAttrib() const
static void saveData(std::ostream &os, UT_Vector3D v)
int64 exint
Definition: SYS_Types.h:125
UT_Vector3D getMinsize() const
const UT_StringHolder & getGroup() const
SYS_FORCE_INLINE const char * buffer() const
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:113
UT_Vector3D opDirection(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
void setXformAttrib(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
bool opAddXformAttrib(const SOP_NodeVerb::CookParms &cookparms) const
const GLdouble * v
Definition: glew.h:1391
static void loadData(UT_IStream &is, UT_Vector4D &v)
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setGroup(const UT_StringHolder &val)
UT_Vector3T< int64 > UT_Vector3I
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool opAccurate(const SOP_NodeVerb::CookParms &cookparms) const
bool opKeeporiginal(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix2D v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setOrientedbbox(bool val)
bool getDodivs() const
static void saveData(std::ostream &os, UT_Matrix3D v)
double fpreal64
Definition: SYS_Types.h:201
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool getRebar() const
void loadFromOpSubclass(const LoadParms &loadparms) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_Vector3D &v)
UT_Vector3D opMaxpad(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE T & y()
Definition: UT_Vector3.h:513
void save(std::ostream &os) const
void setAddRadiiAttrib(bool val)
exint length() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
bool opAddRadiiAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setDistance(fpreal64 val)
UT_Vector3I opDivs(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
SYS_FORCE_INLINE T & z()
Definition: UT_Vector3.h:515
UT_Vector3D opOrigin(const SOP_NodeVerb::CookParms &cookparms) const
void setAddXformAttrib(bool val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setMinradius(fpreal64 val)
const GLfloat * c
Definition: glew.h:16296
UT_Vector3D opMinsize(const SOP_NodeVerb::CookParms &cookparms) const
BoundType opBoundType(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3I getDivs() const
long long int64
Definition: SYS_Types.h:116
void setKeeporiginal(bool val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool opOrientedBRect(const SOP_NodeVerb::CookParms &cookparms) const
void setMinsize(UT_Vector3D val)
void setCreateempty(bool val)
void setBoundType(BoundType val)
UT_Vector3T< fpreal64 > UT_Vector3D
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool opOrientedbbox(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setDivs(UT_Vector3I val)
void setRadiiAttrib(const UT_StringHolder &val)
bool operator!=(const SOP_BoundParms &src) const
static void saveData(std::ostream &os, int64 v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
void setOrigin(UT_Vector3D val)
UT_Vector3D getMinpad() const
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:121
Grouptype getGrouptype() const
void setAccurate(bool val)
bool opRebar(const SOP_NodeVerb::CookParms &cookparms) const
void setOrient(Orient val)
void copyFrom(const SOP_NodeParms *src) override
void setDirection(UT_Vector3D val)
UT_StringHolder opRadiiAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal64 getMinradius() const
fpreal64 fpreal
Definition: SYS_Types.h:277
static void loadData(UT_IStream &is, bool &v)
UT_Vector3D opMinpad(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 fpreal &value) override
void setRebar(bool val)
static void saveData(std::ostream &os, fpreal64 v)
const char * getNestParmName(TempIndex fieldnum) const override
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
bool getCreateempty() const
void setOrientedBRect(bool val)
#define SOP_API
Definition: SOP_API.h:10
const UT_StringHolder & getRadiiAttrib() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
SYS_FORCE_INLINE T & x()
Definition: UT_Vector3.h:511
fpreal64 opMinradius(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:654
BoundType getBoundType() const
bool getAccurate() const
GLuint64EXT * result
Definition: glew.h:14007
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
const char * findChar(int c) const
Definition: UT_String.h:1376
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
UT_Vector3D getMaxpad() const
fpreal64 getDistance() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool getOrientedBRect() const
Grouptype opGrouptype(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opDistance(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D getDirection() const
const UT_StringHolder & getXformAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
GLsizei const GLfloat * value
Definition: glew.h:1849
exint getNestNumParms(TempIndex idx) const override
void setDodivs(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const OP_Context & context() const
Definition: SOP_NodeVerb.h:119
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
bool operator==(const SOP_BoundParms &src) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setGrouptype(Grouptype val)
SYS_FORCE_INLINE bool isstring() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
type
Definition: core.h:528
void setMinpad(UT_Vector3D val)
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_Vector4D v)
~SOP_BoundParms() override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)