HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_IsoOffsetParms.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 
25 {
26 public:
27  static int version() { return 1; }
28 
30  {
31  myOutput = 1;
32  myMode = 0;
33  myUniformSamples = 4;
34  myDivs = 10;
35  mySampleDiv = 10;
36  myDivSize = 0.1;
37  myOverrideOutput = false;
38  myIsoDiv = 10;
39  myPadBounds = false;
40  myOverrideBounds = false;
41  myMin = -1;
42  myMax = 0;
43  myTol = 0.001;
44  myOffset = 0;
45  myLaserScan = true;
46  myFixSigns = true;
47  myForceBounds = true;
48  myInvert = false;
49  myNumNeighbour = 1;
50  mySweepCount = 3;
51  mySweepThreshold = 2;
52  myTetraType = 0;
53  myFileMode = 3;
54  myFileName = "./sdf$F4.simdata"_sh;
55  myName = ""_sh;
56  myBuildPolySoup = false;
57 
58  }
59 
60  explicit SOP_IsoOffsetParms(const SOP_IsoOffsetParms &) = default;
61 
62  ~SOP_IsoOffsetParms() override {}
63 
64  bool operator==(const SOP_IsoOffsetParms &src) const
65  {
66  if (myOutput != src.myOutput) return false;
67  if (myMode != src.myMode) return false;
68  if (myUniformSamples != src.myUniformSamples) return false;
69  if (myDivs != src.myDivs) return false;
70  if (mySampleDiv != src.mySampleDiv) return false;
71  if (myDivSize != src.myDivSize) return false;
72  if (myOverrideOutput != src.myOverrideOutput) return false;
73  if (myIsoDiv != src.myIsoDiv) return false;
74  if (myPadBounds != src.myPadBounds) return false;
75  if (myOverrideBounds != src.myOverrideBounds) return false;
76  if (myMin != src.myMin) return false;
77  if (myMax != src.myMax) return false;
78  if (myTol != src.myTol) return false;
79  if (myOffset != src.myOffset) return false;
80  if (myLaserScan != src.myLaserScan) return false;
81  if (myFixSigns != src.myFixSigns) return false;
82  if (myForceBounds != src.myForceBounds) return false;
83  if (myInvert != src.myInvert) return false;
84  if (myNumNeighbour != src.myNumNeighbour) return false;
85  if (mySweepCount != src.mySweepCount) return false;
86  if (mySweepThreshold != src.mySweepThreshold) return false;
87  if (myTetraType != src.myTetraType) return false;
88  if (myFileMode != src.myFileMode) return false;
89  if (myFileName != src.myFileName) return false;
90  if (myName != src.myName) return false;
91  if (myBuildPolySoup != src.myBuildPolySoup) return false;
92 
93  return true;
94  }
95  bool operator!=(const SOP_IsoOffsetParms &src) const
96  {
97  return !operator==(src);
98  }
99 
100 
101 
102  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
103  {
104  myOutput = 1;
105  if (true)
106  graph->evalOpParm(myOutput, nodeidx, "output", time, 0);
107  myMode = 0;
108  if (true)
109  graph->evalOpParm(myMode, nodeidx, "mode", time, 0);
110  myUniformSamples = 4;
111  if (true)
112  graph->evalOpParm(myUniformSamples, nodeidx, "uniformsamples", time, 0);
113  myDivs = 10;
114  if (true)
115  graph->evalOpParm(myDivs, nodeidx, "divs", time, 0);
116  mySampleDiv = 10;
117  if (true)
118  graph->evalOpParm(mySampleDiv, nodeidx, "samplediv", time, 0);
119  myDivSize = 0.1;
120  if (true)
121  graph->evalOpParm(myDivSize, nodeidx, "divsize", time, 0);
122  myOverrideOutput = false;
123  if (true)
124  graph->evalOpParm(myOverrideOutput, nodeidx, "overrideoutput", time, 0);
125  myIsoDiv = 10;
126  if (true)
127  graph->evalOpParm(myIsoDiv, nodeidx, "isodiv", time, 0);
128  myPadBounds = false;
129  if (true)
130  graph->evalOpParm(myPadBounds, nodeidx, "padbounds", time, 0);
131  myOverrideBounds = false;
132  if (true)
133  graph->evalOpParm(myOverrideBounds, nodeidx, "overridebounds", time, 0);
134  myMin = -1;
135  if (true)
136  graph->evalOpParm(myMin, nodeidx, "min", time, 0);
137  myMax = 0;
138  if (true)
139  graph->evalOpParm(myMax, nodeidx, "max", time, 0);
140  myTol = 0.001;
141  if (true)
142  graph->evalOpParm(myTol, nodeidx, "tol", time, 0);
143  myOffset = 0;
144  if (true)
145  graph->evalOpParm(myOffset, nodeidx, "offset", time, 0);
146  myLaserScan = true;
147  if (true)
148  graph->evalOpParm(myLaserScan, nodeidx, "laserscan", time, 0);
149  myFixSigns = true;
150  if (true)
151  graph->evalOpParm(myFixSigns, nodeidx, "fixsigns", time, 0);
152  myForceBounds = true;
153  if (true)
154  graph->evalOpParm(myForceBounds, nodeidx, "forcebounds", time, 0);
155  myInvert = false;
156  if (true)
157  graph->evalOpParm(myInvert, nodeidx, "invert", time, 0);
158  myNumNeighbour = 1;
159  if (true)
160  graph->evalOpParm(myNumNeighbour, nodeidx, "numneighbour", time, 0);
161  mySweepCount = 3;
162  if (true)
163  graph->evalOpParm(mySweepCount, nodeidx, "sweepcount", time, 0);
164  mySweepThreshold = 2;
165  if (true)
166  graph->evalOpParm(mySweepThreshold, nodeidx, "sweepalpha", time, 0);
167  myTetraType = 0;
168  if (true)
169  graph->evalOpParm(myTetraType, nodeidx, "tetratype", time, 0);
170  myFileMode = 3;
171  if (true)
172  graph->evalOpParm(myFileMode, nodeidx, "filemode", time, 0);
173  myFileName = "./sdf$F4.simdata"_sh;
174  if (true && ( (getFileMode()!=3) ) )
175  graph->evalOpParm(myFileName, nodeidx, "filename", time, 0);
176  myName = ""_sh;
177  if (true)
178  graph->evalOpParm(myName, nodeidx, "name", time, 0);
179  myBuildPolySoup = false;
180  if (true)
181  graph->evalOpParm(myBuildPolySoup, nodeidx, "buildpolysoup", time, 0);
182 
183  }
184 
185 
186  void loadFromOpSubclass(const LoadParms &loadparms) override
187  {
188  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
189  }
190 
191 
192  void copyFrom(const SOP_NodeParms *src) override
193  {
194  *this = *((const SOP_IsoOffsetParms *)src);
195  }
196 
197  template <typename T>
198  void
199  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
200  {
201  if (idx.size() < 1)
202  return;
203  UT_ASSERT(idx.size() == instance.size()+1);
204  if (idx.size() != instance.size()+1)
205  return;
206  switch (idx[0])
207  {
208  case 0:
209  coerceValue(value, myOutput);
210  break;
211  case 1:
212  coerceValue(value, myMode);
213  break;
214  case 2:
215  coerceValue(value, myUniformSamples);
216  break;
217  case 3:
218  coerceValue(value, myDivs);
219  break;
220  case 4:
221  coerceValue(value, mySampleDiv);
222  break;
223  case 5:
224  coerceValue(value, myDivSize);
225  break;
226  case 6:
227  coerceValue(value, myOverrideOutput);
228  break;
229  case 7:
230  coerceValue(value, myIsoDiv);
231  break;
232  case 8:
233  coerceValue(value, myPadBounds);
234  break;
235  case 9:
236  coerceValue(value, myOverrideBounds);
237  break;
238  case 10:
239  coerceValue(value, myMin);
240  break;
241  case 11:
242  coerceValue(value, myMax);
243  break;
244  case 12:
245  coerceValue(value, myTol);
246  break;
247  case 13:
248  coerceValue(value, myOffset);
249  break;
250  case 14:
251  coerceValue(value, myLaserScan);
252  break;
253  case 15:
254  coerceValue(value, myFixSigns);
255  break;
256  case 16:
257  coerceValue(value, myForceBounds);
258  break;
259  case 17:
260  coerceValue(value, myInvert);
261  break;
262  case 18:
263  coerceValue(value, myNumNeighbour);
264  break;
265  case 19:
266  coerceValue(value, mySweepCount);
267  break;
268  case 20:
269  coerceValue(value, mySweepThreshold);
270  break;
271  case 21:
272  coerceValue(value, myTetraType);
273  break;
274  case 22:
275  coerceValue(value, myFileMode);
276  break;
277  case 23:
278  coerceValue(value, myFileName);
279  break;
280  case 24:
281  coerceValue(value, myName);
282  break;
283  case 25:
284  coerceValue(value, myBuildPolySoup);
285  break;
286 
287  }
288  }
289 
290  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
291  { doGetParmValue(idx, instance, value); }
292  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
293  { doGetParmValue(idx, instance, value); }
294  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
299  { doGetParmValue(idx, instance, value); }
300  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
305  { doGetParmValue(idx, instance, value); }
306  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
307  { doGetParmValue(idx, instance, value); }
308  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
309  { doGetParmValue(idx, instance, value); }
310  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
311  { doGetParmValue(idx, instance, value); }
312 
313  template <typename T>
314  void
315  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
316  {
317  if (idx.size() < 1)
318  return;
319  UT_ASSERT(idx.size() == instance.size()+1);
320  if (idx.size() != instance.size()+1)
321  return;
322  switch (idx[0])
323  {
324  case 0:
325  coerceValue(myOutput, value);
326  break;
327  case 1:
328  coerceValue(myMode, value);
329  break;
330  case 2:
331  coerceValue(myUniformSamples, value);
332  break;
333  case 3:
334  coerceValue(myDivs, value);
335  break;
336  case 4:
337  coerceValue(mySampleDiv, value);
338  break;
339  case 5:
340  coerceValue(myDivSize, value);
341  break;
342  case 6:
343  coerceValue(myOverrideOutput, value);
344  break;
345  case 7:
346  coerceValue(myIsoDiv, value);
347  break;
348  case 8:
349  coerceValue(myPadBounds, value);
350  break;
351  case 9:
352  coerceValue(myOverrideBounds, value);
353  break;
354  case 10:
355  coerceValue(myMin, value);
356  break;
357  case 11:
358  coerceValue(myMax, value);
359  break;
360  case 12:
361  coerceValue(myTol, value);
362  break;
363  case 13:
364  coerceValue(myOffset, value);
365  break;
366  case 14:
367  coerceValue(myLaserScan, value);
368  break;
369  case 15:
370  coerceValue(myFixSigns, value);
371  break;
372  case 16:
373  coerceValue(myForceBounds, value);
374  break;
375  case 17:
376  coerceValue(myInvert, value);
377  break;
378  case 18:
379  coerceValue(myNumNeighbour, value);
380  break;
381  case 19:
382  coerceValue(mySweepCount, value);
383  break;
384  case 20:
385  coerceValue(mySweepThreshold, value);
386  break;
387  case 21:
388  coerceValue(myTetraType, value);
389  break;
390  case 22:
391  coerceValue(myFileMode, value);
392  break;
393  case 23:
394  coerceValue(myFileName, value);
395  break;
396  case 24:
397  coerceValue(myName, value);
398  break;
399  case 25:
400  coerceValue(myBuildPolySoup, value);
401  break;
402 
403  }
404  }
405 
406  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
407  { doSetParmValue(idx, instance, value); }
408  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
409  { doSetParmValue(idx, instance, value); }
410  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
411  { doSetParmValue(idx, instance, value); }
412  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
413  { doSetParmValue(idx, instance, value); }
414  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
415  { doSetParmValue(idx, instance, value); }
416  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
417  { doSetParmValue(idx, instance, value); }
418  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
419  { doSetParmValue(idx, instance, value); }
420  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
421  { doSetParmValue(idx, instance, value); }
422  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
423  { doSetParmValue(idx, instance, value); }
424  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
425  { doSetParmValue(idx, instance, value); }
426  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
427  { doSetParmValue(idx, instance, value); }
428 
429  exint getNestNumParms(TempIndex idx) const override
430  {
431  if (idx.size() == 0)
432  return 26;
433  switch (idx[0])
434  {
435 
436  }
437  // Invalid
438  return 0;
439  }
440 
441  const char *getNestParmName(TempIndex fieldnum) const override
442  {
443  if (fieldnum.size() < 1)
444  return 0;
445  switch (fieldnum[0])
446  {
447  case 0:
448  return "output";
449  case 1:
450  return "mode";
451  case 2:
452  return "uniformsamples";
453  case 3:
454  return "divs";
455  case 4:
456  return "samplediv";
457  case 5:
458  return "divsize";
459  case 6:
460  return "overrideoutput";
461  case 7:
462  return "isodiv";
463  case 8:
464  return "padbounds";
465  case 9:
466  return "overridebounds";
467  case 10:
468  return "min";
469  case 11:
470  return "max";
471  case 12:
472  return "tol";
473  case 13:
474  return "offset";
475  case 14:
476  return "laserscan";
477  case 15:
478  return "fixsigns";
479  case 16:
480  return "forcebounds";
481  case 17:
482  return "invert";
483  case 18:
484  return "numneighbour";
485  case 19:
486  return "sweepcount";
487  case 20:
488  return "sweepalpha";
489  case 21:
490  return "tetratype";
491  case 22:
492  return "filemode";
493  case 23:
494  return "filename";
495  case 24:
496  return "name";
497  case 25:
498  return "buildpolysoup";
499 
500  }
501  return 0;
502  }
503 
504  ParmType getNestParmType(TempIndex fieldnum) const override
505  {
506  if (fieldnum.size() < 1)
507  return PARM_UNSUPPORTED;
508  switch (fieldnum[0])
509  {
510  case 0:
511  return PARM_INTEGER;
512  case 1:
513  return PARM_INTEGER;
514  case 2:
515  return PARM_INTEGER;
516  case 3:
517  return PARM_VECTOR3;
518  case 4:
519  return PARM_INTEGER;
520  case 5:
521  return PARM_FLOAT;
522  case 6:
523  return PARM_INTEGER;
524  case 7:
525  return PARM_VECTOR3;
526  case 8:
527  return PARM_INTEGER;
528  case 9:
529  return PARM_INTEGER;
530  case 10:
531  return PARM_VECTOR3;
532  case 11:
533  return PARM_VECTOR3;
534  case 12:
535  return PARM_FLOAT;
536  case 13:
537  return PARM_FLOAT;
538  case 14:
539  return PARM_INTEGER;
540  case 15:
541  return PARM_INTEGER;
542  case 16:
543  return PARM_INTEGER;
544  case 17:
545  return PARM_INTEGER;
546  case 18:
547  return PARM_INTEGER;
548  case 19:
549  return PARM_INTEGER;
550  case 20:
551  return PARM_INTEGER;
552  case 21:
553  return PARM_INTEGER;
554  case 22:
555  return PARM_INTEGER;
556  case 23:
557  return PARM_STRING;
558  case 24:
559  return PARM_STRING;
560  case 25:
561  return PARM_INTEGER;
562 
563  }
564  return PARM_UNSUPPORTED;
565  }
566 
567  // Boiler plate to load individual types.
568  static void loadData(UT_IStream &is, int64 &v)
569  { is.bread(&v, 1); }
570  static void loadData(UT_IStream &is, bool &v)
571  { int64 iv; is.bread(&iv, 1); v = iv; }
572  static void loadData(UT_IStream &is, fpreal64 &v)
573  { is.bread<fpreal64>(&v, 1); }
574  static void loadData(UT_IStream &is, UT_Vector2D &v)
575  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
576  static void loadData(UT_IStream &is, UT_Vector3D &v)
577  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
578  is.bread<fpreal64>(&v.z(), 1); }
579  static void loadData(UT_IStream &is, UT_Vector4D &v)
580  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
581  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
582  static void loadData(UT_IStream &is, UT_Matrix2D &v)
583  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
584  static void loadData(UT_IStream &is, UT_Matrix3D &v)
585  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
586  static void loadData(UT_IStream &is, UT_Matrix4D &v)
587  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
588  static void loadData(UT_IStream &is, UT_Vector2I &v)
589  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
590  static void loadData(UT_IStream &is, UT_Vector3I &v)
591  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
592  is.bread<int64>(&v.z(), 1); }
593  static void loadData(UT_IStream &is, UT_Vector4I &v)
594  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
595  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
597  { is.bread(v); }
599  { UT_StringHolder rampdata;
600  loadData(is, rampdata);
601  if (rampdata.isstring())
602  {
603  v.reset(new UT_Ramp());
604  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
605  v->load(istr);
606  }
607  else v.reset();
608  }
611  loadData(is, data);
612  if (data.isstring())
613  {
614  // Find the data type.
615  const char *colon = UT_StringWrap(data).findChar(':');
616  if (colon)
617  {
618  int typelen = colon - data.buffer();
620  type.strncpy(data.buffer(), typelen);
621  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
622 
623  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
624  }
625  }
626  else v.reset();
627  }
628 
629  static void saveData(std::ostream &os, int64 v)
630  { UTwrite(os, &v); }
631  static void saveData(std::ostream &os, bool v)
632  { int64 iv = v; UTwrite(os, &iv); }
633  static void saveData(std::ostream &os, fpreal64 v)
634  { UTwrite<fpreal64>(os, &v); }
635  static void saveData(std::ostream &os, UT_Vector2D v)
636  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
637  static void saveData(std::ostream &os, UT_Vector3D v)
638  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
639  UTwrite<fpreal64>(os, &v.z()); }
640  static void saveData(std::ostream &os, UT_Vector4D v)
641  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
642  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
643  static void saveData(std::ostream &os, UT_Matrix2D v)
645  static void saveData(std::ostream &os, UT_Matrix3D v)
647  static void saveData(std::ostream &os, UT_Matrix4D v)
649  static void saveData(std::ostream &os, UT_StringHolder s)
650  { UT_StringWrap(s).saveBinary(os); }
651  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
653  UT_OStringStream ostr;
654  if (s) s->save(ostr);
655  result = ostr.str();
656  saveData(os, result);
657  }
658  static void saveData(std::ostream &os, PRM_DataItemHandle s)
660  UT_OStringStream ostr;
661  if (s)
662  {
663  ostr << s->getDataTypeToken();
664  ostr << ":";
665  s->saveBinary(ostr);
666  }
667  result = ostr.str();
668  saveData(os, result);
669  }
670 
671 
672  void save(std::ostream &os) const
673  {
674  int32 v = version();
675  UTwrite(os, &v);
676  saveData(os, myOutput);
677  saveData(os, myMode);
678  saveData(os, myUniformSamples);
679  saveData(os, myDivs);
680  saveData(os, mySampleDiv);
681  saveData(os, myDivSize);
682  saveData(os, myOverrideOutput);
683  saveData(os, myIsoDiv);
684  saveData(os, myPadBounds);
685  saveData(os, myOverrideBounds);
686  saveData(os, myMin);
687  saveData(os, myMax);
688  saveData(os, myTol);
689  saveData(os, myOffset);
690  saveData(os, myLaserScan);
691  saveData(os, myFixSigns);
692  saveData(os, myForceBounds);
693  saveData(os, myInvert);
694  saveData(os, myNumNeighbour);
695  saveData(os, mySweepCount);
696  saveData(os, mySweepThreshold);
697  saveData(os, myTetraType);
698  saveData(os, myFileMode);
699  saveData(os, myFileName);
700  saveData(os, myName);
701  saveData(os, myBuildPolySoup);
702 
703  }
704 
705  bool load(UT_IStream &is)
706  {
707  int32 v;
708  is.bread(&v, 1);
709  if (version() != v)
710  {
711  // Fail incompatible versions
712  return false;
713  }
714  loadData(is, myOutput);
715  loadData(is, myMode);
716  loadData(is, myUniformSamples);
717  loadData(is, myDivs);
718  loadData(is, mySampleDiv);
719  loadData(is, myDivSize);
720  loadData(is, myOverrideOutput);
721  loadData(is, myIsoDiv);
722  loadData(is, myPadBounds);
723  loadData(is, myOverrideBounds);
724  loadData(is, myMin);
725  loadData(is, myMax);
726  loadData(is, myTol);
727  loadData(is, myOffset);
728  loadData(is, myLaserScan);
729  loadData(is, myFixSigns);
730  loadData(is, myForceBounds);
731  loadData(is, myInvert);
732  loadData(is, myNumNeighbour);
733  loadData(is, mySweepCount);
734  loadData(is, mySweepThreshold);
735  loadData(is, myTetraType);
736  loadData(is, myFileMode);
737  loadData(is, myFileName);
738  loadData(is, myName);
739  loadData(is, myBuildPolySoup);
740 
741  return true;
742  }
743 
744  int64 getOutput() const { return myOutput; }
745  void setOutput(int64 val) { myOutput = val; }
746  int64 opOutput(const SOP_NodeVerb::CookParms &cookparms) const
747  {
748  SOP_Node *thissop = cookparms.getNode();
749  if (!thissop) return getOutput();
750  int64 result;
751  OP_Utils::evalOpParm(result, thissop, "output", cookparms.getCookTime(), 0);
752  return result;
753  }
754  int64 getMode() const { return myMode; }
755  void setMode(int64 val) { myMode = val; }
756  int64 opMode(const SOP_NodeVerb::CookParms &cookparms) const
757  {
758  SOP_Node *thissop = cookparms.getNode();
759  if (!thissop) return getMode();
760  int64 result;
761  OP_Utils::evalOpParm(result, thissop, "mode", cookparms.getCookTime(), 0);
762  return result;
763  }
764  int64 getUniformSamples() const { return myUniformSamples; }
765  void setUniformSamples(int64 val) { myUniformSamples = val; }
767  {
768  SOP_Node *thissop = cookparms.getNode();
769  if (!thissop) return getUniformSamples();
770  int64 result;
771  OP_Utils::evalOpParm(result, thissop, "uniformsamples", cookparms.getCookTime(), 0);
772  return result;
773  }
774  UT_Vector3I getDivs() const { return myDivs; }
775  void setDivs(UT_Vector3I val) { myDivs = val; }
777  {
778  SOP_Node *thissop = cookparms.getNode();
779  if (!thissop) return getDivs();
781  OP_Utils::evalOpParm(result, thissop, "divs", cookparms.getCookTime(), 0);
782  return result;
783  }
784  int64 getSampleDiv() const { return mySampleDiv; }
785  void setSampleDiv(int64 val) { mySampleDiv = val; }
786  int64 opSampleDiv(const SOP_NodeVerb::CookParms &cookparms) const
787  {
788  SOP_Node *thissop = cookparms.getNode();
789  if (!thissop) return getSampleDiv();
790  int64 result;
791  OP_Utils::evalOpParm(result, thissop, "samplediv", cookparms.getCookTime(), 0);
792  return result;
793  }
794  fpreal64 getDivSize() const { return myDivSize; }
795  void setDivSize(fpreal64 val) { myDivSize = val; }
797  {
798  SOP_Node *thissop = cookparms.getNode();
799  if (!thissop) return getDivSize();
801  OP_Utils::evalOpParm(result, thissop, "divsize", cookparms.getCookTime(), 0);
802  return result;
803  }
804  bool getOverrideOutput() const { return myOverrideOutput; }
805  void setOverrideOutput(bool val) { myOverrideOutput = val; }
806  bool opOverrideOutput(const SOP_NodeVerb::CookParms &cookparms) const
807  {
808  SOP_Node *thissop = cookparms.getNode();
809  if (!thissop) return getOverrideOutput();
810  bool result;
811  OP_Utils::evalOpParm(result, thissop, "overrideoutput", cookparms.getCookTime(), 0);
812  return result;
813  }
814  UT_Vector3I getIsoDiv() const { return myIsoDiv; }
815  void setIsoDiv(UT_Vector3I val) { myIsoDiv = val; }
817  {
818  SOP_Node *thissop = cookparms.getNode();
819  if (!thissop) return getIsoDiv();
821  OP_Utils::evalOpParm(result, thissop, "isodiv", cookparms.getCookTime(), 0);
822  return result;
823  }
824  bool getPadBounds() const { return myPadBounds; }
825  void setPadBounds(bool val) { myPadBounds = val; }
826  bool opPadBounds(const SOP_NodeVerb::CookParms &cookparms) const
827  {
828  SOP_Node *thissop = cookparms.getNode();
829  if (!thissop) return getPadBounds();
830  bool result;
831  OP_Utils::evalOpParm(result, thissop, "padbounds", cookparms.getCookTime(), 0);
832  return result;
833  }
834  bool getOverrideBounds() const { return myOverrideBounds; }
835  void setOverrideBounds(bool val) { myOverrideBounds = val; }
836  bool opOverrideBounds(const SOP_NodeVerb::CookParms &cookparms) const
837  {
838  SOP_Node *thissop = cookparms.getNode();
839  if (!thissop) return getOverrideBounds();
840  bool result;
841  OP_Utils::evalOpParm(result, thissop, "overridebounds", cookparms.getCookTime(), 0);
842  return result;
843  }
844  UT_Vector3D getMin() const { return myMin; }
845  void setMin(UT_Vector3D val) { myMin = val; }
846  UT_Vector3D opMin(const SOP_NodeVerb::CookParms &cookparms) const
847  {
848  SOP_Node *thissop = cookparms.getNode();
849  if (!thissop) return getMin();
851  OP_Utils::evalOpParm(result, thissop, "min", cookparms.getCookTime(), 0);
852  return result;
853  }
854  UT_Vector3D getMax() const { return myMax; }
855  void setMax(UT_Vector3D val) { myMax = val; }
856  UT_Vector3D opMax(const SOP_NodeVerb::CookParms &cookparms) const
857  {
858  SOP_Node *thissop = cookparms.getNode();
859  if (!thissop) return getMax();
861  OP_Utils::evalOpParm(result, thissop, "max", cookparms.getCookTime(), 0);
862  return result;
863  }
864  fpreal64 getTol() const { return myTol; }
865  void setTol(fpreal64 val) { myTol = val; }
866  fpreal64 opTol(const SOP_NodeVerb::CookParms &cookparms) const
867  {
868  SOP_Node *thissop = cookparms.getNode();
869  if (!thissop) return getTol();
871  OP_Utils::evalOpParm(result, thissop, "tol", cookparms.getCookTime(), 0);
872  return result;
873  }
874  fpreal64 getOffset() const { return myOffset; }
875  void setOffset(fpreal64 val) { myOffset = val; }
876  fpreal64 opOffset(const SOP_NodeVerb::CookParms &cookparms) const
877  {
878  SOP_Node *thissop = cookparms.getNode();
879  if (!thissop) return getOffset();
881  OP_Utils::evalOpParm(result, thissop, "offset", cookparms.getCookTime(), 0);
882  return result;
883  }
884  bool getLaserScan() const { return myLaserScan; }
885  void setLaserScan(bool val) { myLaserScan = val; }
886  bool opLaserScan(const SOP_NodeVerb::CookParms &cookparms) const
887  {
888  SOP_Node *thissop = cookparms.getNode();
889  if (!thissop) return getLaserScan();
890  bool result;
891  OP_Utils::evalOpParm(result, thissop, "laserscan", cookparms.getCookTime(), 0);
892  return result;
893  }
894  bool getFixSigns() const { return myFixSigns; }
895  void setFixSigns(bool val) { myFixSigns = val; }
896  bool opFixSigns(const SOP_NodeVerb::CookParms &cookparms) const
897  {
898  SOP_Node *thissop = cookparms.getNode();
899  if (!thissop) return getFixSigns();
900  bool result;
901  OP_Utils::evalOpParm(result, thissop, "fixsigns", cookparms.getCookTime(), 0);
902  return result;
903  }
904  bool getForceBounds() const { return myForceBounds; }
905  void setForceBounds(bool val) { myForceBounds = val; }
906  bool opForceBounds(const SOP_NodeVerb::CookParms &cookparms) const
907  {
908  SOP_Node *thissop = cookparms.getNode();
909  if (!thissop) return getForceBounds();
910  bool result;
911  OP_Utils::evalOpParm(result, thissop, "forcebounds", cookparms.getCookTime(), 0);
912  return result;
913  }
914  bool getInvert() const { return myInvert; }
915  void setInvert(bool val) { myInvert = val; }
916  bool opInvert(const SOP_NodeVerb::CookParms &cookparms) const
917  {
918  SOP_Node *thissop = cookparms.getNode();
919  if (!thissop) return getInvert();
920  bool result;
921  OP_Utils::evalOpParm(result, thissop, "invert", cookparms.getCookTime(), 0);
922  return result;
923  }
924  int64 getNumNeighbour() const { return myNumNeighbour; }
925  void setNumNeighbour(int64 val) { myNumNeighbour = val; }
927  {
928  SOP_Node *thissop = cookparms.getNode();
929  if (!thissop) return getNumNeighbour();
930  int64 result;
931  OP_Utils::evalOpParm(result, thissop, "numneighbour", cookparms.getCookTime(), 0);
932  return result;
933  }
934  int64 getSweepCount() const { return mySweepCount; }
935  void setSweepCount(int64 val) { mySweepCount = val; }
937  {
938  SOP_Node *thissop = cookparms.getNode();
939  if (!thissop) return getSweepCount();
940  int64 result;
941  OP_Utils::evalOpParm(result, thissop, "sweepcount", cookparms.getCookTime(), 0);
942  return result;
943  }
944  int64 getSweepThreshold() const { return mySweepThreshold; }
945  void setSweepThreshold(int64 val) { mySweepThreshold = val; }
947  {
948  SOP_Node *thissop = cookparms.getNode();
949  if (!thissop) return getSweepThreshold();
950  int64 result;
951  OP_Utils::evalOpParm(result, thissop, "sweepalpha", cookparms.getCookTime(), 0);
952  return result;
953  }
954  int64 getTetraType() const { return myTetraType; }
955  void setTetraType(int64 val) { myTetraType = val; }
956  int64 opTetraType(const SOP_NodeVerb::CookParms &cookparms) const
957  {
958  SOP_Node *thissop = cookparms.getNode();
959  if (!thissop) return getTetraType();
960  int64 result;
961  OP_Utils::evalOpParm(result, thissop, "tetratype", cookparms.getCookTime(), 0);
962  return result;
963  }
964  int64 getFileMode() const { return myFileMode; }
965  void setFileMode(int64 val) { myFileMode = val; }
966  int64 opFileMode(const SOP_NodeVerb::CookParms &cookparms) const
967  {
968  SOP_Node *thissop = cookparms.getNode();
969  if (!thissop) return getFileMode();
970  int64 result;
971  OP_Utils::evalOpParm(result, thissop, "filemode", cookparms.getCookTime(), 0);
972  return result;
973  }
974  const UT_StringHolder & getFileName() const { return myFileName; }
975  void setFileName(const UT_StringHolder & val) { myFileName = val; }
977  {
978  SOP_Node *thissop = cookparms.getNode();
979  if (!thissop) return getFileName();
981  OP_Utils::evalOpParm(result, thissop, "filename", cookparms.getCookTime(), 0);
982  return result;
983  }
984  const UT_StringHolder & getName() const { return myName; }
985  void setName(const UT_StringHolder & val) { myName = val; }
987  {
988  SOP_Node *thissop = cookparms.getNode();
989  if (!thissop) return getName();
991  OP_Utils::evalOpParm(result, thissop, "name", cookparms.getCookTime(), 0);
992  return result;
993  }
994  bool getBuildPolySoup() const { return myBuildPolySoup; }
995  void setBuildPolySoup(bool val) { myBuildPolySoup = val; }
996  bool opBuildPolySoup(const SOP_NodeVerb::CookParms &cookparms) const
997  {
998  SOP_Node *thissop = cookparms.getNode();
999  if (!thissop) return getBuildPolySoup();
1000  bool result;
1001  OP_Utils::evalOpParm(result, thissop, "buildpolysoup", cookparms.getCookTime(), 0);
1002  return result;
1003  }
1004 
1005 private:
1006  int64 myOutput;
1007  int64 myMode;
1008  int64 myUniformSamples;
1009  UT_Vector3I myDivs;
1010  int64 mySampleDiv;
1011  fpreal64 myDivSize;
1012  bool myOverrideOutput;
1013  UT_Vector3I myIsoDiv;
1014  bool myPadBounds;
1015  bool myOverrideBounds;
1016  UT_Vector3D myMin;
1017  UT_Vector3D myMax;
1018  fpreal64 myTol;
1019  fpreal64 myOffset;
1020  bool myLaserScan;
1021  bool myFixSigns;
1022  bool myForceBounds;
1023  bool myInvert;
1024  int64 myNumNeighbour;
1025  int64 mySweepCount;
1026  int64 mySweepThreshold;
1027  int64 myTetraType;
1028  int64 myFileMode;
1029  UT_StringHolder myFileName;
1030  UT_StringHolder myName;
1031  bool myBuildPolySoup;
1032 
1033 };
GLdouble s
Definition: glew.h:1390
int64 opUniformSamples(const SOP_NodeVerb::CookParms &cookparms) const
bool opForceBounds(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void saveData(std::ostream &os, UT_Vector4D v)
void setOffset(fpreal64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
exint nodeIdx() const
Definition: SOP_NodeVerb.h:114
bool opOverrideOutput(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:640
bool operator!=(const SOP_IsoOffsetParms &src) const
bool opInvert(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
const UT_StringHolder & getName() const
void setIsoDiv(UT_Vector3I val)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal getTime() const
Definition: OP_Context.h:60
void setMin(UT_Vector3D val)
GLuint const GLfloat * val
Definition: glew.h:2794
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
int64 opFileMode(const SOP_NodeVerb::CookParms &cookparms) const
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:113
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
fpreal64 opDivSize(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool load(UT_IStream &is)
int64 opMode(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
UT_Vector3I opIsoDiv(const SOP_NodeVerb::CookParms &cookparms) const
const GLdouble * v
Definition: glew.h:1391
static void saveData(std::ostream &os, UT_Matrix2D v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void saveData(std::ostream &os, UT_Vector2D v)
int64 opNumNeighbour(const SOP_NodeVerb::CookParms &cookparms) const
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
UT_Vector3D getMax() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
UT_Vector3I getDivs() const
UT_StringHolder opFileName(const SOP_NodeVerb::CookParms &cookparms) const
bool opOverrideBounds(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const SOP_IsoOffsetParms &src) const
double fpreal64
Definition: SYS_Types.h:201
static void loadData(UT_IStream &is, bool &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void copyFrom(const SOP_NodeParms *src) override
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_Vector3D opMin(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setDivs(UT_Vector3I val)
fpreal64 getDivSize() const
const UT_StringHolder & getFileName() const
static void saveData(std::ostream &os, UT_Matrix3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
SYS_FORCE_INLINE T & y()
Definition: UT_Vector3.h:513
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
exint length() const
void setDivSize(fpreal64 val)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
static void saveData(std::ostream &os, PRM_DataItemHandle s)
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
int64 opOutput(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE T & z()
Definition: UT_Vector3.h:515
void setName(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
const GLfloat * c
Definition: glew.h:16296
long long int64
Definition: SYS_Types.h:116
UT_Vector3D getMin() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector4D &v)
UT_Vector3D opMax(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3I getIsoDiv() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setFileName(const UT_StringHolder &val)
void setUniformSamples(int64 val)
static void saveData(std::ostream &os, UT_Vector3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
int64 opSweepThreshold(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:121
static void saveData(std::ostream &os, bool v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setMax(UT_Vector3D val)
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
fpreal64 opOffset(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opName(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool opBuildPolySoup(const SOP_NodeVerb::CookParms &cookparms) const
bool opPadBounds(const SOP_NodeVerb::CookParms &cookparms) const
void setSweepThreshold(int64 val)
fpreal64 fpreal
Definition: SYS_Types.h:277
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
#define SOP_API
Definition: SOP_API.h:10
int64 opTetraType(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool opFixSigns(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE T & x()
Definition: UT_Vector3.h:511
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:654
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
GLuint64EXT * result
Definition: glew.h:14007
const char * findChar(int c) const
Definition: UT_String.h:1367
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
void save(std::ostream &os) const
UT_Vector3I opDivs(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
bool opLaserScan(const SOP_NodeVerb::CookParms &cookparms) const
int64 opSampleDiv(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
GLsizei const GLfloat * value
Definition: glew.h:1849
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
fpreal64 opTol(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: SOP_NodeVerb.h:119
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
type
Definition: core.h:528
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
int64 opSweepCount(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override