HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_VolumeFromAttrib.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_VolumeFromAttribEnums
24 {
25  enum class Calculationtype
26  {
27  COPY = 0,
28  ADD,
29  SUB,
30  MUL,
31  DIV,
32  MAX,
33  MIN,
34  AVERAGE
35  };
36 
39  {
40  using namespace UT::Literal;
41  switch (enum_value) {
42  case Calculationtype::COPY: return "copy"_sh;
43  case Calculationtype::ADD: return "add"_sh;
44  case Calculationtype::SUB: return "sub"_sh;
45  case Calculationtype::MUL: return "mul"_sh;
46  case Calculationtype::DIV: return "div"_sh;
47  case Calculationtype::MAX: return "max"_sh;
48  case Calculationtype::MIN: return "min"_sh;
49  case Calculationtype::AVERAGE: return "average"_sh;
50  default: UT_ASSERT(false); return ""_sh;
51  }
52  }
53 
54 }
55 
56 
58 {
59 public:
60  static int version() { return 1; }
61 
63  {
64  myGroup = ""_UTsh;
65  myPointgrp = ""_UTsh;
66  myUseattrib = true;
67  myAttrib = ""_UTsh;
68  myDisableonmissing = false;
69  myAccumulate = false;
70  myExtrapolate = true;
71  myUsemaxextrapolate = true;
72  myMaxextrapolate = 2;
73  myUsemaxextrapolatedist = false;
74  myMaxextrapolatedist = 0;
75  myThreshold = 1;
76  myBandwidth = 0;
77  myCalculationtype = 0;
78  myDstpreadd = 0;
79  myDstpremul = 1;
80  myScalebyvolume = false;
81  mySrcpreadd = 0;
82  mySrcpremul = 1;
83  myPostadd = 0;
84  myPostmul = 1;
85 
86  }
87 
88  explicit SOP_VolumeFromAttribParms(const SOP_VolumeFromAttribParms &) = default;
91  SOP_VolumeFromAttribParms &operator=(SOP_VolumeFromAttribParms &&) noexcept = default;
92 
94 
96  {
97  if (myGroup != src.myGroup) return false;
98  if (myPointgrp != src.myPointgrp) return false;
99  if (myUseattrib != src.myUseattrib) return false;
100  if (myAttrib != src.myAttrib) return false;
101  if (myDisableonmissing != src.myDisableonmissing) return false;
102  if (myAccumulate != src.myAccumulate) return false;
103  if (myExtrapolate != src.myExtrapolate) return false;
104  if (myUsemaxextrapolate != src.myUsemaxextrapolate) return false;
105  if (myMaxextrapolate != src.myMaxextrapolate) return false;
106  if (myUsemaxextrapolatedist != src.myUsemaxextrapolatedist) return false;
107  if (myMaxextrapolatedist != src.myMaxextrapolatedist) return false;
108  if (myThreshold != src.myThreshold) return false;
109  if (myBandwidth != src.myBandwidth) return false;
110  if (myCalculationtype != src.myCalculationtype) return false;
111  if (myDstpreadd != src.myDstpreadd) return false;
112  if (myDstpremul != src.myDstpremul) return false;
113  if (myScalebyvolume != src.myScalebyvolume) return false;
114  if (mySrcpreadd != src.mySrcpreadd) return false;
115  if (mySrcpremul != src.mySrcpremul) return false;
116  if (myPostadd != src.myPostadd) return false;
117  if (myPostmul != src.myPostmul) return false;
118 
119  return true;
120  }
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  myPointgrp = ""_UTsh;
135  if (true)
136  graph->evalOpParm(myPointgrp, nodeidx, "pointgrp", time, 0);
137  myUseattrib = true;
138  if (true)
139  graph->evalOpParm(myUseattrib, nodeidx, "useattrib", time, 0);
140  myAttrib = ""_UTsh;
141  if (true && ( (true&&!(((getUseattrib()==0)))) ) )
142  graph->evalOpParm(myAttrib, nodeidx, "attrib", time, 0);
143  myDisableonmissing = false;
144  if (true && ( (true&&!(((getUseattrib()==0)))) ) )
145  graph->evalOpParm(myDisableonmissing, nodeidx, "disableonmissing", time, 0);
146  myAccumulate = false;
147  if (true)
148  graph->evalOpParm(myAccumulate, nodeidx, "accumulate", time, 0);
149  myExtrapolate = true;
150  if (true && ( (true&&!(((getAccumulate()==1)))) ) )
151  graph->evalOpParm(myExtrapolate, nodeidx, "extrapolate", time, 0);
152  myUsemaxextrapolate = true;
153  if (true && ( (true&&!(((getAccumulate()==1))||((getExtrapolate()==0)))) ) )
154  graph->evalOpParm(myUsemaxextrapolate, nodeidx, "usemaxextrapolate", time, 0);
155  myMaxextrapolate = 2;
156  if (true && ( (true&&!(((getAccumulate()==1))||((getExtrapolate()==0))||((getUsemaxextrapolate()==0)))) ) )
157  graph->evalOpParm(myMaxextrapolate, nodeidx, "maxextrapolate", time, 0);
158  myUsemaxextrapolatedist = false;
159  if (true && ( (true&&!(((getAccumulate()==1))||((getExtrapolate()==0)))) ) )
160  graph->evalOpParm(myUsemaxextrapolatedist, nodeidx, "usemaxextrapolatedist", time, 0);
161  myMaxextrapolatedist = 0;
162  if (true && ( (true&&!(((getAccumulate()==1))||((getExtrapolate()==0))||((getUsemaxextrapolatedist()==0)))) ) )
163  graph->evalOpParm(myMaxextrapolatedist, nodeidx, "maxextrapolatedist", time, 0);
164  myThreshold = 1;
165  if (true && ( (true&&!(((getAccumulate()==1))||((getExtrapolate()==1)))) ) )
166  graph->evalOpParm(myThreshold, nodeidx, "threshold", time, 0);
167  myBandwidth = 0;
168  if (true && ( (true&&!(((getAccumulate()==1))||((getExtrapolate()==1)))) ) )
169  graph->evalOpParm(myBandwidth, nodeidx, "bandwidth", time, 0);
170  myCalculationtype = 0;
171  if (true)
172  graph->evalOpParm(myCalculationtype, nodeidx, "calculationtype", time, 0);
173  myDstpreadd = 0;
174  if (true)
175  graph->evalOpParm(myDstpreadd, nodeidx, "dstpreadd", time, 0);
176  myDstpremul = 1;
177  if (true)
178  graph->evalOpParm(myDstpremul, nodeidx, "dstpremul", time, 0);
179  myScalebyvolume = false;
180  if (true)
181  graph->evalOpParm(myScalebyvolume, nodeidx, "scalebyvolume", time, 0);
182  mySrcpreadd = 0;
183  if (true)
184  graph->evalOpParm(mySrcpreadd, nodeidx, "srcpreadd", time, 0);
185  mySrcpremul = 1;
186  if (true)
187  graph->evalOpParm(mySrcpremul, nodeidx, "srcpremul", time, 0);
188  myPostadd = 0;
189  if (true)
190  graph->evalOpParm(myPostadd, nodeidx, "postadd", time, 0);
191  myPostmul = 1;
192  if (true)
193  graph->evalOpParm(myPostmul, nodeidx, "postmul", time, 0);
194 
195  }
196 
197 
198  void loadFromOpSubclass(const LoadParms &loadparms) override
199  {
200  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
201  }
202 
203 
204  void copyFrom(const OP_NodeParms *src) override
205  {
206  *this = *((const SOP_VolumeFromAttribParms *)src);
207  }
208 
209  template <typename T>
210  void
211  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
212  {
213  if (idx.size() < 1)
214  return;
215  UT_ASSERT(idx.size() == instance.size()+1);
216  if (idx.size() != instance.size()+1)
217  return;
218  switch (idx[0])
219  {
220  case 0:
221  coerceValue(value, myGroup);
222  break;
223  case 1:
224  coerceValue(value, myPointgrp);
225  break;
226  case 2:
227  coerceValue(value, myUseattrib);
228  break;
229  case 3:
230  coerceValue(value, myAttrib);
231  break;
232  case 4:
233  coerceValue(value, myDisableonmissing);
234  break;
235  case 5:
236  coerceValue(value, myAccumulate);
237  break;
238  case 6:
239  coerceValue(value, myExtrapolate);
240  break;
241  case 7:
242  coerceValue(value, myUsemaxextrapolate);
243  break;
244  case 8:
245  coerceValue(value, myMaxextrapolate);
246  break;
247  case 9:
248  coerceValue(value, myUsemaxextrapolatedist);
249  break;
250  case 10:
251  coerceValue(value, myMaxextrapolatedist);
252  break;
253  case 11:
254  coerceValue(value, myThreshold);
255  break;
256  case 12:
257  coerceValue(value, myBandwidth);
258  break;
259  case 13:
260  coerceValue(value, myCalculationtype);
261  break;
262  case 14:
263  coerceValue(value, myDstpreadd);
264  break;
265  case 15:
266  coerceValue(value, myDstpremul);
267  break;
268  case 16:
269  coerceValue(value, myScalebyvolume);
270  break;
271  case 17:
272  coerceValue(value, mySrcpreadd);
273  break;
274  case 18:
275  coerceValue(value, mySrcpremul);
276  break;
277  case 19:
278  coerceValue(value, myPostadd);
279  break;
280  case 20:
281  coerceValue(value, myPostmul);
282  break;
283 
284  }
285  }
286 
287  bool isParmColorRamp(exint idx) const override
288  {
289  switch (idx)
290  {
291 
292  }
293  return false;
294  }
295 
296  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
299  { doGetParmValue(idx, instance, value); }
300  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
305  { doGetParmValue(idx, instance, value); }
306  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
307  { doGetParmValue(idx, instance, value); }
308  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
309  { doGetParmValue(idx, instance, value); }
310  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
311  { doGetParmValue(idx, instance, value); }
312  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
313  { doGetParmValue(idx, instance, value); }
314  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
315  { doGetParmValue(idx, instance, value); }
316  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
317  { doGetParmValue(idx, instance, value); }
318 
319  template <typename T>
320  void
321  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
322  {
323  if (idx.size() < 1)
324  return;
325  UT_ASSERT(idx.size() == instance.size()+1);
326  if (idx.size() != instance.size()+1)
327  return;
328  switch (idx[0])
329  {
330  case 0:
331  coerceValue(myGroup, ( ( value ) ));
332  break;
333  case 1:
334  coerceValue(myPointgrp, ( ( value ) ));
335  break;
336  case 2:
337  coerceValue(myUseattrib, ( ( value ) ));
338  break;
339  case 3:
340  coerceValue(myAttrib, ( ( value ) ));
341  break;
342  case 4:
343  coerceValue(myDisableonmissing, ( ( value ) ));
344  break;
345  case 5:
346  coerceValue(myAccumulate, ( ( value ) ));
347  break;
348  case 6:
349  coerceValue(myExtrapolate, ( ( value ) ));
350  break;
351  case 7:
352  coerceValue(myUsemaxextrapolate, ( ( value ) ));
353  break;
354  case 8:
355  coerceValue(myMaxextrapolate, ( ( value ) ));
356  break;
357  case 9:
358  coerceValue(myUsemaxextrapolatedist, ( ( value ) ));
359  break;
360  case 10:
361  coerceValue(myMaxextrapolatedist, ( ( value ) ));
362  break;
363  case 11:
364  coerceValue(myThreshold, ( ( value ) ));
365  break;
366  case 12:
367  coerceValue(myBandwidth, ( ( value ) ));
368  break;
369  case 13:
370  coerceValue(myCalculationtype, clampMinValue(0, clampMaxValue(7, value ) ));
371  break;
372  case 14:
373  coerceValue(myDstpreadd, ( ( value ) ));
374  break;
375  case 15:
376  coerceValue(myDstpremul, ( ( value ) ));
377  break;
378  case 16:
379  coerceValue(myScalebyvolume, ( ( value ) ));
380  break;
381  case 17:
382  coerceValue(mySrcpreadd, ( ( value ) ));
383  break;
384  case 18:
385  coerceValue(mySrcpremul, ( ( value ) ));
386  break;
387  case 19:
388  coerceValue(myPostadd, ( ( value ) ));
389  break;
390  case 20:
391  coerceValue(myPostmul, ( ( value ) ));
392  break;
393 
394  }
395  }
396 
397  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
398  { doSetParmValue(idx, instance, value); }
399  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
400  { doSetParmValue(idx, instance, value); }
401  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
402  { doSetParmValue(idx, instance, value); }
403  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
404  { doSetParmValue(idx, instance, value); }
405  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
406  { doSetParmValue(idx, instance, value); }
407  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
408  { doSetParmValue(idx, instance, value); }
409  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
410  { doSetParmValue(idx, instance, value); }
411  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
412  { doSetParmValue(idx, instance, value); }
413  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
414  { doSetParmValue(idx, instance, value); }
415  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
416  { doSetParmValue(idx, instance, value); }
417  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
418  { doSetParmValue(idx, instance, value); }
419 
420  exint getNestNumParms(TempIndex idx) const override
421  {
422  if (idx.size() == 0)
423  return 21;
424  switch (idx[0])
425  {
426 
427  }
428  // Invalid
429  return 0;
430  }
431 
432  const char *getNestParmName(TempIndex fieldnum) const override
433  {
434  if (fieldnum.size() < 1)
435  return 0;
436  switch (fieldnum[0])
437  {
438  case 0:
439  return "group";
440  case 1:
441  return "pointgrp";
442  case 2:
443  return "useattrib";
444  case 3:
445  return "attrib";
446  case 4:
447  return "disableonmissing";
448  case 5:
449  return "accumulate";
450  case 6:
451  return "extrapolate";
452  case 7:
453  return "usemaxextrapolate";
454  case 8:
455  return "maxextrapolate";
456  case 9:
457  return "usemaxextrapolatedist";
458  case 10:
459  return "maxextrapolatedist";
460  case 11:
461  return "threshold";
462  case 12:
463  return "bandwidth";
464  case 13:
465  return "calculationtype";
466  case 14:
467  return "dstpreadd";
468  case 15:
469  return "dstpremul";
470  case 16:
471  return "scalebyvolume";
472  case 17:
473  return "srcpreadd";
474  case 18:
475  return "srcpremul";
476  case 19:
477  return "postadd";
478  case 20:
479  return "postmul";
480 
481  }
482  return 0;
483  }
484 
485  ParmType getNestParmType(TempIndex fieldnum) const override
486  {
487  if (fieldnum.size() < 1)
488  return PARM_UNSUPPORTED;
489  switch (fieldnum[0])
490  {
491  case 0:
492  return PARM_STRING;
493  case 1:
494  return PARM_STRING;
495  case 2:
496  return PARM_INTEGER;
497  case 3:
498  return PARM_STRING;
499  case 4:
500  return PARM_INTEGER;
501  case 5:
502  return PARM_INTEGER;
503  case 6:
504  return PARM_INTEGER;
505  case 7:
506  return PARM_INTEGER;
507  case 8:
508  return PARM_FLOAT;
509  case 9:
510  return PARM_INTEGER;
511  case 10:
512  return PARM_FLOAT;
513  case 11:
514  return PARM_FLOAT;
515  case 12:
516  return PARM_FLOAT;
517  case 13:
518  return PARM_INTEGER;
519  case 14:
520  return PARM_FLOAT;
521  case 15:
522  return PARM_FLOAT;
523  case 16:
524  return PARM_INTEGER;
525  case 17:
526  return PARM_FLOAT;
527  case 18:
528  return PARM_FLOAT;
529  case 19:
530  return PARM_FLOAT;
531  case 20:
532  return PARM_FLOAT;
533 
534  }
535  return PARM_UNSUPPORTED;
536  }
537 
538  // Boiler plate to load individual types.
539  static void loadData(UT_IStream &is, int64 &v)
540  { is.bread(&v, 1); }
541  static void loadData(UT_IStream &is, bool &v)
542  { int64 iv; is.bread(&iv, 1); v = iv; }
543  static void loadData(UT_IStream &is, fpreal64 &v)
544  { is.bread<fpreal64>(&v, 1); }
545  static void loadData(UT_IStream &is, UT_Vector2D &v)
546  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
547  static void loadData(UT_IStream &is, UT_Vector3D &v)
548  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
549  is.bread<fpreal64>(&v.z(), 1); }
550  static void loadData(UT_IStream &is, UT_Vector4D &v)
551  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
552  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
553  static void loadData(UT_IStream &is, UT_Matrix2D &v)
554  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
555  static void loadData(UT_IStream &is, UT_Matrix3D &v)
556  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
557  static void loadData(UT_IStream &is, UT_Matrix4D &v)
558  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
559  static void loadData(UT_IStream &is, UT_Vector2I &v)
560  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
561  static void loadData(UT_IStream &is, UT_Vector3I &v)
562  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
563  is.bread<int64>(&v.z(), 1); }
564  static void loadData(UT_IStream &is, UT_Vector4I &v)
565  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
566  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
568  { is.bread(v); }
570  { UT_StringHolder rampdata;
571  loadData(is, rampdata);
572  if (rampdata.isstring())
573  {
574  v.reset(new UT_Ramp());
575  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
576  v->load(istr);
577  }
578  else v.reset();
579  }
582  loadData(is, data);
583  if (data.isstring())
584  {
585  // Find the data type.
586  const char *colon = UT_StringWrap(data).findChar(':');
587  if (colon)
588  {
589  int typelen = colon - data.buffer();
591  type.strncpy(data.buffer(), typelen);
592  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
593 
594  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
595  }
596  }
597  else v.reset();
598  }
599 
600  static void saveData(std::ostream &os, int64 v)
601  { UTwrite(os, &v); }
602  static void saveData(std::ostream &os, bool v)
603  { int64 iv = v; UTwrite(os, &iv); }
604  static void saveData(std::ostream &os, fpreal64 v)
605  { UTwrite<fpreal64>(os, &v); }
606  static void saveData(std::ostream &os, UT_Vector2D v)
607  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
608  static void saveData(std::ostream &os, UT_Vector3D v)
609  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
610  UTwrite<fpreal64>(os, &v.z()); }
611  static void saveData(std::ostream &os, UT_Vector4D v)
612  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
613  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
614  static void saveData(std::ostream &os, UT_Matrix2D v)
616  static void saveData(std::ostream &os, UT_Matrix3D v)
618  static void saveData(std::ostream &os, UT_Matrix4D v)
620  static void saveData(std::ostream &os, UT_StringHolder s)
621  { UT_StringWrap(s).saveBinary(os); }
622  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
624  UT_OStringStream ostr;
625  if (s) s->save(ostr);
626  result = ostr.str();
627  saveData(os, result);
628  }
629  static void saveData(std::ostream &os, PRM_DataItemHandle s)
631  UT_OStringStream ostr;
632  if (s)
633  {
634  ostr << s->getDataTypeToken();
635  ostr << ":";
636  s->saveBinary(ostr);
637  }
638  result = ostr.str();
639  saveData(os, result);
640  }
641 
642 
643  void save(std::ostream &os) const
644  {
645  int32 v = version();
646  UTwrite(os, &v);
647  saveData(os, myGroup);
648  saveData(os, myPointgrp);
649  saveData(os, myUseattrib);
650  saveData(os, myAttrib);
651  saveData(os, myDisableonmissing);
652  saveData(os, myAccumulate);
653  saveData(os, myExtrapolate);
654  saveData(os, myUsemaxextrapolate);
655  saveData(os, myMaxextrapolate);
656  saveData(os, myUsemaxextrapolatedist);
657  saveData(os, myMaxextrapolatedist);
658  saveData(os, myThreshold);
659  saveData(os, myBandwidth);
660  saveData(os, myCalculationtype);
661  saveData(os, myDstpreadd);
662  saveData(os, myDstpremul);
663  saveData(os, myScalebyvolume);
664  saveData(os, mySrcpreadd);
665  saveData(os, mySrcpremul);
666  saveData(os, myPostadd);
667  saveData(os, myPostmul);
668 
669  }
670 
671  bool load(UT_IStream &is)
672  {
673  int32 v;
674  is.bread(&v, 1);
675  if (version() != v)
676  {
677  // Fail incompatible versions
678  return false;
679  }
680  loadData(is, myGroup);
681  loadData(is, myPointgrp);
682  loadData(is, myUseattrib);
683  loadData(is, myAttrib);
684  loadData(is, myDisableonmissing);
685  loadData(is, myAccumulate);
686  loadData(is, myExtrapolate);
687  loadData(is, myUsemaxextrapolate);
688  loadData(is, myMaxextrapolate);
689  loadData(is, myUsemaxextrapolatedist);
690  loadData(is, myMaxextrapolatedist);
691  loadData(is, myThreshold);
692  loadData(is, myBandwidth);
693  loadData(is, myCalculationtype);
694  loadData(is, myDstpreadd);
695  loadData(is, myDstpremul);
696  loadData(is, myScalebyvolume);
697  loadData(is, mySrcpreadd);
698  loadData(is, mySrcpremul);
699  loadData(is, myPostadd);
700  loadData(is, myPostmul);
701 
702  return true;
703  }
704 
705  const UT_StringHolder & getGroup() const { return myGroup; }
706  void setGroup(const UT_StringHolder & val) { myGroup = val; }
708  {
709  SOP_Node *thissop = cookparms.getNode();
710  if (!thissop) return getGroup();
712  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
713  return result;
714  }
715  const UT_StringHolder & getPointgrp() const { return myPointgrp; }
716  void setPointgrp(const UT_StringHolder & val) { myPointgrp = val; }
718  {
719  SOP_Node *thissop = cookparms.getNode();
720  if (!thissop) return getPointgrp();
722  OP_Utils::evalOpParm(result, thissop, "pointgrp", cookparms.getCookTime(), 0);
723  return result;
724  }
725  bool getUseattrib() const { return myUseattrib; }
726  void setUseattrib(bool val) { myUseattrib = val; }
727  bool opUseattrib(const SOP_NodeVerb::CookParms &cookparms) const
728  {
729  SOP_Node *thissop = cookparms.getNode();
730  if (!thissop) return getUseattrib();
731  bool result;
732  OP_Utils::evalOpParm(result, thissop, "useattrib", cookparms.getCookTime(), 0);
733  return result;
734  }
735  const UT_StringHolder & getAttrib() const { return myAttrib; }
736  void setAttrib(const UT_StringHolder & val) { myAttrib = val; }
738  {
739  SOP_Node *thissop = cookparms.getNode();
740  if (!thissop) return getAttrib();
742  OP_Utils::evalOpParm(result, thissop, "attrib", cookparms.getCookTime(), 0);
743  return result;
744  }
745  bool getDisableonmissing() const { return myDisableonmissing; }
746  void setDisableonmissing(bool val) { myDisableonmissing = val; }
747  bool opDisableonmissing(const SOP_NodeVerb::CookParms &cookparms) const
748  {
749  SOP_Node *thissop = cookparms.getNode();
750  if (!thissop) return getDisableonmissing();
751  bool result;
752  OP_Utils::evalOpParm(result, thissop, "disableonmissing", cookparms.getCookTime(), 0);
753  return result;
754  }
755  bool getAccumulate() const { return myAccumulate; }
756  void setAccumulate(bool val) { myAccumulate = val; }
757  bool opAccumulate(const SOP_NodeVerb::CookParms &cookparms) const
758  {
759  SOP_Node *thissop = cookparms.getNode();
760  if (!thissop) return getAccumulate();
761  bool result;
762  OP_Utils::evalOpParm(result, thissop, "accumulate", cookparms.getCookTime(), 0);
763  return result;
764  }
765  bool getExtrapolate() const { return myExtrapolate; }
766  void setExtrapolate(bool val) { myExtrapolate = val; }
767  bool opExtrapolate(const SOP_NodeVerb::CookParms &cookparms) const
768  {
769  SOP_Node *thissop = cookparms.getNode();
770  if (!thissop) return getExtrapolate();
771  bool result;
772  OP_Utils::evalOpParm(result, thissop, "extrapolate", cookparms.getCookTime(), 0);
773  return result;
774  }
775  bool getUsemaxextrapolate() const { return myUsemaxextrapolate; }
776  void setUsemaxextrapolate(bool val) { myUsemaxextrapolate = val; }
777  bool opUsemaxextrapolate(const SOP_NodeVerb::CookParms &cookparms) const
778  {
779  SOP_Node *thissop = cookparms.getNode();
780  if (!thissop) return getUsemaxextrapolate();
781  bool result;
782  OP_Utils::evalOpParm(result, thissop, "usemaxextrapolate", cookparms.getCookTime(), 0);
783  return result;
784  }
785  fpreal64 getMaxextrapolate() const { return myMaxextrapolate; }
786  void setMaxextrapolate(fpreal64 val) { myMaxextrapolate = val; }
788  {
789  SOP_Node *thissop = cookparms.getNode();
790  if (!thissop) return getMaxextrapolate();
792  OP_Utils::evalOpParm(result, thissop, "maxextrapolate", cookparms.getCookTime(), 0);
793  return result;
794  }
795  bool getUsemaxextrapolatedist() const { return myUsemaxextrapolatedist; }
796  void setUsemaxextrapolatedist(bool val) { myUsemaxextrapolatedist = val; }
798  {
799  SOP_Node *thissop = cookparms.getNode();
800  if (!thissop) return getUsemaxextrapolatedist();
801  bool result;
802  OP_Utils::evalOpParm(result, thissop, "usemaxextrapolatedist", cookparms.getCookTime(), 0);
803  return result;
804  }
805  fpreal64 getMaxextrapolatedist() const { return myMaxextrapolatedist; }
806  void setMaxextrapolatedist(fpreal64 val) { myMaxextrapolatedist = val; }
808  {
809  SOP_Node *thissop = cookparms.getNode();
810  if (!thissop) return getMaxextrapolatedist();
812  OP_Utils::evalOpParm(result, thissop, "maxextrapolatedist", cookparms.getCookTime(), 0);
813  return result;
814  }
815  fpreal64 getThreshold() const { return myThreshold; }
816  void setThreshold(fpreal64 val) { myThreshold = val; }
818  {
819  SOP_Node *thissop = cookparms.getNode();
820  if (!thissop) return getThreshold();
822  OP_Utils::evalOpParm(result, thissop, "threshold", cookparms.getCookTime(), 0);
823  return result;
824  }
825  fpreal64 getBandwidth() const { return myBandwidth; }
826  void setBandwidth(fpreal64 val) { myBandwidth = val; }
828  {
829  SOP_Node *thissop = cookparms.getNode();
830  if (!thissop) return getBandwidth();
832  OP_Utils::evalOpParm(result, thissop, "bandwidth", cookparms.getCookTime(), 0);
833  return result;
834  }
835  Calculationtype getCalculationtype() const { return Calculationtype(myCalculationtype); }
836  void setCalculationtype(Calculationtype val) { myCalculationtype = int64(val); }
838  {
839  SOP_Node *thissop = cookparms.getNode();
840  if (!thissop) return getCalculationtype();
841  int64 result;
842  OP_Utils::evalOpParm(result, thissop, "calculationtype", cookparms.getCookTime(), 0);
843  return Calculationtype(result);
844  }
845  fpreal64 getDstpreadd() const { return myDstpreadd; }
846  void setDstpreadd(fpreal64 val) { myDstpreadd = val; }
848  {
849  SOP_Node *thissop = cookparms.getNode();
850  if (!thissop) return getDstpreadd();
852  OP_Utils::evalOpParm(result, thissop, "dstpreadd", cookparms.getCookTime(), 0);
853  return result;
854  }
855  fpreal64 getDstpremul() const { return myDstpremul; }
856  void setDstpremul(fpreal64 val) { myDstpremul = val; }
858  {
859  SOP_Node *thissop = cookparms.getNode();
860  if (!thissop) return getDstpremul();
862  OP_Utils::evalOpParm(result, thissop, "dstpremul", cookparms.getCookTime(), 0);
863  return result;
864  }
865  bool getScalebyvolume() const { return myScalebyvolume; }
866  void setScalebyvolume(bool val) { myScalebyvolume = val; }
867  bool opScalebyvolume(const SOP_NodeVerb::CookParms &cookparms) const
868  {
869  SOP_Node *thissop = cookparms.getNode();
870  if (!thissop) return getScalebyvolume();
871  bool result;
872  OP_Utils::evalOpParm(result, thissop, "scalebyvolume", cookparms.getCookTime(), 0);
873  return result;
874  }
875  fpreal64 getSrcpreadd() const { return mySrcpreadd; }
876  void setSrcpreadd(fpreal64 val) { mySrcpreadd = val; }
878  {
879  SOP_Node *thissop = cookparms.getNode();
880  if (!thissop) return getSrcpreadd();
882  OP_Utils::evalOpParm(result, thissop, "srcpreadd", cookparms.getCookTime(), 0);
883  return result;
884  }
885  fpreal64 getSrcpremul() const { return mySrcpremul; }
886  void setSrcpremul(fpreal64 val) { mySrcpremul = val; }
888  {
889  SOP_Node *thissop = cookparms.getNode();
890  if (!thissop) return getSrcpremul();
892  OP_Utils::evalOpParm(result, thissop, "srcpremul", cookparms.getCookTime(), 0);
893  return result;
894  }
895  fpreal64 getPostadd() const { return myPostadd; }
896  void setPostadd(fpreal64 val) { myPostadd = val; }
898  {
899  SOP_Node *thissop = cookparms.getNode();
900  if (!thissop) return getPostadd();
902  OP_Utils::evalOpParm(result, thissop, "postadd", cookparms.getCookTime(), 0);
903  return result;
904  }
905  fpreal64 getPostmul() const { return myPostmul; }
906  void setPostmul(fpreal64 val) { myPostmul = val; }
908  {
909  SOP_Node *thissop = cookparms.getNode();
910  if (!thissop) return getPostmul();
912  OP_Utils::evalOpParm(result, thissop, "postmul", cookparms.getCookTime(), 0);
913  return result;
914  }
915 
916 private:
917  UT_StringHolder myGroup;
918  UT_StringHolder myPointgrp;
919  bool myUseattrib;
920  UT_StringHolder myAttrib;
921  bool myDisableonmissing;
922  bool myAccumulate;
923  bool myExtrapolate;
924  bool myUsemaxextrapolate;
925  fpreal64 myMaxextrapolate;
926  bool myUsemaxextrapolatedist;
927  fpreal64 myMaxextrapolatedist;
928  fpreal64 myThreshold;
929  fpreal64 myBandwidth;
930  int64 myCalculationtype;
931  fpreal64 myDstpreadd;
932  fpreal64 myDstpremul;
933  bool myScalebyvolume;
934  fpreal64 mySrcpreadd;
935  fpreal64 mySrcpremul;
936  fpreal64 myPostadd;
937  fpreal64 myPostmul;
938 
939 };
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, int64 v)
const UT_StringHolder & getPointgrp() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
fpreal64 opMaxextrapolatedist(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, bool &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, exint &value) const override
const GLdouble * v
Definition: glcorearb.h:837
void setCalculationtype(Calculationtype val)
fpreal getTime() const
Definition: OP_Context.h:62
static void loadData(UT_IStream &is, UT_Vector3D &v)
const UT_StringHolder & getGroup() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
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
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
bool opDisableonmissing(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
**But if you need a result
Definition: thread.h:613
const UT_StringHolder & getAttrib() const
void setPointgrp(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void loadData(UT_IStream &is, UT_Vector3I &v)
ParmType getNestParmType(TempIndex fieldnum) const override
void setGroup(const UT_StringHolder &val)
const char * getNestParmName(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void loadData(UT_IStream &is, UT_Vector2I &v)
bool operator==(const SOP_VolumeFromAttribParms &src) 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
bool opScalebyvolume(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opBandwidth(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
SYS_FORCE_INLINE UT_StringHolder getToken(Calculationtype enum_value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_StringHolder opPointgrp(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
Calculationtype getCalculationtype() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
exint length() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
fpreal64 opSrcpremul(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
bool opUsemaxextrapolatedist(const SOP_NodeVerb::CookParms &cookparms) const
bool opUseattrib(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
long long int64
Definition: SYS_Types.h:116
bool opExtrapolate(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
Calculationtype opCalculationtype(const SOP_NodeVerb::CookParms &cookparms) 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_Vector2D &value) override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
GT_API const UT_StringHolder version
fpreal64 opPostadd(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opDstpremul(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
fpreal64 opMaxextrapolate(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opDstpreadd(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_VolumeFromAttribParms &src) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
fpreal64 opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
GLuint GLfloat * val
Definition: glcorearb.h:1608
static void saveData(std::ostream &os, UT_Vector3D v)
#define SOP_API
Definition: SOP_API.h:10
void setAttrib(const UT_StringHolder &val)
fpreal64 opSrcpreadd(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
UT_StringHolder opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
GLboolean r
Definition: glcorearb.h:1222
bool opUsemaxextrapolate(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
fpreal64 opPostmul(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
type
Definition: core.h:1059
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool opAccumulate(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, bool v)
exint getNestNumParms(TempIndex idx) const override
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
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