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 <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_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 
144  if (baseGetSignature() != src.baseGetSignature()) return false;
145 
146  return true;
147  }
149  {
150  return !operator==(src);
151  }
155 
156 
157 
158  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
159  {
160  myTotype = 0;
161  if (true)
162  graph->evalOpParm(myTotype, nodeidx, "totype", time, graph->isDirect()?nullptr:depnode);
163  myInterpby = 0;
164  if (true)
165  graph->evalOpParm(myInterpby, nodeidx, "interpby", time, graph->isDirect()?nullptr:depnode);
166  myNumberattrib = "sourceprim"_UTsh;
167  if (true)
168  graph->evalOpParm(myNumberattrib, nodeidx, "numberattrib", time, graph->isDirect()?nullptr:depnode);
169  myWeightsattrib = "sourceprimuv"_UTsh;
170  if (true)
171  graph->evalOpParm(myWeightsattrib, nodeidx, "weightsattrib", time, graph->isDirect()?nullptr:depnode);
172  myPointattribs = "*"_UTsh;
173  if (true && ( (true&&!(((int64(getInterpby())==3)))) ) )
174  graph->evalOpParm(myPointattribs, nodeidx, "pointattribs", time, graph->isDirect()?nullptr:depnode);
175  myVertattribs = ""_UTsh;
176  if (true && ( (true&&!(((int64(getInterpby())==3))||((int64(getInterpby())==1)))) ) )
177  graph->evalOpParm(myVertattribs, nodeidx, "vertattribs", time, graph->isDirect()?nullptr:depnode);
178  myPrimattribs = ""_UTsh;
179  if (true && ( (true&&!(((int64(getInterpby())==1)))) ) )
180  graph->evalOpParm(myPrimattribs, nodeidx, "primattribs", time, graph->isDirect()?nullptr:depnode);
181  myDetailattribs = ""_UTsh;
182  if (true)
183  graph->evalOpParm(myDetailattribs, nodeidx, "detailattribs", time, graph->isDirect()?nullptr:depnode);
184  myMatchgroups = true;
185  if (true)
186  graph->evalOpParm(myMatchgroups, nodeidx, "matchgroups", time, graph->isDirect()?nullptr:depnode);
187  myComputeweights = false;
188  if (true && ( (true&&!(((int64(getInterpby())!=0)))) ) )
189  graph->evalOpParm(myComputeweights, nodeidx, "computeweights", time, graph->isDirect()?nullptr:depnode);
190  myComputenumberstype = 1;
191  if (true && ( (true&&!(((int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
192  graph->evalOpParm(myComputenumberstype, nodeidx, "computenumberstype", time, graph->isDirect()?nullptr:depnode);
193  myComputednumbersattrib = "sourcevtxnums"_UTsh;
194  if (true && ( (true&&!(((int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
195  graph->evalOpParm(myComputednumbersattrib, nodeidx, "computednumbersattrib", time, graph->isDirect()?nullptr:depnode);
196  myComputedweightsattrib = "sourcevtxweights"_UTsh;
197  if (true && ( (true&&!(((int64(getInterpby())!=0))||((getComputeweights()==0)))) ) )
198  graph->evalOpParm(myComputedweightsattrib, nodeidx, "computedweightsattrib", time, graph->isDirect()?nullptr:depnode);
199  myPrescale = 1;
200  if (true)
201  graph->evalOpParm(myPrescale, nodeidx, "prescale", time, graph->isDirect()?nullptr:depnode);
202  myNormalize = false;
203  if (true)
204  graph->evalOpParm(myNormalize, nodeidx, "normalize", time, graph->isDirect()?nullptr:depnode);
205  myThreshold = 0;
206  if (true && ( (true&&!(((getNormalize()==0)))) ) )
207  graph->evalOpParm(myThreshold, nodeidx, "threshold", time, graph->isDirect()?nullptr:depnode);
208  myBlend = 0;
209  if (true && ( (true&&!(((getNormalize()==0)))) ) )
210  graph->evalOpParm(myBlend, nodeidx, "blend", time, graph->isDirect()?nullptr:depnode);
211  myGroup = ""_UTsh;
212  if (true && ( (true&&!(((int64(getTotype())==3)))) ) )
213  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
214 
215  }
216 
217 
218  void loadFromOpSubclass(const LoadParms &loadparms) override
219  {
220  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
221  }
222 
223 
224  void copyFrom(const OP_NodeParms *src) override
225  {
226  *this = *((const SOP_AttribInterpolateParms *)src);
227  }
228 
229  template <typename T>
230  void
231  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
232  {
233  if (idx.size() < 1)
234  return;
235  UT_ASSERT(idx.size() == instance.size()+1);
236  if (idx.size() != instance.size()+1)
237  return;
238  switch (idx[0])
239  {
240  case 0:
241  coerceValue(value, myTotype);
242  break;
243  case 1:
244  coerceValue(value, myInterpby);
245  break;
246  case 2:
247  coerceValue(value, myNumberattrib);
248  break;
249  case 3:
250  coerceValue(value, myWeightsattrib);
251  break;
252  case 4:
253  coerceValue(value, myPointattribs);
254  break;
255  case 5:
256  coerceValue(value, myVertattribs);
257  break;
258  case 6:
259  coerceValue(value, myPrimattribs);
260  break;
261  case 7:
262  coerceValue(value, myDetailattribs);
263  break;
264  case 8:
265  coerceValue(value, myMatchgroups);
266  break;
267  case 9:
268  coerceValue(value, myComputeweights);
269  break;
270  case 10:
271  coerceValue(value, myComputenumberstype);
272  break;
273  case 11:
274  coerceValue(value, myComputednumbersattrib);
275  break;
276  case 12:
277  coerceValue(value, myComputedweightsattrib);
278  break;
279  case 13:
280  coerceValue(value, myPrescale);
281  break;
282  case 14:
283  coerceValue(value, myNormalize);
284  break;
285  case 15:
286  coerceValue(value, myThreshold);
287  break;
288  case 16:
289  coerceValue(value, myBlend);
290  break;
291  case 17:
292  coerceValue(value, myGroup);
293  break;
294 
295  }
296  }
297 
298  bool isParmColorRamp(exint idx) const override
299  {
300  switch (idx)
301  {
302 
303  }
304  return false;
305  }
306 
307  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
308  { doGetParmValue(idx, instance, value); }
309  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
310  { doGetParmValue(idx, instance, value); }
311  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
312  { doGetParmValue(idx, instance, value); }
313  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
314  { doGetParmValue(idx, instance, value); }
315  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
316  { doGetParmValue(idx, instance, value); }
317  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
318  { doGetParmValue(idx, instance, value); }
319  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
320  { doGetParmValue(idx, instance, value); }
321  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
322  { doGetParmValue(idx, instance, value); }
323  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
324  { doGetParmValue(idx, instance, value); }
325  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
326  { doGetParmValue(idx, instance, value); }
327  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
328  { doGetParmValue(idx, instance, value); }
329 
330  template <typename T>
331  void
332  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
333  {
334  if (idx.size() < 1)
335  return;
336  UT_ASSERT(idx.size() == instance.size()+1);
337  if (idx.size() != instance.size()+1)
338  return;
339  switch (idx[0])
340  {
341  case 0:
342  coerceValue(myTotype, clampMinValue(0, clampMaxValue(3, value ) ));
343  break;
344  case 1:
345  coerceValue(myInterpby, clampMinValue(0, clampMaxValue(3, value ) ));
346  break;
347  case 2:
348  coerceValue(myNumberattrib, ( ( value ) ));
349  break;
350  case 3:
351  coerceValue(myWeightsattrib, ( ( value ) ));
352  break;
353  case 4:
354  coerceValue(myPointattribs, ( ( value ) ));
355  break;
356  case 5:
357  coerceValue(myVertattribs, ( ( value ) ));
358  break;
359  case 6:
360  coerceValue(myPrimattribs, ( ( value ) ));
361  break;
362  case 7:
363  coerceValue(myDetailattribs, ( ( value ) ));
364  break;
365  case 8:
366  coerceValue(myMatchgroups, ( ( value ) ));
367  break;
368  case 9:
369  coerceValue(myComputeweights, ( ( value ) ));
370  break;
371  case 10:
372  coerceValue(myComputenumberstype, clampMinValue(0, clampMaxValue(1, value ) ));
373  break;
374  case 11:
375  coerceValue(myComputednumbersattrib, ( ( value ) ));
376  break;
377  case 12:
378  coerceValue(myComputedweightsattrib, ( ( value ) ));
379  break;
380  case 13:
381  coerceValue(myPrescale, clampMinValue(0, ( value ) ));
382  break;
383  case 14:
384  coerceValue(myNormalize, ( ( value ) ));
385  break;
386  case 15:
387  coerceValue(myThreshold, clampMinValue(0, clampMaxValue(1, value ) ));
388  break;
389  case 16:
390  coerceValue(myBlend, clampMinValue(0, clampMaxValue(1, value ) ));
391  break;
392  case 17:
393  coerceValue(myGroup, ( ( value ) ));
394  break;
395 
396  }
397  }
398 
399  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
400  { doSetParmValue(idx, instance, value); }
401  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
402  { doSetParmValue(idx, instance, value); }
403  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
404  { doSetParmValue(idx, instance, value); }
405  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
406  { doSetParmValue(idx, instance, value); }
407  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
408  { doSetParmValue(idx, instance, value); }
409  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
410  { doSetParmValue(idx, instance, value); }
411  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
412  { doSetParmValue(idx, instance, value); }
413  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
414  { doSetParmValue(idx, instance, value); }
415  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
416  { doSetParmValue(idx, instance, value); }
417  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
418  { doSetParmValue(idx, instance, value); }
419  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
420  { doSetParmValue(idx, instance, value); }
421 
422  exint getNestNumParms(TempIndex idx) const override
423  {
424  if (idx.size() == 0)
425  return 18;
426  switch (idx[0])
427  {
428 
429  }
430  // Invalid
431  return 0;
432  }
433 
434  const char *getNestParmName(TempIndex fieldnum) const override
435  {
436  if (fieldnum.size() < 1)
437  return 0;
438  switch (fieldnum[0])
439  {
440  case 0:
441  return "totype";
442  case 1:
443  return "interpby";
444  case 2:
445  return "numberattrib";
446  case 3:
447  return "weightsattrib";
448  case 4:
449  return "pointattribs";
450  case 5:
451  return "vertattribs";
452  case 6:
453  return "primattribs";
454  case 7:
455  return "detailattribs";
456  case 8:
457  return "matchgroups";
458  case 9:
459  return "computeweights";
460  case 10:
461  return "computenumberstype";
462  case 11:
463  return "computednumbersattrib";
464  case 12:
465  return "computedweightsattrib";
466  case 13:
467  return "prescale";
468  case 14:
469  return "normalize";
470  case 15:
471  return "threshold";
472  case 16:
473  return "blend";
474  case 17:
475  return "group";
476 
477  }
478  return 0;
479  }
480 
481  ParmType getNestParmType(TempIndex fieldnum) const override
482  {
483  if (fieldnum.size() < 1)
484  return PARM_UNSUPPORTED;
485  switch (fieldnum[0])
486  {
487  case 0:
488  return PARM_INTEGER;
489  case 1:
490  return PARM_INTEGER;
491  case 2:
492  return PARM_STRING;
493  case 3:
494  return PARM_STRING;
495  case 4:
496  return PARM_STRING;
497  case 5:
498  return PARM_STRING;
499  case 6:
500  return PARM_STRING;
501  case 7:
502  return PARM_STRING;
503  case 8:
504  return PARM_INTEGER;
505  case 9:
506  return PARM_INTEGER;
507  case 10:
508  return PARM_INTEGER;
509  case 11:
510  return PARM_STRING;
511  case 12:
512  return PARM_STRING;
513  case 13:
514  return PARM_FLOAT;
515  case 14:
516  return PARM_INTEGER;
517  case 15:
518  return PARM_FLOAT;
519  case 16:
520  return PARM_FLOAT;
521  case 17:
522  return PARM_STRING;
523 
524  }
525  return PARM_UNSUPPORTED;
526  }
527 
528  // Boiler plate to load individual types.
529  static void loadData(UT_IStream &is, int64 &v)
530  { is.bread(&v, 1); }
531  static void loadData(UT_IStream &is, bool &v)
532  { int64 iv; is.bread(&iv, 1); v = iv; }
533  static void loadData(UT_IStream &is, fpreal64 &v)
534  { is.bread<fpreal64>(&v, 1); }
535  static void loadData(UT_IStream &is, UT_Vector2D &v)
536  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
537  static void loadData(UT_IStream &is, UT_Vector3D &v)
538  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
539  is.bread<fpreal64>(&v.z(), 1); }
540  static void loadData(UT_IStream &is, UT_Vector4D &v)
541  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
542  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
543  static void loadData(UT_IStream &is, UT_Matrix2D &v)
544  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
545  static void loadData(UT_IStream &is, UT_Matrix3D &v)
546  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
547  static void loadData(UT_IStream &is, UT_Matrix4D &v)
548  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
549  static void loadData(UT_IStream &is, UT_Vector2I &v)
550  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
551  static void loadData(UT_IStream &is, UT_Vector3I &v)
552  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
553  is.bread<int64>(&v.z(), 1); }
554  static void loadData(UT_IStream &is, UT_Vector4I &v)
555  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
556  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
558  { is.bread(v); }
560  { UT_StringHolder rampdata;
561  loadData(is, rampdata);
562  if (rampdata.isstring())
563  {
564  v.reset(new UT_Ramp());
565  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
566  v->load(istr);
567  }
568  else v.reset();
569  }
572  loadData(is, data);
573  if (data.isstring())
574  {
575  // Find the data type.
576  const char *colon = UT_StringWrap(data).findChar(':');
577  if (colon)
578  {
579  int typelen = colon - data.buffer();
581  type.strncpy(data.buffer(), typelen);
582  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
583 
584  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
585  }
586  }
587  else v.reset();
588  }
589 
590  static void saveData(std::ostream &os, int64 v)
591  { UTwrite(os, &v); }
592  static void saveData(std::ostream &os, bool v)
593  { int64 iv = v; UTwrite(os, &iv); }
594  static void saveData(std::ostream &os, fpreal64 v)
595  { UTwrite<fpreal64>(os, &v); }
596  static void saveData(std::ostream &os, UT_Vector2D v)
597  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
598  static void saveData(std::ostream &os, UT_Vector3D v)
599  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
600  UTwrite<fpreal64>(os, &v.z()); }
601  static void saveData(std::ostream &os, UT_Vector4D v)
602  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
603  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
604  static void saveData(std::ostream &os, UT_Matrix2D v)
606  static void saveData(std::ostream &os, UT_Matrix3D v)
608  static void saveData(std::ostream &os, UT_Matrix4D v)
610  static void saveData(std::ostream &os, UT_StringHolder s)
611  { UT_StringWrap(s).saveBinary(os); }
612  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
614  UT_OStringStream ostr;
615  if (s) s->save(ostr);
616  result = ostr.str();
617  saveData(os, result);
618  }
619  static void saveData(std::ostream &os, PRM_DataItemHandle s)
621  UT_OStringStream ostr;
622  if (s)
623  {
624  ostr << s->getDataTypeToken();
625  ostr << ":";
626  s->saveBinary(ostr);
627  }
628  result = ostr.str();
629  saveData(os, result);
630  }
631 
632 
633  void save(std::ostream &os) const
634  {
635  int32 v = version();
636  UTwrite(os, &v);
637  saveData(os, myTotype);
638  saveData(os, myInterpby);
639  saveData(os, myNumberattrib);
640  saveData(os, myWeightsattrib);
641  saveData(os, myPointattribs);
642  saveData(os, myVertattribs);
643  saveData(os, myPrimattribs);
644  saveData(os, myDetailattribs);
645  saveData(os, myMatchgroups);
646  saveData(os, myComputeweights);
647  saveData(os, myComputenumberstype);
648  saveData(os, myComputednumbersattrib);
649  saveData(os, myComputedweightsattrib);
650  saveData(os, myPrescale);
651  saveData(os, myNormalize);
652  saveData(os, myThreshold);
653  saveData(os, myBlend);
654  saveData(os, myGroup);
655 
656  }
657 
658  bool load(UT_IStream &is)
659  {
660  int32 v;
661  is.bread(&v, 1);
662  if (version() != v)
663  {
664  // Fail incompatible versions
665  return false;
666  }
667  loadData(is, myTotype);
668  loadData(is, myInterpby);
669  loadData(is, myNumberattrib);
670  loadData(is, myWeightsattrib);
671  loadData(is, myPointattribs);
672  loadData(is, myVertattribs);
673  loadData(is, myPrimattribs);
674  loadData(is, myDetailattribs);
675  loadData(is, myMatchgroups);
676  loadData(is, myComputeweights);
677  loadData(is, myComputenumberstype);
678  loadData(is, myComputednumbersattrib);
679  loadData(is, myComputedweightsattrib);
680  loadData(is, myPrescale);
681  loadData(is, myNormalize);
682  loadData(is, myThreshold);
683  loadData(is, myBlend);
684  loadData(is, myGroup);
685 
686  return true;
687  }
688 
689  Totype getTotype() const { return Totype(myTotype); }
690  void setTotype(Totype val) { myTotype = int64(val); }
691  Totype opTotype(const SOP_NodeVerb::CookParms &cookparms) const
692  {
693  SOP_Node *thissop = cookparms.getNode();
694  if (!thissop) return getTotype();
695  int64 result;
696  OP_Utils::evalOpParm(result, thissop, "totype", cookparms.getCookTime(), 0);
697  return Totype(result);
698  }
699  Interpby getInterpby() const { return Interpby(myInterpby); }
700  void setInterpby(Interpby val) { myInterpby = int64(val); }
702  {
703  SOP_Node *thissop = cookparms.getNode();
704  if (!thissop) return getInterpby();
705  int64 result;
706  OP_Utils::evalOpParm(result, thissop, "interpby", cookparms.getCookTime(), 0);
707  return Interpby(result);
708  }
709  const UT_StringHolder & getNumberattrib() const { return myNumberattrib; }
710  void setNumberattrib(const UT_StringHolder & val) { myNumberattrib = val; }
712  {
713  SOP_Node *thissop = cookparms.getNode();
714  if (!thissop) return getNumberattrib();
716  OP_Utils::evalOpParm(result, thissop, "numberattrib", cookparms.getCookTime(), 0);
717  return result;
718  }
719  const UT_StringHolder & getWeightsattrib() const { return myWeightsattrib; }
720  void setWeightsattrib(const UT_StringHolder & val) { myWeightsattrib = val; }
722  {
723  SOP_Node *thissop = cookparms.getNode();
724  if (!thissop) return getWeightsattrib();
726  OP_Utils::evalOpParm(result, thissop, "weightsattrib", cookparms.getCookTime(), 0);
727  return result;
728  }
729  const UT_StringHolder & getPointattribs() const { return myPointattribs; }
730  void setPointattribs(const UT_StringHolder & val) { myPointattribs = val; }
732  {
733  SOP_Node *thissop = cookparms.getNode();
734  if (!thissop) return getPointattribs();
736  OP_Utils::evalOpParm(result, thissop, "pointattribs", cookparms.getCookTime(), 0);
737  return result;
738  }
739  const UT_StringHolder & getVertattribs() const { return myVertattribs; }
740  void setVertattribs(const UT_StringHolder & val) { myVertattribs = val; }
742  {
743  SOP_Node *thissop = cookparms.getNode();
744  if (!thissop) return getVertattribs();
746  OP_Utils::evalOpParm(result, thissop, "vertattribs", cookparms.getCookTime(), 0);
747  return result;
748  }
749  const UT_StringHolder & getPrimattribs() const { return myPrimattribs; }
750  void setPrimattribs(const UT_StringHolder & val) { myPrimattribs = val; }
752  {
753  SOP_Node *thissop = cookparms.getNode();
754  if (!thissop) return getPrimattribs();
756  OP_Utils::evalOpParm(result, thissop, "primattribs", cookparms.getCookTime(), 0);
757  return result;
758  }
759  const UT_StringHolder & getDetailattribs() const { return myDetailattribs; }
760  void setDetailattribs(const UT_StringHolder & val) { myDetailattribs = val; }
762  {
763  SOP_Node *thissop = cookparms.getNode();
764  if (!thissop) return getDetailattribs();
766  OP_Utils::evalOpParm(result, thissop, "detailattribs", cookparms.getCookTime(), 0);
767  return result;
768  }
769  bool getMatchgroups() const { return myMatchgroups; }
770  void setMatchgroups(bool val) { myMatchgroups = val; }
771  bool opMatchgroups(const SOP_NodeVerb::CookParms &cookparms) const
772  {
773  SOP_Node *thissop = cookparms.getNode();
774  if (!thissop) return getMatchgroups();
775  bool result;
776  OP_Utils::evalOpParm(result, thissop, "matchgroups", cookparms.getCookTime(), 0);
777  return result;
778  }
779  bool getComputeweights() const { return myComputeweights; }
780  void setComputeweights(bool val) { myComputeweights = val; }
781  bool opComputeweights(const SOP_NodeVerb::CookParms &cookparms) const
782  {
783  SOP_Node *thissop = cookparms.getNode();
784  if (!thissop) return getComputeweights();
785  bool result;
786  OP_Utils::evalOpParm(result, thissop, "computeweights", cookparms.getCookTime(), 0);
787  return result;
788  }
789  Computenumberstype getComputenumberstype() const { return Computenumberstype(myComputenumberstype); }
790  void setComputenumberstype(Computenumberstype val) { myComputenumberstype = int64(val); }
792  {
793  SOP_Node *thissop = cookparms.getNode();
794  if (!thissop) return getComputenumberstype();
795  int64 result;
796  OP_Utils::evalOpParm(result, thissop, "computenumberstype", cookparms.getCookTime(), 0);
797  return Computenumberstype(result);
798  }
799  const UT_StringHolder & getComputednumbersattrib() const { return myComputednumbersattrib; }
800  void setComputednumbersattrib(const UT_StringHolder & val) { myComputednumbersattrib = val; }
802  {
803  SOP_Node *thissop = cookparms.getNode();
804  if (!thissop) return getComputednumbersattrib();
806  OP_Utils::evalOpParm(result, thissop, "computednumbersattrib", cookparms.getCookTime(), 0);
807  return result;
808  }
809  const UT_StringHolder & getComputedweightsattrib() const { return myComputedweightsattrib; }
810  void setComputedweightsattrib(const UT_StringHolder & val) { myComputedweightsattrib = val; }
812  {
813  SOP_Node *thissop = cookparms.getNode();
814  if (!thissop) return getComputedweightsattrib();
816  OP_Utils::evalOpParm(result, thissop, "computedweightsattrib", cookparms.getCookTime(), 0);
817  return result;
818  }
819  fpreal64 getPrescale() const { return myPrescale; }
820  void setPrescale(fpreal64 val) { myPrescale = val; }
822  {
823  SOP_Node *thissop = cookparms.getNode();
824  if (!thissop) return getPrescale();
826  OP_Utils::evalOpParm(result, thissop, "prescale", cookparms.getCookTime(), 0);
827  return result;
828  }
829  bool getNormalize() const { return myNormalize; }
830  void setNormalize(bool val) { myNormalize = val; }
831  bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
832  {
833  SOP_Node *thissop = cookparms.getNode();
834  if (!thissop) return getNormalize();
835  bool result;
836  OP_Utils::evalOpParm(result, thissop, "normalize", cookparms.getCookTime(), 0);
837  return result;
838  }
839  fpreal64 getThreshold() const { return myThreshold; }
840  void setThreshold(fpreal64 val) { myThreshold = val; }
842  {
843  SOP_Node *thissop = cookparms.getNode();
844  if (!thissop) return getThreshold();
846  OP_Utils::evalOpParm(result, thissop, "threshold", cookparms.getCookTime(), 0);
847  return result;
848  }
849  fpreal64 getBlend() const { return myBlend; }
850  void setBlend(fpreal64 val) { myBlend = val; }
851  fpreal64 opBlend(const SOP_NodeVerb::CookParms &cookparms) const
852  {
853  SOP_Node *thissop = cookparms.getNode();
854  if (!thissop) return getBlend();
856  OP_Utils::evalOpParm(result, thissop, "blend", cookparms.getCookTime(), 0);
857  return result;
858  }
859  const UT_StringHolder & getGroup() const { return myGroup; }
860  void setGroup(const UT_StringHolder & val) { myGroup = val; }
862  {
863  SOP_Node *thissop = cookparms.getNode();
864  if (!thissop) return getGroup();
866  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
867  return result;
868  }
869 
870 private:
871  int64 myTotype;
872  int64 myInterpby;
873  UT_StringHolder myNumberattrib;
874  UT_StringHolder myWeightsattrib;
875  UT_StringHolder myPointattribs;
876  UT_StringHolder myVertattribs;
877  UT_StringHolder myPrimattribs;
878  UT_StringHolder myDetailattribs;
879  bool myMatchgroups;
880  bool myComputeweights;
881  int64 myComputenumberstype;
882  UT_StringHolder myComputednumbersattrib;
883  UT_StringHolder myComputedweightsattrib;
884  fpreal64 myPrescale;
885  bool myNormalize;
886  fpreal64 myThreshold;
887  fpreal64 myBlend;
888  UT_StringHolder myGroup;
889 
890 };
type
Definition: core.h:556
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:63
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
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
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 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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
#define SOP_API
Definition: SOP_API.h:10
UT_StringHolder opDetailattribs(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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