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