HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_VolumeMix.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_VolumeMixEnums
24 {
25  enum class Mixmethod
26  {
27  COPY = 0,
28  ADD,
29  SUB,
30  DIFF,
31  MUL,
32  DIV,
33  INVERT,
34  MAX,
35  MIN,
36  CLAMP,
37  BLEND,
38  USER
39  };
40 
42  getToken(Mixmethod enum_value)
43  {
44  using namespace UT::Literal;
45  switch (enum_value) {
46  case Mixmethod::COPY: return "copy"_sh;
47  case Mixmethod::ADD: return "add"_sh;
48  case Mixmethod::SUB: return "sub"_sh;
49  case Mixmethod::DIFF: return "diff"_sh;
50  case Mixmethod::MUL: return "mul"_sh;
51  case Mixmethod::DIV: return "div"_sh;
52  case Mixmethod::INVERT: return "invert"_sh;
53  case Mixmethod::MAX: return "max"_sh;
54  case Mixmethod::MIN: return "min"_sh;
55  case Mixmethod::CLAMP: return "clamp"_sh;
56  case Mixmethod::BLEND: return "blend"_sh;
57  case Mixmethod::USER: return "user"_sh;
58  default: UT_ASSERT(false); return ""_sh;
59  }
60  }
61 
62 }
63 
64 
66 {
67 public:
68  static int version() { return 1; }
69 
71  {
72  myGroup = ""_UTsh;
73  myMixgrp = ""_UTsh;
74  myMixmethod = 0;
75  myRange = UT_Vector2D(0,1);
76  myBlend = 0.5;
77  myExpr = 0;
78  myDstpreadd = 0;
79  myDstpremul = 1;
80  mySrcpreadd = 0;
81  mySrcpremul = 1;
82  myPostadd = 0;
83  myPostmul = 1;
84  myDoclampmin = false;
85  myClampmin = 0;
86  myDoclampmax = false;
87  myClampmax = 1;
88  myExpandvdb = true;
89 
90  }
91 
92  explicit SOP_VolumeMixParms(const SOP_VolumeMixParms &) = default;
94  SOP_VolumeMixParms(SOP_VolumeMixParms &&) noexcept = default;
95  SOP_VolumeMixParms &operator=(SOP_VolumeMixParms &&) noexcept = default;
96 
97  ~SOP_VolumeMixParms() override {}
98 
99  bool operator==(const SOP_VolumeMixParms &src) const
100  {
101  if (myGroup != src.myGroup) return false;
102  if (myMixgrp != src.myMixgrp) return false;
103  if (myMixmethod != src.myMixmethod) return false;
104  if (myRange != src.myRange) return false;
105  if (myBlend != src.myBlend) return false;
106  if (myExpr != src.myExpr) return false;
107  if (myDstpreadd != src.myDstpreadd) return false;
108  if (myDstpremul != src.myDstpremul) return false;
109  if (mySrcpreadd != src.mySrcpreadd) return false;
110  if (mySrcpremul != src.mySrcpremul) return false;
111  if (myPostadd != src.myPostadd) return false;
112  if (myPostmul != src.myPostmul) return false;
113  if (myDoclampmin != src.myDoclampmin) return false;
114  if (myClampmin != src.myClampmin) return false;
115  if (myDoclampmax != src.myDoclampmax) return false;
116  if (myClampmax != src.myClampmax) return false;
117  if (myExpandvdb != src.myExpandvdb) return false;
118 
119  return true;
120  }
121  bool operator!=(const SOP_VolumeMixParms &src) const
122  {
123  return !operator==(src);
124  }
126 
127 
128 
129  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
130  {
131  myGroup = ""_UTsh;
132  if (true)
133  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
134  myMixgrp = ""_UTsh;
135  if (true)
136  graph->evalOpParm(myMixgrp, nodeidx, "mixgrp", time, 0);
137  myMixmethod = 0;
138  if (true)
139  graph->evalOpParm(myMixmethod, nodeidx, "mixmethod", time, 0);
140  myRange = UT_Vector2D(0,1);
141  if (true && ( (true&&!(((int64(getMixmethod())!=9)))) ) )
142  graph->evalOpParm(myRange, nodeidx, "range", time, 0);
143  myBlend = 0.5;
144  if (true && ( (true&&!(((int64(getMixmethod())!=10)))) ) )
145  graph->evalOpParm(myBlend, nodeidx, "blend", time, 0);
146  myExpr = 0;
147  if (true && ( (true&&!(((int64(getMixmethod())!=11)))) ) )
148  graph->evalOpParm(myExpr, nodeidx, "expr", time, 0);
149  myDstpreadd = 0;
150  if (true)
151  graph->evalOpParm(myDstpreadd, nodeidx, "dstpreadd", time, 0);
152  myDstpremul = 1;
153  if (true)
154  graph->evalOpParm(myDstpremul, nodeidx, "dstpremul", time, 0);
155  mySrcpreadd = 0;
156  if (true)
157  graph->evalOpParm(mySrcpreadd, nodeidx, "srcpreadd", time, 0);
158  mySrcpremul = 1;
159  if (true)
160  graph->evalOpParm(mySrcpremul, nodeidx, "srcpremul", time, 0);
161  myPostadd = 0;
162  if (true)
163  graph->evalOpParm(myPostadd, nodeidx, "postadd", time, 0);
164  myPostmul = 1;
165  if (true)
166  graph->evalOpParm(myPostmul, nodeidx, "postmul", time, 0);
167  myDoclampmin = false;
168  if (true)
169  graph->evalOpParm(myDoclampmin, nodeidx, "doclampmin", time, 0);
170  myClampmin = 0;
171  if (true && ( (true&&!(((getDoclampmin()==0)))) ) )
172  graph->evalOpParm(myClampmin, nodeidx, "clampmin", time, 0);
173  myDoclampmax = false;
174  if (true)
175  graph->evalOpParm(myDoclampmax, nodeidx, "doclampmax", time, 0);
176  myClampmax = 1;
177  if (true && ( (true&&!(((getDoclampmax()==0)))) ) )
178  graph->evalOpParm(myClampmax, nodeidx, "clampmax", time, 0);
179  myExpandvdb = true;
180  if (true)
181  graph->evalOpParm(myExpandvdb, nodeidx, "expandvdb", time, 0);
182 
183  }
184 
185 
186  void loadFromOpSubclass(const LoadParms &loadparms) override
187  {
188  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
189  }
190 
191 
192  void copyFrom(const OP_NodeParms *src) override
193  {
194  *this = *((const SOP_VolumeMixParms *)src);
195  }
196 
197  template <typename T>
198  void
199  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
200  {
201  if (idx.size() < 1)
202  return;
203  UT_ASSERT(idx.size() == instance.size()+1);
204  if (idx.size() != instance.size()+1)
205  return;
206  switch (idx[0])
207  {
208  case 0:
209  coerceValue(value, myGroup);
210  break;
211  case 1:
212  coerceValue(value, myMixgrp);
213  break;
214  case 2:
215  coerceValue(value, myMixmethod);
216  break;
217  case 3:
218  coerceValue(value, myRange);
219  break;
220  case 4:
221  coerceValue(value, myBlend);
222  break;
223  case 5:
224  coerceValue(value, myExpr);
225  break;
226  case 6:
227  coerceValue(value, myDstpreadd);
228  break;
229  case 7:
230  coerceValue(value, myDstpremul);
231  break;
232  case 8:
233  coerceValue(value, mySrcpreadd);
234  break;
235  case 9:
236  coerceValue(value, mySrcpremul);
237  break;
238  case 10:
239  coerceValue(value, myPostadd);
240  break;
241  case 11:
242  coerceValue(value, myPostmul);
243  break;
244  case 12:
245  coerceValue(value, myDoclampmin);
246  break;
247  case 13:
248  coerceValue(value, myClampmin);
249  break;
250  case 14:
251  coerceValue(value, myDoclampmax);
252  break;
253  case 15:
254  coerceValue(value, myClampmax);
255  break;
256  case 16:
257  coerceValue(value, myExpandvdb);
258  break;
259 
260  }
261  }
262 
263  bool isParmColorRamp(exint idx) const override
264  {
265  switch (idx)
266  {
267 
268  }
269  return false;
270  }
271 
272  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
273  { doGetParmValue(idx, instance, value); }
274  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
275  { doGetParmValue(idx, instance, value); }
276  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
277  { doGetParmValue(idx, instance, value); }
278  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
279  { doGetParmValue(idx, instance, value); }
280  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
281  { doGetParmValue(idx, instance, value); }
282  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
283  { doGetParmValue(idx, instance, value); }
284  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
285  { doGetParmValue(idx, instance, value); }
286  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
287  { doGetParmValue(idx, instance, value); }
288  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
289  { doGetParmValue(idx, instance, value); }
290  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
291  { doGetParmValue(idx, instance, value); }
292  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
293  { doGetParmValue(idx, instance, value); }
294 
295  template <typename T>
296  void
297  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
298  {
299  if (idx.size() < 1)
300  return;
301  UT_ASSERT(idx.size() == instance.size()+1);
302  if (idx.size() != instance.size()+1)
303  return;
304  switch (idx[0])
305  {
306  case 0:
307  coerceValue(myGroup, ( ( value ) ));
308  break;
309  case 1:
310  coerceValue(myMixgrp, ( ( value ) ));
311  break;
312  case 2:
313  coerceValue(myMixmethod, clampMinValue(0, clampMaxValue(11, value ) ));
314  break;
315  case 3:
316  coerceValue(myRange, ( ( value ) ));
317  break;
318  case 4:
319  coerceValue(myBlend, ( ( value ) ));
320  break;
321  case 5:
322  coerceValue(myExpr, ( ( value ) ));
323  break;
324  case 6:
325  coerceValue(myDstpreadd, ( ( value ) ));
326  break;
327  case 7:
328  coerceValue(myDstpremul, ( ( value ) ));
329  break;
330  case 8:
331  coerceValue(mySrcpreadd, ( ( value ) ));
332  break;
333  case 9:
334  coerceValue(mySrcpremul, ( ( value ) ));
335  break;
336  case 10:
337  coerceValue(myPostadd, ( ( value ) ));
338  break;
339  case 11:
340  coerceValue(myPostmul, ( ( value ) ));
341  break;
342  case 12:
343  coerceValue(myDoclampmin, ( ( value ) ));
344  break;
345  case 13:
346  coerceValue(myClampmin, ( ( value ) ));
347  break;
348  case 14:
349  coerceValue(myDoclampmax, ( ( value ) ));
350  break;
351  case 15:
352  coerceValue(myClampmax, ( ( value ) ));
353  break;
354  case 16:
355  coerceValue(myExpandvdb, ( ( value ) ));
356  break;
357 
358  }
359  }
360 
361  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
362  { doSetParmValue(idx, instance, value); }
363  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
364  { doSetParmValue(idx, instance, value); }
365  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
366  { doSetParmValue(idx, instance, value); }
367  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
368  { doSetParmValue(idx, instance, value); }
369  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
370  { doSetParmValue(idx, instance, value); }
371  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
372  { doSetParmValue(idx, instance, value); }
373  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
374  { doSetParmValue(idx, instance, value); }
375  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
376  { doSetParmValue(idx, instance, value); }
377  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
378  { doSetParmValue(idx, instance, value); }
379  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
380  { doSetParmValue(idx, instance, value); }
381  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
382  { doSetParmValue(idx, instance, value); }
383 
384  exint getNestNumParms(TempIndex idx) const override
385  {
386  if (idx.size() == 0)
387  return 17;
388  switch (idx[0])
389  {
390 
391  }
392  // Invalid
393  return 0;
394  }
395 
396  const char *getNestParmName(TempIndex fieldnum) const override
397  {
398  if (fieldnum.size() < 1)
399  return 0;
400  switch (fieldnum[0])
401  {
402  case 0:
403  return "group";
404  case 1:
405  return "mixgrp";
406  case 2:
407  return "mixmethod";
408  case 3:
409  return "range";
410  case 4:
411  return "blend";
412  case 5:
413  return "expr";
414  case 6:
415  return "dstpreadd";
416  case 7:
417  return "dstpremul";
418  case 8:
419  return "srcpreadd";
420  case 9:
421  return "srcpremul";
422  case 10:
423  return "postadd";
424  case 11:
425  return "postmul";
426  case 12:
427  return "doclampmin";
428  case 13:
429  return "clampmin";
430  case 14:
431  return "doclampmax";
432  case 15:
433  return "clampmax";
434  case 16:
435  return "expandvdb";
436 
437  }
438  return 0;
439  }
440 
441  ParmType getNestParmType(TempIndex fieldnum) const override
442  {
443  if (fieldnum.size() < 1)
444  return PARM_UNSUPPORTED;
445  switch (fieldnum[0])
446  {
447  case 0:
448  return PARM_STRING;
449  case 1:
450  return PARM_STRING;
451  case 2:
452  return PARM_INTEGER;
453  case 3:
454  return PARM_VECTOR2;
455  case 4:
456  return PARM_FLOAT;
457  case 5:
458  return PARM_FLOAT;
459  case 6:
460  return PARM_FLOAT;
461  case 7:
462  return PARM_FLOAT;
463  case 8:
464  return PARM_FLOAT;
465  case 9:
466  return PARM_FLOAT;
467  case 10:
468  return PARM_FLOAT;
469  case 11:
470  return PARM_FLOAT;
471  case 12:
472  return PARM_INTEGER;
473  case 13:
474  return PARM_FLOAT;
475  case 14:
476  return PARM_INTEGER;
477  case 15:
478  return PARM_FLOAT;
479  case 16:
480  return PARM_INTEGER;
481 
482  }
483  return PARM_UNSUPPORTED;
484  }
485 
486  // Boiler plate to load individual types.
487  static void loadData(UT_IStream &is, int64 &v)
488  { is.bread(&v, 1); }
489  static void loadData(UT_IStream &is, bool &v)
490  { int64 iv; is.bread(&iv, 1); v = iv; }
491  static void loadData(UT_IStream &is, fpreal64 &v)
492  { is.bread<fpreal64>(&v, 1); }
493  static void loadData(UT_IStream &is, UT_Vector2D &v)
494  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
495  static void loadData(UT_IStream &is, UT_Vector3D &v)
496  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
497  is.bread<fpreal64>(&v.z(), 1); }
498  static void loadData(UT_IStream &is, UT_Vector4D &v)
499  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
500  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
501  static void loadData(UT_IStream &is, UT_Matrix2D &v)
502  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
503  static void loadData(UT_IStream &is, UT_Matrix3D &v)
504  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
505  static void loadData(UT_IStream &is, UT_Matrix4D &v)
506  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
507  static void loadData(UT_IStream &is, UT_Vector2I &v)
508  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
509  static void loadData(UT_IStream &is, UT_Vector3I &v)
510  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
511  is.bread<int64>(&v.z(), 1); }
512  static void loadData(UT_IStream &is, UT_Vector4I &v)
513  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
514  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
516  { is.bread(v); }
518  { UT_StringHolder rampdata;
519  loadData(is, rampdata);
520  if (rampdata.isstring())
521  {
522  v.reset(new UT_Ramp());
523  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
524  v->load(istr);
525  }
526  else v.reset();
527  }
530  loadData(is, data);
531  if (data.isstring())
532  {
533  // Find the data type.
534  const char *colon = UT_StringWrap(data).findChar(':');
535  if (colon)
536  {
537  int typelen = colon - data.buffer();
539  type.strncpy(data.buffer(), typelen);
540  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
541 
542  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
543  }
544  }
545  else v.reset();
546  }
547 
548  static void saveData(std::ostream &os, int64 v)
549  { UTwrite(os, &v); }
550  static void saveData(std::ostream &os, bool v)
551  { int64 iv = v; UTwrite(os, &iv); }
552  static void saveData(std::ostream &os, fpreal64 v)
553  { UTwrite<fpreal64>(os, &v); }
554  static void saveData(std::ostream &os, UT_Vector2D v)
555  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
556  static void saveData(std::ostream &os, UT_Vector3D v)
557  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
558  UTwrite<fpreal64>(os, &v.z()); }
559  static void saveData(std::ostream &os, UT_Vector4D v)
560  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
561  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
562  static void saveData(std::ostream &os, UT_Matrix2D v)
564  static void saveData(std::ostream &os, UT_Matrix3D v)
566  static void saveData(std::ostream &os, UT_Matrix4D v)
568  static void saveData(std::ostream &os, UT_StringHolder s)
569  { UT_StringWrap(s).saveBinary(os); }
570  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
572  UT_OStringStream ostr;
573  if (s) s->save(ostr);
574  result = ostr.str();
575  saveData(os, result);
576  }
577  static void saveData(std::ostream &os, PRM_DataItemHandle s)
579  UT_OStringStream ostr;
580  if (s)
581  {
582  ostr << s->getDataTypeToken();
583  ostr << ":";
584  s->saveBinary(ostr);
585  }
586  result = ostr.str();
587  saveData(os, result);
588  }
589 
590 
591  void save(std::ostream &os) const
592  {
593  int32 v = version();
594  UTwrite(os, &v);
595  saveData(os, myGroup);
596  saveData(os, myMixgrp);
597  saveData(os, myMixmethod);
598  saveData(os, myRange);
599  saveData(os, myBlend);
600  saveData(os, myExpr);
601  saveData(os, myDstpreadd);
602  saveData(os, myDstpremul);
603  saveData(os, mySrcpreadd);
604  saveData(os, mySrcpremul);
605  saveData(os, myPostadd);
606  saveData(os, myPostmul);
607  saveData(os, myDoclampmin);
608  saveData(os, myClampmin);
609  saveData(os, myDoclampmax);
610  saveData(os, myClampmax);
611  saveData(os, myExpandvdb);
612 
613  }
614 
615  bool load(UT_IStream &is)
616  {
617  int32 v;
618  is.bread(&v, 1);
619  if (version() != v)
620  {
621  // Fail incompatible versions
622  return false;
623  }
624  loadData(is, myGroup);
625  loadData(is, myMixgrp);
626  loadData(is, myMixmethod);
627  loadData(is, myRange);
628  loadData(is, myBlend);
629  loadData(is, myExpr);
630  loadData(is, myDstpreadd);
631  loadData(is, myDstpremul);
632  loadData(is, mySrcpreadd);
633  loadData(is, mySrcpremul);
634  loadData(is, myPostadd);
635  loadData(is, myPostmul);
636  loadData(is, myDoclampmin);
637  loadData(is, myClampmin);
638  loadData(is, myDoclampmax);
639  loadData(is, myClampmax);
640  loadData(is, myExpandvdb);
641 
642  return true;
643  }
644 
645  const UT_StringHolder & getGroup() const { return myGroup; }
646  void setGroup(const UT_StringHolder & val) { myGroup = val; }
648  {
649  SOP_Node *thissop = cookparms.getNode();
650  if (!thissop) return getGroup();
652  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
653  return result;
654  }
655  const UT_StringHolder & getMixgrp() const { return myMixgrp; }
656  void setMixgrp(const UT_StringHolder & val) { myMixgrp = val; }
658  {
659  SOP_Node *thissop = cookparms.getNode();
660  if (!thissop) return getMixgrp();
662  OP_Utils::evalOpParm(result, thissop, "mixgrp", cookparms.getCookTime(), 0);
663  return result;
664  }
665  Mixmethod getMixmethod() const { return Mixmethod(myMixmethod); }
666  void setMixmethod(Mixmethod val) { myMixmethod = int64(val); }
668  {
669  SOP_Node *thissop = cookparms.getNode();
670  if (!thissop) return getMixmethod();
671  int64 result;
672  OP_Utils::evalOpParm(result, thissop, "mixmethod", cookparms.getCookTime(), 0);
673  return Mixmethod(result);
674  }
675  UT_Vector2D getRange() const { return myRange; }
676  void setRange(UT_Vector2D val) { myRange = val; }
678  {
679  SOP_Node *thissop = cookparms.getNode();
680  if (!thissop) return getRange();
682  OP_Utils::evalOpParm(result, thissop, "range", cookparms.getCookTime(), 0);
683  return result;
684  }
685  fpreal64 getBlend() const { return myBlend; }
686  void setBlend(fpreal64 val) { myBlend = val; }
687  fpreal64 opBlend(const SOP_NodeVerb::CookParms &cookparms) const
688  {
689  SOP_Node *thissop = cookparms.getNode();
690  if (!thissop) return getBlend();
692  OP_Utils::evalOpParm(result, thissop, "blend", cookparms.getCookTime(), 0);
693  return result;
694  }
695  fpreal64 getExpr() const { return myExpr; }
696  void setExpr(fpreal64 val) { myExpr = val; }
697  fpreal64 opExpr(const SOP_NodeVerb::CookParms &cookparms) const
698  {
699  SOP_Node *thissop = cookparms.getNode();
700  if (!thissop) return getExpr();
702  OP_Utils::evalOpParm(result, thissop, "expr", cookparms.getCookTime(), 0);
703  return result;
704  }
705  fpreal64 getDstpreadd() const { return myDstpreadd; }
706  void setDstpreadd(fpreal64 val) { myDstpreadd = val; }
708  {
709  SOP_Node *thissop = cookparms.getNode();
710  if (!thissop) return getDstpreadd();
712  OP_Utils::evalOpParm(result, thissop, "dstpreadd", cookparms.getCookTime(), 0);
713  return result;
714  }
715  fpreal64 getDstpremul() const { return myDstpremul; }
716  void setDstpremul(fpreal64 val) { myDstpremul = val; }
718  {
719  SOP_Node *thissop = cookparms.getNode();
720  if (!thissop) return getDstpremul();
722  OP_Utils::evalOpParm(result, thissop, "dstpremul", cookparms.getCookTime(), 0);
723  return result;
724  }
725  fpreal64 getSrcpreadd() const { return mySrcpreadd; }
726  void setSrcpreadd(fpreal64 val) { mySrcpreadd = val; }
728  {
729  SOP_Node *thissop = cookparms.getNode();
730  if (!thissop) return getSrcpreadd();
732  OP_Utils::evalOpParm(result, thissop, "srcpreadd", cookparms.getCookTime(), 0);
733  return result;
734  }
735  fpreal64 getSrcpremul() const { return mySrcpremul; }
736  void setSrcpremul(fpreal64 val) { mySrcpremul = val; }
738  {
739  SOP_Node *thissop = cookparms.getNode();
740  if (!thissop) return getSrcpremul();
742  OP_Utils::evalOpParm(result, thissop, "srcpremul", cookparms.getCookTime(), 0);
743  return result;
744  }
745  fpreal64 getPostadd() const { return myPostadd; }
746  void setPostadd(fpreal64 val) { myPostadd = val; }
748  {
749  SOP_Node *thissop = cookparms.getNode();
750  if (!thissop) return getPostadd();
752  OP_Utils::evalOpParm(result, thissop, "postadd", cookparms.getCookTime(), 0);
753  return result;
754  }
755  fpreal64 getPostmul() const { return myPostmul; }
756  void setPostmul(fpreal64 val) { myPostmul = val; }
758  {
759  SOP_Node *thissop = cookparms.getNode();
760  if (!thissop) return getPostmul();
762  OP_Utils::evalOpParm(result, thissop, "postmul", cookparms.getCookTime(), 0);
763  return result;
764  }
765  bool getDoclampmin() const { return myDoclampmin; }
766  void setDoclampmin(bool val) { myDoclampmin = val; }
767  bool opDoclampmin(const SOP_NodeVerb::CookParms &cookparms) const
768  {
769  SOP_Node *thissop = cookparms.getNode();
770  if (!thissop) return getDoclampmin();
771  bool result;
772  OP_Utils::evalOpParm(result, thissop, "doclampmin", cookparms.getCookTime(), 0);
773  return result;
774  }
775  fpreal64 getClampmin() const { return myClampmin; }
776  void setClampmin(fpreal64 val) { myClampmin = val; }
778  {
779  SOP_Node *thissop = cookparms.getNode();
780  if (!thissop) return getClampmin();
782  OP_Utils::evalOpParm(result, thissop, "clampmin", cookparms.getCookTime(), 0);
783  return result;
784  }
785  bool getDoclampmax() const { return myDoclampmax; }
786  void setDoclampmax(bool val) { myDoclampmax = val; }
787  bool opDoclampmax(const SOP_NodeVerb::CookParms &cookparms) const
788  {
789  SOP_Node *thissop = cookparms.getNode();
790  if (!thissop) return getDoclampmax();
791  bool result;
792  OP_Utils::evalOpParm(result, thissop, "doclampmax", cookparms.getCookTime(), 0);
793  return result;
794  }
795  fpreal64 getClampmax() const { return myClampmax; }
796  void setClampmax(fpreal64 val) { myClampmax = val; }
798  {
799  SOP_Node *thissop = cookparms.getNode();
800  if (!thissop) return getClampmax();
802  OP_Utils::evalOpParm(result, thissop, "clampmax", cookparms.getCookTime(), 0);
803  return result;
804  }
805  bool getExpandvdb() const { return myExpandvdb; }
806  void setExpandvdb(bool val) { myExpandvdb = val; }
807  bool opExpandvdb(const SOP_NodeVerb::CookParms &cookparms) const
808  {
809  SOP_Node *thissop = cookparms.getNode();
810  if (!thissop) return getExpandvdb();
811  bool result;
812  OP_Utils::evalOpParm(result, thissop, "expandvdb", cookparms.getCookTime(), 0);
813  return result;
814  }
815 
816 private:
817  UT_StringHolder myGroup;
818  UT_StringHolder myMixgrp;
819  int64 myMixmethod;
820  UT_Vector2D myRange;
821  fpreal64 myBlend;
822  fpreal64 myExpr;
823  fpreal64 myDstpreadd;
824  fpreal64 myDstpremul;
825  fpreal64 mySrcpreadd;
826  fpreal64 mySrcpremul;
827  fpreal64 myPostadd;
828  fpreal64 myPostmul;
829  bool myDoclampmin;
830  fpreal64 myClampmin;
831  bool myDoclampmax;
832  fpreal64 myClampmax;
833  bool myExpandvdb;
834 
835 };
fpreal64 getDstpremul() const
static void saveData(std::ostream &os, UT_Matrix3D v)
void setMixgrp(const UT_StringHolder &val)
Mixmethod getMixmethod() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void setRange(UT_Vector2D val)
static void saveData(std::ostream &os, UT_StringHolder s)
void setGroup(const UT_StringHolder &val)
bool load(UT_IStream &is)
Mixmethod opMixmethod(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opClampmax(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
bool getDoclampmin() const
const char * getNestParmName(TempIndex fieldnum) const override
void setMixmethod(Mixmethod val)
fpreal64 getPostadd() const
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
bool opDoclampmin(const SOP_NodeVerb::CookParms &cookparms) const
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
UT_Vector2T< fpreal64 > UT_Vector2D
const UT_StringHolder & getMixgrp() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
bool operator!=(const SOP_VolumeMixParms &src) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
void setSrcpreadd(fpreal64 val)
fpreal64 opClampmin(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
void setExpandvdb(bool val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
**But if you need a result
Definition: thread.h:613
static void loadData(UT_IStream &is, UT_StringHolder &v)
fpreal64 opDstpremul(const SOP_NodeVerb::CookParms &cookparms) const
void setSrcpremul(fpreal64 val)
exint getNestNumParms(TempIndex idx) const override
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
fpreal64 opDstpreadd(const SOP_NodeVerb::CookParms &cookparms) const
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.
fpreal64 getSrcpremul() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setClampmax(fpreal64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setBlend(fpreal64 val)
void setClampmin(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool opExpandvdb(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D opRange(const SOP_NodeVerb::CookParms &cookparms) const
void loadFromOpSubclass(const LoadParms &loadparms) override
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void save(std::ostream &os) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
bool isParmColorRamp(exint idx) const override
exint length() const
bool opDoclampmax(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void copyFrom(const OP_NodeParms *src) override
fpreal64 getClampmax() const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
fpreal64 getClampmin() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal64 getBlend() const
long long int64
Definition: SYS_Types.h:116
void setDstpremul(fpreal64 val)
bool operator==(const SOP_VolumeMixParms &src) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
fpreal64 opBlend(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void loadData(UT_IStream &is, fpreal64 &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setDoclampmax(bool val)
void setPostadd(fpreal64 val)
fpreal64 opSrcpreadd(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
fpreal64 getDstpreadd() const
bool getDoclampmax() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
UT_StringHolder opMixgrp(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, bool &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
static void saveData(std::ostream &os, UT_Matrix4D v)
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
fpreal64 getExpr() const
bool getExpandvdb() const
void setDstpreadd(fpreal64 val)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
fpreal64 opSrcpremul(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opExpr(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
GLuint GLfloat * val
Definition: glcorearb.h:1608
void setExpr(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
fpreal64 getPostmul() const
#define SOP_API
Definition: SOP_API.h:10
void setDoclampmin(bool val)
SYS_FORCE_INLINE UT_StringHolder getToken(Mixmethod enum_value)
static void saveData(std::ostream &os, int64 v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
static void saveData(std::ostream &os, UT_Matrix2D v)
UT_Vector2D getRange() const
fpreal64 opPostmul(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
GLboolean r
Definition: glcorearb.h:1222
fpreal64 getSrcpreadd() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
fpreal64 opPostadd(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, bool v)
type
Definition: core.h:1059
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
void setPostmul(fpreal64 val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663