HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_VolumeTrail.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_VolumeTrailEnums
24 {
25  enum class AdvectionChoice
26  {
27  ADVECTBYDISTANCE = 0,
29  };
30 
33  {
34  using namespace UT::Literal;
35  switch (enum_value) {
36  case AdvectionChoice::ADVECTBYDISTANCE: return "advectbydistance"_sh;
37  case AdvectionChoice::ADVECTBYTIME: return "advectbytime"_sh;
38  default: UT_ASSERT(false); return ""_sh;
39  }
40  }
41 
42  enum class VisRamp
43  {
44  FALSE_ = 0,
45  PINK,
46  MONO,
47  BLACKBODY,
48  BIPARTITE,
49  CUSTOM
50  };
51 
53  getToken(VisRamp enum_value)
54  {
55  using namespace UT::Literal;
56  switch (enum_value) {
57  case VisRamp::FALSE_: return "false"_sh;
58  case VisRamp::PINK: return "pink"_sh;
59  case VisRamp::MONO: return "mono"_sh;
60  case VisRamp::BLACKBODY: return "blackbody"_sh;
61  case VisRamp::BIPARTITE: return "bipartite"_sh;
62  case VisRamp::CUSTOM: return "custom"_sh;
63  default: UT_ASSERT(false); return ""_sh;
64  }
65  }
66 
67 }
68 
69 
71 {
72 public:
73  static int version() { return 1; }
74 
76  {
77  myGroup = ""_UTsh;
78  myVelField = ""_UTsh;
79  myAdvectionChoice = 0;
80  myTrailLen = 1;
81  myUseCFL = true;
82  myCFL = 0.5;
83  myNumSteps = 10;
84  myUseMaxSteps = true;
85  myMaxSteps = 1000;
86  myKeep = false;
87  myVisEnable = true;
88  myDetectRange = true;
89  myVisMax = 1;
90  myVisRamp = 0;
91  myCdRamp = UT_SharedPtr<UT_Ramp>(0);
92 
93  }
94 
95  explicit SOP_VolumeTrailParms(const SOP_VolumeTrailParms &) = default;
97  SOP_VolumeTrailParms(SOP_VolumeTrailParms &&) noexcept = default;
98  SOP_VolumeTrailParms &operator=(SOP_VolumeTrailParms &&) noexcept = default;
99 
100  ~SOP_VolumeTrailParms() override {}
101 
103  {
104  if (myGroup != src.myGroup) return false;
105  if (myVelField != src.myVelField) return false;
106  if (myAdvectionChoice != src.myAdvectionChoice) return false;
107  if (myTrailLen != src.myTrailLen) return false;
108  if (myUseCFL != src.myUseCFL) return false;
109  if (myCFL != src.myCFL) return false;
110  if (myNumSteps != src.myNumSteps) return false;
111  if (myUseMaxSteps != src.myUseMaxSteps) return false;
112  if (myMaxSteps != src.myMaxSteps) return false;
113  if (myKeep != src.myKeep) return false;
114  if (myVisEnable != src.myVisEnable) return false;
115  if (myDetectRange != src.myDetectRange) return false;
116  if (myVisMax != src.myVisMax) return false;
117  if (myVisRamp != src.myVisRamp) return false;
118  if (myCdRamp != src.myCdRamp)
119  { if (!myCdRamp || !src.myCdRamp || !(*myCdRamp == *src.myCdRamp)) return false; }
120 
121 
122  if (baseGetSignature() != src.baseGetSignature()) return false;
123 
124  return true;
125  }
127  {
128  return !operator==(src);
129  }
132 
133 
134 
135  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
136  {
137  myGroup = ""_UTsh;
138  if (true)
139  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
140  myVelField = ""_UTsh;
141  if (true)
142  graph->evalOpParm(myVelField, nodeidx, "velfield", time, graph->isDirect()?nullptr:depnode);
143  myAdvectionChoice = 0;
144  if (true)
145  graph->evalOpParm(myAdvectionChoice, nodeidx, "advectionchoice", time, graph->isDirect()?nullptr:depnode);
146  myTrailLen = 1;
147  if (true)
148  graph->evalOpParm(myTrailLen, nodeidx, "traillen", time, graph->isDirect()?nullptr:depnode);
149  myUseCFL = true;
150  if (true)
151  graph->evalOpParm(myUseCFL, nodeidx, "usecfl", time, graph->isDirect()?nullptr:depnode);
152  myCFL = 0.5;
153  if (true && ( (true&&!(((getUseCFL()==0)))) ) )
154  graph->evalOpParm(myCFL, nodeidx, "cfl", time, graph->isDirect()?nullptr:depnode);
155  myNumSteps = 10;
156  if (true && ( (true&&!(((getUseCFL()==1)))) ) )
157  graph->evalOpParm(myNumSteps, nodeidx, "numsteps", time, graph->isDirect()?nullptr:depnode);
158  myUseMaxSteps = true;
159  if (true)
160  graph->evalOpParm(myUseMaxSteps, nodeidx, "usemaxsteps", time, graph->isDirect()?nullptr:depnode);
161  myMaxSteps = 1000;
162  if (true && ( (true&&!(((getUseMaxSteps()==0)))) ) )
163  graph->evalOpParm(myMaxSteps, nodeidx, "maxsteps", time, graph->isDirect()?nullptr:depnode);
164  myKeep = false;
165  if (true)
166  graph->evalOpParm(myKeep, nodeidx, "keep", time, graph->isDirect()?nullptr:depnode);
167  myVisEnable = true;
168  if (true)
169  graph->evalOpParm(myVisEnable, nodeidx, "visenable", time, graph->isDirect()?nullptr:depnode);
170  myDetectRange = true;
171  if (true && ( (true&&!(((getVisEnable()==0)))) ) )
172  graph->evalOpParm(myDetectRange, nodeidx, "detectrange", time, graph->isDirect()?nullptr:depnode);
173  myVisMax = 1;
174  if (true && ( (true&&!(((getVisEnable()==0)))) ) )
175  graph->evalOpParm(myVisMax, nodeidx, "vismax", time, graph->isDirect()?nullptr:depnode);
176  myVisRamp = 0;
177  if (true && ( (true&&!(((getVisEnable()==0)))) ) )
178  graph->evalOpParm(myVisRamp, nodeidx, "visramp", time, graph->isDirect()?nullptr:depnode);
179  myCdRamp = UT_SharedPtr<UT_Ramp>(0);
180  if (true && ( (true&&!(((getVisEnable()==0))||((int64(getVisRamp())!=5)))) ) )
181  graph->evalOpParm(myCdRamp, nodeidx, "cdramp", time, graph->isDirect()?nullptr:depnode);
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 OP_NodeParms *src) override
193  {
194  *this = *((const SOP_VolumeTrailParms *)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, myGroup);
210  break;
211  case 1:
212  coerceValue(value, myVelField);
213  break;
214  case 2:
215  coerceValue(value, myAdvectionChoice);
216  break;
217  case 3:
218  coerceValue(value, myTrailLen);
219  break;
220  case 4:
221  coerceValue(value, myUseCFL);
222  break;
223  case 5:
224  coerceValue(value, myCFL);
225  break;
226  case 6:
227  coerceValue(value, myNumSteps);
228  break;
229  case 7:
230  coerceValue(value, myUseMaxSteps);
231  break;
232  case 8:
233  coerceValue(value, myMaxSteps);
234  break;
235  case 9:
236  coerceValue(value, myKeep);
237  break;
238  case 10:
239  coerceValue(value, myVisEnable);
240  break;
241  case 11:
242  coerceValue(value, myDetectRange);
243  break;
244  case 12:
245  coerceValue(value, myVisMax);
246  break;
247  case 13:
248  coerceValue(value, myVisRamp);
249  break;
250  case 14:
251  coerceValue(value, myCdRamp);
252  break;
253 
254  }
255  }
256 
257  bool isParmColorRamp(exint idx) const override
258  {
259  switch (idx)
260  {
261  case 14:
262  return true;
263  }
264  return false;
265  }
266 
267  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
268  { doGetParmValue(idx, instance, value); }
269  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
270  { doGetParmValue(idx, instance, value); }
271  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
272  { doGetParmValue(idx, instance, value); }
273  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
274  { doGetParmValue(idx, instance, value); }
275  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
276  { doGetParmValue(idx, instance, value); }
277  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
278  { doGetParmValue(idx, instance, value); }
279  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
280  { doGetParmValue(idx, instance, value); }
281  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
282  { doGetParmValue(idx, instance, value); }
283  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
284  { doGetParmValue(idx, instance, value); }
285  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
286  { doGetParmValue(idx, instance, value); }
287  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
288  { doGetParmValue(idx, instance, value); }
289 
290  template <typename T>
291  void
292  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
293  {
294  if (idx.size() < 1)
295  return;
296  UT_ASSERT(idx.size() == instance.size()+1);
297  if (idx.size() != instance.size()+1)
298  return;
299  switch (idx[0])
300  {
301  case 0:
302  coerceValue(myGroup, ( ( value ) ));
303  break;
304  case 1:
305  coerceValue(myVelField, ( ( value ) ));
306  break;
307  case 2:
308  coerceValue(myAdvectionChoice, clampMinValue(0, clampMaxValue(1, value ) ));
309  break;
310  case 3:
311  coerceValue(myTrailLen, ( ( value ) ));
312  break;
313  case 4:
314  coerceValue(myUseCFL, ( ( value ) ));
315  break;
316  case 5:
317  coerceValue(myCFL, ( ( value ) ));
318  break;
319  case 6:
320  coerceValue(myNumSteps, clampMinValue(1, ( value ) ));
321  break;
322  case 7:
323  coerceValue(myUseMaxSteps, ( ( value ) ));
324  break;
325  case 8:
326  coerceValue(myMaxSteps, clampMinValue(1, ( value ) ));
327  break;
328  case 9:
329  coerceValue(myKeep, ( ( value ) ));
330  break;
331  case 10:
332  coerceValue(myVisEnable, ( ( value ) ));
333  break;
334  case 11:
335  coerceValue(myDetectRange, ( ( value ) ));
336  break;
337  case 12:
338  coerceValue(myVisMax, ( ( value ) ));
339  break;
340  case 13:
341  coerceValue(myVisRamp, clampMinValue(0, clampMaxValue(5, value ) ));
342  break;
343  case 14:
344  coerceValue(myCdRamp, clampMinValue(1, ( value ) ));
345  break;
346 
347  }
348  }
349 
350  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
351  { doSetParmValue(idx, instance, value); }
352  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
353  { doSetParmValue(idx, instance, value); }
354  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
355  { doSetParmValue(idx, instance, value); }
356  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
357  { doSetParmValue(idx, instance, value); }
358  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
359  { doSetParmValue(idx, instance, value); }
360  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
361  { doSetParmValue(idx, instance, value); }
362  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
363  { doSetParmValue(idx, instance, value); }
364  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
365  { doSetParmValue(idx, instance, value); }
366  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
367  { doSetParmValue(idx, instance, value); }
368  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
369  { doSetParmValue(idx, instance, value); }
370  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
371  { doSetParmValue(idx, instance, value); }
372 
373  exint getNestNumParms(TempIndex idx) const override
374  {
375  if (idx.size() == 0)
376  return 15;
377  switch (idx[0])
378  {
379 
380  }
381  // Invalid
382  return 0;
383  }
384 
385  const char *getNestParmName(TempIndex fieldnum) const override
386  {
387  if (fieldnum.size() < 1)
388  return 0;
389  switch (fieldnum[0])
390  {
391  case 0:
392  return "group";
393  case 1:
394  return "velfield";
395  case 2:
396  return "advectionchoice";
397  case 3:
398  return "traillen";
399  case 4:
400  return "usecfl";
401  case 5:
402  return "cfl";
403  case 6:
404  return "numsteps";
405  case 7:
406  return "usemaxsteps";
407  case 8:
408  return "maxsteps";
409  case 9:
410  return "keep";
411  case 10:
412  return "visenable";
413  case 11:
414  return "detectrange";
415  case 12:
416  return "vismax";
417  case 13:
418  return "visramp";
419  case 14:
420  return "cdramp";
421 
422  }
423  return 0;
424  }
425 
426  ParmType getNestParmType(TempIndex fieldnum) const override
427  {
428  if (fieldnum.size() < 1)
429  return PARM_UNSUPPORTED;
430  switch (fieldnum[0])
431  {
432  case 0:
433  return PARM_STRING;
434  case 1:
435  return PARM_STRING;
436  case 2:
437  return PARM_INTEGER;
438  case 3:
439  return PARM_FLOAT;
440  case 4:
441  return PARM_INTEGER;
442  case 5:
443  return PARM_FLOAT;
444  case 6:
445  return PARM_INTEGER;
446  case 7:
447  return PARM_INTEGER;
448  case 8:
449  return PARM_INTEGER;
450  case 9:
451  return PARM_INTEGER;
452  case 10:
453  return PARM_INTEGER;
454  case 11:
455  return PARM_INTEGER;
456  case 12:
457  return PARM_FLOAT;
458  case 13:
459  return PARM_INTEGER;
460  case 14:
461  return PARM_RAMP;
462 
463  }
464  return PARM_UNSUPPORTED;
465  }
466 
467  // Boiler plate to load individual types.
468  static void loadData(UT_IStream &is, int64 &v)
469  { is.bread(&v, 1); }
470  static void loadData(UT_IStream &is, bool &v)
471  { int64 iv; is.bread(&iv, 1); v = iv; }
472  static void loadData(UT_IStream &is, fpreal64 &v)
473  { is.bread<fpreal64>(&v, 1); }
474  static void loadData(UT_IStream &is, UT_Vector2D &v)
475  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
476  static void loadData(UT_IStream &is, UT_Vector3D &v)
477  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
478  is.bread<fpreal64>(&v.z(), 1); }
479  static void loadData(UT_IStream &is, UT_Vector4D &v)
480  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
481  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
482  static void loadData(UT_IStream &is, UT_Matrix2D &v)
483  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
484  static void loadData(UT_IStream &is, UT_Matrix3D &v)
485  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
486  static void loadData(UT_IStream &is, UT_Matrix4D &v)
487  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
488  static void loadData(UT_IStream &is, UT_Vector2I &v)
489  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
490  static void loadData(UT_IStream &is, UT_Vector3I &v)
491  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
492  is.bread<int64>(&v.z(), 1); }
493  static void loadData(UT_IStream &is, UT_Vector4I &v)
494  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
495  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
497  { is.bread(v); }
499  { UT_StringHolder rampdata;
500  loadData(is, rampdata);
501  if (rampdata.isstring())
502  {
503  v.reset(new UT_Ramp());
504  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
505  v->load(istr);
506  }
507  else v.reset();
508  }
511  loadData(is, data);
512  if (data.isstring())
513  {
514  // Find the data type.
515  const char *colon = UT_StringWrap(data).findChar(':');
516  if (colon)
517  {
518  int typelen = colon - data.buffer();
520  type.strncpy(data.buffer(), typelen);
521  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
522 
523  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
524  }
525  }
526  else v.reset();
527  }
528 
529  static void saveData(std::ostream &os, int64 v)
530  { UTwrite(os, &v); }
531  static void saveData(std::ostream &os, bool v)
532  { int64 iv = v; UTwrite(os, &iv); }
533  static void saveData(std::ostream &os, fpreal64 v)
534  { UTwrite<fpreal64>(os, &v); }
535  static void saveData(std::ostream &os, UT_Vector2D v)
536  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
537  static void saveData(std::ostream &os, UT_Vector3D v)
538  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
539  UTwrite<fpreal64>(os, &v.z()); }
540  static void saveData(std::ostream &os, UT_Vector4D v)
541  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
542  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
543  static void saveData(std::ostream &os, UT_Matrix2D v)
545  static void saveData(std::ostream &os, UT_Matrix3D v)
547  static void saveData(std::ostream &os, UT_Matrix4D v)
549  static void saveData(std::ostream &os, UT_StringHolder s)
550  { UT_StringWrap(s).saveBinary(os); }
551  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
553  UT_OStringStream ostr;
554  if (s) s->save(ostr);
555  result = ostr.str();
556  saveData(os, result);
557  }
558  static void saveData(std::ostream &os, PRM_DataItemHandle s)
560  UT_OStringStream ostr;
561  if (s)
562  {
563  ostr << s->getDataTypeToken();
564  ostr << ":";
565  s->saveBinary(ostr);
566  }
567  result = ostr.str();
568  saveData(os, result);
569  }
570 
571 
572  void save(std::ostream &os) const
573  {
574  int32 v = version();
575  UTwrite(os, &v);
576  saveData(os, myGroup);
577  saveData(os, myVelField);
578  saveData(os, myAdvectionChoice);
579  saveData(os, myTrailLen);
580  saveData(os, myUseCFL);
581  saveData(os, myCFL);
582  saveData(os, myNumSteps);
583  saveData(os, myUseMaxSteps);
584  saveData(os, myMaxSteps);
585  saveData(os, myKeep);
586  saveData(os, myVisEnable);
587  saveData(os, myDetectRange);
588  saveData(os, myVisMax);
589  saveData(os, myVisRamp);
590  saveData(os, myCdRamp);
591 
592  }
593 
594  bool load(UT_IStream &is)
595  {
596  int32 v;
597  is.bread(&v, 1);
598  if (version() != v)
599  {
600  // Fail incompatible versions
601  return false;
602  }
603  loadData(is, myGroup);
604  loadData(is, myVelField);
605  loadData(is, myAdvectionChoice);
606  loadData(is, myTrailLen);
607  loadData(is, myUseCFL);
608  loadData(is, myCFL);
609  loadData(is, myNumSteps);
610  loadData(is, myUseMaxSteps);
611  loadData(is, myMaxSteps);
612  loadData(is, myKeep);
613  loadData(is, myVisEnable);
614  loadData(is, myDetectRange);
615  loadData(is, myVisMax);
616  loadData(is, myVisRamp);
617  loadData(is, myCdRamp);
618 
619  return true;
620  }
621 
622  const UT_StringHolder & getGroup() const { return myGroup; }
623  void setGroup(const UT_StringHolder & val) { myGroup = val; }
625  {
626  SOP_Node *thissop = cookparms.getNode();
627  if (!thissop) return getGroup();
629  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
630  return result;
631  }
632  const UT_StringHolder & getVelField() const { return myVelField; }
633  void setVelField(const UT_StringHolder & val) { myVelField = val; }
635  {
636  SOP_Node *thissop = cookparms.getNode();
637  if (!thissop) return getVelField();
639  OP_Utils::evalOpParm(result, thissop, "velfield", cookparms.getCookTime(), 0);
640  return result;
641  }
642  AdvectionChoice getAdvectionChoice() const { return AdvectionChoice(myAdvectionChoice); }
643  void setAdvectionChoice(AdvectionChoice val) { myAdvectionChoice = int64(val); }
645  {
646  SOP_Node *thissop = cookparms.getNode();
647  if (!thissop) return getAdvectionChoice();
648  int64 result;
649  OP_Utils::evalOpParm(result, thissop, "advectionchoice", cookparms.getCookTime(), 0);
650  return AdvectionChoice(result);
651  }
652  fpreal64 getTrailLen() const { return myTrailLen; }
653  void setTrailLen(fpreal64 val) { myTrailLen = val; }
655  {
656  SOP_Node *thissop = cookparms.getNode();
657  if (!thissop) return getTrailLen();
659  OP_Utils::evalOpParm(result, thissop, "traillen", cookparms.getCookTime(), 0);
660  return result;
661  }
662  bool getUseCFL() const { return myUseCFL; }
663  void setUseCFL(bool val) { myUseCFL = val; }
664  bool opUseCFL(const SOP_NodeVerb::CookParms &cookparms) const
665  {
666  SOP_Node *thissop = cookparms.getNode();
667  if (!thissop) return getUseCFL();
668  bool result;
669  OP_Utils::evalOpParm(result, thissop, "usecfl", cookparms.getCookTime(), 0);
670  return result;
671  }
672  fpreal64 getCFL() const { return myCFL; }
673  void setCFL(fpreal64 val) { myCFL = val; }
674  fpreal64 opCFL(const SOP_NodeVerb::CookParms &cookparms) const
675  {
676  SOP_Node *thissop = cookparms.getNode();
677  if (!thissop) return getCFL();
679  OP_Utils::evalOpParm(result, thissop, "cfl", cookparms.getCookTime(), 0);
680  return result;
681  }
682  int64 getNumSteps() const { return myNumSteps; }
683  void setNumSteps(int64 val) { myNumSteps = val; }
684  int64 opNumSteps(const SOP_NodeVerb::CookParms &cookparms) const
685  {
686  SOP_Node *thissop = cookparms.getNode();
687  if (!thissop) return getNumSteps();
688  int64 result;
689  OP_Utils::evalOpParm(result, thissop, "numsteps", cookparms.getCookTime(), 0);
690  return result;
691  }
692  bool getUseMaxSteps() const { return myUseMaxSteps; }
693  void setUseMaxSteps(bool val) { myUseMaxSteps = val; }
694  bool opUseMaxSteps(const SOP_NodeVerb::CookParms &cookparms) const
695  {
696  SOP_Node *thissop = cookparms.getNode();
697  if (!thissop) return getUseMaxSteps();
698  bool result;
699  OP_Utils::evalOpParm(result, thissop, "usemaxsteps", cookparms.getCookTime(), 0);
700  return result;
701  }
702  int64 getMaxSteps() const { return myMaxSteps; }
703  void setMaxSteps(int64 val) { myMaxSteps = val; }
704  int64 opMaxSteps(const SOP_NodeVerb::CookParms &cookparms) const
705  {
706  SOP_Node *thissop = cookparms.getNode();
707  if (!thissop) return getMaxSteps();
708  int64 result;
709  OP_Utils::evalOpParm(result, thissop, "maxsteps", cookparms.getCookTime(), 0);
710  return result;
711  }
712  bool getKeep() const { return myKeep; }
713  void setKeep(bool val) { myKeep = val; }
714  bool opKeep(const SOP_NodeVerb::CookParms &cookparms) const
715  {
716  SOP_Node *thissop = cookparms.getNode();
717  if (!thissop) return getKeep();
718  bool result;
719  OP_Utils::evalOpParm(result, thissop, "keep", cookparms.getCookTime(), 0);
720  return result;
721  }
722  bool getVisEnable() const { return myVisEnable; }
723  void setVisEnable(bool val) { myVisEnable = val; }
724  bool opVisEnable(const SOP_NodeVerb::CookParms &cookparms) const
725  {
726  SOP_Node *thissop = cookparms.getNode();
727  if (!thissop) return getVisEnable();
728  bool result;
729  OP_Utils::evalOpParm(result, thissop, "visenable", cookparms.getCookTime(), 0);
730  return result;
731  }
732  bool getDetectRange() const { return myDetectRange; }
733  void setDetectRange(bool val) { myDetectRange = val; }
734  bool opDetectRange(const SOP_NodeVerb::CookParms &cookparms) const
735  {
736  SOP_Node *thissop = cookparms.getNode();
737  if (!thissop) return getDetectRange();
738  bool result;
739  OP_Utils::evalOpParm(result, thissop, "detectrange", cookparms.getCookTime(), 0);
740  return result;
741  }
742  fpreal64 getVisMax() const { return myVisMax; }
743  void setVisMax(fpreal64 val) { myVisMax = val; }
744  fpreal64 opVisMax(const SOP_NodeVerb::CookParms &cookparms) const
745  {
746  SOP_Node *thissop = cookparms.getNode();
747  if (!thissop) return getVisMax();
749  OP_Utils::evalOpParm(result, thissop, "vismax", cookparms.getCookTime(), 0);
750  return result;
751  }
752  VisRamp getVisRamp() const { return VisRamp(myVisRamp); }
753  void setVisRamp(VisRamp val) { myVisRamp = int64(val); }
754  VisRamp opVisRamp(const SOP_NodeVerb::CookParms &cookparms) const
755  {
756  SOP_Node *thissop = cookparms.getNode();
757  if (!thissop) return getVisRamp();
758  int64 result;
759  OP_Utils::evalOpParm(result, thissop, "visramp", cookparms.getCookTime(), 0);
760  return VisRamp(result);
761  }
762  UT_SharedPtr<UT_Ramp> getCdRamp() const { return myCdRamp; }
763  void setCdRamp(UT_SharedPtr<UT_Ramp> val) { myCdRamp = val; }
765  {
766  SOP_Node *thissop = cookparms.getNode();
767  if (!thissop) return getCdRamp();
769  OP_Utils::evalOpParm(result, thissop, "cdramp", cookparms.getCookTime(), 0);
770  return result;
771  }
772 
773 private:
774  UT_StringHolder myGroup;
775  UT_StringHolder myVelField;
776  int64 myAdvectionChoice;
777  fpreal64 myTrailLen;
778  bool myUseCFL;
779  fpreal64 myCFL;
780  int64 myNumSteps;
781  bool myUseMaxSteps;
782  int64 myMaxSteps;
783  bool myKeep;
784  bool myVisEnable;
785  bool myDetectRange;
786  fpreal64 myVisMax;
787  int64 myVisRamp;
788  UT_SharedPtr<UT_Ramp> myCdRamp;
789 
790 };
type
Definition: core.h:556
void loadFromOpSubclass(const LoadParms &loadparms) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, bool &v)
fpreal64 opCFL(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setCdRamp(UT_SharedPtr< UT_Ramp > val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, bool v)
const UT_StringHolder & getVelField() const
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
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, int64 &v)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
exint getNestNumParms(TempIndex idx) const override
VisRamp opVisRamp(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
static void saveData(std::ostream &os, UT_Matrix4D v)
void setCFL(fpreal64 val)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
static void loadData(UT_IStream &is, UT_Vector3D &v)
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
**But if you need a result
Definition: thread.h:622
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
const char * getNestParmName(TempIndex fieldnum) const override
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.
bool opKeep(const SOP_NodeVerb::CookParms &cookparms) const
bool opVisEnable(const SOP_NodeVerb::CookParms &cookparms) const
void setAdvectionChoice(AdvectionChoice val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal64 getTrailLen() const
UT_SharedPtr< UT_Ramp > opCdRamp(const SOP_NodeVerb::CookParms &cookparms) const
bool load(UT_IStream &is)
bool opUseCFL(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
static void saveData(std::ostream &os, UT_Vector4D v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
bool opUseMaxSteps(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void loadData(UT_IStream &is, UT_Vector4D &v)
fpreal64 opVisMax(const SOP_NodeVerb::CookParms &cookparms) const
bool opDetectRange(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
static void loadData(UT_IStream &is, fpreal64 &v)
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void loadData(UT_IStream &is, UT_StringHolder &v)
int64 opNumSteps(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
UT_StringHolder opVelField(const SOP_NodeVerb::CookParms &cookparms) const
long long int64
Definition: SYS_Types.h:116
static void saveData(std::ostream &os, int64 v)
AdvectionChoice opAdvectionChoice(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setGroup(const UT_StringHolder &val)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, UT_Vector2D v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setVisRamp(VisRamp val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
bool operator!=(const SOP_VolumeTrailParms &src) const
bool isParmColorRamp(exint idx) const override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
void save(std::ostream &os) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
static void saveData(std::ostream &os, UT_Matrix3D v)
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
#define SOP_API
Definition: SOP_API.h:10
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setTrailLen(fpreal64 val)
UT_SharedPtr< UT_Ramp > getCdRamp() const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
void setVelField(const UT_StringHolder &val)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
bool operator==(const SOP_VolumeTrailParms &src) const
AdvectionChoice getAdvectionChoice() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
GLboolean r
Definition: glcorearb.h:1222
void setVisMax(fpreal64 val)
fpreal64 opTrailLen(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
SYS_FORCE_INLINE UT_StringHolder getToken(AdvectionChoice enum_value)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
fpreal64 getVisMax() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
int64 opMaxSteps(const SOP_NodeVerb::CookParms &cookparms) const