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 <SOP/SOP_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  return true;
122  }
124  {
125  return !operator==(src);
126  }
129 
130 
131 
132  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
133  {
134  myGroup = ""_UTsh;
135  if (true)
136  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
137  myVelField = ""_UTsh;
138  if (true)
139  graph->evalOpParm(myVelField, nodeidx, "velfield", time, 0);
140  myAdvectionChoice = 0;
141  if (true)
142  graph->evalOpParm(myAdvectionChoice, nodeidx, "advectionchoice", time, 0);
143  myTrailLen = 1;
144  if (true)
145  graph->evalOpParm(myTrailLen, nodeidx, "traillen", time, 0);
146  myUseCFL = true;
147  if (true)
148  graph->evalOpParm(myUseCFL, nodeidx, "usecfl", time, 0);
149  myCFL = 0.5;
150  if (true && ( (true&&!(((getUseCFL()==0)))) ) )
151  graph->evalOpParm(myCFL, nodeidx, "cfl", time, 0);
152  myNumSteps = 10;
153  if (true && ( (true&&!(((getUseCFL()==1)))) ) )
154  graph->evalOpParm(myNumSteps, nodeidx, "numsteps", time, 0);
155  myUseMaxSteps = true;
156  if (true)
157  graph->evalOpParm(myUseMaxSteps, nodeidx, "usemaxsteps", time, 0);
158  myMaxSteps = 1000;
159  if (true && ( (true&&!(((getUseMaxSteps()==0)))) ) )
160  graph->evalOpParm(myMaxSteps, nodeidx, "maxsteps", time, 0);
161  myKeep = false;
162  if (true)
163  graph->evalOpParm(myKeep, nodeidx, "keep", time, 0);
164  myVisEnable = true;
165  if (true)
166  graph->evalOpParm(myVisEnable, nodeidx, "visenable", time, 0);
167  myDetectRange = true;
168  if (true && ( (true&&!(((getVisEnable()==0)))) ) )
169  graph->evalOpParm(myDetectRange, nodeidx, "detectrange", time, 0);
170  myVisMax = 1;
171  if (true && ( (true&&!(((getVisEnable()==0)))) ) )
172  graph->evalOpParm(myVisMax, nodeidx, "vismax", time, 0);
173  myVisRamp = 0;
174  if (true && ( (true&&!(((getVisEnable()==0)))) ) )
175  graph->evalOpParm(myVisRamp, nodeidx, "visramp", time, 0);
176  myCdRamp = UT_SharedPtr<UT_Ramp>(0);
177  if (true && ( (true&&!(((getVisEnable()==0))||((int64(getVisRamp())!=5)))) ) )
178  graph->evalOpParm(myCdRamp, nodeidx, "cdramp", time, 0);
179 
180  }
181 
182 
183  void loadFromOpSubclass(const LoadParms &loadparms) override
184  {
185  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
186  }
187 
188 
189  void copyFrom(const OP_NodeParms *src) override
190  {
191  *this = *((const SOP_VolumeTrailParms *)src);
192  }
193 
194  template <typename T>
195  void
196  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
197  {
198  if (idx.size() < 1)
199  return;
200  UT_ASSERT(idx.size() == instance.size()+1);
201  if (idx.size() != instance.size()+1)
202  return;
203  switch (idx[0])
204  {
205  case 0:
206  coerceValue(value, myGroup);
207  break;
208  case 1:
209  coerceValue(value, myVelField);
210  break;
211  case 2:
212  coerceValue(value, myAdvectionChoice);
213  break;
214  case 3:
215  coerceValue(value, myTrailLen);
216  break;
217  case 4:
218  coerceValue(value, myUseCFL);
219  break;
220  case 5:
221  coerceValue(value, myCFL);
222  break;
223  case 6:
224  coerceValue(value, myNumSteps);
225  break;
226  case 7:
227  coerceValue(value, myUseMaxSteps);
228  break;
229  case 8:
230  coerceValue(value, myMaxSteps);
231  break;
232  case 9:
233  coerceValue(value, myKeep);
234  break;
235  case 10:
236  coerceValue(value, myVisEnable);
237  break;
238  case 11:
239  coerceValue(value, myDetectRange);
240  break;
241  case 12:
242  coerceValue(value, myVisMax);
243  break;
244  case 13:
245  coerceValue(value, myVisRamp);
246  break;
247  case 14:
248  coerceValue(value, myCdRamp);
249  break;
250 
251  }
252  }
253 
254  bool isParmColorRamp(exint idx) const override
255  {
256  switch (idx)
257  {
258  case 14:
259  return true;
260  }
261  return false;
262  }
263 
264  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
265  { doGetParmValue(idx, instance, value); }
266  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
267  { doGetParmValue(idx, instance, value); }
268  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
269  { doGetParmValue(idx, instance, value); }
270  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
271  { doGetParmValue(idx, instance, value); }
272  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
273  { doGetParmValue(idx, instance, value); }
274  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
275  { doGetParmValue(idx, instance, value); }
276  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
277  { doGetParmValue(idx, instance, value); }
278  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
279  { doGetParmValue(idx, instance, value); }
280  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
281  { doGetParmValue(idx, instance, value); }
282  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
283  { doGetParmValue(idx, instance, value); }
284  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
285  { doGetParmValue(idx, instance, value); }
286 
287  template <typename T>
288  void
289  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
290  {
291  if (idx.size() < 1)
292  return;
293  UT_ASSERT(idx.size() == instance.size()+1);
294  if (idx.size() != instance.size()+1)
295  return;
296  switch (idx[0])
297  {
298  case 0:
299  coerceValue(myGroup, ( ( value ) ));
300  break;
301  case 1:
302  coerceValue(myVelField, ( ( value ) ));
303  break;
304  case 2:
305  coerceValue(myAdvectionChoice, clampMinValue(0, clampMaxValue(1, value ) ));
306  break;
307  case 3:
308  coerceValue(myTrailLen, ( ( value ) ));
309  break;
310  case 4:
311  coerceValue(myUseCFL, ( ( value ) ));
312  break;
313  case 5:
314  coerceValue(myCFL, ( ( value ) ));
315  break;
316  case 6:
317  coerceValue(myNumSteps, clampMinValue(1, ( value ) ));
318  break;
319  case 7:
320  coerceValue(myUseMaxSteps, ( ( value ) ));
321  break;
322  case 8:
323  coerceValue(myMaxSteps, clampMinValue(1, ( value ) ));
324  break;
325  case 9:
326  coerceValue(myKeep, ( ( value ) ));
327  break;
328  case 10:
329  coerceValue(myVisEnable, ( ( value ) ));
330  break;
331  case 11:
332  coerceValue(myDetectRange, ( ( value ) ));
333  break;
334  case 12:
335  coerceValue(myVisMax, ( ( value ) ));
336  break;
337  case 13:
338  coerceValue(myVisRamp, clampMinValue(0, clampMaxValue(5, value ) ));
339  break;
340  case 14:
341  coerceValue(myCdRamp, clampMinValue(1, ( value ) ));
342  break;
343 
344  }
345  }
346 
347  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
348  { doSetParmValue(idx, instance, value); }
349  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
350  { doSetParmValue(idx, instance, value); }
351  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
352  { doSetParmValue(idx, instance, value); }
353  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
354  { doSetParmValue(idx, instance, value); }
355  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
356  { doSetParmValue(idx, instance, value); }
357  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
358  { doSetParmValue(idx, instance, value); }
359  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
360  { doSetParmValue(idx, instance, value); }
361  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
362  { doSetParmValue(idx, instance, value); }
363  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
364  { doSetParmValue(idx, instance, value); }
365  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
366  { doSetParmValue(idx, instance, value); }
367  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
368  { doSetParmValue(idx, instance, value); }
369 
370  exint getNestNumParms(TempIndex idx) const override
371  {
372  if (idx.size() == 0)
373  return 15;
374  switch (idx[0])
375  {
376 
377  }
378  // Invalid
379  return 0;
380  }
381 
382  const char *getNestParmName(TempIndex fieldnum) const override
383  {
384  if (fieldnum.size() < 1)
385  return 0;
386  switch (fieldnum[0])
387  {
388  case 0:
389  return "group";
390  case 1:
391  return "velfield";
392  case 2:
393  return "advectionchoice";
394  case 3:
395  return "traillen";
396  case 4:
397  return "usecfl";
398  case 5:
399  return "cfl";
400  case 6:
401  return "numsteps";
402  case 7:
403  return "usemaxsteps";
404  case 8:
405  return "maxsteps";
406  case 9:
407  return "keep";
408  case 10:
409  return "visenable";
410  case 11:
411  return "detectrange";
412  case 12:
413  return "vismax";
414  case 13:
415  return "visramp";
416  case 14:
417  return "cdramp";
418 
419  }
420  return 0;
421  }
422 
423  ParmType getNestParmType(TempIndex fieldnum) const override
424  {
425  if (fieldnum.size() < 1)
426  return PARM_UNSUPPORTED;
427  switch (fieldnum[0])
428  {
429  case 0:
430  return PARM_STRING;
431  case 1:
432  return PARM_STRING;
433  case 2:
434  return PARM_INTEGER;
435  case 3:
436  return PARM_FLOAT;
437  case 4:
438  return PARM_INTEGER;
439  case 5:
440  return PARM_FLOAT;
441  case 6:
442  return PARM_INTEGER;
443  case 7:
444  return PARM_INTEGER;
445  case 8:
446  return PARM_INTEGER;
447  case 9:
448  return PARM_INTEGER;
449  case 10:
450  return PARM_INTEGER;
451  case 11:
452  return PARM_INTEGER;
453  case 12:
454  return PARM_FLOAT;
455  case 13:
456  return PARM_INTEGER;
457  case 14:
458  return PARM_RAMP;
459 
460  }
461  return PARM_UNSUPPORTED;
462  }
463 
464  // Boiler plate to load individual types.
465  static void loadData(UT_IStream &is, int64 &v)
466  { is.bread(&v, 1); }
467  static void loadData(UT_IStream &is, bool &v)
468  { int64 iv; is.bread(&iv, 1); v = iv; }
469  static void loadData(UT_IStream &is, fpreal64 &v)
470  { is.bread<fpreal64>(&v, 1); }
471  static void loadData(UT_IStream &is, UT_Vector2D &v)
472  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
473  static void loadData(UT_IStream &is, UT_Vector3D &v)
474  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
475  is.bread<fpreal64>(&v.z(), 1); }
476  static void loadData(UT_IStream &is, UT_Vector4D &v)
477  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
478  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
479  static void loadData(UT_IStream &is, UT_Matrix2D &v)
480  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
481  static void loadData(UT_IStream &is, UT_Matrix3D &v)
482  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
483  static void loadData(UT_IStream &is, UT_Matrix4D &v)
484  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
485  static void loadData(UT_IStream &is, UT_Vector2I &v)
486  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
487  static void loadData(UT_IStream &is, UT_Vector3I &v)
488  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
489  is.bread<int64>(&v.z(), 1); }
490  static void loadData(UT_IStream &is, UT_Vector4I &v)
491  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
492  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
494  { is.bread(v); }
496  { UT_StringHolder rampdata;
497  loadData(is, rampdata);
498  if (rampdata.isstring())
499  {
500  v.reset(new UT_Ramp());
501  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
502  v->load(istr);
503  }
504  else v.reset();
505  }
508  loadData(is, data);
509  if (data.isstring())
510  {
511  // Find the data type.
512  const char *colon = UT_StringWrap(data).findChar(':');
513  if (colon)
514  {
515  int typelen = colon - data.buffer();
517  type.strncpy(data.buffer(), typelen);
518  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
519 
520  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
521  }
522  }
523  else v.reset();
524  }
525 
526  static void saveData(std::ostream &os, int64 v)
527  { UTwrite(os, &v); }
528  static void saveData(std::ostream &os, bool v)
529  { int64 iv = v; UTwrite(os, &iv); }
530  static void saveData(std::ostream &os, fpreal64 v)
531  { UTwrite<fpreal64>(os, &v); }
532  static void saveData(std::ostream &os, UT_Vector2D v)
533  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
534  static void saveData(std::ostream &os, UT_Vector3D v)
535  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
536  UTwrite<fpreal64>(os, &v.z()); }
537  static void saveData(std::ostream &os, UT_Vector4D v)
538  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
539  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
540  static void saveData(std::ostream &os, UT_Matrix2D v)
542  static void saveData(std::ostream &os, UT_Matrix3D v)
544  static void saveData(std::ostream &os, UT_Matrix4D v)
546  static void saveData(std::ostream &os, UT_StringHolder s)
547  { UT_StringWrap(s).saveBinary(os); }
548  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
550  UT_OStringStream ostr;
551  if (s) s->save(ostr);
552  result = ostr.str();
553  saveData(os, result);
554  }
555  static void saveData(std::ostream &os, PRM_DataItemHandle s)
557  UT_OStringStream ostr;
558  if (s)
559  {
560  ostr << s->getDataTypeToken();
561  ostr << ":";
562  s->saveBinary(ostr);
563  }
564  result = ostr.str();
565  saveData(os, result);
566  }
567 
568 
569  void save(std::ostream &os) const
570  {
571  int32 v = version();
572  UTwrite(os, &v);
573  saveData(os, myGroup);
574  saveData(os, myVelField);
575  saveData(os, myAdvectionChoice);
576  saveData(os, myTrailLen);
577  saveData(os, myUseCFL);
578  saveData(os, myCFL);
579  saveData(os, myNumSteps);
580  saveData(os, myUseMaxSteps);
581  saveData(os, myMaxSteps);
582  saveData(os, myKeep);
583  saveData(os, myVisEnable);
584  saveData(os, myDetectRange);
585  saveData(os, myVisMax);
586  saveData(os, myVisRamp);
587  saveData(os, myCdRamp);
588 
589  }
590 
591  bool load(UT_IStream &is)
592  {
593  int32 v;
594  is.bread(&v, 1);
595  if (version() != v)
596  {
597  // Fail incompatible versions
598  return false;
599  }
600  loadData(is, myGroup);
601  loadData(is, myVelField);
602  loadData(is, myAdvectionChoice);
603  loadData(is, myTrailLen);
604  loadData(is, myUseCFL);
605  loadData(is, myCFL);
606  loadData(is, myNumSteps);
607  loadData(is, myUseMaxSteps);
608  loadData(is, myMaxSteps);
609  loadData(is, myKeep);
610  loadData(is, myVisEnable);
611  loadData(is, myDetectRange);
612  loadData(is, myVisMax);
613  loadData(is, myVisRamp);
614  loadData(is, myCdRamp);
615 
616  return true;
617  }
618 
619  const UT_StringHolder & getGroup() const { return myGroup; }
620  void setGroup(const UT_StringHolder & val) { myGroup = val; }
622  {
623  SOP_Node *thissop = cookparms.getNode();
624  if (!thissop) return getGroup();
626  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
627  return result;
628  }
629  const UT_StringHolder & getVelField() const { return myVelField; }
630  void setVelField(const UT_StringHolder & val) { myVelField = val; }
632  {
633  SOP_Node *thissop = cookparms.getNode();
634  if (!thissop) return getVelField();
636  OP_Utils::evalOpParm(result, thissop, "velfield", cookparms.getCookTime(), 0);
637  return result;
638  }
639  AdvectionChoice getAdvectionChoice() const { return AdvectionChoice(myAdvectionChoice); }
640  void setAdvectionChoice(AdvectionChoice val) { myAdvectionChoice = int64(val); }
642  {
643  SOP_Node *thissop = cookparms.getNode();
644  if (!thissop) return getAdvectionChoice();
645  int64 result;
646  OP_Utils::evalOpParm(result, thissop, "advectionchoice", cookparms.getCookTime(), 0);
647  return AdvectionChoice(result);
648  }
649  fpreal64 getTrailLen() const { return myTrailLen; }
650  void setTrailLen(fpreal64 val) { myTrailLen = val; }
652  {
653  SOP_Node *thissop = cookparms.getNode();
654  if (!thissop) return getTrailLen();
656  OP_Utils::evalOpParm(result, thissop, "traillen", cookparms.getCookTime(), 0);
657  return result;
658  }
659  bool getUseCFL() const { return myUseCFL; }
660  void setUseCFL(bool val) { myUseCFL = val; }
661  bool opUseCFL(const SOP_NodeVerb::CookParms &cookparms) const
662  {
663  SOP_Node *thissop = cookparms.getNode();
664  if (!thissop) return getUseCFL();
665  bool result;
666  OP_Utils::evalOpParm(result, thissop, "usecfl", cookparms.getCookTime(), 0);
667  return result;
668  }
669  fpreal64 getCFL() const { return myCFL; }
670  void setCFL(fpreal64 val) { myCFL = val; }
671  fpreal64 opCFL(const SOP_NodeVerb::CookParms &cookparms) const
672  {
673  SOP_Node *thissop = cookparms.getNode();
674  if (!thissop) return getCFL();
676  OP_Utils::evalOpParm(result, thissop, "cfl", cookparms.getCookTime(), 0);
677  return result;
678  }
679  int64 getNumSteps() const { return myNumSteps; }
680  void setNumSteps(int64 val) { myNumSteps = val; }
681  int64 opNumSteps(const SOP_NodeVerb::CookParms &cookparms) const
682  {
683  SOP_Node *thissop = cookparms.getNode();
684  if (!thissop) return getNumSteps();
685  int64 result;
686  OP_Utils::evalOpParm(result, thissop, "numsteps", cookparms.getCookTime(), 0);
687  return result;
688  }
689  bool getUseMaxSteps() const { return myUseMaxSteps; }
690  void setUseMaxSteps(bool val) { myUseMaxSteps = val; }
691  bool opUseMaxSteps(const SOP_NodeVerb::CookParms &cookparms) const
692  {
693  SOP_Node *thissop = cookparms.getNode();
694  if (!thissop) return getUseMaxSteps();
695  bool result;
696  OP_Utils::evalOpParm(result, thissop, "usemaxsteps", cookparms.getCookTime(), 0);
697  return result;
698  }
699  int64 getMaxSteps() const { return myMaxSteps; }
700  void setMaxSteps(int64 val) { myMaxSteps = val; }
701  int64 opMaxSteps(const SOP_NodeVerb::CookParms &cookparms) const
702  {
703  SOP_Node *thissop = cookparms.getNode();
704  if (!thissop) return getMaxSteps();
705  int64 result;
706  OP_Utils::evalOpParm(result, thissop, "maxsteps", cookparms.getCookTime(), 0);
707  return result;
708  }
709  bool getKeep() const { return myKeep; }
710  void setKeep(bool val) { myKeep = val; }
711  bool opKeep(const SOP_NodeVerb::CookParms &cookparms) const
712  {
713  SOP_Node *thissop = cookparms.getNode();
714  if (!thissop) return getKeep();
715  bool result;
716  OP_Utils::evalOpParm(result, thissop, "keep", cookparms.getCookTime(), 0);
717  return result;
718  }
719  bool getVisEnable() const { return myVisEnable; }
720  void setVisEnable(bool val) { myVisEnable = val; }
721  bool opVisEnable(const SOP_NodeVerb::CookParms &cookparms) const
722  {
723  SOP_Node *thissop = cookparms.getNode();
724  if (!thissop) return getVisEnable();
725  bool result;
726  OP_Utils::evalOpParm(result, thissop, "visenable", cookparms.getCookTime(), 0);
727  return result;
728  }
729  bool getDetectRange() const { return myDetectRange; }
730  void setDetectRange(bool val) { myDetectRange = val; }
731  bool opDetectRange(const SOP_NodeVerb::CookParms &cookparms) const
732  {
733  SOP_Node *thissop = cookparms.getNode();
734  if (!thissop) return getDetectRange();
735  bool result;
736  OP_Utils::evalOpParm(result, thissop, "detectrange", cookparms.getCookTime(), 0);
737  return result;
738  }
739  fpreal64 getVisMax() const { return myVisMax; }
740  void setVisMax(fpreal64 val) { myVisMax = val; }
741  fpreal64 opVisMax(const SOP_NodeVerb::CookParms &cookparms) const
742  {
743  SOP_Node *thissop = cookparms.getNode();
744  if (!thissop) return getVisMax();
746  OP_Utils::evalOpParm(result, thissop, "vismax", cookparms.getCookTime(), 0);
747  return result;
748  }
749  VisRamp getVisRamp() const { return VisRamp(myVisRamp); }
750  void setVisRamp(VisRamp val) { myVisRamp = int64(val); }
751  VisRamp opVisRamp(const SOP_NodeVerb::CookParms &cookparms) const
752  {
753  SOP_Node *thissop = cookparms.getNode();
754  if (!thissop) return getVisRamp();
755  int64 result;
756  OP_Utils::evalOpParm(result, thissop, "visramp", cookparms.getCookTime(), 0);
757  return VisRamp(result);
758  }
759  UT_SharedPtr<UT_Ramp> getCdRamp() const { return myCdRamp; }
760  void setCdRamp(UT_SharedPtr<UT_Ramp> val) { myCdRamp = val; }
762  {
763  SOP_Node *thissop = cookparms.getNode();
764  if (!thissop) return getCdRamp();
766  OP_Utils::evalOpParm(result, thissop, "cdramp", cookparms.getCookTime(), 0);
767  return result;
768  }
769 
770 private:
771  UT_StringHolder myGroup;
772  UT_StringHolder myVelField;
773  int64 myAdvectionChoice;
774  fpreal64 myTrailLen;
775  bool myUseCFL;
776  fpreal64 myCFL;
777  int64 myNumSteps;
778  bool myUseMaxSteps;
779  int64 myMaxSteps;
780  bool myKeep;
781  bool myVisEnable;
782  bool myDetectRange;
783  fpreal64 myVisMax;
784  int64 myVisRamp;
785  UT_SharedPtr<UT_Ramp> myCdRamp;
786 
787 };
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:62
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)
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:613
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
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:296
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:277
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:92
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
#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:361
void setVelField(const UT_StringHolder &val)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
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
type
Definition: core.h:1059
SYS_FORCE_INLINE UT_StringHolder getToken(AdvectionChoice enum_value)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
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