HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_AttribInterpolate.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_AttribInterpolateEnums
24 {
25  enum class Totype
26  {
27  POINTS = 0,
28  VERTICES,
29  PRIMS,
30  DETAIL
31  };
32 
34  getToken(Totype enum_value)
35  {
36  using namespace UT::Literal;
37  switch (enum_value) {
38  case Totype::POINTS: return "points"_sh;
39  case Totype::VERTICES: return "vertices"_sh;
40  case Totype::PRIMS: return "prims"_sh;
41  case Totype::DETAIL: return "detail"_sh;
42  default: UT_ASSERT(false); return ""_sh;
43  }
44  }
45 
46  enum class Interpby
47  {
48  PRIMUVW = 0,
52  };
53 
55  getToken(Interpby enum_value)
56  {
57  using namespace UT::Literal;
58  switch (enum_value) {
59  case Interpby::PRIMUVW: return "primuvw"_sh;
60  case Interpby::POINTWEIGHTS: return "pointweights"_sh;
61  case Interpby::VERTWEIGHTS: return "vertweights"_sh;
62  case Interpby::PRIMWEIGHTS: return "primweights"_sh;
63  default: UT_ASSERT(false); return ""_sh;
64  }
65  }
66 
67  enum class Computenumberstype
68  {
69  NUMBERTYPEPOINT = 0,
71  };
72 
75  {
76  using namespace UT::Literal;
77  switch (enum_value) {
78  case Computenumberstype::NUMBERTYPEPOINT: return "numbertypepoint"_sh;
79  case Computenumberstype::NUMBERTYPEVERTEX: return "numbertypevertex"_sh;
80  default: UT_ASSERT(false); return ""_sh;
81  }
82  }
83 
84 }
85 
86 
88 {
89 public:
90  static int version() { return 1; }
91 
93  {
94  myTotype = 0;
95  myInterpby = 0;
96  myNumberattrib = "sourceprim"_UTsh;
97  myWeightsattrib = "sourceprimuv"_UTsh;
98  myPointattribs = "*"_UTsh;
99  myVertattribs = ""_UTsh;
100  myPrimattribs = ""_UTsh;
101  myDetailattribs = ""_UTsh;
102  myMatchgroups = true;
103  myComputeweights = false;
104  myComputenumberstype = 1;
105  myComputednumbersattrib = "sourcevtxnums"_UTsh;
106  myComputedweightsattrib = "sourcevtxweights"_UTsh;
107  myPrescale = 1;
108  myNormalize = false;
109  myThreshold = 0;
110  myBlend = 0;
111  myGroup = ""_UTsh;
112 
113  }
114 
115  explicit SOP_AttribInterpolateParms(const SOP_AttribInterpolateParms &) = default;
118  SOP_AttribInterpolateParms &operator=(SOP_AttribInterpolateParms &&) noexcept = default;
119 
121 
123  {
124  if (myTotype != src.myTotype) return false;
125  if (myInterpby != src.myInterpby) return false;
126  if (myNumberattrib != src.myNumberattrib) return false;
127  if (myWeightsattrib != src.myWeightsattrib) return false;
128  if (myPointattribs != src.myPointattribs) return false;
129  if (myVertattribs != src.myVertattribs) return false;
130  if (myPrimattribs != src.myPrimattribs) return false;
131  if (myDetailattribs != src.myDetailattribs) return false;
132  if (myMatchgroups != src.myMatchgroups) return false;
133  if (myComputeweights != src.myComputeweights) return false;
134  if (myComputenumberstype != src.myComputenumberstype) return false;
135  if (myComputednumbersattrib != src.myComputednumbersattrib) return false;
136  if (myComputedweightsattrib != src.myComputedweightsattrib) return false;
137  if (myPrescale != src.myPrescale) return false;
138  if (myNormalize != src.myNormalize) return false;
139  if (myThreshold != src.myThreshold) return false;
140  if (myBlend != src.myBlend) return false;
141  if (myGroup != src.myGroup) return false;
142 
143  return true;
144  }
146  {
147  return !operator==(src);
148  }
152 
153 
154 
155  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
156  {
157  myTotype = 0;
158  if (true)
159  graph->evalOpParm(myTotype, nodeidx, "totype", time, 0);
160  myInterpby = 0;
161  if (true)
162  graph->evalOpParm(myInterpby, nodeidx, "interpby", time, 0);
163  myNumberattrib = "sourceprim"_UTsh;
164  if (true)
165  graph->evalOpParm(myNumberattrib, nodeidx, "numberattrib", time, 0);
166  myWeightsattrib = "sourceprimuv"_UTsh;
167  if (true)
168  graph->evalOpParm(myWeightsattrib, nodeidx, "weightsattrib", time, 0);
169  myPointattribs = "*"_UTsh;
170  if (true && ( (true&&!(((int64(getInterpby())==3)))) ) )
171  graph->evalOpParm(myPointattribs, nodeidx, "pointattribs", time, 0);
172  myVertattribs = ""_UTsh;
173  if (true && ( (true&&!(((int64(getInterpby())==3))||((int64(getInterpby())==1)))) ) )
174  graph->evalOpParm(myVertattribs, nodeidx, "vertattribs", time, 0);
175  myPrimattribs = ""_UTsh;
176  if (true && ( (true&&!(((int64(getInterpby())==1)))) ) )
177  graph->evalOpParm(myPrimattribs, nodeidx, "primattribs", time, 0);
178  myDetailattribs = ""_UTsh;
179  if (true)
180  graph->evalOpParm(myDetailattribs, nodeidx, "detailattribs", time, 0);
181  myMatchgroups = true;
182  if (true)
183  graph->evalOpParm(myMatchgroups, nodeidx, "matchgroups", time, 0);
184  myComputeweights = false;
185  if (true && ( (true&&!(((int64(getInterpby())!=0)))) ) )
186  graph->evalOpParm(myComputeweights, nodeidx, "computeweights", time, 0);
187  myComputenumberstype = 1;
188  if (true && ( (true&&!(((int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
189  graph->evalOpParm(myComputenumberstype, nodeidx, "computenumberstype", time, 0);
190  myComputednumbersattrib = "sourcevtxnums"_UTsh;
191  if (true && ( (true&&!(((int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
192  graph->evalOpParm(myComputednumbersattrib, nodeidx, "computednumbersattrib", time, 0);
193  myComputedweightsattrib = "sourcevtxweights"_UTsh;
194  if (true && ( (true&&!(((int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
195  graph->evalOpParm(myComputedweightsattrib, nodeidx, "computedweightsattrib", time, 0);
196  myPrescale = 1;
197  if (true)
198  graph->evalOpParm(myPrescale, nodeidx, "prescale", time, 0);
199  myNormalize = false;
200  if (true)
201  graph->evalOpParm(myNormalize, nodeidx, "normalize", time, 0);
202  myThreshold = 0;
203  if (true && ( (true&&!(((getNormalize()==0)))) ) )
204  graph->evalOpParm(myThreshold, nodeidx, "threshold", time, 0);
205  myBlend = 0;
206  if (true && ( (true&&!(((getNormalize()==0)))) ) )
207  graph->evalOpParm(myBlend, nodeidx, "blend", time, 0);
208  myGroup = ""_UTsh;
209  if (true && ( (true&&!(((int64(getTotype())==3)))) ) )
210  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
211 
212  }
213 
214 
215  void loadFromOpSubclass(const LoadParms &loadparms) override
216  {
217  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
218  }
219 
220 
221  void copyFrom(const OP_NodeParms *src) override
222  {
223  *this = *((const SOP_AttribInterpolateParms *)src);
224  }
225 
226  template <typename T>
227  void
228  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
229  {
230  if (idx.size() < 1)
231  return;
232  UT_ASSERT(idx.size() == instance.size()+1);
233  if (idx.size() != instance.size()+1)
234  return;
235  switch (idx[0])
236  {
237  case 0:
238  coerceValue(value, myTotype);
239  break;
240  case 1:
241  coerceValue(value, myInterpby);
242  break;
243  case 2:
244  coerceValue(value, myNumberattrib);
245  break;
246  case 3:
247  coerceValue(value, myWeightsattrib);
248  break;
249  case 4:
250  coerceValue(value, myPointattribs);
251  break;
252  case 5:
253  coerceValue(value, myVertattribs);
254  break;
255  case 6:
256  coerceValue(value, myPrimattribs);
257  break;
258  case 7:
259  coerceValue(value, myDetailattribs);
260  break;
261  case 8:
262  coerceValue(value, myMatchgroups);
263  break;
264  case 9:
265  coerceValue(value, myComputeweights);
266  break;
267  case 10:
268  coerceValue(value, myComputenumberstype);
269  break;
270  case 11:
271  coerceValue(value, myComputednumbersattrib);
272  break;
273  case 12:
274  coerceValue(value, myComputedweightsattrib);
275  break;
276  case 13:
277  coerceValue(value, myPrescale);
278  break;
279  case 14:
280  coerceValue(value, myNormalize);
281  break;
282  case 15:
283  coerceValue(value, myThreshold);
284  break;
285  case 16:
286  coerceValue(value, myBlend);
287  break;
288  case 17:
289  coerceValue(value, myGroup);
290  break;
291 
292  }
293  }
294 
295  bool isParmColorRamp(exint idx) const override
296  {
297  switch (idx)
298  {
299 
300  }
301  return false;
302  }
303 
304  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
305  { doGetParmValue(idx, instance, value); }
306  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
307  { doGetParmValue(idx, instance, value); }
308  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
309  { doGetParmValue(idx, instance, value); }
310  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
311  { doGetParmValue(idx, instance, value); }
312  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
313  { doGetParmValue(idx, instance, value); }
314  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
315  { doGetParmValue(idx, instance, value); }
316  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
317  { doGetParmValue(idx, instance, value); }
318  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
319  { doGetParmValue(idx, instance, value); }
320  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
321  { doGetParmValue(idx, instance, value); }
322  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
323  { doGetParmValue(idx, instance, value); }
324  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
325  { doGetParmValue(idx, instance, value); }
326 
327  template <typename T>
328  void
329  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
330  {
331  if (idx.size() < 1)
332  return;
333  UT_ASSERT(idx.size() == instance.size()+1);
334  if (idx.size() != instance.size()+1)
335  return;
336  switch (idx[0])
337  {
338  case 0:
339  coerceValue(myTotype, clampMinValue(0, clampMaxValue(3, value ) ));
340  break;
341  case 1:
342  coerceValue(myInterpby, clampMinValue(0, clampMaxValue(3, value ) ));
343  break;
344  case 2:
345  coerceValue(myNumberattrib, ( ( value ) ));
346  break;
347  case 3:
348  coerceValue(myWeightsattrib, ( ( value ) ));
349  break;
350  case 4:
351  coerceValue(myPointattribs, ( ( value ) ));
352  break;
353  case 5:
354  coerceValue(myVertattribs, ( ( value ) ));
355  break;
356  case 6:
357  coerceValue(myPrimattribs, ( ( value ) ));
358  break;
359  case 7:
360  coerceValue(myDetailattribs, ( ( value ) ));
361  break;
362  case 8:
363  coerceValue(myMatchgroups, ( ( value ) ));
364  break;
365  case 9:
366  coerceValue(myComputeweights, ( ( value ) ));
367  break;
368  case 10:
369  coerceValue(myComputenumberstype, clampMinValue(0, clampMaxValue(1, value ) ));
370  break;
371  case 11:
372  coerceValue(myComputednumbersattrib, ( ( value ) ));
373  break;
374  case 12:
375  coerceValue(myComputedweightsattrib, ( ( value ) ));
376  break;
377  case 13:
378  coerceValue(myPrescale, clampMinValue(0, ( value ) ));
379  break;
380  case 14:
381  coerceValue(myNormalize, ( ( value ) ));
382  break;
383  case 15:
384  coerceValue(myThreshold, clampMinValue(0, clampMaxValue(1, value ) ));
385  break;
386  case 16:
387  coerceValue(myBlend, clampMinValue(0, clampMaxValue(1, value ) ));
388  break;
389  case 17:
390  coerceValue(myGroup, ( ( value ) ));
391  break;
392 
393  }
394  }
395 
396  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
397  { doSetParmValue(idx, instance, value); }
398  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
399  { doSetParmValue(idx, instance, value); }
400  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
401  { doSetParmValue(idx, instance, value); }
402  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
403  { doSetParmValue(idx, instance, value); }
404  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
405  { doSetParmValue(idx, instance, value); }
406  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
407  { doSetParmValue(idx, instance, value); }
408  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
409  { doSetParmValue(idx, instance, value); }
410  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
411  { doSetParmValue(idx, instance, value); }
412  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
413  { doSetParmValue(idx, instance, value); }
414  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
415  { doSetParmValue(idx, instance, value); }
416  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
417  { doSetParmValue(idx, instance, value); }
418 
419  exint getNestNumParms(TempIndex idx) const override
420  {
421  if (idx.size() == 0)
422  return 18;
423  switch (idx[0])
424  {
425 
426  }
427  // Invalid
428  return 0;
429  }
430 
431  const char *getNestParmName(TempIndex fieldnum) const override
432  {
433  if (fieldnum.size() < 1)
434  return 0;
435  switch (fieldnum[0])
436  {
437  case 0:
438  return "totype";
439  case 1:
440  return "interpby";
441  case 2:
442  return "numberattrib";
443  case 3:
444  return "weightsattrib";
445  case 4:
446  return "pointattribs";
447  case 5:
448  return "vertattribs";
449  case 6:
450  return "primattribs";
451  case 7:
452  return "detailattribs";
453  case 8:
454  return "matchgroups";
455  case 9:
456  return "computeweights";
457  case 10:
458  return "computenumberstype";
459  case 11:
460  return "computednumbersattrib";
461  case 12:
462  return "computedweightsattrib";
463  case 13:
464  return "prescale";
465  case 14:
466  return "normalize";
467  case 15:
468  return "threshold";
469  case 16:
470  return "blend";
471  case 17:
472  return "group";
473 
474  }
475  return 0;
476  }
477 
478  ParmType getNestParmType(TempIndex fieldnum) const override
479  {
480  if (fieldnum.size() < 1)
481  return PARM_UNSUPPORTED;
482  switch (fieldnum[0])
483  {
484  case 0:
485  return PARM_INTEGER;
486  case 1:
487  return PARM_INTEGER;
488  case 2:
489  return PARM_STRING;
490  case 3:
491  return PARM_STRING;
492  case 4:
493  return PARM_STRING;
494  case 5:
495  return PARM_STRING;
496  case 6:
497  return PARM_STRING;
498  case 7:
499  return PARM_STRING;
500  case 8:
501  return PARM_INTEGER;
502  case 9:
503  return PARM_INTEGER;
504  case 10:
505  return PARM_INTEGER;
506  case 11:
507  return PARM_STRING;
508  case 12:
509  return PARM_STRING;
510  case 13:
511  return PARM_FLOAT;
512  case 14:
513  return PARM_INTEGER;
514  case 15:
515  return PARM_FLOAT;
516  case 16:
517  return PARM_FLOAT;
518  case 17:
519  return PARM_STRING;
520 
521  }
522  return PARM_UNSUPPORTED;
523  }
524 
525  // Boiler plate to load individual types.
526  static void loadData(UT_IStream &is, int64 &v)
527  { is.bread(&v, 1); }
528  static void loadData(UT_IStream &is, bool &v)
529  { int64 iv; is.bread(&iv, 1); v = iv; }
530  static void loadData(UT_IStream &is, fpreal64 &v)
531  { is.bread<fpreal64>(&v, 1); }
532  static void loadData(UT_IStream &is, UT_Vector2D &v)
533  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
534  static void loadData(UT_IStream &is, UT_Vector3D &v)
535  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
536  is.bread<fpreal64>(&v.z(), 1); }
537  static void loadData(UT_IStream &is, UT_Vector4D &v)
538  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
539  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
540  static void loadData(UT_IStream &is, UT_Matrix2D &v)
541  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
542  static void loadData(UT_IStream &is, UT_Matrix3D &v)
543  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
544  static void loadData(UT_IStream &is, UT_Matrix4D &v)
545  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
546  static void loadData(UT_IStream &is, UT_Vector2I &v)
547  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
548  static void loadData(UT_IStream &is, UT_Vector3I &v)
549  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
550  is.bread<int64>(&v.z(), 1); }
551  static void loadData(UT_IStream &is, UT_Vector4I &v)
552  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
553  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
555  { is.bread(v); }
557  { UT_StringHolder rampdata;
558  loadData(is, rampdata);
559  if (rampdata.isstring())
560  {
561  v.reset(new UT_Ramp());
562  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
563  v->load(istr);
564  }
565  else v.reset();
566  }
569  loadData(is, data);
570  if (data.isstring())
571  {
572  // Find the data type.
573  const char *colon = UT_StringWrap(data).findChar(':');
574  if (colon)
575  {
576  int typelen = colon - data.buffer();
578  type.strncpy(data.buffer(), typelen);
579  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
580 
581  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
582  }
583  }
584  else v.reset();
585  }
586 
587  static void saveData(std::ostream &os, int64 v)
588  { UTwrite(os, &v); }
589  static void saveData(std::ostream &os, bool v)
590  { int64 iv = v; UTwrite(os, &iv); }
591  static void saveData(std::ostream &os, fpreal64 v)
592  { UTwrite<fpreal64>(os, &v); }
593  static void saveData(std::ostream &os, UT_Vector2D v)
594  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
595  static void saveData(std::ostream &os, UT_Vector3D v)
596  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
597  UTwrite<fpreal64>(os, &v.z()); }
598  static void saveData(std::ostream &os, UT_Vector4D v)
599  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
600  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
601  static void saveData(std::ostream &os, UT_Matrix2D v)
603  static void saveData(std::ostream &os, UT_Matrix3D v)
605  static void saveData(std::ostream &os, UT_Matrix4D v)
607  static void saveData(std::ostream &os, UT_StringHolder s)
608  { UT_StringWrap(s).saveBinary(os); }
609  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
611  UT_OStringStream ostr;
612  if (s) s->save(ostr);
613  result = ostr.str();
614  saveData(os, result);
615  }
616  static void saveData(std::ostream &os, PRM_DataItemHandle s)
618  UT_OStringStream ostr;
619  if (s)
620  {
621  ostr << s->getDataTypeToken();
622  ostr << ":";
623  s->saveBinary(ostr);
624  }
625  result = ostr.str();
626  saveData(os, result);
627  }
628 
629 
630  void save(std::ostream &os) const
631  {
632  int32 v = version();
633  UTwrite(os, &v);
634  saveData(os, myTotype);
635  saveData(os, myInterpby);
636  saveData(os, myNumberattrib);
637  saveData(os, myWeightsattrib);
638  saveData(os, myPointattribs);
639  saveData(os, myVertattribs);
640  saveData(os, myPrimattribs);
641  saveData(os, myDetailattribs);
642  saveData(os, myMatchgroups);
643  saveData(os, myComputeweights);
644  saveData(os, myComputenumberstype);
645  saveData(os, myComputednumbersattrib);
646  saveData(os, myComputedweightsattrib);
647  saveData(os, myPrescale);
648  saveData(os, myNormalize);
649  saveData(os, myThreshold);
650  saveData(os, myBlend);
651  saveData(os, myGroup);
652 
653  }
654 
655  bool load(UT_IStream &is)
656  {
657  int32 v;
658  is.bread(&v, 1);
659  if (version() != v)
660  {
661  // Fail incompatible versions
662  return false;
663  }
664  loadData(is, myTotype);
665  loadData(is, myInterpby);
666  loadData(is, myNumberattrib);
667  loadData(is, myWeightsattrib);
668  loadData(is, myPointattribs);
669  loadData(is, myVertattribs);
670  loadData(is, myPrimattribs);
671  loadData(is, myDetailattribs);
672  loadData(is, myMatchgroups);
673  loadData(is, myComputeweights);
674  loadData(is, myComputenumberstype);
675  loadData(is, myComputednumbersattrib);
676  loadData(is, myComputedweightsattrib);
677  loadData(is, myPrescale);
678  loadData(is, myNormalize);
679  loadData(is, myThreshold);
680  loadData(is, myBlend);
681  loadData(is, myGroup);
682 
683  return true;
684  }
685 
686  Totype getTotype() const { return Totype(myTotype); }
687  void setTotype(Totype val) { myTotype = int64(val); }
688  Totype opTotype(const SOP_NodeVerb::CookParms &cookparms) const
689  {
690  SOP_Node *thissop = cookparms.getNode();
691  if (!thissop) return getTotype();
692  int64 result;
693  OP_Utils::evalOpParm(result, thissop, "totype", cookparms.getCookTime(), 0);
694  return Totype(result);
695  }
696  Interpby getInterpby() const { return Interpby(myInterpby); }
697  void setInterpby(Interpby val) { myInterpby = int64(val); }
699  {
700  SOP_Node *thissop = cookparms.getNode();
701  if (!thissop) return getInterpby();
702  int64 result;
703  OP_Utils::evalOpParm(result, thissop, "interpby", cookparms.getCookTime(), 0);
704  return Interpby(result);
705  }
706  const UT_StringHolder & getNumberattrib() const { return myNumberattrib; }
707  void setNumberattrib(const UT_StringHolder & val) { myNumberattrib = val; }
709  {
710  SOP_Node *thissop = cookparms.getNode();
711  if (!thissop) return getNumberattrib();
713  OP_Utils::evalOpParm(result, thissop, "numberattrib", cookparms.getCookTime(), 0);
714  return result;
715  }
716  const UT_StringHolder & getWeightsattrib() const { return myWeightsattrib; }
717  void setWeightsattrib(const UT_StringHolder & val) { myWeightsattrib = val; }
719  {
720  SOP_Node *thissop = cookparms.getNode();
721  if (!thissop) return getWeightsattrib();
723  OP_Utils::evalOpParm(result, thissop, "weightsattrib", cookparms.getCookTime(), 0);
724  return result;
725  }
726  const UT_StringHolder & getPointattribs() const { return myPointattribs; }
727  void setPointattribs(const UT_StringHolder & val) { myPointattribs = val; }
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return getPointattribs();
733  OP_Utils::evalOpParm(result, thissop, "pointattribs", cookparms.getCookTime(), 0);
734  return result;
735  }
736  const UT_StringHolder & getVertattribs() const { return myVertattribs; }
737  void setVertattribs(const UT_StringHolder & val) { myVertattribs = val; }
739  {
740  SOP_Node *thissop = cookparms.getNode();
741  if (!thissop) return getVertattribs();
743  OP_Utils::evalOpParm(result, thissop, "vertattribs", cookparms.getCookTime(), 0);
744  return result;
745  }
746  const UT_StringHolder & getPrimattribs() const { return myPrimattribs; }
747  void setPrimattribs(const UT_StringHolder & val) { myPrimattribs = val; }
749  {
750  SOP_Node *thissop = cookparms.getNode();
751  if (!thissop) return getPrimattribs();
753  OP_Utils::evalOpParm(result, thissop, "primattribs", cookparms.getCookTime(), 0);
754  return result;
755  }
756  const UT_StringHolder & getDetailattribs() const { return myDetailattribs; }
757  void setDetailattribs(const UT_StringHolder & val) { myDetailattribs = val; }
759  {
760  SOP_Node *thissop = cookparms.getNode();
761  if (!thissop) return getDetailattribs();
763  OP_Utils::evalOpParm(result, thissop, "detailattribs", cookparms.getCookTime(), 0);
764  return result;
765  }
766  bool getMatchgroups() const { return myMatchgroups; }
767  void setMatchgroups(bool val) { myMatchgroups = val; }
768  bool opMatchgroups(const SOP_NodeVerb::CookParms &cookparms) const
769  {
770  SOP_Node *thissop = cookparms.getNode();
771  if (!thissop) return getMatchgroups();
772  bool result;
773  OP_Utils::evalOpParm(result, thissop, "matchgroups", cookparms.getCookTime(), 0);
774  return result;
775  }
776  bool getComputeweights() const { return myComputeweights; }
777  void setComputeweights(bool val) { myComputeweights = val; }
778  bool opComputeweights(const SOP_NodeVerb::CookParms &cookparms) const
779  {
780  SOP_Node *thissop = cookparms.getNode();
781  if (!thissop) return getComputeweights();
782  bool result;
783  OP_Utils::evalOpParm(result, thissop, "computeweights", cookparms.getCookTime(), 0);
784  return result;
785  }
786  Computenumberstype getComputenumberstype() const { return Computenumberstype(myComputenumberstype); }
787  void setComputenumberstype(Computenumberstype val) { myComputenumberstype = int64(val); }
789  {
790  SOP_Node *thissop = cookparms.getNode();
791  if (!thissop) return getComputenumberstype();
792  int64 result;
793  OP_Utils::evalOpParm(result, thissop, "computenumberstype", cookparms.getCookTime(), 0);
794  return Computenumberstype(result);
795  }
796  const UT_StringHolder & getComputednumbersattrib() const { return myComputednumbersattrib; }
797  void setComputednumbersattrib(const UT_StringHolder & val) { myComputednumbersattrib = val; }
799  {
800  SOP_Node *thissop = cookparms.getNode();
801  if (!thissop) return getComputednumbersattrib();
803  OP_Utils::evalOpParm(result, thissop, "computednumbersattrib", cookparms.getCookTime(), 0);
804  return result;
805  }
806  const UT_StringHolder & getComputedweightsattrib() const { return myComputedweightsattrib; }
807  void setComputedweightsattrib(const UT_StringHolder & val) { myComputedweightsattrib = val; }
809  {
810  SOP_Node *thissop = cookparms.getNode();
811  if (!thissop) return getComputedweightsattrib();
813  OP_Utils::evalOpParm(result, thissop, "computedweightsattrib", cookparms.getCookTime(), 0);
814  return result;
815  }
816  fpreal64 getPrescale() const { return myPrescale; }
817  void setPrescale(fpreal64 val) { myPrescale = val; }
819  {
820  SOP_Node *thissop = cookparms.getNode();
821  if (!thissop) return getPrescale();
823  OP_Utils::evalOpParm(result, thissop, "prescale", cookparms.getCookTime(), 0);
824  return result;
825  }
826  bool getNormalize() const { return myNormalize; }
827  void setNormalize(bool val) { myNormalize = val; }
828  bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
829  {
830  SOP_Node *thissop = cookparms.getNode();
831  if (!thissop) return getNormalize();
832  bool result;
833  OP_Utils::evalOpParm(result, thissop, "normalize", cookparms.getCookTime(), 0);
834  return result;
835  }
836  fpreal64 getThreshold() const { return myThreshold; }
837  void setThreshold(fpreal64 val) { myThreshold = val; }
839  {
840  SOP_Node *thissop = cookparms.getNode();
841  if (!thissop) return getThreshold();
843  OP_Utils::evalOpParm(result, thissop, "threshold", cookparms.getCookTime(), 0);
844  return result;
845  }
846  fpreal64 getBlend() const { return myBlend; }
847  void setBlend(fpreal64 val) { myBlend = val; }
848  fpreal64 opBlend(const SOP_NodeVerb::CookParms &cookparms) const
849  {
850  SOP_Node *thissop = cookparms.getNode();
851  if (!thissop) return getBlend();
853  OP_Utils::evalOpParm(result, thissop, "blend", cookparms.getCookTime(), 0);
854  return result;
855  }
856  const UT_StringHolder & getGroup() const { return myGroup; }
857  void setGroup(const UT_StringHolder & val) { myGroup = val; }
859  {
860  SOP_Node *thissop = cookparms.getNode();
861  if (!thissop) return getGroup();
863  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
864  return result;
865  }
866 
867 private:
868  int64 myTotype;
869  int64 myInterpby;
870  UT_StringHolder myNumberattrib;
871  UT_StringHolder myWeightsattrib;
872  UT_StringHolder myPointattribs;
873  UT_StringHolder myVertattribs;
874  UT_StringHolder myPrimattribs;
875  UT_StringHolder myDetailattribs;
876  bool myMatchgroups;
877  bool myComputeweights;
878  int64 myComputenumberstype;
879  UT_StringHolder myComputednumbersattrib;
880  UT_StringHolder myComputedweightsattrib;
881  fpreal64 myPrescale;
882  bool myNormalize;
883  fpreal64 myThreshold;
884  fpreal64 myBlend;
885  UT_StringHolder myGroup;
886 
887 };
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setComputedweightsattrib(const UT_StringHolder &val)
void setPrimattribs(const UT_StringHolder &val)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_StringHolder s)
UT_StringHolder opComputednumbersattrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setWeightsattrib(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
UT_StringHolder opPrimattribs(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
const UT_StringHolder & getNumberattrib() const
fpreal64 opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
bool opMatchgroups(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
bool operator!=(const SOP_AttribInterpolateParms &src) const
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const UT_StringHolder & getGroup() const
bool opComputeweights(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opNumberattrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
**But if you need a result
Definition: thread.h:613
const char * getNestParmName(TempIndex fieldnum) const override
Totype opTotype(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
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.
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setComputednumbersattrib(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void save(std::ostream &os) const
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
fpreal64 opBlend(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
UT_StringHolder opPointattribs(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &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
const UT_StringHolder & getPrimattribs() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
SYS_FORCE_INLINE UT_StringHolder getToken(Totype enum_value)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
UT_StringHolder opWeightsattrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setPointattribs(const UT_StringHolder &val)
const UT_StringHolder & getComputednumbersattrib() const
const UT_StringHolder & getWeightsattrib() const
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
long long int64
Definition: SYS_Types.h:116
fpreal64 opPrescale(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_Vector3D v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
const UT_StringHolder & getComputedweightsattrib() const
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
const UT_StringHolder & getVertattribs() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setVertattribs(const UT_StringHolder &val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
GT_API const UT_StringHolder version
Computenumberstype getComputenumberstype() const
static void saveData(std::ostream &os, UT_Vector2D v)
UT_StringHolder opComputedweightsattrib(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getDetailattribs() const
bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
Computenumberstype opComputenumberstype(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
Interpby opInterpby(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
UT_StringHolder opDetailattribs(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
const UT_StringHolder & getPointattribs() const
void copyFrom(const OP_NodeParms *src) override
UT_StringHolder opVertattribs(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
GLboolean r
Definition: glcorearb.h:1222
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void setDetailattribs(const UT_StringHolder &val)
type
Definition: core.h:1059
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
void setNumberattrib(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, bool v)
SYS_FORCE_INLINE bool isstring() const
void setGroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool operator==(const SOP_AttribInterpolateParms &src) const
void setComputenumberstype(Computenumberstype val)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
ParmType getNestParmType(TempIndex fieldnum) const override