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