HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_AttribFromVolume.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_AttribFromVolumeEnums
24 {
25  enum class Type
26  {
27  FLOAT = 0,
28  INT,
29  VECTOR
30  };
31 
33  getToken(Type enum_value)
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case Type::FLOAT: return "float"_sh;
38  case Type::INT: return "int"_sh;
39  case Type::VECTOR: return "vector"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class MonoRampMode
45  {
46  CLAMP = 0,
47  PERIODIC
48  };
49 
51  getToken(MonoRampMode enum_value)
52  {
53  using namespace UT::Literal;
54  switch (enum_value) {
55  case MonoRampMode::CLAMP: return "clamp"_sh;
56  case MonoRampMode::PERIODIC: return "periodic"_sh;
57  default: UT_ASSERT(false); return ""_sh;
58  }
59  }
60 
61  enum class Monopreset
62  {
63  NONE = 0,
64  INCREASING,
66  HILL,
67  VALLEY,
68  STEP,
69  SQUARE
70  };
71 
73  getToken(Monopreset enum_value)
74  {
75  using namespace UT::Literal;
76  switch (enum_value) {
77  case Monopreset::NONE: return "none"_sh;
78  case Monopreset::INCREASING: return "increasing"_sh;
79  case Monopreset::DESCREASING: return "descreasing"_sh;
80  case Monopreset::HILL: return "hill"_sh;
81  case Monopreset::VALLEY: return "valley"_sh;
82  case Monopreset::STEP: return "step"_sh;
83  case Monopreset::SQUARE: return "square"_sh;
84  default: UT_ASSERT(false); return ""_sh;
85  }
86  }
87 
88  enum class VectorRampMode
89  {
90  CLAMP = 0,
91  PERIODIC
92  };
93 
95  getToken(VectorRampMode enum_value)
96  {
97  using namespace UT::Literal;
98  switch (enum_value) {
99  case VectorRampMode::CLAMP: return "clamp"_sh;
100  case VectorRampMode::PERIODIC: return "periodic"_sh;
101  default: UT_ASSERT(false); return ""_sh;
102  }
103  }
104 
105  enum class Vectorpreset
106  {
107  NONE = 0,
108  FALSE_,
109  PINK,
110  MONO,
111  BLACKBODY,
112  BIPARTITE
113  };
114 
116  getToken(Vectorpreset enum_value)
117  {
118  using namespace UT::Literal;
119  switch (enum_value) {
120  case Vectorpreset::NONE: return "none"_sh;
121  case Vectorpreset::FALSE_: return "false"_sh;
122  case Vectorpreset::PINK: return "pink"_sh;
123  case Vectorpreset::MONO: return "mono"_sh;
124  case Vectorpreset::BLACKBODY: return "blackbody"_sh;
125  case Vectorpreset::BIPARTITE: return "bipartite"_sh;
126  default: UT_ASSERT(false); return ""_sh;
127  }
128  }
129 
130 }
131 
132 
134 {
135 public:
136  static int version() { return 1; }
137 
139  {
140  myGroup = ""_UTsh;
141  myField = ""_UTsh;
142  myName = "Cd"_UTsh;
143  myCreateVarMap = false;
144  myVarName = ""_UTsh;
145  myType = 0;
146  mySize = 3;
147  myDefault = UT_Vector4D(0,0,0,0);
148  myRangeIn = UT_Vector2D(0,1);
149  myMonoEnable = false;
150  myMonoRampMode = 0;
151  myMonopreset = 0;
152  myMonoRamp = UT_SharedPtr<UT_Ramp>(0);
153  myVectorEnable = false;
154  myVectorRampMode = 0;
155  myVectorpreset = 0;
156  myVectorRamp = UT_SharedPtr<UT_Ramp>(0);
157  myRangeOut = UT_Vector2D(0,1);
158 
159  }
160 
161  explicit SOP_AttribFromVolumeParms(const SOP_AttribFromVolumeParms &) = default;
164  SOP_AttribFromVolumeParms &operator=(SOP_AttribFromVolumeParms &&) noexcept = default;
165 
167 
169  {
170  if (myGroup != src.myGroup) return false;
171  if (myField != src.myField) return false;
172  if (myName != src.myName) return false;
173  if (myCreateVarMap != src.myCreateVarMap) return false;
174  if (myVarName != src.myVarName) return false;
175  if (myType != src.myType) return false;
176  if (mySize != src.mySize) return false;
177  if (myDefault != src.myDefault) return false;
178  if (myRangeIn != src.myRangeIn) return false;
179  if (myMonoEnable != src.myMonoEnable) return false;
180  if (myMonoRampMode != src.myMonoRampMode) return false;
181  if (myMonopreset != src.myMonopreset) return false;
182  if (myMonoRamp != src.myMonoRamp)
183  { if (!myMonoRamp || !src.myMonoRamp || !(*myMonoRamp == *src.myMonoRamp)) return false; }
184  if (myVectorEnable != src.myVectorEnable) return false;
185  if (myVectorRampMode != src.myVectorRampMode) return false;
186  if (myVectorpreset != src.myVectorpreset) return false;
187  if (myVectorRamp != src.myVectorRamp)
188  { if (!myVectorRamp || !src.myVectorRamp || !(*myVectorRamp == *src.myVectorRamp)) return false; }
189  if (myRangeOut != src.myRangeOut) return false;
190 
191 
192  if (baseGetSignature() != src.baseGetSignature()) return false;
193 
194  return true;
195  }
197  {
198  return !operator==(src);
199  }
205 
206 
207 
208  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
209  {
210  myGroup = ""_UTsh;
211  if (true)
212  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
213  myField = ""_UTsh;
214  if (true)
215  graph->evalOpParm(myField, nodeidx, "field", time, graph->isDirect()?nullptr:depnode);
216  myName = "Cd"_UTsh;
217  if (true)
218  graph->evalOpParm(myName, nodeidx, "name", time, graph->isDirect()?nullptr:depnode);
219  myCreateVarMap = false;
220  if (true)
221  graph->evalOpParm(myCreateVarMap, nodeidx, "createvarmap", time, graph->isDirect()?nullptr:depnode);
222  myVarName = ""_UTsh;
223  if (true && ( (true&&!(((getCreateVarMap()==0)))) ) )
224  graph->evalOpParm(myVarName, nodeidx, "varname", time, graph->isDirect()?nullptr:depnode);
225  myType = 0;
226  if (true)
227  graph->evalOpParm(myType, nodeidx, "type", time, graph->isDirect()?nullptr:depnode);
228  mySize = 3;
229  if (true)
230  graph->evalOpParm(mySize, nodeidx, "size", time, graph->isDirect()?nullptr:depnode);
231  myDefault = UT_Vector4D(0,0,0,0);
232  if (true)
233  graph->evalOpParm(myDefault, nodeidx, "default", time, graph->isDirect()?nullptr:depnode);
234  myRangeIn = UT_Vector2D(0,1);
235  if (true)
236  graph->evalOpParm(myRangeIn, nodeidx, "rangein", time, graph->isDirect()?nullptr:depnode);
237  myMonoEnable = false;
238  if (true)
239  graph->evalOpParm(myMonoEnable, nodeidx, "monoenable", time, graph->isDirect()?nullptr:depnode);
240  myMonoRampMode = 0;
241  if (true && ( (true&&!(((getMonoEnable()==0)))) ) )
242  graph->evalOpParm(myMonoRampMode, nodeidx, "monorampmode", time, graph->isDirect()?nullptr:depnode);
243  myMonopreset = 0;
244  if (true && ( (true&&!(((getMonoEnable()==0)))) ) )
245  graph->evalOpParm(myMonopreset, nodeidx, "monopreset", time, graph->isDirect()?nullptr:depnode);
246  myMonoRamp = UT_SharedPtr<UT_Ramp>(0);
247  if (true && ( (true&&!(((getMonoEnable()==0)))) ) )
248  graph->evalOpParm(myMonoRamp, nodeidx, "monoramp", time, graph->isDirect()?nullptr:depnode);
249  myVectorEnable = false;
250  if (true)
251  graph->evalOpParm(myVectorEnable, nodeidx, "vectorenable", time, graph->isDirect()?nullptr:depnode);
252  myVectorRampMode = 0;
253  if (true && ( (true&&!(((getVectorEnable()==0)))) ) )
254  graph->evalOpParm(myVectorRampMode, nodeidx, "vectorrampmode", time, graph->isDirect()?nullptr:depnode);
255  myVectorpreset = 0;
256  if (true && ( (true&&!(((getVectorEnable()==0)))) ) )
257  graph->evalOpParm(myVectorpreset, nodeidx, "vectorpreset", time, graph->isDirect()?nullptr:depnode);
258  myVectorRamp = UT_SharedPtr<UT_Ramp>(0);
259  if (true && ( (true&&!(((getVectorEnable()==0)))) ) )
260  graph->evalOpParm(myVectorRamp, nodeidx, "vectorramp", time, graph->isDirect()?nullptr:depnode);
261  myRangeOut = UT_Vector2D(0,1);
262  if (true)
263  graph->evalOpParm(myRangeOut, nodeidx, "rangeout", time, graph->isDirect()?nullptr:depnode);
264 
265  }
266 
267 
268  void loadFromOpSubclass(const LoadParms &loadparms) override
269  {
270  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
271  }
272 
273 
274  void copyFrom(const OP_NodeParms *src) override
275  {
276  *this = *((const SOP_AttribFromVolumeParms *)src);
277  }
278 
279  template <typename T>
280  void
281  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
282  {
283  if (idx.size() < 1)
284  return;
285  UT_ASSERT(idx.size() == instance.size()+1);
286  if (idx.size() != instance.size()+1)
287  return;
288  switch (idx[0])
289  {
290  case 0:
291  coerceValue(value, myGroup);
292  break;
293  case 1:
294  coerceValue(value, myField);
295  break;
296  case 2:
297  coerceValue(value, myName);
298  break;
299  case 3:
300  coerceValue(value, myCreateVarMap);
301  break;
302  case 4:
303  coerceValue(value, myVarName);
304  break;
305  case 5:
306  coerceValue(value, myType);
307  break;
308  case 6:
309  coerceValue(value, mySize);
310  break;
311  case 7:
312  coerceValue(value, myDefault);
313  break;
314  case 8:
315  coerceValue(value, myRangeIn);
316  break;
317  case 9:
318  coerceValue(value, myMonoEnable);
319  break;
320  case 10:
321  coerceValue(value, myMonoRampMode);
322  break;
323  case 11:
324  coerceValue(value, myMonopreset);
325  break;
326  case 12:
327  coerceValue(value, myMonoRamp);
328  break;
329  case 13:
330  coerceValue(value, myVectorEnable);
331  break;
332  case 14:
333  coerceValue(value, myVectorRampMode);
334  break;
335  case 15:
336  coerceValue(value, myVectorpreset);
337  break;
338  case 16:
339  coerceValue(value, myVectorRamp);
340  break;
341  case 17:
342  coerceValue(value, myRangeOut);
343  break;
344 
345  }
346  }
347 
348  bool isParmColorRamp(exint idx) const override
349  {
350  switch (idx)
351  {
352  case 16:
353  return true;
354  }
355  return false;
356  }
357 
358  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
359  { doGetParmValue(idx, instance, value); }
360  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
361  { doGetParmValue(idx, instance, value); }
362  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
363  { doGetParmValue(idx, instance, value); }
364  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
365  { doGetParmValue(idx, instance, value); }
366  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
367  { doGetParmValue(idx, instance, value); }
368  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
369  { doGetParmValue(idx, instance, value); }
370  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
371  { doGetParmValue(idx, instance, value); }
372  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
373  { doGetParmValue(idx, instance, value); }
374  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
375  { doGetParmValue(idx, instance, value); }
376  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
377  { doGetParmValue(idx, instance, value); }
378  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
379  { doGetParmValue(idx, instance, value); }
380 
381  template <typename T>
382  void
383  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
384  {
385  if (idx.size() < 1)
386  return;
387  UT_ASSERT(idx.size() == instance.size()+1);
388  if (idx.size() != instance.size()+1)
389  return;
390  switch (idx[0])
391  {
392  case 0:
393  coerceValue(myGroup, ( ( value ) ));
394  break;
395  case 1:
396  coerceValue(myField, ( ( value ) ));
397  break;
398  case 2:
399  coerceValue(myName, ( ( value ) ));
400  break;
401  case 3:
402  coerceValue(myCreateVarMap, ( ( value ) ));
403  break;
404  case 4:
405  coerceValue(myVarName, ( ( value ) ));
406  break;
407  case 5:
408  coerceValue(myType, clampMinValue(0, clampMaxValue(2, value ) ));
409  break;
410  case 6:
411  coerceValue(mySize, clampMinValue(1, ( value ) ));
412  break;
413  case 7:
414  coerceValue(myDefault, ( ( value ) ));
415  break;
416  case 8:
417  coerceValue(myRangeIn, ( ( value ) ));
418  break;
419  case 9:
420  coerceValue(myMonoEnable, ( ( value ) ));
421  break;
422  case 10:
423  coerceValue(myMonoRampMode, clampMinValue(0, clampMaxValue(1, value ) ));
424  break;
425  case 11:
426  coerceValue(myMonopreset, clampMinValue(0, clampMaxValue(6, value ) ));
427  break;
428  case 12:
429  coerceValue(myMonoRamp, clampMinValue(1, ( value ) ));
430  break;
431  case 13:
432  coerceValue(myVectorEnable, ( ( value ) ));
433  break;
434  case 14:
435  coerceValue(myVectorRampMode, clampMinValue(0, clampMaxValue(1, value ) ));
436  break;
437  case 15:
438  coerceValue(myVectorpreset, clampMinValue(0, clampMaxValue(5, value ) ));
439  break;
440  case 16:
441  coerceValue(myVectorRamp, clampMinValue(1, ( value ) ));
442  break;
443  case 17:
444  coerceValue(myRangeOut, ( ( value ) ));
445  break;
446 
447  }
448  }
449 
450  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
451  { doSetParmValue(idx, instance, value); }
452  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
453  { doSetParmValue(idx, instance, value); }
454  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
455  { doSetParmValue(idx, instance, value); }
456  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
457  { doSetParmValue(idx, instance, value); }
458  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
459  { doSetParmValue(idx, instance, value); }
460  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
461  { doSetParmValue(idx, instance, value); }
462  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
463  { doSetParmValue(idx, instance, value); }
464  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
465  { doSetParmValue(idx, instance, value); }
466  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
467  { doSetParmValue(idx, instance, value); }
468  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
469  { doSetParmValue(idx, instance, value); }
470  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
471  { doSetParmValue(idx, instance, value); }
472 
473  exint getNestNumParms(TempIndex idx) const override
474  {
475  if (idx.size() == 0)
476  return 18;
477  switch (idx[0])
478  {
479 
480  }
481  // Invalid
482  return 0;
483  }
484 
485  const char *getNestParmName(TempIndex fieldnum) const override
486  {
487  if (fieldnum.size() < 1)
488  return 0;
489  switch (fieldnum[0])
490  {
491  case 0:
492  return "group";
493  case 1:
494  return "field";
495  case 2:
496  return "name";
497  case 3:
498  return "createvarmap";
499  case 4:
500  return "varname";
501  case 5:
502  return "type";
503  case 6:
504  return "size";
505  case 7:
506  return "default";
507  case 8:
508  return "rangein";
509  case 9:
510  return "monoenable";
511  case 10:
512  return "monorampmode";
513  case 11:
514  return "monopreset";
515  case 12:
516  return "monoramp";
517  case 13:
518  return "vectorenable";
519  case 14:
520  return "vectorrampmode";
521  case 15:
522  return "vectorpreset";
523  case 16:
524  return "vectorramp";
525  case 17:
526  return "rangeout";
527 
528  }
529  return 0;
530  }
531 
532  ParmType getNestParmType(TempIndex fieldnum) const override
533  {
534  if (fieldnum.size() < 1)
535  return PARM_UNSUPPORTED;
536  switch (fieldnum[0])
537  {
538  case 0:
539  return PARM_STRING;
540  case 1:
541  return PARM_STRING;
542  case 2:
543  return PARM_STRING;
544  case 3:
545  return PARM_INTEGER;
546  case 4:
547  return PARM_STRING;
548  case 5:
549  return PARM_INTEGER;
550  case 6:
551  return PARM_INTEGER;
552  case 7:
553  return PARM_VECTOR4;
554  case 8:
555  return PARM_VECTOR2;
556  case 9:
557  return PARM_INTEGER;
558  case 10:
559  return PARM_INTEGER;
560  case 11:
561  return PARM_INTEGER;
562  case 12:
563  return PARM_RAMP;
564  case 13:
565  return PARM_INTEGER;
566  case 14:
567  return PARM_INTEGER;
568  case 15:
569  return PARM_INTEGER;
570  case 16:
571  return PARM_RAMP;
572  case 17:
573  return PARM_VECTOR2;
574 
575  }
576  return PARM_UNSUPPORTED;
577  }
578 
579  // Boiler plate to load individual types.
580  static void loadData(UT_IStream &is, int64 &v)
581  { is.bread(&v, 1); }
582  static void loadData(UT_IStream &is, bool &v)
583  { int64 iv; is.bread(&iv, 1); v = iv; }
584  static void loadData(UT_IStream &is, fpreal64 &v)
585  { is.bread<fpreal64>(&v, 1); }
586  static void loadData(UT_IStream &is, UT_Vector2D &v)
587  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
588  static void loadData(UT_IStream &is, UT_Vector3D &v)
589  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
590  is.bread<fpreal64>(&v.z(), 1); }
591  static void loadData(UT_IStream &is, UT_Vector4D &v)
592  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
593  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
594  static void loadData(UT_IStream &is, UT_Matrix2D &v)
595  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
596  static void loadData(UT_IStream &is, UT_Matrix3D &v)
597  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
598  static void loadData(UT_IStream &is, UT_Matrix4D &v)
599  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
600  static void loadData(UT_IStream &is, UT_Vector2I &v)
601  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
602  static void loadData(UT_IStream &is, UT_Vector3I &v)
603  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
604  is.bread<int64>(&v.z(), 1); }
605  static void loadData(UT_IStream &is, UT_Vector4I &v)
606  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
607  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
609  { is.bread(v); }
611  { UT_StringHolder rampdata;
612  loadData(is, rampdata);
613  if (rampdata.isstring())
614  {
615  v.reset(new UT_Ramp());
616  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
617  v->load(istr);
618  }
619  else v.reset();
620  }
623  loadData(is, data);
624  if (data.isstring())
625  {
626  // Find the data type.
627  const char *colon = UT_StringWrap(data).findChar(':');
628  if (colon)
629  {
630  int typelen = colon - data.buffer();
632  type.strncpy(data.buffer(), typelen);
633  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
634 
635  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
636  }
637  }
638  else v.reset();
639  }
640 
641  static void saveData(std::ostream &os, int64 v)
642  { UTwrite(os, &v); }
643  static void saveData(std::ostream &os, bool v)
644  { int64 iv = v; UTwrite(os, &iv); }
645  static void saveData(std::ostream &os, fpreal64 v)
646  { UTwrite<fpreal64>(os, &v); }
647  static void saveData(std::ostream &os, UT_Vector2D v)
648  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
649  static void saveData(std::ostream &os, UT_Vector3D v)
650  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
651  UTwrite<fpreal64>(os, &v.z()); }
652  static void saveData(std::ostream &os, UT_Vector4D v)
653  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
654  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
655  static void saveData(std::ostream &os, UT_Matrix2D v)
657  static void saveData(std::ostream &os, UT_Matrix3D v)
659  static void saveData(std::ostream &os, UT_Matrix4D v)
661  static void saveData(std::ostream &os, UT_StringHolder s)
662  { UT_StringWrap(s).saveBinary(os); }
663  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
665  UT_OStringStream ostr;
666  if (s) s->save(ostr);
667  result = ostr.str();
668  saveData(os, result);
669  }
670  static void saveData(std::ostream &os, PRM_DataItemHandle s)
672  UT_OStringStream ostr;
673  if (s)
674  {
675  ostr << s->getDataTypeToken();
676  ostr << ":";
677  s->saveBinary(ostr);
678  }
679  result = ostr.str();
680  saveData(os, result);
681  }
682 
683 
684  void save(std::ostream &os) const
685  {
686  int32 v = version();
687  UTwrite(os, &v);
688  saveData(os, myGroup);
689  saveData(os, myField);
690  saveData(os, myName);
691  saveData(os, myCreateVarMap);
692  saveData(os, myVarName);
693  saveData(os, myType);
694  saveData(os, mySize);
695  saveData(os, myDefault);
696  saveData(os, myRangeIn);
697  saveData(os, myMonoEnable);
698  saveData(os, myMonoRampMode);
699  saveData(os, myMonopreset);
700  saveData(os, myMonoRamp);
701  saveData(os, myVectorEnable);
702  saveData(os, myVectorRampMode);
703  saveData(os, myVectorpreset);
704  saveData(os, myVectorRamp);
705  saveData(os, myRangeOut);
706 
707  }
708 
709  bool load(UT_IStream &is)
710  {
711  int32 v;
712  is.bread(&v, 1);
713  if (version() != v)
714  {
715  // Fail incompatible versions
716  return false;
717  }
718  loadData(is, myGroup);
719  loadData(is, myField);
720  loadData(is, myName);
721  loadData(is, myCreateVarMap);
722  loadData(is, myVarName);
723  loadData(is, myType);
724  loadData(is, mySize);
725  loadData(is, myDefault);
726  loadData(is, myRangeIn);
727  loadData(is, myMonoEnable);
728  loadData(is, myMonoRampMode);
729  loadData(is, myMonopreset);
730  loadData(is, myMonoRamp);
731  loadData(is, myVectorEnable);
732  loadData(is, myVectorRampMode);
733  loadData(is, myVectorpreset);
734  loadData(is, myVectorRamp);
735  loadData(is, myRangeOut);
736 
737  return true;
738  }
739 
740  const UT_StringHolder & getGroup() const { return myGroup; }
741  void setGroup(const UT_StringHolder & val) { myGroup = val; }
743  {
744  SOP_Node *thissop = cookparms.getNode();
745  if (!thissop) return getGroup();
747  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
748  return result;
749  }
750  const UT_StringHolder & getField() const { return myField; }
751  void setField(const UT_StringHolder & val) { myField = val; }
753  {
754  SOP_Node *thissop = cookparms.getNode();
755  if (!thissop) return getField();
757  OP_Utils::evalOpParm(result, thissop, "field", cookparms.getCookTime(), 0);
758  return result;
759  }
760  const UT_StringHolder & getName() const { return myName; }
761  void setName(const UT_StringHolder & val) { myName = val; }
763  {
764  SOP_Node *thissop = cookparms.getNode();
765  if (!thissop) return getName();
767  OP_Utils::evalOpParm(result, thissop, "name", cookparms.getCookTime(), 0);
768  return result;
769  }
770  bool getCreateVarMap() const { return myCreateVarMap; }
771  void setCreateVarMap(bool val) { myCreateVarMap = val; }
772  bool opCreateVarMap(const SOP_NodeVerb::CookParms &cookparms) const
773  {
774  SOP_Node *thissop = cookparms.getNode();
775  if (!thissop) return getCreateVarMap();
776  bool result;
777  OP_Utils::evalOpParm(result, thissop, "createvarmap", cookparms.getCookTime(), 0);
778  return result;
779  }
780  const UT_StringHolder & getVarName() const { return myVarName; }
781  void setVarName(const UT_StringHolder & val) { myVarName = val; }
783  {
784  SOP_Node *thissop = cookparms.getNode();
785  if (!thissop) return getVarName();
787  OP_Utils::evalOpParm(result, thissop, "varname", cookparms.getCookTime(), 0);
788  return result;
789  }
790  Type getType() const { return Type(myType); }
791  void setType(Type val) { myType = int64(val); }
792  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
793  {
794  SOP_Node *thissop = cookparms.getNode();
795  if (!thissop) return getType();
796  int64 result;
797  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
798  return Type(result);
799  }
800  int64 getSize() const { return mySize; }
801  void setSize(int64 val) { mySize = val; }
802  int64 opSize(const SOP_NodeVerb::CookParms &cookparms) const
803  {
804  SOP_Node *thissop = cookparms.getNode();
805  if (!thissop) return getSize();
806  int64 result;
807  OP_Utils::evalOpParm(result, thissop, "size", cookparms.getCookTime(), 0);
808  return result;
809  }
810  UT_Vector4D getDefault() const { return myDefault; }
811  void setDefault(UT_Vector4D val) { myDefault = val; }
813  {
814  SOP_Node *thissop = cookparms.getNode();
815  if (!thissop) return getDefault();
817  OP_Utils::evalOpParm(result, thissop, "default", cookparms.getCookTime(), 0);
818  return result;
819  }
820  UT_Vector2D getRangeIn() const { return myRangeIn; }
821  void setRangeIn(UT_Vector2D val) { myRangeIn = val; }
823  {
824  SOP_Node *thissop = cookparms.getNode();
825  if (!thissop) return getRangeIn();
827  OP_Utils::evalOpParm(result, thissop, "rangein", cookparms.getCookTime(), 0);
828  return result;
829  }
830  bool getMonoEnable() const { return myMonoEnable; }
831  void setMonoEnable(bool val) { myMonoEnable = val; }
832  bool opMonoEnable(const SOP_NodeVerb::CookParms &cookparms) const
833  {
834  SOP_Node *thissop = cookparms.getNode();
835  if (!thissop) return getMonoEnable();
836  bool result;
837  OP_Utils::evalOpParm(result, thissop, "monoenable", cookparms.getCookTime(), 0);
838  return result;
839  }
840  MonoRampMode getMonoRampMode() const { return MonoRampMode(myMonoRampMode); }
841  void setMonoRampMode(MonoRampMode val) { myMonoRampMode = int64(val); }
843  {
844  SOP_Node *thissop = cookparms.getNode();
845  if (!thissop) return getMonoRampMode();
846  int64 result;
847  OP_Utils::evalOpParm(result, thissop, "monorampmode", cookparms.getCookTime(), 0);
848  return MonoRampMode(result);
849  }
850  Monopreset getMonopreset() const { return Monopreset(myMonopreset); }
851  void setMonopreset(Monopreset val) { myMonopreset = int64(val); }
853  {
854  SOP_Node *thissop = cookparms.getNode();
855  if (!thissop) return getMonopreset();
856  int64 result;
857  OP_Utils::evalOpParm(result, thissop, "monopreset", cookparms.getCookTime(), 0);
858  return Monopreset(result);
859  }
860  UT_SharedPtr<UT_Ramp> getMonoRamp() const { return myMonoRamp; }
861  void setMonoRamp(UT_SharedPtr<UT_Ramp> val) { myMonoRamp = val; }
863  {
864  SOP_Node *thissop = cookparms.getNode();
865  if (!thissop) return getMonoRamp();
867  OP_Utils::evalOpParm(result, thissop, "monoramp", cookparms.getCookTime(), 0);
868  return result;
869  }
870  bool getVectorEnable() const { return myVectorEnable; }
871  void setVectorEnable(bool val) { myVectorEnable = val; }
872  bool opVectorEnable(const SOP_NodeVerb::CookParms &cookparms) const
873  {
874  SOP_Node *thissop = cookparms.getNode();
875  if (!thissop) return getVectorEnable();
876  bool result;
877  OP_Utils::evalOpParm(result, thissop, "vectorenable", cookparms.getCookTime(), 0);
878  return result;
879  }
880  VectorRampMode getVectorRampMode() const { return VectorRampMode(myVectorRampMode); }
881  void setVectorRampMode(VectorRampMode val) { myVectorRampMode = int64(val); }
883  {
884  SOP_Node *thissop = cookparms.getNode();
885  if (!thissop) return getVectorRampMode();
886  int64 result;
887  OP_Utils::evalOpParm(result, thissop, "vectorrampmode", cookparms.getCookTime(), 0);
888  return VectorRampMode(result);
889  }
890  Vectorpreset getVectorpreset() const { return Vectorpreset(myVectorpreset); }
891  void setVectorpreset(Vectorpreset val) { myVectorpreset = int64(val); }
893  {
894  SOP_Node *thissop = cookparms.getNode();
895  if (!thissop) return getVectorpreset();
896  int64 result;
897  OP_Utils::evalOpParm(result, thissop, "vectorpreset", cookparms.getCookTime(), 0);
898  return Vectorpreset(result);
899  }
900  UT_SharedPtr<UT_Ramp> getVectorRamp() const { return myVectorRamp; }
901  void setVectorRamp(UT_SharedPtr<UT_Ramp> val) { myVectorRamp = val; }
903  {
904  SOP_Node *thissop = cookparms.getNode();
905  if (!thissop) return getVectorRamp();
907  OP_Utils::evalOpParm(result, thissop, "vectorramp", cookparms.getCookTime(), 0);
908  return result;
909  }
910  UT_Vector2D getRangeOut() const { return myRangeOut; }
911  void setRangeOut(UT_Vector2D val) { myRangeOut = val; }
913  {
914  SOP_Node *thissop = cookparms.getNode();
915  if (!thissop) return getRangeOut();
917  OP_Utils::evalOpParm(result, thissop, "rangeout", cookparms.getCookTime(), 0);
918  return result;
919  }
920 
921 private:
922  UT_StringHolder myGroup;
923  UT_StringHolder myField;
924  UT_StringHolder myName;
925  bool myCreateVarMap;
926  UT_StringHolder myVarName;
927  int64 myType;
928  int64 mySize;
929  UT_Vector4D myDefault;
930  UT_Vector2D myRangeIn;
931  bool myMonoEnable;
932  int64 myMonoRampMode;
933  int64 myMonopreset;
934  UT_SharedPtr<UT_Ramp> myMonoRamp;
935  bool myVectorEnable;
936  int64 myVectorRampMode;
937  int64 myVectorpreset;
938  UT_SharedPtr<UT_Ramp> myVectorRamp;
939  UT_Vector2D myRangeOut;
940 
941 };
UT_SharedPtr< UT_Ramp > opVectorRamp(const SOP_NodeVerb::CookParms &cookparms) const
type
Definition: core.h:556
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setVectorRamp(UT_SharedPtr< UT_Ramp > val)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void save(std::ostream &os) const
void setMonoRamp(UT_SharedPtr< UT_Ramp > val)
exint getNestNumParms(TempIndex idx) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_SharedPtr< UT_Ramp > opMonoRamp(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D opRangeOut(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
UT_Vector2T< fpreal64 > UT_Vector2D
static void saveData(std::ostream &os, UT_Matrix4D v)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
UT_StringHolder opVarName(const SOP_NodeVerb::CookParms &cookparms) const
MonoRampMode opMonoRampMode(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
static void loadData(UT_IStream &is, int64 &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void setMonoRampMode(MonoRampMode val)
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
UT_SharedPtr< UT_Ramp > getMonoRamp() const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
**But if you need a result
Definition: thread.h:622
UT_Vector4D opDefault(const SOP_NodeVerb::CookParms &cookparms) const
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void loadData(UT_IStream &is, UT_Vector4D &v)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const 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
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setName(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
Vectorpreset opVectorpreset(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
UT_Vector2D opRangeIn(const SOP_NodeVerb::CookParms &cookparms) const
bool opCreateVarMap(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
exint length() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void copyFrom(const OP_NodeParms *src) override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void loadData(UT_IStream &is, fpreal64 &v)
const UT_StringHolder & getName() const
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
void setVectorRampMode(VectorRampMode val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void loadData(UT_IStream &is, UT_Matrix2D &v)
const UT_StringHolder & getGroup() const
long long int64
Definition: SYS_Types.h:116
UT_StringHolder opField(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
int64 opSize(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setVarName(const UT_StringHolder &val)
void setGroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, UT_Vector3D v)
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, int64 v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
static void saveData(std::ostream &os, UT_Matrix3D v)
GT_API const UT_StringHolder version
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool operator==(const SOP_AttribFromVolumeParms &src) const
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
bool opVectorEnable(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setField(const UT_StringHolder &val)
UT_StringHolder opName(const SOP_NodeVerb::CookParms &cookparms) const
void setVectorpreset(Vectorpreset val)
static void saveData(std::ostream &os, bool v)
VectorRampMode getVectorRampMode() const
fpreal64 fpreal
Definition: SYS_Types.h:278
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
bool operator!=(const SOP_AttribFromVolumeParms &src) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
const char * getNestParmName(TempIndex fieldnum) const 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
#define SOP_API
Definition: SOP_API.h:10
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, fpreal64 v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool opMonoEnable(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
const UT_StringHolder & getVarName() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Vector2D &v)
const UT_GeometryPredicates< REAL, false, true > & getDefault()
GLboolean r
Definition: glcorearb.h:1222
static void loadData(UT_IStream &is, UT_Vector3I &v)
UT_Vector4T< fpreal64 > UT_Vector4D
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
const UT_StringHolder & getField() const
VectorRampMode opVectorRampMode(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< UT_Ramp > getVectorRamp() const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
Monopreset opMonopreset(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_StringHolder s)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1793
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663