HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Curve.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_CurveEnums
24 {
25  enum class Type
26  {
27  POLY = 0,
28  NURBS,
29  BEZIER,
30  POINTS
31  };
32 
34  getToken(Type enum_value)
35  {
36  using namespace UT::Literal;
37  switch (enum_value) {
38  case Type::POLY: return "poly"_sh;
39  case Type::NURBS: return "nurbs"_sh;
40  case Type::BEZIER: return "bezier"_sh;
41  case Type::POINTS: return "points"_sh;
42  default: UT_ASSERT(false); return ""_sh;
43  }
44  }
45 
46  enum class Method
47  {
48  CV = 0,
50  FREEHAND
51  };
52 
54  getToken(Method enum_value)
55  {
56  using namespace UT::Literal;
57  switch (enum_value) {
58  case Method::CV: return "cv"_sh;
59  case Method::BREAKPOINTS: return "breakpoints"_sh;
60  case Method::FREEHAND: return "freehand"_sh;
61  default: UT_ASSERT(false); return ""_sh;
62  }
63  }
64 
65  enum class Param
66  {
67  UNIFORM = 0,
68  CHRDLEN,
69  CENTRIP
70  };
71 
73  getToken(Param enum_value)
74  {
75  using namespace UT::Literal;
76  switch (enum_value) {
77  case Param::UNIFORM: return "uniform"_sh;
78  case Param::CHRDLEN: return "chrdlen"_sh;
79  case Param::CENTRIP: return "centrip"_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  myType = 0;
95  myMethod = 0;
96  myCoords = ""_UTsh;
97  myClose = false;
98  myReverse = false;
99  myOrder = 4;
100  myParam = 0;
101  myTolerance = 0.01;
102  mySmooth = 0;
103  myCsharp = false;
104  myKeepgeo = false;
105  myNormalize = false;
106 
107  }
108 
109  explicit SOP_CurveParms(const SOP_CurveParms &) = default;
110  SOP_CurveParms &operator=(const SOP_CurveParms &) = default;
111  SOP_CurveParms(SOP_CurveParms &&) noexcept = default;
112  SOP_CurveParms &operator=(SOP_CurveParms &&) noexcept = default;
113 
114  ~SOP_CurveParms() override {}
115 
116  bool operator==(const SOP_CurveParms &src) const
117  {
118  if (myType != src.myType) return false;
119  if (myMethod != src.myMethod) return false;
120  if (myCoords != src.myCoords) return false;
121  if (myClose != src.myClose) return false;
122  if (myReverse != src.myReverse) return false;
123  if (myOrder != src.myOrder) return false;
124  if (myParam != src.myParam) return false;
125  if (myTolerance != src.myTolerance) return false;
126  if (mySmooth != src.mySmooth) return false;
127  if (myCsharp != src.myCsharp) return false;
128  if (myKeepgeo != src.myKeepgeo) return false;
129  if (myNormalize != src.myNormalize) return false;
130 
131  return true;
132  }
133  bool operator!=(const SOP_CurveParms &src) const
134  {
135  return !operator==(src);
136  }
140 
141 
142 
143  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
144  {
145  myType = 0;
146  if (true)
147  graph->evalOpParm(myType, nodeidx, "type", time, 0);
148  myMethod = 0;
149  if (true)
150  graph->evalOpParm(myMethod, nodeidx, "method", time, 0);
151  myCoords = ""_UTsh;
152  if (true)
153  graph->evalOpParm(myCoords, nodeidx, "coords", time, 0);
154  myClose = false;
155  if (true && ( (true&&!(((int64(getType())==3)))) ) )
156  graph->evalOpParm(myClose, nodeidx, "close", time, 0);
157  myReverse = false;
158  if (true)
159  graph->evalOpParm(myReverse, nodeidx, "reverse", time, 0);
160  myOrder = 4;
161  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2)))) ) )
162  graph->evalOpParm(myOrder, nodeidx, "order", time, 0);
163  myParam = 0;
164  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2))||((int64(getMethod())!=1)))) ) )
165  graph->evalOpParm(myParam, nodeidx, "param", time, 0);
166  myTolerance = 0.01;
167  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2))||((int64(getMethod())!=2)))) ) )
168  graph->evalOpParm(myTolerance, nodeidx, "tolerance", time, 0);
169  mySmooth = 0;
170  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2))||((int64(getMethod())!=2)))) ) )
171  graph->evalOpParm(mySmooth, nodeidx, "smooth", time, 0);
172  myCsharp = false;
173  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2))||((int64(getMethod())!=2)))) ) )
174  graph->evalOpParm(myCsharp, nodeidx, "csharp", time, 0);
175  myKeepgeo = false;
176  if (true)
177  graph->evalOpParm(myKeepgeo, nodeidx, "keepgeo", time, 0);
178  myNormalize = false;
179  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2))||((int64(getMethod())!=1))||((int64(getParam())!=0)))) ) )
180  graph->evalOpParm(myNormalize, nodeidx, "normalize", time, 0);
181 
182  }
183 
184 
185  void loadFromOpSubclass(const LoadParms &loadparms) override
186  {
187  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
188  }
189 
190 
191  void copyFrom(const OP_NodeParms *src) override
192  {
193  *this = *((const SOP_CurveParms *)src);
194  }
195 
196  template <typename T>
197  void
198  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
199  {
200  if (idx.size() < 1)
201  return;
202  UT_ASSERT(idx.size() == instance.size()+1);
203  if (idx.size() != instance.size()+1)
204  return;
205  switch (idx[0])
206  {
207  case 0:
208  coerceValue(value, myType);
209  break;
210  case 1:
211  coerceValue(value, myMethod);
212  break;
213  case 2:
214  coerceValue(value, myCoords);
215  break;
216  case 3:
217  coerceValue(value, myClose);
218  break;
219  case 4:
220  coerceValue(value, myReverse);
221  break;
222  case 5:
223  coerceValue(value, myOrder);
224  break;
225  case 6:
226  coerceValue(value, myParam);
227  break;
228  case 7:
229  coerceValue(value, myTolerance);
230  break;
231  case 8:
232  coerceValue(value, mySmooth);
233  break;
234  case 9:
235  coerceValue(value, myCsharp);
236  break;
237  case 10:
238  coerceValue(value, myKeepgeo);
239  break;
240  case 11:
241  coerceValue(value, myNormalize);
242  break;
243 
244  }
245  }
246 
247  bool isParmColorRamp(exint idx) const override
248  {
249  switch (idx)
250  {
251 
252  }
253  return false;
254  }
255 
256  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
257  { doGetParmValue(idx, instance, value); }
258  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
259  { doGetParmValue(idx, instance, value); }
260  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
261  { doGetParmValue(idx, instance, value); }
262  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
263  { doGetParmValue(idx, instance, value); }
264  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
265  { doGetParmValue(idx, instance, value); }
266  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
267  { doGetParmValue(idx, instance, value); }
268  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
269  { doGetParmValue(idx, instance, value); }
270  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
271  { doGetParmValue(idx, instance, value); }
272  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
273  { doGetParmValue(idx, instance, value); }
274  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
275  { doGetParmValue(idx, instance, value); }
276  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
277  { doGetParmValue(idx, instance, value); }
278 
279  template <typename T>
280  void
281  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
282  {
283  if (idx.size() < 1)
284  return;
285  UT_ASSERT(idx.size() == instance.size()+1);
286  if (idx.size() != instance.size()+1)
287  return;
288  switch (idx[0])
289  {
290  case 0:
291  coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
292  break;
293  case 1:
294  coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
295  break;
296  case 2:
297  coerceValue(myCoords, ( ( value ) ));
298  break;
299  case 3:
300  coerceValue(myClose, ( ( value ) ));
301  break;
302  case 4:
303  coerceValue(myReverse, ( ( value ) ));
304  break;
305  case 5:
306  coerceValue(myOrder, clampMinValue(2, clampMaxValue(11, value ) ));
307  break;
308  case 6:
309  coerceValue(myParam, clampMinValue(0, clampMaxValue(2, value ) ));
310  break;
311  case 7:
312  coerceValue(myTolerance, clampMinValue(0, ( value ) ));
313  break;
314  case 8:
315  coerceValue(mySmooth, clampMinValue(0, clampMaxValue(1, value ) ));
316  break;
317  case 9:
318  coerceValue(myCsharp, ( ( value ) ));
319  break;
320  case 10:
321  coerceValue(myKeepgeo, ( ( value ) ));
322  break;
323  case 11:
324  coerceValue(myNormalize, ( ( value ) ));
325  break;
326 
327  }
328  }
329 
330  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
331  { doSetParmValue(idx, instance, value); }
332  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
333  { doSetParmValue(idx, instance, value); }
334  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
335  { doSetParmValue(idx, instance, value); }
336  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
337  { doSetParmValue(idx, instance, value); }
338  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
339  { doSetParmValue(idx, instance, value); }
340  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
341  { doSetParmValue(idx, instance, value); }
342  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
343  { doSetParmValue(idx, instance, value); }
344  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
345  { doSetParmValue(idx, instance, value); }
346  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
347  { doSetParmValue(idx, instance, value); }
348  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
349  { doSetParmValue(idx, instance, value); }
350  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
351  { doSetParmValue(idx, instance, value); }
352 
353  exint getNestNumParms(TempIndex idx) const override
354  {
355  if (idx.size() == 0)
356  return 12;
357  switch (idx[0])
358  {
359 
360  }
361  // Invalid
362  return 0;
363  }
364 
365  const char *getNestParmName(TempIndex fieldnum) const override
366  {
367  if (fieldnum.size() < 1)
368  return 0;
369  switch (fieldnum[0])
370  {
371  case 0:
372  return "type";
373  case 1:
374  return "method";
375  case 2:
376  return "coords";
377  case 3:
378  return "close";
379  case 4:
380  return "reverse";
381  case 5:
382  return "order";
383  case 6:
384  return "param";
385  case 7:
386  return "tolerance";
387  case 8:
388  return "smooth";
389  case 9:
390  return "csharp";
391  case 10:
392  return "keepgeo";
393  case 11:
394  return "normalize";
395 
396  }
397  return 0;
398  }
399 
400  ParmType getNestParmType(TempIndex fieldnum) const override
401  {
402  if (fieldnum.size() < 1)
403  return PARM_UNSUPPORTED;
404  switch (fieldnum[0])
405  {
406  case 0:
407  return PARM_INTEGER;
408  case 1:
409  return PARM_INTEGER;
410  case 2:
411  return PARM_STRING;
412  case 3:
413  return PARM_INTEGER;
414  case 4:
415  return PARM_INTEGER;
416  case 5:
417  return PARM_INTEGER;
418  case 6:
419  return PARM_INTEGER;
420  case 7:
421  return PARM_FLOAT;
422  case 8:
423  return PARM_FLOAT;
424  case 9:
425  return PARM_INTEGER;
426  case 10:
427  return PARM_INTEGER;
428  case 11:
429  return PARM_INTEGER;
430 
431  }
432  return PARM_UNSUPPORTED;
433  }
434 
435  // Boiler plate to load individual types.
436  static void loadData(UT_IStream &is, int64 &v)
437  { is.bread(&v, 1); }
438  static void loadData(UT_IStream &is, bool &v)
439  { int64 iv; is.bread(&iv, 1); v = iv; }
440  static void loadData(UT_IStream &is, fpreal64 &v)
441  { is.bread<fpreal64>(&v, 1); }
442  static void loadData(UT_IStream &is, UT_Vector2D &v)
443  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
444  static void loadData(UT_IStream &is, UT_Vector3D &v)
445  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
446  is.bread<fpreal64>(&v.z(), 1); }
447  static void loadData(UT_IStream &is, UT_Vector4D &v)
448  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
449  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
450  static void loadData(UT_IStream &is, UT_Matrix2D &v)
451  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
452  static void loadData(UT_IStream &is, UT_Matrix3D &v)
453  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
454  static void loadData(UT_IStream &is, UT_Matrix4D &v)
455  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
456  static void loadData(UT_IStream &is, UT_Vector2I &v)
457  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
458  static void loadData(UT_IStream &is, UT_Vector3I &v)
459  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
460  is.bread<int64>(&v.z(), 1); }
461  static void loadData(UT_IStream &is, UT_Vector4I &v)
462  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
463  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
465  { is.bread(v); }
467  { UT_StringHolder rampdata;
468  loadData(is, rampdata);
469  if (rampdata.isstring())
470  {
471  v.reset(new UT_Ramp());
472  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
473  v->load(istr);
474  }
475  else v.reset();
476  }
479  loadData(is, data);
480  if (data.isstring())
481  {
482  // Find the data type.
483  const char *colon = UT_StringWrap(data).findChar(':');
484  if (colon)
485  {
486  int typelen = colon - data.buffer();
488  type.strncpy(data.buffer(), typelen);
489  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
490 
491  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
492  }
493  }
494  else v.reset();
495  }
496 
497  static void saveData(std::ostream &os, int64 v)
498  { UTwrite(os, &v); }
499  static void saveData(std::ostream &os, bool v)
500  { int64 iv = v; UTwrite(os, &iv); }
501  static void saveData(std::ostream &os, fpreal64 v)
502  { UTwrite<fpreal64>(os, &v); }
503  static void saveData(std::ostream &os, UT_Vector2D v)
504  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
505  static void saveData(std::ostream &os, UT_Vector3D v)
506  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
507  UTwrite<fpreal64>(os, &v.z()); }
508  static void saveData(std::ostream &os, UT_Vector4D v)
509  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
510  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
511  static void saveData(std::ostream &os, UT_Matrix2D v)
513  static void saveData(std::ostream &os, UT_Matrix3D v)
515  static void saveData(std::ostream &os, UT_Matrix4D v)
517  static void saveData(std::ostream &os, UT_StringHolder s)
518  { UT_StringWrap(s).saveBinary(os); }
519  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
521  UT_OStringStream ostr;
522  if (s) s->save(ostr);
523  result = ostr.str();
524  saveData(os, result);
525  }
526  static void saveData(std::ostream &os, PRM_DataItemHandle s)
528  UT_OStringStream ostr;
529  if (s)
530  {
531  ostr << s->getDataTypeToken();
532  ostr << ":";
533  s->saveBinary(ostr);
534  }
535  result = ostr.str();
536  saveData(os, result);
537  }
538 
539 
540  void save(std::ostream &os) const
541  {
542  int32 v = version();
543  UTwrite(os, &v);
544  saveData(os, myType);
545  saveData(os, myMethod);
546  saveData(os, myCoords);
547  saveData(os, myClose);
548  saveData(os, myReverse);
549  saveData(os, myOrder);
550  saveData(os, myParam);
551  saveData(os, myTolerance);
552  saveData(os, mySmooth);
553  saveData(os, myCsharp);
554  saveData(os, myKeepgeo);
555  saveData(os, myNormalize);
556 
557  }
558 
559  bool load(UT_IStream &is)
560  {
561  int32 v;
562  is.bread(&v, 1);
563  if (version() != v)
564  {
565  // Fail incompatible versions
566  return false;
567  }
568  loadData(is, myType);
569  loadData(is, myMethod);
570  loadData(is, myCoords);
571  loadData(is, myClose);
572  loadData(is, myReverse);
573  loadData(is, myOrder);
574  loadData(is, myParam);
575  loadData(is, myTolerance);
576  loadData(is, mySmooth);
577  loadData(is, myCsharp);
578  loadData(is, myKeepgeo);
579  loadData(is, myNormalize);
580 
581  return true;
582  }
583 
584  Type getType() const { return Type(myType); }
585  void setType(Type val) { myType = int64(val); }
586  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
587  {
588  SOP_Node *thissop = cookparms.getNode();
589  if (!thissop) return getType();
590  int64 result;
591  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
592  return Type(result);
593  }
594  Method getMethod() const { return Method(myMethod); }
595  void setMethod(Method val) { myMethod = int64(val); }
596  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
597  {
598  SOP_Node *thissop = cookparms.getNode();
599  if (!thissop) return getMethod();
600  int64 result;
601  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
602  return Method(result);
603  }
604  const UT_StringHolder & getCoords() const { return myCoords; }
605  void setCoords(const UT_StringHolder & val) { myCoords = val; }
607  {
608  SOP_Node *thissop = cookparms.getNode();
609  if (!thissop) return getCoords();
611  OP_Utils::evalOpParm(result, thissop, "coords", cookparms.getCookTime(), 0);
612  return result;
613  }
614  bool getClose() const { return myClose; }
615  void setClose(bool val) { myClose = val; }
616  bool opClose(const SOP_NodeVerb::CookParms &cookparms) const
617  {
618  SOP_Node *thissop = cookparms.getNode();
619  if (!thissop) return getClose();
620  bool result;
621  OP_Utils::evalOpParm(result, thissop, "close", cookparms.getCookTime(), 0);
622  return result;
623  }
624  bool getReverse() const { return myReverse; }
625  void setReverse(bool val) { myReverse = val; }
626  bool opReverse(const SOP_NodeVerb::CookParms &cookparms) const
627  {
628  SOP_Node *thissop = cookparms.getNode();
629  if (!thissop) return getReverse();
630  bool result;
631  OP_Utils::evalOpParm(result, thissop, "reverse", cookparms.getCookTime(), 0);
632  return result;
633  }
634  int64 getOrder() const { return myOrder; }
635  void setOrder(int64 val) { myOrder = val; }
636  int64 opOrder(const SOP_NodeVerb::CookParms &cookparms) const
637  {
638  SOP_Node *thissop = cookparms.getNode();
639  if (!thissop) return getOrder();
640  int64 result;
641  OP_Utils::evalOpParm(result, thissop, "order", cookparms.getCookTime(), 0);
642  return result;
643  }
644  Param getParam() const { return Param(myParam); }
645  void setParam(Param val) { myParam = int64(val); }
646  Param opParam(const SOP_NodeVerb::CookParms &cookparms) const
647  {
648  SOP_Node *thissop = cookparms.getNode();
649  if (!thissop) return getParam();
650  int64 result;
651  OP_Utils::evalOpParm(result, thissop, "param", cookparms.getCookTime(), 0);
652  return Param(result);
653  }
654  fpreal64 getTolerance() const { return myTolerance; }
655  void setTolerance(fpreal64 val) { myTolerance = val; }
657  {
658  SOP_Node *thissop = cookparms.getNode();
659  if (!thissop) return getTolerance();
661  OP_Utils::evalOpParm(result, thissop, "tolerance", cookparms.getCookTime(), 0);
662  return result;
663  }
664  fpreal64 getSmooth() const { return mySmooth; }
665  void setSmooth(fpreal64 val) { mySmooth = val; }
666  fpreal64 opSmooth(const SOP_NodeVerb::CookParms &cookparms) const
667  {
668  SOP_Node *thissop = cookparms.getNode();
669  if (!thissop) return getSmooth();
671  OP_Utils::evalOpParm(result, thissop, "smooth", cookparms.getCookTime(), 0);
672  return result;
673  }
674  bool getCsharp() const { return myCsharp; }
675  void setCsharp(bool val) { myCsharp = val; }
676  bool opCsharp(const SOP_NodeVerb::CookParms &cookparms) const
677  {
678  SOP_Node *thissop = cookparms.getNode();
679  if (!thissop) return getCsharp();
680  bool result;
681  OP_Utils::evalOpParm(result, thissop, "csharp", cookparms.getCookTime(), 0);
682  return result;
683  }
684  bool getKeepgeo() const { return myKeepgeo; }
685  void setKeepgeo(bool val) { myKeepgeo = val; }
686  bool opKeepgeo(const SOP_NodeVerb::CookParms &cookparms) const
687  {
688  SOP_Node *thissop = cookparms.getNode();
689  if (!thissop) return getKeepgeo();
690  bool result;
691  OP_Utils::evalOpParm(result, thissop, "keepgeo", cookparms.getCookTime(), 0);
692  return result;
693  }
694  bool getNormalize() const { return myNormalize; }
695  void setNormalize(bool val) { myNormalize = val; }
696  bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
697  {
698  SOP_Node *thissop = cookparms.getNode();
699  if (!thissop) return getNormalize();
700  bool result;
701  OP_Utils::evalOpParm(result, thissop, "normalize", cookparms.getCookTime(), 0);
702  return result;
703  }
704 
705 private:
706  int64 myType;
707  int64 myMethod;
708  UT_StringHolder myCoords;
709  bool myClose;
710  bool myReverse;
711  int64 myOrder;
712  int64 myParam;
713  fpreal64 myTolerance;
714  fpreal64 mySmooth;
715  bool myCsharp;
716  bool myKeepgeo;
717  bool myNormalize;
718 
719 };
int64 getOrder() const
void copyFrom(const OP_NodeParms *src) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setParam(Param val)
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
int myOrder
Definition: GT_CurveEval.h:263
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
bool getClose() const
void setType(Type 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
bool opKeepgeo(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getTime() const
Definition: OP_Context.h:62
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, UT_Vector2D v)
void save(std::ostream &os) const
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const OP_Context & context() const
Definition: OP_NodeParms.h:97
static void saveData(std::ostream &os, int64 v)
void setSmooth(fpreal64 val)
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE const char * buffer() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
GLdouble s
Definition: glad.h:3009
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
const char * getNestParmName(TempIndex fieldnum) const override
bool load(UT_IStream &is)
An output stream object that owns its own string buffer storage.
void setTolerance(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
**But if you need a result
Definition: thread.h:613
Type getType() const
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 setReverse(bool val)
void setCsharp(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
static void saveData(std::ostream &os, UT_Vector3D v)
void setClose(bool val)
void setKeepgeo(bool val)
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
Method opMethod(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 setMethod(Method val)
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal64 getTolerance() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
bool opReverse(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
fpreal64 getSmooth() const
UT_StringHolder opCoords(const SOP_NodeVerb::CookParms &cookparms) const
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
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, bool v)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
fpreal64 opTolerance(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Vector4D &v)
long long int64
Definition: SYS_Types.h:116
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
bool operator!=(const SOP_CurveParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setCoords(const UT_StringHolder &val)
static void saveData(std::ostream &os, fpreal64 v)
exint getNestNumParms(TempIndex idx) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool getCsharp() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool getNormalize() const
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
int64 opOrder(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
void setOrder(int64 val)
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
bool isParmColorRamp(exint idx) const override
LeafData & operator=(const LeafData &)=delete
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
const UT_StringHolder & getCoords() const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool opCsharp(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLfloat * val
Definition: glcorearb.h:1608
static int version()
#define SOP_API
Definition: SOP_API.h:10
bool opClose(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const SOP_CurveParms &src) const
Param getParam() const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void saveData(std::ostream &os, UT_StringHolder s)
void setNormalize(bool val)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
GLboolean r
Definition: glcorearb.h:1222
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
type
Definition: core.h:1059
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool getReverse() const
Method getMethod() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
fpreal64 opSmooth(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
Param opParam(const SOP_NodeVerb::CookParms &cookparms) const
bool getKeepgeo() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663