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