HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_SoftPeak.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_SoftPeakEnums
24 {
25  enum class Enablemaskattrib
26  {
27  NOSCALING = 0,
28  BYATTRIB
29  };
30 
33  {
34  using namespace UT::Literal;
35  switch (enum_value) {
36  case Enablemaskattrib::NOSCALING: return "noscaling"_sh;
37  case Enablemaskattrib::BYATTRIB: return "byattrib"_sh;
38  default: UT_ASSERT(false); return ""_sh;
39  }
40  }
41 
42  enum class Distmetric
43  {
44  CUSTOM = 0,
45  EDGES,
46  GLOBAL,
48  SURFACE
49  };
50 
52  getToken(Distmetric enum_value)
53  {
54  using namespace UT::Literal;
55  switch (enum_value) {
56  case Distmetric::CUSTOM: return "custom"_sh;
57  case Distmetric::EDGES: return "edges"_sh;
58  case Distmetric::GLOBAL: return "global"_sh;
59  case Distmetric::GLOBALCONNECTED: return "globalconnected"_sh;
60  case Distmetric::SURFACE: return "surface"_sh;
61  default: UT_ASSERT(false); return ""_sh;
62  }
63  }
64 
65  enum class Type
66  {
67  LINEAR = 0,
68  QUADRATIC,
69  CUBIC,
70  META
71  };
72 
74  getToken(Type enum_value)
75  {
76  using namespace UT::Literal;
77  switch (enum_value) {
78  case Type::LINEAR: return "linear"_sh;
79  case Type::QUADRATIC: return "quadratic"_sh;
80  case Type::CUBIC: return "cubic"_sh;
81  case Type::META: return "meta"_sh;
82  default: UT_ASSERT(false); return ""_sh;
83  }
84  }
85 
86  enum class Visualizefalloff
87  {
88  NEVER = 0,
89  ALWAYS,
90  STATE
91  };
92 
95  {
96  using namespace UT::Literal;
97  switch (enum_value) {
98  case Visualizefalloff::NEVER: return "never"_sh;
99  case Visualizefalloff::ALWAYS: return "always"_sh;
100  case Visualizefalloff::STATE: return "state"_sh;
101  default: UT_ASSERT(false); return ""_sh;
102  }
103  }
104 
105 }
106 
107 
109 {
110 public:
111  static int version() { return 1; }
112 
114  {
115  myGroup = ""_UTsh;
116  myMask = 1;
117  myEnablemaskattrib = 0;
118  myMaskattrib = "mask"_UTsh;
119  myDist = 0;
120  myDistmetric = 4;
121  myApplyrolloff = false;
122  myDistattr = ""_UTsh;
123  myRad = 0.5;
124  myType = 2;
125  myTandeg = UT_Vector2D(0,0);
126  myKernel = "wyvill"_UTsh;
127  myLeadnml = true;
128  myUpdatenmls = false;
129  myUpdateaffectednmls = true;
130  myVisualizefalloff = 2;
131  myLeadptattr = ""_UTsh;
132 
133  }
134 
135  explicit SOP_SoftPeakParms(const SOP_SoftPeakParms &) = default;
136  SOP_SoftPeakParms &operator=(const SOP_SoftPeakParms &) = default;
137  SOP_SoftPeakParms(SOP_SoftPeakParms &&) noexcept = default;
138  SOP_SoftPeakParms &operator=(SOP_SoftPeakParms &&) noexcept = default;
139 
140  ~SOP_SoftPeakParms() override {}
141 
142  bool operator==(const SOP_SoftPeakParms &src) const
143  {
144  if (myGroup != src.myGroup) return false;
145  if (myMask != src.myMask) return false;
146  if (myEnablemaskattrib != src.myEnablemaskattrib) return false;
147  if (myMaskattrib != src.myMaskattrib) return false;
148  if (myDist != src.myDist) return false;
149  if (myDistmetric != src.myDistmetric) return false;
150  if (myApplyrolloff != src.myApplyrolloff) return false;
151  if (myDistattr != src.myDistattr) return false;
152  if (myRad != src.myRad) return false;
153  if (myType != src.myType) return false;
154  if (myTandeg != src.myTandeg) return false;
155  if (myKernel != src.myKernel) return false;
156  if (myLeadnml != src.myLeadnml) return false;
157  if (myUpdatenmls != src.myUpdatenmls) return false;
158  if (myUpdateaffectednmls != src.myUpdateaffectednmls) return false;
159  if (myVisualizefalloff != src.myVisualizefalloff) return false;
160  if (myLeadptattr != src.myLeadptattr) return false;
161 
162 
163  if (baseGetSignature() != src.baseGetSignature()) return false;
164 
165  return true;
166  }
167  bool operator!=(const SOP_SoftPeakParms &src) const
168  {
169  return !operator==(src);
170  }
175 
176 
177 
178  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
179  {
180  myGroup = ""_UTsh;
181  if (true)
182  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
183  myMask = 1;
184  if (true)
185  graph->evalOpParm(myMask, nodeidx, "mask", time, graph->isDirect()?nullptr:depnode);
186  myEnablemaskattrib = 0;
187  if (true)
188  graph->evalOpParm(myEnablemaskattrib, nodeidx, "enablemaskattrib", time, graph->isDirect()?nullptr:depnode);
189  myMaskattrib = "mask"_UTsh;
190  if (true && ( (true&&!(((int64(getEnablemaskattrib())==0)))) ) )
191  graph->evalOpParm(myMaskattrib, nodeidx, "maskattrib", time, graph->isDirect()?nullptr:depnode);
192  myDist = 0;
193  if (true)
194  graph->evalOpParm(myDist, nodeidx, "dist", time, graph->isDirect()?nullptr:depnode);
195  myDistmetric = 4;
196  if (true)
197  graph->evalOpParm(myDistmetric, nodeidx, "distmetric", time, graph->isDirect()?nullptr:depnode);
198  myApplyrolloff = false;
199  if (true && ( (true&&!(((int64(getDistmetric())!=0)))) ) )
200  graph->evalOpParm(myApplyrolloff, nodeidx, "applyrolloff", time, graph->isDirect()?nullptr:depnode);
201  myDistattr = ""_UTsh;
202  if (true && ( (true&&!(((int64(getDistmetric())!=0)))) ) )
203  graph->evalOpParm(myDistattr, nodeidx, "distattr", time, graph->isDirect()?nullptr:depnode);
204  myRad = 0.5;
205  if (true && ( (true&&!(((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
206  graph->evalOpParm(myRad, nodeidx, "rad", time, graph->isDirect()?nullptr:depnode);
207  myType = 2;
208  if (true && ( (true&&!(((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
209  graph->evalOpParm(myType, nodeidx, "type", time, graph->isDirect()?nullptr:depnode);
210  myTandeg = UT_Vector2D(0,0);
211  if (true && ( (true&&!(((int64(getType())!=2))||((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
212  graph->evalOpParm(myTandeg, nodeidx, "tandeg", time, graph->isDirect()?nullptr:depnode);
213  myKernel = "wyvill"_UTsh;
214  if (true && ( (true&&!(((int64(getType())!=3))||((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
215  graph->evalOpParm(myKernel, nodeidx, "kernel", time, graph->isDirect()?nullptr:depnode);
216  myLeadnml = true;
217  if (true)
218  graph->evalOpParm(myLeadnml, nodeidx, "leadnml", time, graph->isDirect()?nullptr:depnode);
219  myUpdatenmls = false;
220  if (true)
221  graph->evalOpParm(myUpdatenmls, nodeidx, "updatenmls", time, graph->isDirect()?nullptr:depnode);
222  myUpdateaffectednmls = true;
223  if (true && ( (true&&!(((getUpdatenmls()==1)))) ) )
224  graph->evalOpParm(myUpdateaffectednmls, nodeidx, "updateaffectednmls", time, graph->isDirect()?nullptr:depnode);
225  myVisualizefalloff = 2;
226  if (true)
227  graph->evalOpParm(myVisualizefalloff, nodeidx, "visualizefalloff", time, graph->isDirect()?nullptr:depnode);
228  myLeadptattr = ""_UTsh;
229  if (true && ( (true&&!(((int64(getDistmetric())!=0))||((getLeadnml()==0)))) ) )
230  graph->evalOpParm(myLeadptattr, nodeidx, "leadptattr", time, graph->isDirect()?nullptr:depnode);
231 
232  }
233 
234 
235  void loadFromOpSubclass(const LoadParms &loadparms) override
236  {
237  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
238  }
239 
240 
241  void copyFrom(const OP_NodeParms *src) override
242  {
243  *this = *((const SOP_SoftPeakParms *)src);
244  }
245 
246  template <typename T>
247  void
248  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
249  {
250  if (idx.size() < 1)
251  return;
252  UT_ASSERT(idx.size() == instance.size()+1);
253  if (idx.size() != instance.size()+1)
254  return;
255  switch (idx[0])
256  {
257  case 0:
258  coerceValue(value, myGroup);
259  break;
260  case 1:
261  coerceValue(value, myMask);
262  break;
263  case 2:
264  coerceValue(value, myEnablemaskattrib);
265  break;
266  case 3:
267  coerceValue(value, myMaskattrib);
268  break;
269  case 4:
270  coerceValue(value, myDist);
271  break;
272  case 5:
273  coerceValue(value, myDistmetric);
274  break;
275  case 6:
276  coerceValue(value, myApplyrolloff);
277  break;
278  case 7:
279  coerceValue(value, myDistattr);
280  break;
281  case 8:
282  coerceValue(value, myRad);
283  break;
284  case 9:
285  coerceValue(value, myType);
286  break;
287  case 10:
288  coerceValue(value, myTandeg);
289  break;
290  case 11:
291  coerceValue(value, myKernel);
292  break;
293  case 12:
294  coerceValue(value, myLeadnml);
295  break;
296  case 13:
297  coerceValue(value, myUpdatenmls);
298  break;
299  case 14:
300  coerceValue(value, myUpdateaffectednmls);
301  break;
302  case 15:
303  coerceValue(value, myVisualizefalloff);
304  break;
305  case 16:
306  coerceValue(value, myLeadptattr);
307  break;
308 
309  }
310  }
311 
312  bool isParmColorRamp(exint idx) const override
313  {
314  switch (idx)
315  {
316 
317  }
318  return false;
319  }
320 
321  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
322  { doGetParmValue(idx, instance, value); }
323  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
324  { doGetParmValue(idx, instance, value); }
325  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
326  { doGetParmValue(idx, instance, value); }
327  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
328  { doGetParmValue(idx, instance, value); }
329  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
330  { doGetParmValue(idx, instance, value); }
331  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
332  { doGetParmValue(idx, instance, value); }
333  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
334  { doGetParmValue(idx, instance, value); }
335  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
336  { doGetParmValue(idx, instance, value); }
337  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
338  { doGetParmValue(idx, instance, value); }
339  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
340  { doGetParmValue(idx, instance, value); }
341  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
342  { doGetParmValue(idx, instance, value); }
343 
344  template <typename T>
345  void
346  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
347  {
348  if (idx.size() < 1)
349  return;
350  UT_ASSERT(idx.size() == instance.size()+1);
351  if (idx.size() != instance.size()+1)
352  return;
353  switch (idx[0])
354  {
355  case 0:
356  coerceValue(myGroup, ( ( value ) ));
357  break;
358  case 1:
359  coerceValue(myMask, ( ( value ) ));
360  break;
361  case 2:
362  coerceValue(myEnablemaskattrib, clampMinValue(0, clampMaxValue(1, value ) ));
363  break;
364  case 3:
365  coerceValue(myMaskattrib, ( ( value ) ));
366  break;
367  case 4:
368  coerceValue(myDist, ( ( value ) ));
369  break;
370  case 5:
371  coerceValue(myDistmetric, clampMinValue(0, clampMaxValue(4, value ) ));
372  break;
373  case 6:
374  coerceValue(myApplyrolloff, ( ( value ) ));
375  break;
376  case 7:
377  coerceValue(myDistattr, ( ( value ) ));
378  break;
379  case 8:
380  coerceValue(myRad, clampMinValue(0, ( value ) ));
381  break;
382  case 9:
383  coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
384  break;
385  case 10:
386  coerceValue(myTandeg, ( ( value ) ));
387  break;
388  case 11:
389  coerceValue(myKernel, ( ( value ) ));
390  break;
391  case 12:
392  coerceValue(myLeadnml, ( ( value ) ));
393  break;
394  case 13:
395  coerceValue(myUpdatenmls, ( ( value ) ));
396  break;
397  case 14:
398  coerceValue(myUpdateaffectednmls, ( ( value ) ));
399  break;
400  case 15:
401  coerceValue(myVisualizefalloff, clampMinValue(0, clampMaxValue(2, value ) ));
402  break;
403  case 16:
404  coerceValue(myLeadptattr, ( ( value ) ));
405  break;
406 
407  }
408  }
409 
410  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
411  { doSetParmValue(idx, instance, value); }
412  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
413  { doSetParmValue(idx, instance, value); }
414  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
415  { doSetParmValue(idx, instance, value); }
416  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
417  { doSetParmValue(idx, instance, value); }
418  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
419  { doSetParmValue(idx, instance, value); }
420  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
421  { doSetParmValue(idx, instance, value); }
422  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
423  { doSetParmValue(idx, instance, value); }
424  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
425  { doSetParmValue(idx, instance, value); }
426  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
427  { doSetParmValue(idx, instance, value); }
428  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
429  { doSetParmValue(idx, instance, value); }
430  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
431  { doSetParmValue(idx, instance, value); }
432 
433  exint getNestNumParms(TempIndex idx) const override
434  {
435  if (idx.size() == 0)
436  return 17;
437  switch (idx[0])
438  {
439 
440  }
441  // Invalid
442  return 0;
443  }
444 
445  const char *getNestParmName(TempIndex fieldnum) const override
446  {
447  if (fieldnum.size() < 1)
448  return 0;
449  switch (fieldnum[0])
450  {
451  case 0:
452  return "group";
453  case 1:
454  return "mask";
455  case 2:
456  return "enablemaskattrib";
457  case 3:
458  return "maskattrib";
459  case 4:
460  return "dist";
461  case 5:
462  return "distmetric";
463  case 6:
464  return "applyrolloff";
465  case 7:
466  return "distattr";
467  case 8:
468  return "rad";
469  case 9:
470  return "type";
471  case 10:
472  return "tandeg";
473  case 11:
474  return "kernel";
475  case 12:
476  return "leadnml";
477  case 13:
478  return "updatenmls";
479  case 14:
480  return "updateaffectednmls";
481  case 15:
482  return "visualizefalloff";
483  case 16:
484  return "leadptattr";
485 
486  }
487  return 0;
488  }
489 
490  ParmType getNestParmType(TempIndex fieldnum) const override
491  {
492  if (fieldnum.size() < 1)
493  return PARM_UNSUPPORTED;
494  switch (fieldnum[0])
495  {
496  case 0:
497  return PARM_STRING;
498  case 1:
499  return PARM_FLOAT;
500  case 2:
501  return PARM_INTEGER;
502  case 3:
503  return PARM_STRING;
504  case 4:
505  return PARM_FLOAT;
506  case 5:
507  return PARM_INTEGER;
508  case 6:
509  return PARM_INTEGER;
510  case 7:
511  return PARM_STRING;
512  case 8:
513  return PARM_FLOAT;
514  case 9:
515  return PARM_INTEGER;
516  case 10:
517  return PARM_VECTOR2;
518  case 11:
519  return PARM_STRING;
520  case 12:
521  return PARM_INTEGER;
522  case 13:
523  return PARM_INTEGER;
524  case 14:
525  return PARM_INTEGER;
526  case 15:
527  return PARM_INTEGER;
528  case 16:
529  return PARM_STRING;
530 
531  }
532  return PARM_UNSUPPORTED;
533  }
534 
535  // Boiler plate to load individual types.
536  static void loadData(UT_IStream &is, int64 &v)
537  { is.bread(&v, 1); }
538  static void loadData(UT_IStream &is, bool &v)
539  { int64 iv; is.bread(&iv, 1); v = iv; }
540  static void loadData(UT_IStream &is, fpreal64 &v)
541  { is.bread<fpreal64>(&v, 1); }
542  static void loadData(UT_IStream &is, UT_Vector2D &v)
543  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
544  static void loadData(UT_IStream &is, UT_Vector3D &v)
545  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
546  is.bread<fpreal64>(&v.z(), 1); }
547  static void loadData(UT_IStream &is, UT_Vector4D &v)
548  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
549  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
550  static void loadData(UT_IStream &is, UT_Matrix2D &v)
551  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
552  static void loadData(UT_IStream &is, UT_Matrix3D &v)
553  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
554  static void loadData(UT_IStream &is, UT_Matrix4D &v)
555  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
556  static void loadData(UT_IStream &is, UT_Vector2I &v)
557  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
558  static void loadData(UT_IStream &is, UT_Vector3I &v)
559  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
560  is.bread<int64>(&v.z(), 1); }
561  static void loadData(UT_IStream &is, UT_Vector4I &v)
562  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
563  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
565  { is.bread(v); }
567  { UT_StringHolder rampdata;
568  loadData(is, rampdata);
569  if (rampdata.isstring())
570  {
571  v.reset(new UT_Ramp());
572  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
573  v->load(istr);
574  }
575  else v.reset();
576  }
579  loadData(is, data);
580  if (data.isstring())
581  {
582  // Find the data type.
583  const char *colon = UT_StringWrap(data).findChar(':');
584  if (colon)
585  {
586  int typelen = colon - data.buffer();
588  type.strncpy(data.buffer(), typelen);
589  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
590 
591  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
592  }
593  }
594  else v.reset();
595  }
596 
597  static void saveData(std::ostream &os, int64 v)
598  { UTwrite(os, &v); }
599  static void saveData(std::ostream &os, bool v)
600  { int64 iv = v; UTwrite(os, &iv); }
601  static void saveData(std::ostream &os, fpreal64 v)
602  { UTwrite<fpreal64>(os, &v); }
603  static void saveData(std::ostream &os, UT_Vector2D v)
604  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
605  static void saveData(std::ostream &os, UT_Vector3D v)
606  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
607  UTwrite<fpreal64>(os, &v.z()); }
608  static void saveData(std::ostream &os, UT_Vector4D v)
609  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
610  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
611  static void saveData(std::ostream &os, UT_Matrix2D v)
613  static void saveData(std::ostream &os, UT_Matrix3D v)
615  static void saveData(std::ostream &os, UT_Matrix4D v)
617  static void saveData(std::ostream &os, UT_StringHolder s)
618  { UT_StringWrap(s).saveBinary(os); }
619  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
621  UT_OStringStream ostr;
622  if (s) s->save(ostr);
623  result = ostr.str();
624  saveData(os, result);
625  }
626  static void saveData(std::ostream &os, PRM_DataItemHandle s)
628  UT_OStringStream ostr;
629  if (s)
630  {
631  ostr << s->getDataTypeToken();
632  ostr << ":";
633  s->saveBinary(ostr);
634  }
635  result = ostr.str();
636  saveData(os, result);
637  }
638 
639 
640  void save(std::ostream &os) const
641  {
642  int32 v = version();
643  UTwrite(os, &v);
644  saveData(os, myGroup);
645  saveData(os, myMask);
646  saveData(os, myEnablemaskattrib);
647  saveData(os, myMaskattrib);
648  saveData(os, myDist);
649  saveData(os, myDistmetric);
650  saveData(os, myApplyrolloff);
651  saveData(os, myDistattr);
652  saveData(os, myRad);
653  saveData(os, myType);
654  saveData(os, myTandeg);
655  saveData(os, myKernel);
656  saveData(os, myLeadnml);
657  saveData(os, myUpdatenmls);
658  saveData(os, myUpdateaffectednmls);
659  saveData(os, myVisualizefalloff);
660  saveData(os, myLeadptattr);
661 
662  }
663 
664  bool load(UT_IStream &is)
665  {
666  int32 v;
667  is.bread(&v, 1);
668  if (version() != v)
669  {
670  // Fail incompatible versions
671  return false;
672  }
673  loadData(is, myGroup);
674  loadData(is, myMask);
675  loadData(is, myEnablemaskattrib);
676  loadData(is, myMaskattrib);
677  loadData(is, myDist);
678  loadData(is, myDistmetric);
679  loadData(is, myApplyrolloff);
680  loadData(is, myDistattr);
681  loadData(is, myRad);
682  loadData(is, myType);
683  loadData(is, myTandeg);
684  loadData(is, myKernel);
685  loadData(is, myLeadnml);
686  loadData(is, myUpdatenmls);
687  loadData(is, myUpdateaffectednmls);
688  loadData(is, myVisualizefalloff);
689  loadData(is, myLeadptattr);
690 
691  return true;
692  }
693 
694  const UT_StringHolder & getGroup() const { return myGroup; }
695  void setGroup(const UT_StringHolder & val) { myGroup = val; }
697  {
698  SOP_Node *thissop = cookparms.getNode();
699  if (!thissop) return getGroup();
701  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
702  return result;
703  }
704  fpreal64 getMask() const { return myMask; }
705  void setMask(fpreal64 val) { myMask = val; }
706  fpreal64 opMask(const SOP_NodeVerb::CookParms &cookparms) const
707  {
708  SOP_Node *thissop = cookparms.getNode();
709  if (!thissop) return getMask();
711  OP_Utils::evalOpParm(result, thissop, "mask", cookparms.getCookTime(), 0);
712  return result;
713  }
714  Enablemaskattrib getEnablemaskattrib() const { return Enablemaskattrib(myEnablemaskattrib); }
715  void setEnablemaskattrib(Enablemaskattrib val) { myEnablemaskattrib = int64(val); }
717  {
718  SOP_Node *thissop = cookparms.getNode();
719  if (!thissop) return getEnablemaskattrib();
720  int64 result;
721  OP_Utils::evalOpParm(result, thissop, "enablemaskattrib", cookparms.getCookTime(), 0);
722  return Enablemaskattrib(result);
723  }
724  const UT_StringHolder & getMaskattrib() const { return myMaskattrib; }
725  void setMaskattrib(const UT_StringHolder & val) { myMaskattrib = val; }
727  {
728  SOP_Node *thissop = cookparms.getNode();
729  if (!thissop) return getMaskattrib();
731  OP_Utils::evalOpParm(result, thissop, "maskattrib", cookparms.getCookTime(), 0);
732  return result;
733  }
734  fpreal64 getDist() const { return myDist; }
735  void setDist(fpreal64 val) { myDist = val; }
736  fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
737  {
738  SOP_Node *thissop = cookparms.getNode();
739  if (!thissop) return getDist();
741  OP_Utils::evalOpParm(result, thissop, "dist", cookparms.getCookTime(), 0);
742  return result;
743  }
744  Distmetric getDistmetric() const { return Distmetric(myDistmetric); }
745  void setDistmetric(Distmetric val) { myDistmetric = int64(val); }
747  {
748  SOP_Node *thissop = cookparms.getNode();
749  if (!thissop) return getDistmetric();
750  int64 result;
751  OP_Utils::evalOpParm(result, thissop, "distmetric", cookparms.getCookTime(), 0);
752  return Distmetric(result);
753  }
754  bool getApplyrolloff() const { return myApplyrolloff; }
755  void setApplyrolloff(bool val) { myApplyrolloff = val; }
756  bool opApplyrolloff(const SOP_NodeVerb::CookParms &cookparms) const
757  {
758  SOP_Node *thissop = cookparms.getNode();
759  if (!thissop) return getApplyrolloff();
760  bool result;
761  OP_Utils::evalOpParm(result, thissop, "applyrolloff", cookparms.getCookTime(), 0);
762  return result;
763  }
764  const UT_StringHolder & getDistattr() const { return myDistattr; }
765  void setDistattr(const UT_StringHolder & val) { myDistattr = val; }
767  {
768  SOP_Node *thissop = cookparms.getNode();
769  if (!thissop) return getDistattr();
771  OP_Utils::evalOpParm(result, thissop, "distattr", cookparms.getCookTime(), 0);
772  return result;
773  }
774  fpreal64 getRad() const { return myRad; }
775  void setRad(fpreal64 val) { myRad = val; }
776  fpreal64 opRad(const SOP_NodeVerb::CookParms &cookparms) const
777  {
778  SOP_Node *thissop = cookparms.getNode();
779  if (!thissop) return getRad();
781  OP_Utils::evalOpParm(result, thissop, "rad", cookparms.getCookTime(), 0);
782  return result;
783  }
784  Type getType() const { return Type(myType); }
785  void setType(Type val) { myType = int64(val); }
786  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
787  {
788  SOP_Node *thissop = cookparms.getNode();
789  if (!thissop) return getType();
790  int64 result;
791  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
792  return Type(result);
793  }
794  UT_Vector2D getTandeg() const { return myTandeg; }
795  void setTandeg(UT_Vector2D val) { myTandeg = val; }
797  {
798  SOP_Node *thissop = cookparms.getNode();
799  if (!thissop) return getTandeg();
801  OP_Utils::evalOpParm(result, thissop, "tandeg", cookparms.getCookTime(), 0);
802  return result;
803  }
804  const UT_StringHolder & getKernel() const { return myKernel; }
805  void setKernel(const UT_StringHolder & val) { myKernel = val; }
807  {
808  SOP_Node *thissop = cookparms.getNode();
809  if (!thissop) return getKernel();
811  OP_Utils::evalOpParm(result, thissop, "kernel", cookparms.getCookTime(), 0);
812  return result;
813  }
814  bool getLeadnml() const { return myLeadnml; }
815  void setLeadnml(bool val) { myLeadnml = val; }
816  bool opLeadnml(const SOP_NodeVerb::CookParms &cookparms) const
817  {
818  SOP_Node *thissop = cookparms.getNode();
819  if (!thissop) return getLeadnml();
820  bool result;
821  OP_Utils::evalOpParm(result, thissop, "leadnml", cookparms.getCookTime(), 0);
822  return result;
823  }
824  bool getUpdatenmls() const { return myUpdatenmls; }
825  void setUpdatenmls(bool val) { myUpdatenmls = val; }
826  bool opUpdatenmls(const SOP_NodeVerb::CookParms &cookparms) const
827  {
828  SOP_Node *thissop = cookparms.getNode();
829  if (!thissop) return getUpdatenmls();
830  bool result;
831  OP_Utils::evalOpParm(result, thissop, "updatenmls", cookparms.getCookTime(), 0);
832  return result;
833  }
834  bool getUpdateaffectednmls() const { return myUpdateaffectednmls; }
835  void setUpdateaffectednmls(bool val) { myUpdateaffectednmls = val; }
836  bool opUpdateaffectednmls(const SOP_NodeVerb::CookParms &cookparms) const
837  {
838  SOP_Node *thissop = cookparms.getNode();
839  if (!thissop) return getUpdateaffectednmls();
840  bool result;
841  OP_Utils::evalOpParm(result, thissop, "updateaffectednmls", cookparms.getCookTime(), 0);
842  return result;
843  }
844  Visualizefalloff getVisualizefalloff() const { return Visualizefalloff(myVisualizefalloff); }
845  void setVisualizefalloff(Visualizefalloff val) { myVisualizefalloff = int64(val); }
847  {
848  SOP_Node *thissop = cookparms.getNode();
849  if (!thissop) return getVisualizefalloff();
850  int64 result;
851  OP_Utils::evalOpParm(result, thissop, "visualizefalloff", cookparms.getCookTime(), 0);
852  return Visualizefalloff(result);
853  }
854  const UT_StringHolder & getLeadptattr() const { return myLeadptattr; }
855  void setLeadptattr(const UT_StringHolder & val) { myLeadptattr = val; }
857  {
858  SOP_Node *thissop = cookparms.getNode();
859  if (!thissop) return getLeadptattr();
861  OP_Utils::evalOpParm(result, thissop, "leadptattr", cookparms.getCookTime(), 0);
862  return result;
863  }
864 
865 private:
866  UT_StringHolder myGroup;
867  fpreal64 myMask;
868  int64 myEnablemaskattrib;
869  UT_StringHolder myMaskattrib;
870  fpreal64 myDist;
871  int64 myDistmetric;
872  bool myApplyrolloff;
873  UT_StringHolder myDistattr;
874  fpreal64 myRad;
875  int64 myType;
876  UT_Vector2D myTandeg;
877  UT_StringHolder myKernel;
878  bool myLeadnml;
879  bool myUpdatenmls;
880  bool myUpdateaffectednmls;
881  int64 myVisualizefalloff;
882  UT_StringHolder myLeadptattr;
883 
884 };
Distmetric getDistmetric() const
type
Definition: core.h:556
const char * getNestParmName(TempIndex fieldnum) const override
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setVisualizefalloff(Visualizefalloff val)
void setDistmetric(Distmetric val)
static void saveData(std::ostream &os, UT_Matrix2D v)
bool opUpdateaffectednmls(const SOP_NodeVerb::CookParms &cookparms) const
void setMask(fpreal64 val)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
void setTandeg(UT_Vector2D val)
fpreal getTime() const
Definition: OP_Context.h:63
UT_Vector2T< fpreal64 > UT_Vector2D
GLsizei const GLfloat * value
Definition: glcorearb.h:824
bool operator==(const SOP_SoftPeakParms &src) const
fpreal64 opRad(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
bool load(UT_IStream &is)
SYS_FORCE_INLINE const char * buffer() const
UT_StringHolder opLeadptattr(const SOP_NodeVerb::CookParms &cookparms) const
GLdouble s
Definition: glad.h:3009
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opMaskattrib(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
**But if you need a result
Definition: thread.h:622
void setUpdateaffectednmls(bool val)
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setGroup(const UT_StringHolder &val)
bool opLeadnml(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 saveData(std::ostream &os, UT_StringHolder s)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
bool isParmColorRamp(exint idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
UT_Vector2D getTandeg() const
static void loadData(UT_IStream &is, fpreal64 &v)
bool opUpdatenmls(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getMask() 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
void save(std::ostream &os) const
void loadFromOpSubclass(const LoadParms &loadparms) override
UT_Vector2D opTandeg(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
fpreal64 getDist() const
exint length() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
const UT_StringHolder & getMaskattrib() const
Enablemaskattrib opEnablemaskattrib(const SOP_NodeVerb::CookParms &cookparms) const
bool opApplyrolloff(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getDistattr() const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setKernel(const UT_StringHolder &val)
bool getUpdateaffectednmls() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, bool &v)
Enablemaskattrib getEnablemaskattrib() const
bool getUpdatenmls() const
long long int64
Definition: SYS_Types.h:116
bool getApplyrolloff() const
Distmetric opDistmetric(const SOP_NodeVerb::CookParms &cookparms) const
void setRad(fpreal64 val)
Visualizefalloff getVisualizefalloff() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setUpdatenmls(bool val)
bool getLeadnml() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
UT_StringHolder opKernel(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
GT_API const UT_StringHolder version
fpreal64 getRad() const
static void saveData(std::ostream &os, UT_Vector3D v)
void setApplyrolloff(bool val)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, fpreal64 v)
const UT_StringHolder & getLeadptattr() const
void setEnablemaskattrib(Enablemaskattrib val)
void setType(Type val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void setMaskattrib(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
fpreal64 opMask(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, bool v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
UT_StringHolder opDistattr(const SOP_NodeVerb::CookParms &cookparms) const
Visualizefalloff opVisualizefalloff(const SOP_NodeVerb::CookParms &cookparms) const
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
const UT_StringHolder & getGroup() const
void setDist(fpreal64 val)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, int64 v)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setLeadptattr(const UT_StringHolder &val)
GLboolean r
Definition: glcorearb.h:1222
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void copyFrom(const OP_NodeParms *src) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const UT_StringHolder & getKernel() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
bool operator!=(const SOP_SoftPeakParms &src) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void saveData(std::ostream &os, UT_Vector4D v)
SYS_FORCE_INLINE UT_StringHolder getToken(Enablemaskattrib enum_value)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setDistattr(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
void setLeadnml(bool val)
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663