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