HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_SBlend-2.0.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_SBlend_2_0Enums
24 {
25  enum class UnmatchedPoints
26  {
27  FREEZE = 0,
28  DELETE,
29  GROUP
30  };
31 
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case UnmatchedPoints::FREEZE: return "freeze"_sh;
38  case UnmatchedPoints::DELETE: return "delete"_sh;
39  case UnmatchedPoints::GROUP: return "group"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class VoxelBlend
45  {
46  NONE = 0,
48  BYVOXELPOS,
49  ADVECTED
50  };
51 
53  getToken(VoxelBlend enum_value)
54  {
55  using namespace UT::Literal;
56  switch (enum_value) {
57  case VoxelBlend::NONE: return "none"_sh;
58  case VoxelBlend::BYGRIDINDEX: return "bygridindex"_sh;
59  case VoxelBlend::BYVOXELPOS: return "byvoxelpos"_sh;
60  case VoxelBlend::ADVECTED: return "advected"_sh;
61  default: UT_ASSERT(false); return ""_sh;
62  }
63  }
64 
65  enum class Interp
66  {
67  LINEAR = 0,
68  CUBIC,
69  SUBD
70  };
71 
73  getToken(Interp enum_value)
74  {
75  using namespace UT::Literal;
76  switch (enum_value) {
77  case Interp::LINEAR: return "linear"_sh;
78  case Interp::CUBIC: return "cubic"_sh;
79  case Interp::SUBD: return "subd"_sh;
80  default: UT_ASSERT(false); return ""_sh;
81  }
82  }
83 
84 }
85 
86 
88 {
89 public:
90  static int version() { return 1; }
91 
93  {
94  myBlend = 0;
95  myAttribs = "*"_UTsh;
96  myPtIDAttr = "id"_UTsh;
97  myUnmatchedPoints = 0;
98  myUnmatchedPointGroup = "unmatched"_UTsh;
99  myPrimIDAttr = "name"_UTsh;
100  myVoxelBlend = 0;
101  myAdvectionDT = 0.0416667;
102  myVelocityField = "vel"_UTsh;
103  myDoSlerp = true;
104  myInterp = 0;
105  myUseVForPInterp = false;
106  myTimeStep = 0;
107 
108  }
109 
110  explicit SOP_SBlend_2_0Parms(const SOP_SBlend_2_0Parms &) = default;
112  SOP_SBlend_2_0Parms(SOP_SBlend_2_0Parms &&) noexcept = default;
113  SOP_SBlend_2_0Parms &operator=(SOP_SBlend_2_0Parms &&) noexcept = default;
114 
115  ~SOP_SBlend_2_0Parms() override {}
116 
117  bool operator==(const SOP_SBlend_2_0Parms &src) const
118  {
119  if (myBlend != src.myBlend) return false;
120  if (myAttribs != src.myAttribs) return false;
121  if (myPtIDAttr != src.myPtIDAttr) return false;
122  if (myUnmatchedPoints != src.myUnmatchedPoints) return false;
123  if (myUnmatchedPointGroup != src.myUnmatchedPointGroup) return false;
124  if (myPrimIDAttr != src.myPrimIDAttr) return false;
125  if (myVoxelBlend != src.myVoxelBlend) return false;
126  if (myAdvectionDT != src.myAdvectionDT) return false;
127  if (myVelocityField != src.myVelocityField) return false;
128  if (myDoSlerp != src.myDoSlerp) return false;
129  if (myInterp != src.myInterp) return false;
130  if (myUseVForPInterp != src.myUseVForPInterp) return false;
131  if (myTimeStep != src.myTimeStep) return false;
132 
133  return true;
134  }
135  bool operator!=(const SOP_SBlend_2_0Parms &src) const
136  {
137  return !operator==(src);
138  }
142 
143 
144 
145  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
146  {
147  myBlend = 0;
148  if (true)
149  graph->evalOpParm(myBlend, nodeidx, "blend", time, 0);
150  myAttribs = "*"_UTsh;
151  if (true)
152  graph->evalOpParm(myAttribs, nodeidx, "attribs", time, 0);
153  myPtIDAttr = "id"_UTsh;
154  if (true)
155  graph->evalOpParm(myPtIDAttr, nodeidx, "ptidattr", time, 0);
156  myUnmatchedPoints = 0;
157  if (true)
158  graph->evalOpParm(myUnmatchedPoints, nodeidx, "unmatchedpts", time, 0);
159  myUnmatchedPointGroup = "unmatched"_UTsh;
160  if (true && ( (true&&!(((int64(getUnmatchedPoints())!=2)))) ) )
161  graph->evalOpParm(myUnmatchedPointGroup, nodeidx, "unmatchedgroup", time, 0);
162  myPrimIDAttr = "name"_UTsh;
163  if (true)
164  graph->evalOpParm(myPrimIDAttr, nodeidx, "primidattr", time, 0);
165  myVoxelBlend = 0;
166  if (true)
167  graph->evalOpParm(myVoxelBlend, nodeidx, "voxelblend", time, 0);
168  myAdvectionDT = 0.0416667;
169  if (true && ( (true&&!(((int64(getVoxelBlend())!=3)))) ) )
170  graph->evalOpParm(myAdvectionDT, nodeidx, "adt", time, 0);
171  myVelocityField = "vel"_UTsh;
172  if (true && ( (true&&!(((int64(getVoxelBlend())!=3)))) ) )
173  graph->evalOpParm(myVelocityField, nodeidx, "velocity", time, 0);
174  myDoSlerp = true;
175  if (true)
176  graph->evalOpParm(myDoSlerp, nodeidx, "doslerp", time, 0);
177  myInterp = 0;
178  if (true)
179  graph->evalOpParm(myInterp, nodeidx, "interp", time, 0);
180  myUseVForPInterp = false;
181  if (true && ( (true&&!(((int64(getInterp())!=0)))) ) )
182  graph->evalOpParm(myUseVForPInterp, nodeidx, "usevforpinterp", time, 0);
183  myTimeStep = 0;
184  if (true && ( (true&&!(((getUseVForPInterp()==0)&&(int64(getVoxelBlend())!=3)))) ) )
185  graph->evalOpParm(myTimeStep, nodeidx, "timestep", time, 0);
186 
187  }
188 
189 
190  void loadFromOpSubclass(const LoadParms &loadparms) override
191  {
192  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
193  }
194 
195 
196  void copyFrom(const OP_NodeParms *src) override
197  {
198  *this = *((const SOP_SBlend_2_0Parms *)src);
199  }
200 
201  template <typename T>
202  void
203  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
204  {
205  if (idx.size() < 1)
206  return;
207  UT_ASSERT(idx.size() == instance.size()+1);
208  if (idx.size() != instance.size()+1)
209  return;
210  switch (idx[0])
211  {
212  case 0:
213  coerceValue(value, myBlend);
214  break;
215  case 1:
216  coerceValue(value, myAttribs);
217  break;
218  case 2:
219  coerceValue(value, myPtIDAttr);
220  break;
221  case 3:
222  coerceValue(value, myUnmatchedPoints);
223  break;
224  case 4:
225  coerceValue(value, myUnmatchedPointGroup);
226  break;
227  case 5:
228  coerceValue(value, myPrimIDAttr);
229  break;
230  case 6:
231  coerceValue(value, myVoxelBlend);
232  break;
233  case 7:
234  coerceValue(value, myAdvectionDT);
235  break;
236  case 8:
237  coerceValue(value, myVelocityField);
238  break;
239  case 9:
240  coerceValue(value, myDoSlerp);
241  break;
242  case 10:
243  coerceValue(value, myInterp);
244  break;
245  case 11:
246  coerceValue(value, myUseVForPInterp);
247  break;
248  case 12:
249  coerceValue(value, myTimeStep);
250  break;
251 
252  }
253  }
254 
255  bool isParmColorRamp(exint idx) const override
256  {
257  switch (idx)
258  {
259 
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(myBlend, clampMinValue(0, ( value ) ));
300  break;
301  case 1:
302  coerceValue(myAttribs, ( ( value ) ));
303  break;
304  case 2:
305  coerceValue(myPtIDAttr, ( ( value ) ));
306  break;
307  case 3:
308  coerceValue(myUnmatchedPoints, clampMinValue(0, clampMaxValue(2, value ) ));
309  break;
310  case 4:
311  coerceValue(myUnmatchedPointGroup, ( ( value ) ));
312  break;
313  case 5:
314  coerceValue(myPrimIDAttr, ( ( value ) ));
315  break;
316  case 6:
317  coerceValue(myVoxelBlend, clampMinValue(0, clampMaxValue(3, value ) ));
318  break;
319  case 7:
320  coerceValue(myAdvectionDT, clampMinValue(0, ( value ) ));
321  break;
322  case 8:
323  coerceValue(myVelocityField, ( ( value ) ));
324  break;
325  case 9:
326  coerceValue(myDoSlerp, ( ( value ) ));
327  break;
328  case 10:
329  coerceValue(myInterp, clampMinValue(0, clampMaxValue(2, value ) ));
330  break;
331  case 11:
332  coerceValue(myUseVForPInterp, ( ( value ) ));
333  break;
334  case 12:
335  coerceValue(myTimeStep, clampMinValue(0, ( value ) ));
336  break;
337 
338  }
339  }
340 
341  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
342  { doSetParmValue(idx, instance, value); }
343  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
344  { doSetParmValue(idx, instance, value); }
345  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
346  { doSetParmValue(idx, instance, value); }
347  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
348  { doSetParmValue(idx, instance, value); }
349  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
350  { doSetParmValue(idx, instance, value); }
351  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
352  { doSetParmValue(idx, instance, value); }
353  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
354  { doSetParmValue(idx, instance, value); }
355  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
356  { doSetParmValue(idx, instance, value); }
357  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
358  { doSetParmValue(idx, instance, value); }
359  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
360  { doSetParmValue(idx, instance, value); }
361  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
362  { doSetParmValue(idx, instance, value); }
363 
364  exint getNestNumParms(TempIndex idx) const override
365  {
366  if (idx.size() == 0)
367  return 13;
368  switch (idx[0])
369  {
370 
371  }
372  // Invalid
373  return 0;
374  }
375 
376  const char *getNestParmName(TempIndex fieldnum) const override
377  {
378  if (fieldnum.size() < 1)
379  return 0;
380  switch (fieldnum[0])
381  {
382  case 0:
383  return "blend";
384  case 1:
385  return "attribs";
386  case 2:
387  return "ptidattr";
388  case 3:
389  return "unmatchedpts";
390  case 4:
391  return "unmatchedgroup";
392  case 5:
393  return "primidattr";
394  case 6:
395  return "voxelblend";
396  case 7:
397  return "adt";
398  case 8:
399  return "velocity";
400  case 9:
401  return "doslerp";
402  case 10:
403  return "interp";
404  case 11:
405  return "usevforpinterp";
406  case 12:
407  return "timestep";
408 
409  }
410  return 0;
411  }
412 
413  ParmType getNestParmType(TempIndex fieldnum) const override
414  {
415  if (fieldnum.size() < 1)
416  return PARM_UNSUPPORTED;
417  switch (fieldnum[0])
418  {
419  case 0:
420  return PARM_FLOAT;
421  case 1:
422  return PARM_STRING;
423  case 2:
424  return PARM_STRING;
425  case 3:
426  return PARM_INTEGER;
427  case 4:
428  return PARM_STRING;
429  case 5:
430  return PARM_STRING;
431  case 6:
432  return PARM_INTEGER;
433  case 7:
434  return PARM_FLOAT;
435  case 8:
436  return PARM_STRING;
437  case 9:
438  return PARM_INTEGER;
439  case 10:
440  return PARM_INTEGER;
441  case 11:
442  return PARM_INTEGER;
443  case 12:
444  return PARM_FLOAT;
445 
446  }
447  return PARM_UNSUPPORTED;
448  }
449 
450  // Boiler plate to load individual types.
451  static void loadData(UT_IStream &is, int64 &v)
452  { is.bread(&v, 1); }
453  static void loadData(UT_IStream &is, bool &v)
454  { int64 iv; is.bread(&iv, 1); v = iv; }
455  static void loadData(UT_IStream &is, fpreal64 &v)
456  { is.bread<fpreal64>(&v, 1); }
457  static void loadData(UT_IStream &is, UT_Vector2D &v)
458  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
459  static void loadData(UT_IStream &is, UT_Vector3D &v)
460  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
461  is.bread<fpreal64>(&v.z(), 1); }
462  static void loadData(UT_IStream &is, UT_Vector4D &v)
463  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
464  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
465  static void loadData(UT_IStream &is, UT_Matrix2D &v)
466  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
467  static void loadData(UT_IStream &is, UT_Matrix3D &v)
468  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
469  static void loadData(UT_IStream &is, UT_Matrix4D &v)
470  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
471  static void loadData(UT_IStream &is, UT_Vector2I &v)
472  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
473  static void loadData(UT_IStream &is, UT_Vector3I &v)
474  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
475  is.bread<int64>(&v.z(), 1); }
476  static void loadData(UT_IStream &is, UT_Vector4I &v)
477  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
478  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
480  { is.bread(v); }
482  { UT_StringHolder rampdata;
483  loadData(is, rampdata);
484  if (rampdata.isstring())
485  {
486  v.reset(new UT_Ramp());
487  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
488  v->load(istr);
489  }
490  else v.reset();
491  }
494  loadData(is, data);
495  if (data.isstring())
496  {
497  // Find the data type.
498  const char *colon = UT_StringWrap(data).findChar(':');
499  if (colon)
500  {
501  int typelen = colon - data.buffer();
503  type.strncpy(data.buffer(), typelen);
504  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
505 
506  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
507  }
508  }
509  else v.reset();
510  }
511 
512  static void saveData(std::ostream &os, int64 v)
513  { UTwrite(os, &v); }
514  static void saveData(std::ostream &os, bool v)
515  { int64 iv = v; UTwrite(os, &iv); }
516  static void saveData(std::ostream &os, fpreal64 v)
517  { UTwrite<fpreal64>(os, &v); }
518  static void saveData(std::ostream &os, UT_Vector2D v)
519  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
520  static void saveData(std::ostream &os, UT_Vector3D v)
521  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
522  UTwrite<fpreal64>(os, &v.z()); }
523  static void saveData(std::ostream &os, UT_Vector4D v)
524  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
525  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
526  static void saveData(std::ostream &os, UT_Matrix2D v)
528  static void saveData(std::ostream &os, UT_Matrix3D v)
530  static void saveData(std::ostream &os, UT_Matrix4D v)
532  static void saveData(std::ostream &os, UT_StringHolder s)
533  { UT_StringWrap(s).saveBinary(os); }
534  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
536  UT_OStringStream ostr;
537  if (s) s->save(ostr);
538  result = ostr.str();
539  saveData(os, result);
540  }
541  static void saveData(std::ostream &os, PRM_DataItemHandle s)
543  UT_OStringStream ostr;
544  if (s)
545  {
546  ostr << s->getDataTypeToken();
547  ostr << ":";
548  s->saveBinary(ostr);
549  }
550  result = ostr.str();
551  saveData(os, result);
552  }
553 
554 
555  void save(std::ostream &os) const
556  {
557  int32 v = version();
558  UTwrite(os, &v);
559  saveData(os, myBlend);
560  saveData(os, myAttribs);
561  saveData(os, myPtIDAttr);
562  saveData(os, myUnmatchedPoints);
563  saveData(os, myUnmatchedPointGroup);
564  saveData(os, myPrimIDAttr);
565  saveData(os, myVoxelBlend);
566  saveData(os, myAdvectionDT);
567  saveData(os, myVelocityField);
568  saveData(os, myDoSlerp);
569  saveData(os, myInterp);
570  saveData(os, myUseVForPInterp);
571  saveData(os, myTimeStep);
572 
573  }
574 
575  bool load(UT_IStream &is)
576  {
577  int32 v;
578  is.bread(&v, 1);
579  if (version() != v)
580  {
581  // Fail incompatible versions
582  return false;
583  }
584  loadData(is, myBlend);
585  loadData(is, myAttribs);
586  loadData(is, myPtIDAttr);
587  loadData(is, myUnmatchedPoints);
588  loadData(is, myUnmatchedPointGroup);
589  loadData(is, myPrimIDAttr);
590  loadData(is, myVoxelBlend);
591  loadData(is, myAdvectionDT);
592  loadData(is, myVelocityField);
593  loadData(is, myDoSlerp);
594  loadData(is, myInterp);
595  loadData(is, myUseVForPInterp);
596  loadData(is, myTimeStep);
597 
598  return true;
599  }
600 
601  fpreal64 getBlend() const { return myBlend; }
602  void setBlend(fpreal64 val) { myBlend = val; }
603  fpreal64 opBlend(const SOP_NodeVerb::CookParms &cookparms) const
604  {
605  SOP_Node *thissop = cookparms.getNode();
606  if (!thissop) return getBlend();
608  OP_Utils::evalOpParm(result, thissop, "blend", cookparms.getCookTime(), 0);
609  return result;
610  }
611  const UT_StringHolder & getAttribs() const { return myAttribs; }
612  void setAttribs(const UT_StringHolder & val) { myAttribs = val; }
614  {
615  SOP_Node *thissop = cookparms.getNode();
616  if (!thissop) return getAttribs();
618  OP_Utils::evalOpParm(result, thissop, "attribs", cookparms.getCookTime(), 0);
619  return result;
620  }
621  const UT_StringHolder & getPtIDAttr() const { return myPtIDAttr; }
622  void setPtIDAttr(const UT_StringHolder & val) { myPtIDAttr = val; }
624  {
625  SOP_Node *thissop = cookparms.getNode();
626  if (!thissop) return getPtIDAttr();
628  OP_Utils::evalOpParm(result, thissop, "ptidattr", cookparms.getCookTime(), 0);
629  return result;
630  }
631  UnmatchedPoints getUnmatchedPoints() const { return UnmatchedPoints(myUnmatchedPoints); }
632  void setUnmatchedPoints(UnmatchedPoints val) { myUnmatchedPoints = int64(val); }
634  {
635  SOP_Node *thissop = cookparms.getNode();
636  if (!thissop) return getUnmatchedPoints();
637  int64 result;
638  OP_Utils::evalOpParm(result, thissop, "unmatchedpts", cookparms.getCookTime(), 0);
639  return UnmatchedPoints(result);
640  }
641  const UT_StringHolder & getUnmatchedPointGroup() const { return myUnmatchedPointGroup; }
642  void setUnmatchedPointGroup(const UT_StringHolder & val) { myUnmatchedPointGroup = val; }
644  {
645  SOP_Node *thissop = cookparms.getNode();
646  if (!thissop) return getUnmatchedPointGroup();
648  OP_Utils::evalOpParm(result, thissop, "unmatchedgroup", cookparms.getCookTime(), 0);
649  return result;
650  }
651  const UT_StringHolder & getPrimIDAttr() const { return myPrimIDAttr; }
652  void setPrimIDAttr(const UT_StringHolder & val) { myPrimIDAttr = val; }
654  {
655  SOP_Node *thissop = cookparms.getNode();
656  if (!thissop) return getPrimIDAttr();
658  OP_Utils::evalOpParm(result, thissop, "primidattr", cookparms.getCookTime(), 0);
659  return result;
660  }
661  VoxelBlend getVoxelBlend() const { return VoxelBlend(myVoxelBlend); }
662  void setVoxelBlend(VoxelBlend val) { myVoxelBlend = int64(val); }
664  {
665  SOP_Node *thissop = cookparms.getNode();
666  if (!thissop) return getVoxelBlend();
667  int64 result;
668  OP_Utils::evalOpParm(result, thissop, "voxelblend", cookparms.getCookTime(), 0);
669  return VoxelBlend(result);
670  }
671  fpreal64 getAdvectionDT() const { return myAdvectionDT; }
672  void setAdvectionDT(fpreal64 val) { myAdvectionDT = val; }
674  {
675  SOP_Node *thissop = cookparms.getNode();
676  if (!thissop) return getAdvectionDT();
678  OP_Utils::evalOpParm(result, thissop, "adt", cookparms.getCookTime(), 0);
679  return result;
680  }
681  const UT_StringHolder & getVelocityField() const { return myVelocityField; }
682  void setVelocityField(const UT_StringHolder & val) { myVelocityField = val; }
684  {
685  SOP_Node *thissop = cookparms.getNode();
686  if (!thissop) return getVelocityField();
688  OP_Utils::evalOpParm(result, thissop, "velocity", cookparms.getCookTime(), 0);
689  return result;
690  }
691  bool getDoSlerp() const { return myDoSlerp; }
692  void setDoSlerp(bool val) { myDoSlerp = val; }
693  bool opDoSlerp(const SOP_NodeVerb::CookParms &cookparms) const
694  {
695  SOP_Node *thissop = cookparms.getNode();
696  if (!thissop) return getDoSlerp();
697  bool result;
698  OP_Utils::evalOpParm(result, thissop, "doslerp", cookparms.getCookTime(), 0);
699  return result;
700  }
701  Interp getInterp() const { return Interp(myInterp); }
702  void setInterp(Interp val) { myInterp = int64(val); }
703  Interp opInterp(const SOP_NodeVerb::CookParms &cookparms) const
704  {
705  SOP_Node *thissop = cookparms.getNode();
706  if (!thissop) return getInterp();
707  int64 result;
708  OP_Utils::evalOpParm(result, thissop, "interp", cookparms.getCookTime(), 0);
709  return Interp(result);
710  }
711  bool getUseVForPInterp() const { return myUseVForPInterp; }
712  void setUseVForPInterp(bool val) { myUseVForPInterp = val; }
713  bool opUseVForPInterp(const SOP_NodeVerb::CookParms &cookparms) const
714  {
715  SOP_Node *thissop = cookparms.getNode();
716  if (!thissop) return getUseVForPInterp();
717  bool result;
718  OP_Utils::evalOpParm(result, thissop, "usevforpinterp", cookparms.getCookTime(), 0);
719  return result;
720  }
721  fpreal64 getTimeStep() const { return myTimeStep; }
722  void setTimeStep(fpreal64 val) { myTimeStep = val; }
724  {
725  SOP_Node *thissop = cookparms.getNode();
726  if (!thissop) return getTimeStep();
728  OP_Utils::evalOpParm(result, thissop, "timestep", cookparms.getCookTime(), 0);
729  return result;
730  }
731 
732 private:
733  fpreal64 myBlend;
734  UT_StringHolder myAttribs;
735  UT_StringHolder myPtIDAttr;
736  int64 myUnmatchedPoints;
737  UT_StringHolder myUnmatchedPointGroup;
738  UT_StringHolder myPrimIDAttr;
739  int64 myVoxelBlend;
740  fpreal64 myAdvectionDT;
741  UT_StringHolder myVelocityField;
742  bool myDoSlerp;
743  int64 myInterp;
744  bool myUseVForPInterp;
745  fpreal64 myTimeStep;
746 
747 };
exint getNestNumParms(TempIndex idx) const override
UT_StringHolder opPtIDAttr(const SOP_NodeVerb::CookParms &cookparms) const
VoxelBlend getVoxelBlend() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, UT_Vector3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
fpreal64 getAdvectionDT() const
static void saveData(std::ostream &os, UT_Vector3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const UT_StringHolder & getVelocityField() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setTimeStep(fpreal64 val)
static void saveData(std::ostream &os, UT_Vector2D v)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
Interp opInterp(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
static void loadData(UT_IStream &is, fpreal64 &v)
SYS_FORCE_INLINE const char * buffer() const
const char * getNestParmName(TempIndex fieldnum) const override
GLdouble s
Definition: glad.h:3009
UT_StringHolder opUnmatchedPointGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool opUseVForPInterp(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setUseVForPInterp(bool val)
void setVelocityField(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void save(std::ostream &os) const
UT_StringHolder opVelocityField(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
Definition: thread.h:613
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setUnmatchedPoints(UnmatchedPoints val)
UnmatchedPoints opUnmatchedPoints(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, UT_Matrix3D v)
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.
static void loadData(UT_IStream &is, UT_StringHolder &v)
VoxelBlend opVoxelBlend(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opAttribs(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool load(UT_IStream &is)
double fpreal64
Definition: SYS_Types.h:201
fpreal64 getTimeStep() const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
const UT_StringHolder & getPrimIDAttr() const
void setVoxelBlend(VoxelBlend val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
exint length() const
SYS_FORCE_INLINE const char * buffer() const
void setBlend(fpreal64 val)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void setAttribs(const UT_StringHolder &val)
bool operator==(const SOP_SBlend_2_0Parms &src) const
ParmType getNestParmType(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Vector4D v)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool operator!=(const SOP_SBlend_2_0Parms &src) const
long long int64
Definition: SYS_Types.h:116
void setAdvectionDT(fpreal64 val)
static void loadData(UT_IStream &is, bool &v)
fpreal64 opAdvectionDT(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE UT_StringHolder getToken(UnmatchedPoints enum_value)
static void loadData(UT_IStream &is, int64 &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, UT_Matrix2D v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void setInterp(Interp val)
static void loadData(UT_IStream &is, UT_Vector3I &v)
GT_API const UT_StringHolder version
void setPrimIDAttr(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UnmatchedPoints getUnmatchedPoints() const
UT_StringHolder opPrimIDAttr(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
static void saveData(std::ostream &os, bool v)
bool isParmColorRamp(exint idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
fpreal64 opBlend(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
static void loadData(UT_IStream &is, UT_Matrix2D &v)
GLuint GLfloat * val
Definition: glcorearb.h:1608
void setPtIDAttr(const UT_StringHolder &val)
#define SOP_API
Definition: SOP_API.h:10
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const UT_StringHolder & getPtIDAttr() const
static void saveData(std::ostream &os, UT_Matrix4D v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
void setUnmatchedPointGroup(const UT_StringHolder &val)
Definition: core.h:1131
GLboolean r
Definition: glcorearb.h:1222
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
fpreal64 getBlend() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
const UT_StringHolder & getUnmatchedPointGroup() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
const UT_StringHolder & getAttribs() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
type
Definition: core.h:1059
bool opDoSlerp(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, int64 v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
bool getUseVForPInterp() 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_Vector4D &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
fpreal64 opTimeStep(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glcorearb.h:1793
void copyFrom(const OP_NodeParms *src) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663