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 <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_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 
132  if (baseGetSignature() != src.baseGetSignature()) return false;
133 
134  return true;
135  }
136  bool operator!=(const SOP_CurveParms &src) const
137  {
138  return !operator==(src);
139  }
143 
144 
145 
146  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
147  {
148  myType = 0;
149  if (true)
150  graph->evalOpParm(myType, nodeidx, "type", time, graph->isDirect()?nullptr:depnode);
151  myMethod = 0;
152  if (true)
153  graph->evalOpParm(myMethod, nodeidx, "method", time, graph->isDirect()?nullptr:depnode);
154  myCoords = ""_UTsh;
155  if (true)
156  graph->evalOpParm(myCoords, nodeidx, "coords", time, graph->isDirect()?nullptr:depnode);
157  myClose = false;
158  if (true && ( (true&&!(((int64(getType())==3)))) ) )
159  graph->evalOpParm(myClose, nodeidx, "close", time, graph->isDirect()?nullptr:depnode);
160  myReverse = false;
161  if (true)
162  graph->evalOpParm(myReverse, nodeidx, "reverse", time, graph->isDirect()?nullptr:depnode);
163  myOrder = 4;
164  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2)))) ) )
165  graph->evalOpParm(myOrder, nodeidx, "order", time, graph->isDirect()?nullptr:depnode);
166  myParam = 0;
167  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2))||((int64(getMethod())!=1)))) ) )
168  graph->evalOpParm(myParam, nodeidx, "param", time, graph->isDirect()?nullptr:depnode);
169  myTolerance = 0.01;
170  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2))||((int64(getMethod())!=2)))) ) )
171  graph->evalOpParm(myTolerance, nodeidx, "tolerance", time, graph->isDirect()?nullptr:depnode);
172  mySmooth = 0;
173  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2))||((int64(getMethod())!=2)))) ) )
174  graph->evalOpParm(mySmooth, nodeidx, "smooth", time, graph->isDirect()?nullptr:depnode);
175  myCsharp = false;
176  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2))||((int64(getMethod())!=2)))) ) )
177  graph->evalOpParm(myCsharp, nodeidx, "csharp", time, graph->isDirect()?nullptr:depnode);
178  myKeepgeo = false;
179  if (true)
180  graph->evalOpParm(myKeepgeo, nodeidx, "keepgeo", time, graph->isDirect()?nullptr:depnode);
181  myNormalize = false;
182  if (true && ( (true&&!(((int64(getType())!=1)&&(int64(getType())!=2))||((int64(getMethod())!=1))||((int64(getParam())!=0)))) ) )
183  graph->evalOpParm(myNormalize, nodeidx, "normalize", time, graph->isDirect()?nullptr:depnode);
184 
185  }
186 
187 
188  void loadFromOpSubclass(const LoadParms &loadparms) override
189  {
190  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
191  }
192 
193 
194  void copyFrom(const OP_NodeParms *src) override
195  {
196  *this = *((const SOP_CurveParms *)src);
197  }
198 
199  template <typename T>
200  void
201  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
202  {
203  if (idx.size() < 1)
204  return;
205  UT_ASSERT(idx.size() == instance.size()+1);
206  if (idx.size() != instance.size()+1)
207  return;
208  switch (idx[0])
209  {
210  case 0:
211  coerceValue(value, myType);
212  break;
213  case 1:
214  coerceValue(value, myMethod);
215  break;
216  case 2:
217  coerceValue(value, myCoords);
218  break;
219  case 3:
220  coerceValue(value, myClose);
221  break;
222  case 4:
223  coerceValue(value, myReverse);
224  break;
225  case 5:
226  coerceValue(value, myOrder);
227  break;
228  case 6:
229  coerceValue(value, myParam);
230  break;
231  case 7:
232  coerceValue(value, myTolerance);
233  break;
234  case 8:
235  coerceValue(value, mySmooth);
236  break;
237  case 9:
238  coerceValue(value, myCsharp);
239  break;
240  case 10:
241  coerceValue(value, myKeepgeo);
242  break;
243  case 11:
244  coerceValue(value, myNormalize);
245  break;
246 
247  }
248  }
249 
250  bool isParmColorRamp(exint idx) const override
251  {
252  switch (idx)
253  {
254 
255  }
256  return false;
257  }
258 
259  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
260  { doGetParmValue(idx, instance, value); }
261  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
262  { doGetParmValue(idx, instance, value); }
263  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
264  { doGetParmValue(idx, instance, value); }
265  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
266  { doGetParmValue(idx, instance, value); }
267  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
268  { doGetParmValue(idx, instance, value); }
269  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
270  { doGetParmValue(idx, instance, value); }
271  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
272  { doGetParmValue(idx, instance, value); }
273  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
274  { doGetParmValue(idx, instance, value); }
275  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
276  { doGetParmValue(idx, instance, value); }
277  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
278  { doGetParmValue(idx, instance, value); }
279  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
280  { doGetParmValue(idx, instance, value); }
281 
282  template <typename T>
283  void
284  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
285  {
286  if (idx.size() < 1)
287  return;
288  UT_ASSERT(idx.size() == instance.size()+1);
289  if (idx.size() != instance.size()+1)
290  return;
291  switch (idx[0])
292  {
293  case 0:
294  coerceValue(myType, clampMinValue(0, clampMaxValue(3, value ) ));
295  break;
296  case 1:
297  coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
298  break;
299  case 2:
300  coerceValue(myCoords, ( ( value ) ));
301  break;
302  case 3:
303  coerceValue(myClose, ( ( value ) ));
304  break;
305  case 4:
306  coerceValue(myReverse, ( ( value ) ));
307  break;
308  case 5:
309  coerceValue(myOrder, clampMinValue(2, clampMaxValue(11, value ) ));
310  break;
311  case 6:
312  coerceValue(myParam, clampMinValue(0, clampMaxValue(2, value ) ));
313  break;
314  case 7:
315  coerceValue(myTolerance, clampMinValue(0, ( value ) ));
316  break;
317  case 8:
318  coerceValue(mySmooth, clampMinValue(0, clampMaxValue(1, value ) ));
319  break;
320  case 9:
321  coerceValue(myCsharp, ( ( value ) ));
322  break;
323  case 10:
324  coerceValue(myKeepgeo, ( ( value ) ));
325  break;
326  case 11:
327  coerceValue(myNormalize, ( ( value ) ));
328  break;
329 
330  }
331  }
332 
333  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
334  { doSetParmValue(idx, instance, value); }
335  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
336  { doSetParmValue(idx, instance, value); }
337  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
338  { doSetParmValue(idx, instance, value); }
339  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
340  { doSetParmValue(idx, instance, value); }
341  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
342  { doSetParmValue(idx, instance, value); }
343  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
344  { doSetParmValue(idx, instance, value); }
345  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
346  { doSetParmValue(idx, instance, value); }
347  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
348  { doSetParmValue(idx, instance, value); }
349  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
350  { doSetParmValue(idx, instance, value); }
351  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
352  { doSetParmValue(idx, instance, value); }
353  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
354  { doSetParmValue(idx, instance, value); }
355 
356  exint getNestNumParms(TempIndex idx) const override
357  {
358  if (idx.size() == 0)
359  return 12;
360  switch (idx[0])
361  {
362 
363  }
364  // Invalid
365  return 0;
366  }
367 
368  const char *getNestParmName(TempIndex fieldnum) const override
369  {
370  if (fieldnum.size() < 1)
371  return 0;
372  switch (fieldnum[0])
373  {
374  case 0:
375  return "type";
376  case 1:
377  return "method";
378  case 2:
379  return "coords";
380  case 3:
381  return "close";
382  case 4:
383  return "reverse";
384  case 5:
385  return "order";
386  case 6:
387  return "param";
388  case 7:
389  return "tolerance";
390  case 8:
391  return "smooth";
392  case 9:
393  return "csharp";
394  case 10:
395  return "keepgeo";
396  case 11:
397  return "normalize";
398 
399  }
400  return 0;
401  }
402 
403  ParmType getNestParmType(TempIndex fieldnum) const override
404  {
405  if (fieldnum.size() < 1)
406  return PARM_UNSUPPORTED;
407  switch (fieldnum[0])
408  {
409  case 0:
410  return PARM_INTEGER;
411  case 1:
412  return PARM_INTEGER;
413  case 2:
414  return PARM_STRING;
415  case 3:
416  return PARM_INTEGER;
417  case 4:
418  return PARM_INTEGER;
419  case 5:
420  return PARM_INTEGER;
421  case 6:
422  return PARM_INTEGER;
423  case 7:
424  return PARM_FLOAT;
425  case 8:
426  return PARM_FLOAT;
427  case 9:
428  return PARM_INTEGER;
429  case 10:
430  return PARM_INTEGER;
431  case 11:
432  return PARM_INTEGER;
433 
434  }
435  return PARM_UNSUPPORTED;
436  }
437 
438  // Boiler plate to load individual types.
439  static void loadData(UT_IStream &is, int64 &v)
440  { is.bread(&v, 1); }
441  static void loadData(UT_IStream &is, bool &v)
442  { int64 iv; is.bread(&iv, 1); v = iv; }
443  static void loadData(UT_IStream &is, fpreal64 &v)
444  { is.bread<fpreal64>(&v, 1); }
445  static void loadData(UT_IStream &is, UT_Vector2D &v)
446  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
447  static void loadData(UT_IStream &is, UT_Vector3D &v)
448  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
449  is.bread<fpreal64>(&v.z(), 1); }
450  static void loadData(UT_IStream &is, UT_Vector4D &v)
451  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
452  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
453  static void loadData(UT_IStream &is, UT_Matrix2D &v)
454  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
455  static void loadData(UT_IStream &is, UT_Matrix3D &v)
456  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
457  static void loadData(UT_IStream &is, UT_Matrix4D &v)
458  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
459  static void loadData(UT_IStream &is, UT_Vector2I &v)
460  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
461  static void loadData(UT_IStream &is, UT_Vector3I &v)
462  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
463  is.bread<int64>(&v.z(), 1); }
464  static void loadData(UT_IStream &is, UT_Vector4I &v)
465  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
466  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
468  { is.bread(v); }
470  { UT_StringHolder rampdata;
471  loadData(is, rampdata);
472  if (rampdata.isstring())
473  {
474  v.reset(new UT_Ramp());
475  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
476  v->load(istr);
477  }
478  else v.reset();
479  }
482  loadData(is, data);
483  if (data.isstring())
484  {
485  // Find the data type.
486  const char *colon = UT_StringWrap(data).findChar(':');
487  if (colon)
488  {
489  int typelen = colon - data.buffer();
491  type.strncpy(data.buffer(), typelen);
492  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
493 
494  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
495  }
496  }
497  else v.reset();
498  }
499 
500  static void saveData(std::ostream &os, int64 v)
501  { UTwrite(os, &v); }
502  static void saveData(std::ostream &os, bool v)
503  { int64 iv = v; UTwrite(os, &iv); }
504  static void saveData(std::ostream &os, fpreal64 v)
505  { UTwrite<fpreal64>(os, &v); }
506  static void saveData(std::ostream &os, UT_Vector2D v)
507  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
508  static void saveData(std::ostream &os, UT_Vector3D v)
509  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
510  UTwrite<fpreal64>(os, &v.z()); }
511  static void saveData(std::ostream &os, UT_Vector4D v)
512  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
513  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
514  static void saveData(std::ostream &os, UT_Matrix2D v)
516  static void saveData(std::ostream &os, UT_Matrix3D v)
518  static void saveData(std::ostream &os, UT_Matrix4D v)
520  static void saveData(std::ostream &os, UT_StringHolder s)
521  { UT_StringWrap(s).saveBinary(os); }
522  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
524  UT_OStringStream ostr;
525  if (s) s->save(ostr);
526  result = ostr.str();
527  saveData(os, result);
528  }
529  static void saveData(std::ostream &os, PRM_DataItemHandle s)
531  UT_OStringStream ostr;
532  if (s)
533  {
534  ostr << s->getDataTypeToken();
535  ostr << ":";
536  s->saveBinary(ostr);
537  }
538  result = ostr.str();
539  saveData(os, result);
540  }
541 
542 
543  void save(std::ostream &os) const
544  {
545  int32 v = version();
546  UTwrite(os, &v);
547  saveData(os, myType);
548  saveData(os, myMethod);
549  saveData(os, myCoords);
550  saveData(os, myClose);
551  saveData(os, myReverse);
552  saveData(os, myOrder);
553  saveData(os, myParam);
554  saveData(os, myTolerance);
555  saveData(os, mySmooth);
556  saveData(os, myCsharp);
557  saveData(os, myKeepgeo);
558  saveData(os, myNormalize);
559 
560  }
561 
562  bool load(UT_IStream &is)
563  {
564  int32 v;
565  is.bread(&v, 1);
566  if (version() != v)
567  {
568  // Fail incompatible versions
569  return false;
570  }
571  loadData(is, myType);
572  loadData(is, myMethod);
573  loadData(is, myCoords);
574  loadData(is, myClose);
575  loadData(is, myReverse);
576  loadData(is, myOrder);
577  loadData(is, myParam);
578  loadData(is, myTolerance);
579  loadData(is, mySmooth);
580  loadData(is, myCsharp);
581  loadData(is, myKeepgeo);
582  loadData(is, myNormalize);
583 
584  return true;
585  }
586 
587  Type getType() const { return Type(myType); }
588  void setType(Type val) { myType = int64(val); }
589  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
590  {
591  SOP_Node *thissop = cookparms.getNode();
592  if (!thissop) return getType();
593  int64 result;
594  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
595  return Type(result);
596  }
597  Method getMethod() const { return Method(myMethod); }
598  void setMethod(Method val) { myMethod = int64(val); }
599  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
600  {
601  SOP_Node *thissop = cookparms.getNode();
602  if (!thissop) return getMethod();
603  int64 result;
604  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
605  return Method(result);
606  }
607  const UT_StringHolder & getCoords() const { return myCoords; }
608  void setCoords(const UT_StringHolder & val) { myCoords = val; }
610  {
611  SOP_Node *thissop = cookparms.getNode();
612  if (!thissop) return getCoords();
614  OP_Utils::evalOpParm(result, thissop, "coords", cookparms.getCookTime(), 0);
615  return result;
616  }
617  bool getClose() const { return myClose; }
618  void setClose(bool val) { myClose = val; }
619  bool opClose(const SOP_NodeVerb::CookParms &cookparms) const
620  {
621  SOP_Node *thissop = cookparms.getNode();
622  if (!thissop) return getClose();
623  bool result;
624  OP_Utils::evalOpParm(result, thissop, "close", cookparms.getCookTime(), 0);
625  return result;
626  }
627  bool getReverse() const { return myReverse; }
628  void setReverse(bool val) { myReverse = val; }
629  bool opReverse(const SOP_NodeVerb::CookParms &cookparms) const
630  {
631  SOP_Node *thissop = cookparms.getNode();
632  if (!thissop) return getReverse();
633  bool result;
634  OP_Utils::evalOpParm(result, thissop, "reverse", cookparms.getCookTime(), 0);
635  return result;
636  }
637  int64 getOrder() const { return myOrder; }
638  void setOrder(int64 val) { myOrder = val; }
639  int64 opOrder(const SOP_NodeVerb::CookParms &cookparms) const
640  {
641  SOP_Node *thissop = cookparms.getNode();
642  if (!thissop) return getOrder();
643  int64 result;
644  OP_Utils::evalOpParm(result, thissop, "order", cookparms.getCookTime(), 0);
645  return result;
646  }
647  Param getParam() const { return Param(myParam); }
648  void setParam(Param val) { myParam = int64(val); }
649  Param opParam(const SOP_NodeVerb::CookParms &cookparms) const
650  {
651  SOP_Node *thissop = cookparms.getNode();
652  if (!thissop) return getParam();
653  int64 result;
654  OP_Utils::evalOpParm(result, thissop, "param", cookparms.getCookTime(), 0);
655  return Param(result);
656  }
657  fpreal64 getTolerance() const { return myTolerance; }
658  void setTolerance(fpreal64 val) { myTolerance = val; }
660  {
661  SOP_Node *thissop = cookparms.getNode();
662  if (!thissop) return getTolerance();
664  OP_Utils::evalOpParm(result, thissop, "tolerance", cookparms.getCookTime(), 0);
665  return result;
666  }
667  fpreal64 getSmooth() const { return mySmooth; }
668  void setSmooth(fpreal64 val) { mySmooth = val; }
669  fpreal64 opSmooth(const SOP_NodeVerb::CookParms &cookparms) const
670  {
671  SOP_Node *thissop = cookparms.getNode();
672  if (!thissop) return getSmooth();
674  OP_Utils::evalOpParm(result, thissop, "smooth", cookparms.getCookTime(), 0);
675  return result;
676  }
677  bool getCsharp() const { return myCsharp; }
678  void setCsharp(bool val) { myCsharp = val; }
679  bool opCsharp(const SOP_NodeVerb::CookParms &cookparms) const
680  {
681  SOP_Node *thissop = cookparms.getNode();
682  if (!thissop) return getCsharp();
683  bool result;
684  OP_Utils::evalOpParm(result, thissop, "csharp", cookparms.getCookTime(), 0);
685  return result;
686  }
687  bool getKeepgeo() const { return myKeepgeo; }
688  void setKeepgeo(bool val) { myKeepgeo = val; }
689  bool opKeepgeo(const SOP_NodeVerb::CookParms &cookparms) const
690  {
691  SOP_Node *thissop = cookparms.getNode();
692  if (!thissop) return getKeepgeo();
693  bool result;
694  OP_Utils::evalOpParm(result, thissop, "keepgeo", cookparms.getCookTime(), 0);
695  return result;
696  }
697  bool getNormalize() const { return myNormalize; }
698  void setNormalize(bool val) { myNormalize = val; }
699  bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
700  {
701  SOP_Node *thissop = cookparms.getNode();
702  if (!thissop) return getNormalize();
703  bool result;
704  OP_Utils::evalOpParm(result, thissop, "normalize", cookparms.getCookTime(), 0);
705  return result;
706  }
707 
708 private:
709  int64 myType;
710  int64 myMethod;
711  UT_StringHolder myCoords;
712  bool myClose;
713  bool myReverse;
714  int64 myOrder;
715  int64 myParam;
716  fpreal64 myTolerance;
717  fpreal64 mySmooth;
718  bool myCsharp;
719  bool myKeepgeo;
720  bool myNormalize;
721 
722 };
type
Definition: core.h:556
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:63
static void saveData(std::ostream &os, PRM_DataItemHandle s)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
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 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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
static void saveData(std::ostream &os, UT_StringHolder s)
void setNormalize(bool val)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
Method getMethod() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
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