HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_VolumeSlice.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_VolumeSliceEnums
24 {
25  enum class Method
26  {
27  VOLUME = 0,
28  MESH,
29  POINTS
30  };
31 
33  getToken(Method enum_value)
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case Method::VOLUME: return "volume"_sh;
38  case Method::MESH: return "mesh"_sh;
39  case Method::POINTS: return "points"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class Plane
45  {
46  XY = 0,
47  YZ,
48  ZX
49  };
50 
52  getToken(Plane enum_value)
53  {
54  using namespace UT::Literal;
55  switch (enum_value) {
56  case Plane::XY: return "xy"_sh;
57  case Plane::YZ: return "yz"_sh;
58  case Plane::ZX: return "zx"_sh;
59  default: UT_ASSERT(false); return ""_sh;
60  }
61  }
62 
63  enum class Vismode
64  {
65  NONE = 0,
66  FALSE_,
67  PINK,
68  MONO,
69  BLACKBODY,
70  BIPARTITE,
71  CUSTOM
72  };
73 
75  getToken(Vismode enum_value)
76  {
77  using namespace UT::Literal;
78  switch (enum_value) {
79  case Vismode::NONE: return "none"_sh;
80  case Vismode::FALSE_: return "false"_sh;
81  case Vismode::PINK: return "pink"_sh;
82  case Vismode::MONO: return "mono"_sh;
83  case Vismode::BLACKBODY: return "blackbody"_sh;
84  case Vismode::BIPARTITE: return "bipartite"_sh;
85  case Vismode::CUSTOM: return "custom"_sh;
86  default: UT_ASSERT(false); return ""_sh;
87  }
88  }
89 
90 }
91 
92 
94 {
95 public:
96  static int version() { return 1; }
97 
99  {
100  myGroup = ""_UTsh;
101  myMethod = 1;
102  myPlane = 0;
103  myRelative = true;
104  myPlanepos = UT_Vector3D(0,0,0);
105  myPlaneoffset = 0;
106  myVoxelsnap = false;
107  myAttrib = "density"_UTsh;
108  myCreatevarmap = false;
109  myLvar = ""_UTsh;
110  myVisualize = true;
111  myVismode = 1;
112  myVisrange = UT_Vector2D(0,1);
113  myCdramp = UT_SharedPtr<UT_Ramp>(0);
114  myKeep = false;
115 
116  }
117 
118  explicit SOP_VolumeSliceParms(const SOP_VolumeSliceParms &) = default;
120  SOP_VolumeSliceParms(SOP_VolumeSliceParms &&) noexcept = default;
121  SOP_VolumeSliceParms &operator=(SOP_VolumeSliceParms &&) noexcept = default;
122 
123  ~SOP_VolumeSliceParms() override {}
124 
126  {
127  if (myGroup != src.myGroup) return false;
128  if (myMethod != src.myMethod) return false;
129  if (myPlane != src.myPlane) return false;
130  if (myRelative != src.myRelative) return false;
131  if (myPlanepos != src.myPlanepos) return false;
132  if (myPlaneoffset != src.myPlaneoffset) return false;
133  if (myVoxelsnap != src.myVoxelsnap) return false;
134  if (myAttrib != src.myAttrib) return false;
135  if (myCreatevarmap != src.myCreatevarmap) return false;
136  if (myLvar != src.myLvar) return false;
137  if (myVisualize != src.myVisualize) return false;
138  if (myVismode != src.myVismode) return false;
139  if (myVisrange != src.myVisrange) return false;
140  if (myCdramp != src.myCdramp)
141  { if (!myCdramp || !src.myCdramp || !(*myCdramp == *src.myCdramp)) return false; }
142  if (myKeep != src.myKeep) return false;
143 
144 
145  if (baseGetSignature() != src.baseGetSignature()) return false;
146 
147  return true;
148  }
150  {
151  return !operator==(src);
152  }
156 
157 
158 
159  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
160  {
161  myGroup = ""_UTsh;
162  if (true)
163  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
164  myMethod = 1;
165  if (true)
166  graph->evalOpParm(myMethod, nodeidx, "method", time, graph->isDirect()?nullptr:depnode);
167  myPlane = 0;
168  if (true)
169  graph->evalOpParm(myPlane, nodeidx, "plane", time, graph->isDirect()?nullptr:depnode);
170  myRelative = true;
171  if (true)
172  graph->evalOpParm(myRelative, nodeidx, "relative", time, graph->isDirect()?nullptr:depnode);
173  myPlanepos = UT_Vector3D(0,0,0);
174  if (true && ( (true&&!(((getRelative()==1)))) ) )
175  graph->evalOpParm(myPlanepos, nodeidx, "planepos", time, graph->isDirect()?nullptr:depnode);
176  myPlaneoffset = 0;
177  if (true)
178  graph->evalOpParm(myPlaneoffset, nodeidx, "planeoffset", time, graph->isDirect()?nullptr:depnode);
179  myVoxelsnap = false;
180  if (true)
181  graph->evalOpParm(myVoxelsnap, nodeidx, "voxelsnap", time, graph->isDirect()?nullptr:depnode);
182  myAttrib = "density"_UTsh;
183  if (true && ( (true&&!(((int64(getMethod())==0)))) ) )
184  graph->evalOpParm(myAttrib, nodeidx, "attrib", time, graph->isDirect()?nullptr:depnode);
185  myCreatevarmap = false;
186  if (true && ( (true&&!(((int64(getMethod())==0)))) ) )
187  graph->evalOpParm(myCreatevarmap, nodeidx, "createvarmap", time, graph->isDirect()?nullptr:depnode);
188  myLvar = ""_UTsh;
189  if (true && ( (true&&!(((int64(getMethod())==0))||((getCreatevarmap()==0)))) ) )
190  graph->evalOpParm(myLvar, nodeidx, "lvar", time, graph->isDirect()?nullptr:depnode);
191  myVisualize = true;
192  if (true && ( (true&&!(((int64(getMethod())==0)))) ) )
193  graph->evalOpParm(myVisualize, nodeidx, "visualize", time, graph->isDirect()?nullptr:depnode);
194  myVismode = 1;
195  if (true && ( (true&&!(((int64(getMethod())==0))||((getVisualize()==0)))) ) )
196  graph->evalOpParm(myVismode, nodeidx, "vismode", time, graph->isDirect()?nullptr:depnode);
197  myVisrange = UT_Vector2D(0,1);
198  if (true && ( (true&&!(((int64(getMethod())==0))||((getVisualize()==0)))) ) )
199  graph->evalOpParm(myVisrange, nodeidx, "visrange", time, graph->isDirect()?nullptr:depnode);
200  myCdramp = UT_SharedPtr<UT_Ramp>(0);
201  if (true && ( (true&&!(((int64(getMethod())==0))||((getVisualize()==0))||((int64(getVismode())!=6)))) ) )
202  graph->evalOpParm(myCdramp, nodeidx, "cdramp", time, graph->isDirect()?nullptr:depnode);
203  myKeep = false;
204  if (true)
205  graph->evalOpParm(myKeep, nodeidx, "keep", time, graph->isDirect()?nullptr:depnode);
206 
207  }
208 
209 
210  void loadFromOpSubclass(const LoadParms &loadparms) override
211  {
212  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
213  }
214 
215 
216  void copyFrom(const OP_NodeParms *src) override
217  {
218  *this = *((const SOP_VolumeSliceParms *)src);
219  }
220 
221  template <typename T>
222  void
223  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
224  {
225  if (idx.size() < 1)
226  return;
227  UT_ASSERT(idx.size() == instance.size()+1);
228  if (idx.size() != instance.size()+1)
229  return;
230  switch (idx[0])
231  {
232  case 0:
233  coerceValue(value, myGroup);
234  break;
235  case 1:
236  coerceValue(value, myMethod);
237  break;
238  case 2:
239  coerceValue(value, myPlane);
240  break;
241  case 3:
242  coerceValue(value, myRelative);
243  break;
244  case 4:
245  coerceValue(value, myPlanepos);
246  break;
247  case 5:
248  coerceValue(value, myPlaneoffset);
249  break;
250  case 6:
251  coerceValue(value, myVoxelsnap);
252  break;
253  case 7:
254  coerceValue(value, myAttrib);
255  break;
256  case 8:
257  coerceValue(value, myCreatevarmap);
258  break;
259  case 9:
260  coerceValue(value, myLvar);
261  break;
262  case 10:
263  coerceValue(value, myVisualize);
264  break;
265  case 11:
266  coerceValue(value, myVismode);
267  break;
268  case 12:
269  coerceValue(value, myVisrange);
270  break;
271  case 13:
272  coerceValue(value, myCdramp);
273  break;
274  case 14:
275  coerceValue(value, myKeep);
276  break;
277 
278  }
279  }
280 
281  bool isParmColorRamp(exint idx) const override
282  {
283  switch (idx)
284  {
285  case 13:
286  return true;
287  }
288  return false;
289  }
290 
291  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
292  { doGetParmValue(idx, instance, value); }
293  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
294  { doGetParmValue(idx, instance, value); }
295  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
296  { doGetParmValue(idx, instance, value); }
297  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
298  { doGetParmValue(idx, instance, value); }
299  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
300  { doGetParmValue(idx, instance, value); }
301  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
302  { doGetParmValue(idx, instance, value); }
303  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
304  { doGetParmValue(idx, instance, value); }
305  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
306  { doGetParmValue(idx, instance, value); }
307  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
308  { doGetParmValue(idx, instance, value); }
309  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
310  { doGetParmValue(idx, instance, value); }
311  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
312  { doGetParmValue(idx, instance, value); }
313 
314  template <typename T>
315  void
316  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
317  {
318  if (idx.size() < 1)
319  return;
320  UT_ASSERT(idx.size() == instance.size()+1);
321  if (idx.size() != instance.size()+1)
322  return;
323  switch (idx[0])
324  {
325  case 0:
326  coerceValue(myGroup, ( ( value ) ));
327  break;
328  case 1:
329  coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
330  break;
331  case 2:
332  coerceValue(myPlane, clampMinValue(0, clampMaxValue(2, value ) ));
333  break;
334  case 3:
335  coerceValue(myRelative, ( ( value ) ));
336  break;
337  case 4:
338  coerceValue(myPlanepos, ( ( value ) ));
339  break;
340  case 5:
341  coerceValue(myPlaneoffset, ( ( value ) ));
342  break;
343  case 6:
344  coerceValue(myVoxelsnap, ( ( value ) ));
345  break;
346  case 7:
347  coerceValue(myAttrib, ( ( value ) ));
348  break;
349  case 8:
350  coerceValue(myCreatevarmap, ( ( value ) ));
351  break;
352  case 9:
353  coerceValue(myLvar, ( ( value ) ));
354  break;
355  case 10:
356  coerceValue(myVisualize, ( ( value ) ));
357  break;
358  case 11:
359  coerceValue(myVismode, clampMinValue(0, clampMaxValue(6, value ) ));
360  break;
361  case 12:
362  coerceValue(myVisrange, ( ( value ) ));
363  break;
364  case 13:
365  coerceValue(myCdramp, ( ( value ) ));
366  break;
367  case 14:
368  coerceValue(myKeep, ( ( value ) ));
369  break;
370 
371  }
372  }
373 
374  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
375  { doSetParmValue(idx, instance, value); }
376  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
377  { doSetParmValue(idx, instance, value); }
378  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
379  { doSetParmValue(idx, instance, value); }
380  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
381  { doSetParmValue(idx, instance, value); }
382  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
383  { doSetParmValue(idx, instance, value); }
384  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
385  { doSetParmValue(idx, instance, value); }
386  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
387  { doSetParmValue(idx, instance, value); }
388  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
389  { doSetParmValue(idx, instance, value); }
390  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
391  { doSetParmValue(idx, instance, value); }
392  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
393  { doSetParmValue(idx, instance, value); }
394  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
395  { doSetParmValue(idx, instance, value); }
396 
397  exint getNestNumParms(TempIndex idx) const override
398  {
399  if (idx.size() == 0)
400  return 15;
401  switch (idx[0])
402  {
403 
404  }
405  // Invalid
406  return 0;
407  }
408 
409  const char *getNestParmName(TempIndex fieldnum) const override
410  {
411  if (fieldnum.size() < 1)
412  return 0;
413  switch (fieldnum[0])
414  {
415  case 0:
416  return "group";
417  case 1:
418  return "method";
419  case 2:
420  return "plane";
421  case 3:
422  return "relative";
423  case 4:
424  return "planepos";
425  case 5:
426  return "planeoffset";
427  case 6:
428  return "voxelsnap";
429  case 7:
430  return "attrib";
431  case 8:
432  return "createvarmap";
433  case 9:
434  return "lvar";
435  case 10:
436  return "visualize";
437  case 11:
438  return "vismode";
439  case 12:
440  return "visrange";
441  case 13:
442  return "cdramp";
443  case 14:
444  return "keep";
445 
446  }
447  return 0;
448  }
449 
450  ParmType getNestParmType(TempIndex fieldnum) const override
451  {
452  if (fieldnum.size() < 1)
453  return PARM_UNSUPPORTED;
454  switch (fieldnum[0])
455  {
456  case 0:
457  return PARM_STRING;
458  case 1:
459  return PARM_INTEGER;
460  case 2:
461  return PARM_INTEGER;
462  case 3:
463  return PARM_INTEGER;
464  case 4:
465  return PARM_VECTOR3;
466  case 5:
467  return PARM_FLOAT;
468  case 6:
469  return PARM_INTEGER;
470  case 7:
471  return PARM_STRING;
472  case 8:
473  return PARM_INTEGER;
474  case 9:
475  return PARM_STRING;
476  case 10:
477  return PARM_INTEGER;
478  case 11:
479  return PARM_INTEGER;
480  case 12:
481  return PARM_VECTOR2;
482  case 13:
483  return PARM_RAMP;
484  case 14:
485  return PARM_INTEGER;
486 
487  }
488  return PARM_UNSUPPORTED;
489  }
490 
491  // Boiler plate to load individual types.
492  static void loadData(UT_IStream &is, int64 &v)
493  { is.bread(&v, 1); }
494  static void loadData(UT_IStream &is, bool &v)
495  { int64 iv; is.bread(&iv, 1); v = iv; }
496  static void loadData(UT_IStream &is, fpreal64 &v)
497  { is.bread<fpreal64>(&v, 1); }
498  static void loadData(UT_IStream &is, UT_Vector2D &v)
499  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
500  static void loadData(UT_IStream &is, UT_Vector3D &v)
501  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
502  is.bread<fpreal64>(&v.z(), 1); }
503  static void loadData(UT_IStream &is, UT_Vector4D &v)
504  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
505  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
506  static void loadData(UT_IStream &is, UT_Matrix2D &v)
507  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
508  static void loadData(UT_IStream &is, UT_Matrix3D &v)
509  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
510  static void loadData(UT_IStream &is, UT_Matrix4D &v)
511  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
512  static void loadData(UT_IStream &is, UT_Vector2I &v)
513  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
514  static void loadData(UT_IStream &is, UT_Vector3I &v)
515  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
516  is.bread<int64>(&v.z(), 1); }
517  static void loadData(UT_IStream &is, UT_Vector4I &v)
518  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
519  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
521  { is.bread(v); }
523  { UT_StringHolder rampdata;
524  loadData(is, rampdata);
525  if (rampdata.isstring())
526  {
527  v.reset(new UT_Ramp());
528  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
529  v->load(istr);
530  }
531  else v.reset();
532  }
535  loadData(is, data);
536  if (data.isstring())
537  {
538  // Find the data type.
539  const char *colon = UT_StringWrap(data).findChar(':');
540  if (colon)
541  {
542  int typelen = colon - data.buffer();
544  type.strncpy(data.buffer(), typelen);
545  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
546 
547  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
548  }
549  }
550  else v.reset();
551  }
552 
553  static void saveData(std::ostream &os, int64 v)
554  { UTwrite(os, &v); }
555  static void saveData(std::ostream &os, bool v)
556  { int64 iv = v; UTwrite(os, &iv); }
557  static void saveData(std::ostream &os, fpreal64 v)
558  { UTwrite<fpreal64>(os, &v); }
559  static void saveData(std::ostream &os, UT_Vector2D v)
560  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
561  static void saveData(std::ostream &os, UT_Vector3D v)
562  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
563  UTwrite<fpreal64>(os, &v.z()); }
564  static void saveData(std::ostream &os, UT_Vector4D v)
565  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
566  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
567  static void saveData(std::ostream &os, UT_Matrix2D v)
569  static void saveData(std::ostream &os, UT_Matrix3D v)
571  static void saveData(std::ostream &os, UT_Matrix4D v)
573  static void saveData(std::ostream &os, UT_StringHolder s)
574  { UT_StringWrap(s).saveBinary(os); }
575  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
577  UT_OStringStream ostr;
578  if (s) s->save(ostr);
579  result = ostr.str();
580  saveData(os, result);
581  }
582  static void saveData(std::ostream &os, PRM_DataItemHandle s)
584  UT_OStringStream ostr;
585  if (s)
586  {
587  ostr << s->getDataTypeToken();
588  ostr << ":";
589  s->saveBinary(ostr);
590  }
591  result = ostr.str();
592  saveData(os, result);
593  }
594 
595 
596  void save(std::ostream &os) const
597  {
598  int32 v = version();
599  UTwrite(os, &v);
600  saveData(os, myGroup);
601  saveData(os, myMethod);
602  saveData(os, myPlane);
603  saveData(os, myRelative);
604  saveData(os, myPlanepos);
605  saveData(os, myPlaneoffset);
606  saveData(os, myVoxelsnap);
607  saveData(os, myAttrib);
608  saveData(os, myCreatevarmap);
609  saveData(os, myLvar);
610  saveData(os, myVisualize);
611  saveData(os, myVismode);
612  saveData(os, myVisrange);
613  saveData(os, myCdramp);
614  saveData(os, myKeep);
615 
616  }
617 
618  bool load(UT_IStream &is)
619  {
620  int32 v;
621  is.bread(&v, 1);
622  if (version() != v)
623  {
624  // Fail incompatible versions
625  return false;
626  }
627  loadData(is, myGroup);
628  loadData(is, myMethod);
629  loadData(is, myPlane);
630  loadData(is, myRelative);
631  loadData(is, myPlanepos);
632  loadData(is, myPlaneoffset);
633  loadData(is, myVoxelsnap);
634  loadData(is, myAttrib);
635  loadData(is, myCreatevarmap);
636  loadData(is, myLvar);
637  loadData(is, myVisualize);
638  loadData(is, myVismode);
639  loadData(is, myVisrange);
640  loadData(is, myCdramp);
641  loadData(is, myKeep);
642 
643  return true;
644  }
645 
646  const UT_StringHolder & getGroup() const { return myGroup; }
647  void setGroup(const UT_StringHolder & val) { myGroup = val; }
649  {
650  SOP_Node *thissop = cookparms.getNode();
651  if (!thissop) return getGroup();
653  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
654  return result;
655  }
656  Method getMethod() const { return Method(myMethod); }
657  void setMethod(Method val) { myMethod = int64(val); }
658  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
659  {
660  SOP_Node *thissop = cookparms.getNode();
661  if (!thissop) return getMethod();
662  int64 result;
663  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
664  return Method(result);
665  }
666  Plane getPlane() const { return Plane(myPlane); }
667  void setPlane(Plane val) { myPlane = int64(val); }
668  Plane opPlane(const SOP_NodeVerb::CookParms &cookparms) const
669  {
670  SOP_Node *thissop = cookparms.getNode();
671  if (!thissop) return getPlane();
672  int64 result;
673  OP_Utils::evalOpParm(result, thissop, "plane", cookparms.getCookTime(), 0);
674  return Plane(result);
675  }
676  bool getRelative() const { return myRelative; }
677  void setRelative(bool val) { myRelative = val; }
678  bool opRelative(const SOP_NodeVerb::CookParms &cookparms) const
679  {
680  SOP_Node *thissop = cookparms.getNode();
681  if (!thissop) return getRelative();
682  bool result;
683  OP_Utils::evalOpParm(result, thissop, "relative", cookparms.getCookTime(), 0);
684  return result;
685  }
686  UT_Vector3D getPlanepos() const { return myPlanepos; }
687  void setPlanepos(UT_Vector3D val) { myPlanepos = val; }
689  {
690  SOP_Node *thissop = cookparms.getNode();
691  if (!thissop) return getPlanepos();
693  OP_Utils::evalOpParm(result, thissop, "planepos", cookparms.getCookTime(), 0);
694  return result;
695  }
696  fpreal64 getPlaneoffset() const { return myPlaneoffset; }
697  void setPlaneoffset(fpreal64 val) { myPlaneoffset = val; }
699  {
700  SOP_Node *thissop = cookparms.getNode();
701  if (!thissop) return getPlaneoffset();
703  OP_Utils::evalOpParm(result, thissop, "planeoffset", cookparms.getCookTime(), 0);
704  return result;
705  }
706  bool getVoxelsnap() const { return myVoxelsnap; }
707  void setVoxelsnap(bool val) { myVoxelsnap = val; }
708  bool opVoxelsnap(const SOP_NodeVerb::CookParms &cookparms) const
709  {
710  SOP_Node *thissop = cookparms.getNode();
711  if (!thissop) return getVoxelsnap();
712  bool result;
713  OP_Utils::evalOpParm(result, thissop, "voxelsnap", cookparms.getCookTime(), 0);
714  return result;
715  }
716  const UT_StringHolder & getAttrib() const { return myAttrib; }
717  void setAttrib(const UT_StringHolder & val) { myAttrib = val; }
719  {
720  SOP_Node *thissop = cookparms.getNode();
721  if (!thissop) return getAttrib();
723  OP_Utils::evalOpParm(result, thissop, "attrib", cookparms.getCookTime(), 0);
724  return result;
725  }
726  bool getCreatevarmap() const { return myCreatevarmap; }
727  void setCreatevarmap(bool val) { myCreatevarmap = val; }
728  bool opCreatevarmap(const SOP_NodeVerb::CookParms &cookparms) const
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return getCreatevarmap();
732  bool result;
733  OP_Utils::evalOpParm(result, thissop, "createvarmap", cookparms.getCookTime(), 0);
734  return result;
735  }
736  const UT_StringHolder & getLvar() const { return myLvar; }
737  void setLvar(const UT_StringHolder & val) { myLvar = val; }
739  {
740  SOP_Node *thissop = cookparms.getNode();
741  if (!thissop) return getLvar();
743  OP_Utils::evalOpParm(result, thissop, "lvar", cookparms.getCookTime(), 0);
744  return result;
745  }
746  bool getVisualize() const { return myVisualize; }
747  void setVisualize(bool val) { myVisualize = val; }
748  bool opVisualize(const SOP_NodeVerb::CookParms &cookparms) const
749  {
750  SOP_Node *thissop = cookparms.getNode();
751  if (!thissop) return getVisualize();
752  bool result;
753  OP_Utils::evalOpParm(result, thissop, "visualize", cookparms.getCookTime(), 0);
754  return result;
755  }
756  Vismode getVismode() const { return Vismode(myVismode); }
757  void setVismode(Vismode val) { myVismode = int64(val); }
758  Vismode opVismode(const SOP_NodeVerb::CookParms &cookparms) const
759  {
760  SOP_Node *thissop = cookparms.getNode();
761  if (!thissop) return getVismode();
762  int64 result;
763  OP_Utils::evalOpParm(result, thissop, "vismode", cookparms.getCookTime(), 0);
764  return Vismode(result);
765  }
766  UT_Vector2D getVisrange() const { return myVisrange; }
767  void setVisrange(UT_Vector2D val) { myVisrange = val; }
769  {
770  SOP_Node *thissop = cookparms.getNode();
771  if (!thissop) return getVisrange();
773  OP_Utils::evalOpParm(result, thissop, "visrange", cookparms.getCookTime(), 0);
774  return result;
775  }
776  UT_SharedPtr<UT_Ramp> getCdramp() const { return myCdramp; }
777  void setCdramp(UT_SharedPtr<UT_Ramp> val) { myCdramp = val; }
779  {
780  SOP_Node *thissop = cookparms.getNode();
781  if (!thissop) return getCdramp();
783  OP_Utils::evalOpParm(result, thissop, "cdramp", cookparms.getCookTime(), 0);
784  return result;
785  }
786  bool getKeep() const { return myKeep; }
787  void setKeep(bool val) { myKeep = val; }
788  bool opKeep(const SOP_NodeVerb::CookParms &cookparms) const
789  {
790  SOP_Node *thissop = cookparms.getNode();
791  if (!thissop) return getKeep();
792  bool result;
793  OP_Utils::evalOpParm(result, thissop, "keep", cookparms.getCookTime(), 0);
794  return result;
795  }
796 
797 private:
798  UT_StringHolder myGroup;
799  int64 myMethod;
800  int64 myPlane;
801  bool myRelative;
802  UT_Vector3D myPlanepos;
803  fpreal64 myPlaneoffset;
804  bool myVoxelsnap;
805  UT_StringHolder myAttrib;
806  bool myCreatevarmap;
807  UT_StringHolder myLvar;
808  bool myVisualize;
809  int64 myVismode;
810  UT_Vector2D myVisrange;
811  UT_SharedPtr<UT_Ramp> myCdramp;
812  bool myKeep;
813 
814 };
Plane opPlane(const SOP_NodeVerb::CookParms &cookparms) const
type
Definition: core.h:556
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool operator!=(const SOP_VolumeSliceParms &src) const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
UT_Vector3D opPlanepos(const SOP_NodeVerb::CookParms &cookparms) const
bool opRelative(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
static void saveData(std::ostream &os, UT_Vector2D v)
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_Vector2T< fpreal64 > UT_Vector2D
bool opCreatevarmap(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
UT_Vector3D getPlanepos() const
GLsizei const GLfloat * value
Definition: glcorearb.h:824
void setPlanepos(UT_Vector3D val)
Vismode opVismode(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
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, fpreal64 v)
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
GLdouble s
Definition: glad.h:3009
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool opVisualize(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const UT_StringHolder & getAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
**But if you need a result
Definition: thread.h:622
void setLvar(const UT_StringHolder &val)
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 save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setPlaneoffset(fpreal64 val)
static void saveData(std::ostream &os, UT_Matrix2D v)
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Vector3D v)
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
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void saveData(std::ostream &os, UT_Vector4D v)
bool opKeep(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
UT_Vector2D opVisrange(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setAttrib(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
exint length() const
bool operator==(const SOP_VolumeSliceParms &src) const
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 loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setVismode(Vismode val)
static void saveData(std::ostream &os, UT_Matrix4D v)
long long int64
Definition: SYS_Types.h:116
UT_Vector3T< fpreal64 > UT_Vector3D
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setGroup(const UT_StringHolder &val)
void setCdramp(UT_SharedPtr< UT_Ramp > val)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
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:303
fpreal64 getPlaneoffset() const
GT_API const UT_StringHolder version
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, int64 &v)
void setVisrange(UT_Vector2D val)
UT_SharedPtr< UT_Ramp > opCdramp(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opLvar(const SOP_NodeVerb::CookParms &cookparms) const
bool opVoxelsnap(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
static void loadData(UT_IStream &is, UT_Vector3D &v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
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
UT_Vector2D getVisrange() const
static void saveData(std::ostream &os, int64 v)
#define SOP_API
Definition: SOP_API.h:10
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, bool v)
void copyFrom(const OP_NodeParms *src) override
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
const char * getNestParmName(TempIndex fieldnum) const override
const UT_StringHolder & getGroup() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
GLboolean r
Definition: glcorearb.h:1222
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
const UT_StringHolder & getLvar() const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
UT_SharedPtr< UT_Ramp > getCdramp() const
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
fpreal64 opPlaneoffset(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663