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 <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_SoftPeakEnums
24 {
25  enum class Distmetric
26  {
27  CUSTOM = 0,
28  EDGES,
29  GLOBAL,
31  SURFACE
32  };
33 
35  getToken(Distmetric enum_value)
36  {
37  using namespace UT::Literal;
38  switch (enum_value) {
39  case Distmetric::CUSTOM: return "custom"_sh;
40  case Distmetric::EDGES: return "edges"_sh;
41  case Distmetric::GLOBAL: return "global"_sh;
42  case Distmetric::GLOBALCONNECTED: return "globalconnected"_sh;
43  case Distmetric::SURFACE: return "surface"_sh;
44  default: UT_ASSERT(false); return ""_sh;
45  }
46  }
47 
48  enum class Type
49  {
50  LINEAR = 0,
51  QUADRATIC,
52  CUBIC,
53  META
54  };
55 
57  getToken(Type enum_value)
58  {
59  using namespace UT::Literal;
60  switch (enum_value) {
61  case Type::LINEAR: return "linear"_sh;
62  case Type::QUADRATIC: return "quadratic"_sh;
63  case Type::CUBIC: return "cubic"_sh;
64  case Type::META: return "meta"_sh;
65  default: UT_ASSERT(false); return ""_sh;
66  }
67  }
68 
69  enum class Visualizefalloff
70  {
71  NEVER = 0,
72  ALWAYS,
73  STATE
74  };
75 
78  {
79  using namespace UT::Literal;
80  switch (enum_value) {
81  case Visualizefalloff::NEVER: return "never"_sh;
82  case Visualizefalloff::ALWAYS: return "always"_sh;
83  case Visualizefalloff::STATE: return "state"_sh;
84  default: UT_ASSERT(false); return ""_sh;
85  }
86  }
87 
88 }
89 
90 
92 {
93 public:
94  static int version() { return 1; }
95 
97  {
98  myGroup = ""_UTsh;
99  myDist = 0;
100  myDistmetric = 4;
101  myApplyrolloff = false;
102  myDistattr = ""_UTsh;
103  myRad = 0.5;
104  myType = 2;
105  myTandeg = UT_Vector2D(0,0);
106  myKernel = "wyvill"_UTsh;
107  myLeadnml = true;
108  myUpdatenmls = false;
109  myUpdateaffectednmls = true;
110  myVisualizefalloff = 2;
111  myLeadptattr = ""_UTsh;
112 
113  }
114 
115  explicit SOP_SoftPeakParms(const SOP_SoftPeakParms &) = default;
116  SOP_SoftPeakParms &operator=(const SOP_SoftPeakParms &) = default;
117  SOP_SoftPeakParms(SOP_SoftPeakParms &&) noexcept = default;
118  SOP_SoftPeakParms &operator=(SOP_SoftPeakParms &&) noexcept = default;
119 
120  ~SOP_SoftPeakParms() override {}
121 
122  bool operator==(const SOP_SoftPeakParms &src) const
123  {
124  if (myGroup != src.myGroup) return false;
125  if (myDist != src.myDist) return false;
126  if (myDistmetric != src.myDistmetric) return false;
127  if (myApplyrolloff != src.myApplyrolloff) return false;
128  if (myDistattr != src.myDistattr) return false;
129  if (myRad != src.myRad) return false;
130  if (myType != src.myType) return false;
131  if (myTandeg != src.myTandeg) return false;
132  if (myKernel != src.myKernel) return false;
133  if (myLeadnml != src.myLeadnml) return false;
134  if (myUpdatenmls != src.myUpdatenmls) return false;
135  if (myUpdateaffectednmls != src.myUpdateaffectednmls) return false;
136  if (myVisualizefalloff != src.myVisualizefalloff) return false;
137  if (myLeadptattr != src.myLeadptattr) return false;
138 
139  return true;
140  }
141  bool operator!=(const SOP_SoftPeakParms &src) const
142  {
143  return !operator==(src);
144  }
148 
149 
150 
151  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
152  {
153  myGroup = ""_UTsh;
154  if (true)
155  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
156  myDist = 0;
157  if (true)
158  graph->evalOpParm(myDist, nodeidx, "dist", time, 0);
159  myDistmetric = 4;
160  if (true)
161  graph->evalOpParm(myDistmetric, nodeidx, "distmetric", time, 0);
162  myApplyrolloff = false;
163  if (true && ( (true&&!(((int64(getDistmetric())!=0)))) ) )
164  graph->evalOpParm(myApplyrolloff, nodeidx, "applyrolloff", time, 0);
165  myDistattr = ""_UTsh;
166  if (true && ( (true&&!(((int64(getDistmetric())!=0)))) ) )
167  graph->evalOpParm(myDistattr, nodeidx, "distattr", time, 0);
168  myRad = 0.5;
169  if (true && ( (true&&!(((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
170  graph->evalOpParm(myRad, nodeidx, "rad", time, 0);
171  myType = 2;
172  if (true && ( (true&&!(((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
173  graph->evalOpParm(myType, nodeidx, "type", time, 0);
174  myTandeg = UT_Vector2D(0,0);
175  if (true && ( (true&&!(((int64(getType())!=2))||((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
176  graph->evalOpParm(myTandeg, nodeidx, "tandeg", time, 0);
177  myKernel = "wyvill"_UTsh;
178  if (true && ( (true&&!(((int64(getType())!=3))||((int64(getDistmetric())==0)&&(getApplyrolloff()==0)))) ) )
179  graph->evalOpParm(myKernel, nodeidx, "kernel", time, 0);
180  myLeadnml = true;
181  if (true)
182  graph->evalOpParm(myLeadnml, nodeidx, "leadnml", time, 0);
183  myUpdatenmls = false;
184  if (true)
185  graph->evalOpParm(myUpdatenmls, nodeidx, "updatenmls", time, 0);
186  myUpdateaffectednmls = true;
187  if (true && ( (true&&!(((getUpdatenmls()==1)))) ) )
188  graph->evalOpParm(myUpdateaffectednmls, nodeidx, "updateaffectednmls", time, 0);
189  myVisualizefalloff = 2;
190  if (true)
191  graph->evalOpParm(myVisualizefalloff, nodeidx, "visualizefalloff", time, 0);
192  myLeadptattr = ""_UTsh;
193  if (true && ( (true&&!(((int64(getDistmetric())!=0))||((getLeadnml()==0)))) ) )
194  graph->evalOpParm(myLeadptattr, nodeidx, "leadptattr", time, 0);
195 
196  }
197 
198 
199  void loadFromOpSubclass(const LoadParms &loadparms) override
200  {
201  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
202  }
203 
204 
205  void copyFrom(const OP_NodeParms *src) override
206  {
207  *this = *((const SOP_SoftPeakParms *)src);
208  }
209 
210  template <typename T>
211  void
212  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
213  {
214  if (idx.size() < 1)
215  return;
216  UT_ASSERT(idx.size() == instance.size()+1);
217  if (idx.size() != instance.size()+1)
218  return;
219  switch (idx[0])
220  {
221  case 0:
222  coerceValue(value, myGroup);
223  break;
224  case 1:
225  coerceValue(value, myDist);
226  break;
227  case 2:
228  coerceValue(value, myDistmetric);
229  break;
230  case 3:
231  coerceValue(value, myApplyrolloff);
232  break;
233  case 4:
234  coerceValue(value, myDistattr);
235  break;
236  case 5:
237  coerceValue(value, myRad);
238  break;
239  case 6:
240  coerceValue(value, myType);
241  break;
242  case 7:
243  coerceValue(value, myTandeg);
244  break;
245  case 8:
246  coerceValue(value, myKernel);
247  break;
248  case 9:
249  coerceValue(value, myLeadnml);
250  break;
251  case 10:
252  coerceValue(value, myUpdatenmls);
253  break;
254  case 11:
255  coerceValue(value, myUpdateaffectednmls);
256  break;
257  case 12:
258  coerceValue(value, myVisualizefalloff);
259  break;
260  case 13:
261  coerceValue(value, myLeadptattr);
262  break;
263 
264  }
265  }
266 
267  bool isParmColorRamp(exint idx) const override
268  {
269  switch (idx)
270  {
271 
272  }
273  return false;
274  }
275 
276  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
277  { doGetParmValue(idx, instance, value); }
278  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
279  { doGetParmValue(idx, instance, value); }
280  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
281  { doGetParmValue(idx, instance, value); }
282  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
283  { doGetParmValue(idx, instance, value); }
284  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
285  { doGetParmValue(idx, instance, value); }
286  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
287  { doGetParmValue(idx, instance, value); }
288  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
289  { doGetParmValue(idx, instance, value); }
290  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
291  { doGetParmValue(idx, instance, value); }
292  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
293  { doGetParmValue(idx, instance, value); }
294  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
297  { doGetParmValue(idx, instance, value); }
298 
299  template <typename T>
300  void
301  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
302  {
303  if (idx.size() < 1)
304  return;
305  UT_ASSERT(idx.size() == instance.size()+1);
306  if (idx.size() != instance.size()+1)
307  return;
308  switch (idx[0])
309  {
310  case 0:
311  coerceValue(myGroup, ( ( value ) ));
312  break;
313  case 1:
314  coerceValue(myDist, ( ( value ) ));
315  break;
316  case 2:
317  coerceValue(myDistmetric, clampMinValue(0, clampMaxValue(4, value ) ));
318  break;
319  case 3:
320  coerceValue(myApplyrolloff, ( ( value ) ));
321  break;
322  case 4:
323  coerceValue(myDistattr, ( ( value ) ));
324  break;
325  case 5:
326  coerceValue(myRad, clampMinValue(0, ( value ) ));
327  break;
328  case 6:
329  coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
330  break;
331  case 7:
332  coerceValue(myTandeg, ( ( value ) ));
333  break;
334  case 8:
335  coerceValue(myKernel, ( ( value ) ));
336  break;
337  case 9:
338  coerceValue(myLeadnml, ( ( value ) ));
339  break;
340  case 10:
341  coerceValue(myUpdatenmls, ( ( value ) ));
342  break;
343  case 11:
344  coerceValue(myUpdateaffectednmls, ( ( value ) ));
345  break;
346  case 12:
347  coerceValue(myVisualizefalloff, clampMinValue(0, clampMaxValue(2, value ) ));
348  break;
349  case 13:
350  coerceValue(myLeadptattr, ( ( value ) ));
351  break;
352 
353  }
354  }
355 
356  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
357  { doSetParmValue(idx, instance, value); }
358  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
359  { doSetParmValue(idx, instance, value); }
360  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
361  { doSetParmValue(idx, instance, value); }
362  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
363  { doSetParmValue(idx, instance, value); }
364  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
365  { doSetParmValue(idx, instance, value); }
366  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
367  { doSetParmValue(idx, instance, value); }
368  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
369  { doSetParmValue(idx, instance, value); }
370  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
371  { doSetParmValue(idx, instance, value); }
372  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
373  { doSetParmValue(idx, instance, value); }
374  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
375  { doSetParmValue(idx, instance, value); }
376  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
377  { doSetParmValue(idx, instance, value); }
378 
379  exint getNestNumParms(TempIndex idx) const override
380  {
381  if (idx.size() == 0)
382  return 14;
383  switch (idx[0])
384  {
385 
386  }
387  // Invalid
388  return 0;
389  }
390 
391  const char *getNestParmName(TempIndex fieldnum) const override
392  {
393  if (fieldnum.size() < 1)
394  return 0;
395  switch (fieldnum[0])
396  {
397  case 0:
398  return "group";
399  case 1:
400  return "dist";
401  case 2:
402  return "distmetric";
403  case 3:
404  return "applyrolloff";
405  case 4:
406  return "distattr";
407  case 5:
408  return "rad";
409  case 6:
410  return "type";
411  case 7:
412  return "tandeg";
413  case 8:
414  return "kernel";
415  case 9:
416  return "leadnml";
417  case 10:
418  return "updatenmls";
419  case 11:
420  return "updateaffectednmls";
421  case 12:
422  return "visualizefalloff";
423  case 13:
424  return "leadptattr";
425 
426  }
427  return 0;
428  }
429 
430  ParmType getNestParmType(TempIndex fieldnum) const override
431  {
432  if (fieldnum.size() < 1)
433  return PARM_UNSUPPORTED;
434  switch (fieldnum[0])
435  {
436  case 0:
437  return PARM_STRING;
438  case 1:
439  return PARM_FLOAT;
440  case 2:
441  return PARM_INTEGER;
442  case 3:
443  return PARM_INTEGER;
444  case 4:
445  return PARM_STRING;
446  case 5:
447  return PARM_FLOAT;
448  case 6:
449  return PARM_INTEGER;
450  case 7:
451  return PARM_VECTOR2;
452  case 8:
453  return PARM_STRING;
454  case 9:
455  return PARM_INTEGER;
456  case 10:
457  return PARM_INTEGER;
458  case 11:
459  return PARM_INTEGER;
460  case 12:
461  return PARM_INTEGER;
462  case 13:
463  return PARM_STRING;
464 
465  }
466  return PARM_UNSUPPORTED;
467  }
468 
469  // Boiler plate to load individual types.
470  static void loadData(UT_IStream &is, int64 &v)
471  { is.bread(&v, 1); }
472  static void loadData(UT_IStream &is, bool &v)
473  { int64 iv; is.bread(&iv, 1); v = iv; }
474  static void loadData(UT_IStream &is, fpreal64 &v)
475  { is.bread<fpreal64>(&v, 1); }
476  static void loadData(UT_IStream &is, UT_Vector2D &v)
477  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
478  static void loadData(UT_IStream &is, UT_Vector3D &v)
479  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
480  is.bread<fpreal64>(&v.z(), 1); }
481  static void loadData(UT_IStream &is, UT_Vector4D &v)
482  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
483  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
484  static void loadData(UT_IStream &is, UT_Matrix2D &v)
485  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
486  static void loadData(UT_IStream &is, UT_Matrix3D &v)
487  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
488  static void loadData(UT_IStream &is, UT_Matrix4D &v)
489  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
490  static void loadData(UT_IStream &is, UT_Vector2I &v)
491  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
492  static void loadData(UT_IStream &is, UT_Vector3I &v)
493  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
494  is.bread<int64>(&v.z(), 1); }
495  static void loadData(UT_IStream &is, UT_Vector4I &v)
496  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
497  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
499  { is.bread(v); }
501  { UT_StringHolder rampdata;
502  loadData(is, rampdata);
503  if (rampdata.isstring())
504  {
505  v.reset(new UT_Ramp());
506  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
507  v->load(istr);
508  }
509  else v.reset();
510  }
513  loadData(is, data);
514  if (data.isstring())
515  {
516  // Find the data type.
517  const char *colon = UT_StringWrap(data).findChar(':');
518  if (colon)
519  {
520  int typelen = colon - data.buffer();
522  type.strncpy(data.buffer(), typelen);
523  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
524 
525  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
526  }
527  }
528  else v.reset();
529  }
530 
531  static void saveData(std::ostream &os, int64 v)
532  { UTwrite(os, &v); }
533  static void saveData(std::ostream &os, bool v)
534  { int64 iv = v; UTwrite(os, &iv); }
535  static void saveData(std::ostream &os, fpreal64 v)
536  { UTwrite<fpreal64>(os, &v); }
537  static void saveData(std::ostream &os, UT_Vector2D v)
538  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
539  static void saveData(std::ostream &os, UT_Vector3D v)
540  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
541  UTwrite<fpreal64>(os, &v.z()); }
542  static void saveData(std::ostream &os, UT_Vector4D v)
543  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
544  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
545  static void saveData(std::ostream &os, UT_Matrix2D v)
547  static void saveData(std::ostream &os, UT_Matrix3D v)
549  static void saveData(std::ostream &os, UT_Matrix4D v)
551  static void saveData(std::ostream &os, UT_StringHolder s)
552  { UT_StringWrap(s).saveBinary(os); }
553  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
555  UT_OStringStream ostr;
556  if (s) s->save(ostr);
557  result = ostr.str();
558  saveData(os, result);
559  }
560  static void saveData(std::ostream &os, PRM_DataItemHandle s)
562  UT_OStringStream ostr;
563  if (s)
564  {
565  ostr << s->getDataTypeToken();
566  ostr << ":";
567  s->saveBinary(ostr);
568  }
569  result = ostr.str();
570  saveData(os, result);
571  }
572 
573 
574  void save(std::ostream &os) const
575  {
576  int32 v = version();
577  UTwrite(os, &v);
578  saveData(os, myGroup);
579  saveData(os, myDist);
580  saveData(os, myDistmetric);
581  saveData(os, myApplyrolloff);
582  saveData(os, myDistattr);
583  saveData(os, myRad);
584  saveData(os, myType);
585  saveData(os, myTandeg);
586  saveData(os, myKernel);
587  saveData(os, myLeadnml);
588  saveData(os, myUpdatenmls);
589  saveData(os, myUpdateaffectednmls);
590  saveData(os, myVisualizefalloff);
591  saveData(os, myLeadptattr);
592 
593  }
594 
595  bool load(UT_IStream &is)
596  {
597  int32 v;
598  is.bread(&v, 1);
599  if (version() != v)
600  {
601  // Fail incompatible versions
602  return false;
603  }
604  loadData(is, myGroup);
605  loadData(is, myDist);
606  loadData(is, myDistmetric);
607  loadData(is, myApplyrolloff);
608  loadData(is, myDistattr);
609  loadData(is, myRad);
610  loadData(is, myType);
611  loadData(is, myTandeg);
612  loadData(is, myKernel);
613  loadData(is, myLeadnml);
614  loadData(is, myUpdatenmls);
615  loadData(is, myUpdateaffectednmls);
616  loadData(is, myVisualizefalloff);
617  loadData(is, myLeadptattr);
618 
619  return true;
620  }
621 
622  const UT_StringHolder & getGroup() const { return myGroup; }
623  void setGroup(const UT_StringHolder & val) { myGroup = val; }
625  {
626  SOP_Node *thissop = cookparms.getNode();
627  if (!thissop) return getGroup();
629  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
630  return result;
631  }
632  fpreal64 getDist() const { return myDist; }
633  void setDist(fpreal64 val) { myDist = val; }
634  fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
635  {
636  SOP_Node *thissop = cookparms.getNode();
637  if (!thissop) return getDist();
639  OP_Utils::evalOpParm(result, thissop, "dist", cookparms.getCookTime(), 0);
640  return result;
641  }
642  Distmetric getDistmetric() const { return Distmetric(myDistmetric); }
643  void setDistmetric(Distmetric val) { myDistmetric = int64(val); }
645  {
646  SOP_Node *thissop = cookparms.getNode();
647  if (!thissop) return getDistmetric();
648  int64 result;
649  OP_Utils::evalOpParm(result, thissop, "distmetric", cookparms.getCookTime(), 0);
650  return Distmetric(result);
651  }
652  bool getApplyrolloff() const { return myApplyrolloff; }
653  void setApplyrolloff(bool val) { myApplyrolloff = val; }
654  bool opApplyrolloff(const SOP_NodeVerb::CookParms &cookparms) const
655  {
656  SOP_Node *thissop = cookparms.getNode();
657  if (!thissop) return getApplyrolloff();
658  bool result;
659  OP_Utils::evalOpParm(result, thissop, "applyrolloff", cookparms.getCookTime(), 0);
660  return result;
661  }
662  const UT_StringHolder & getDistattr() const { return myDistattr; }
663  void setDistattr(const UT_StringHolder & val) { myDistattr = val; }
665  {
666  SOP_Node *thissop = cookparms.getNode();
667  if (!thissop) return getDistattr();
669  OP_Utils::evalOpParm(result, thissop, "distattr", cookparms.getCookTime(), 0);
670  return result;
671  }
672  fpreal64 getRad() const { return myRad; }
673  void setRad(fpreal64 val) { myRad = val; }
674  fpreal64 opRad(const SOP_NodeVerb::CookParms &cookparms) const
675  {
676  SOP_Node *thissop = cookparms.getNode();
677  if (!thissop) return getRad();
679  OP_Utils::evalOpParm(result, thissop, "rad", cookparms.getCookTime(), 0);
680  return result;
681  }
682  Type getType() const { return Type(myType); }
683  void setType(Type val) { myType = int64(val); }
684  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
685  {
686  SOP_Node *thissop = cookparms.getNode();
687  if (!thissop) return getType();
688  int64 result;
689  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
690  return Type(result);
691  }
692  UT_Vector2D getTandeg() const { return myTandeg; }
693  void setTandeg(UT_Vector2D val) { myTandeg = val; }
695  {
696  SOP_Node *thissop = cookparms.getNode();
697  if (!thissop) return getTandeg();
699  OP_Utils::evalOpParm(result, thissop, "tandeg", cookparms.getCookTime(), 0);
700  return result;
701  }
702  const UT_StringHolder & getKernel() const { return myKernel; }
703  void setKernel(const UT_StringHolder & val) { myKernel = val; }
705  {
706  SOP_Node *thissop = cookparms.getNode();
707  if (!thissop) return getKernel();
709  OP_Utils::evalOpParm(result, thissop, "kernel", cookparms.getCookTime(), 0);
710  return result;
711  }
712  bool getLeadnml() const { return myLeadnml; }
713  void setLeadnml(bool val) { myLeadnml = val; }
714  bool opLeadnml(const SOP_NodeVerb::CookParms &cookparms) const
715  {
716  SOP_Node *thissop = cookparms.getNode();
717  if (!thissop) return getLeadnml();
718  bool result;
719  OP_Utils::evalOpParm(result, thissop, "leadnml", cookparms.getCookTime(), 0);
720  return result;
721  }
722  bool getUpdatenmls() const { return myUpdatenmls; }
723  void setUpdatenmls(bool val) { myUpdatenmls = val; }
724  bool opUpdatenmls(const SOP_NodeVerb::CookParms &cookparms) const
725  {
726  SOP_Node *thissop = cookparms.getNode();
727  if (!thissop) return getUpdatenmls();
728  bool result;
729  OP_Utils::evalOpParm(result, thissop, "updatenmls", cookparms.getCookTime(), 0);
730  return result;
731  }
732  bool getUpdateaffectednmls() const { return myUpdateaffectednmls; }
733  void setUpdateaffectednmls(bool val) { myUpdateaffectednmls = val; }
734  bool opUpdateaffectednmls(const SOP_NodeVerb::CookParms &cookparms) const
735  {
736  SOP_Node *thissop = cookparms.getNode();
737  if (!thissop) return getUpdateaffectednmls();
738  bool result;
739  OP_Utils::evalOpParm(result, thissop, "updateaffectednmls", cookparms.getCookTime(), 0);
740  return result;
741  }
742  Visualizefalloff getVisualizefalloff() const { return Visualizefalloff(myVisualizefalloff); }
743  void setVisualizefalloff(Visualizefalloff val) { myVisualizefalloff = int64(val); }
745  {
746  SOP_Node *thissop = cookparms.getNode();
747  if (!thissop) return getVisualizefalloff();
748  int64 result;
749  OP_Utils::evalOpParm(result, thissop, "visualizefalloff", cookparms.getCookTime(), 0);
750  return Visualizefalloff(result);
751  }
752  const UT_StringHolder & getLeadptattr() const { return myLeadptattr; }
753  void setLeadptattr(const UT_StringHolder & val) { myLeadptattr = val; }
755  {
756  SOP_Node *thissop = cookparms.getNode();
757  if (!thissop) return getLeadptattr();
759  OP_Utils::evalOpParm(result, thissop, "leadptattr", cookparms.getCookTime(), 0);
760  return result;
761  }
762 
763 private:
764  UT_StringHolder myGroup;
765  fpreal64 myDist;
766  int64 myDistmetric;
767  bool myApplyrolloff;
768  UT_StringHolder myDistattr;
769  fpreal64 myRad;
770  int64 myType;
771  UT_Vector2D myTandeg;
772  UT_StringHolder myKernel;
773  bool myLeadnml;
774  bool myUpdatenmls;
775  bool myUpdateaffectednmls;
776  int64 myVisualizefalloff;
777  UT_StringHolder myLeadptattr;
778 
779 };
Distmetric getDistmetric() const
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
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:62
UT_Vector2T< fpreal64 > UT_Vector2D
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)
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:613
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
double fpreal64
Definition: SYS_Types.h:201
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
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)
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:296
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 setType(Type val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void saveData(std::ostream &os, bool v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
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
#define SOP_API
Definition: SOP_API.h:10
const UT_StringHolder & getGroup() const
void setDist(fpreal64 val)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
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:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
Definition: core.h:1131
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
SYS_FORCE_INLINE UT_StringHolder getToken(Distmetric enum_value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const UT_StringHolder & getKernel() const
type
Definition: core.h:1059
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
bool operator!=(const SOP_SoftPeakParms &src) const
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
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