HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Tube.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_TubeEnums
24 {
25  enum class Type
26  {
27  PRIM = 0,
28  POLY,
29  MESH,
30  NURBS,
31  BEZIER,
32  POLYSOUP
33  };
34 
36  getToken(Type enum_value)
37  {
38  using namespace UT::Literal;
39  switch (enum_value) {
40  case Type::PRIM: return "prim"_sh;
41  case Type::POLY: return "poly"_sh;
42  case Type::MESH: return "mesh"_sh;
43  case Type::NURBS: return "nurbs"_sh;
44  case Type::BEZIER: return "bezier"_sh;
45  case Type::POLYSOUP: return "polysoup"_sh;
46  default: UT_ASSERT(false); return ""_sh;
47  }
48  }
49 
50  enum class Surftype
51  {
52  ROWS = 0,
53  COLS,
54  ROWCOL,
55  TRIANGLES,
56  QUADS,
59  };
60 
62  getToken(Surftype enum_value)
63  {
64  using namespace UT::Literal;
65  switch (enum_value) {
66  case Surftype::ROWS: return "rows"_sh;
67  case Surftype::COLS: return "cols"_sh;
68  case Surftype::ROWCOL: return "rowcol"_sh;
69  case Surftype::TRIANGLES: return "triangles"_sh;
70  case Surftype::QUADS: return "quads"_sh;
71  case Surftype::ALTTRIANGLES: return "alttriangles"_sh;
72  case Surftype::REVTRIANGLES: return "revtriangles"_sh;
73  default: UT_ASSERT(false); return ""_sh;
74  }
75  }
76 
77  enum class Orient
78  {
79  X = 0,
80  Y,
81  Z
82  };
83 
85  getToken(Orient enum_value)
86  {
87  using namespace UT::Literal;
88  switch (enum_value) {
89  case Orient::X: return "x"_sh;
90  case Orient::Y: return "y"_sh;
91  case Orient::Z: return "z"_sh;
92  default: UT_ASSERT(false); return ""_sh;
93  }
94  }
95 
96 }
97 
98 
100 {
101 public:
102  static int version() { return 1; }
103 
105  {
106  myType = 0;
107  mySurftype = 4;
108  myOrient = 1;
109  myCap = false;
110  myConsolidatepts = true;
111  myVertexnormals = false;
112  myT = UT_Vector3D(0,0,0);
113  myR = UT_Vector3D(0,0,0);
114  myRad = UT_Vector2D(1,1);
115  myRadscale = 1;
116  myHeight = 1;
117  myRows = 2;
118  myOrderu = 4;
119  myOrderv = 2;
120  myImperfect = true;
121  myCols = 12;
122 
123  }
124 
125  explicit SOP_TubeParms(const SOP_TubeParms &) = default;
126  SOP_TubeParms &operator=(const SOP_TubeParms &) = default;
127  SOP_TubeParms(SOP_TubeParms &&) noexcept = default;
128  SOP_TubeParms &operator=(SOP_TubeParms &&) noexcept = default;
129 
130  ~SOP_TubeParms() override {}
131 
132  bool operator==(const SOP_TubeParms &src) const
133  {
134  if (myType != src.myType) return false;
135  if (mySurftype != src.mySurftype) return false;
136  if (myOrient != src.myOrient) return false;
137  if (myCap != src.myCap) return false;
138  if (myConsolidatepts != src.myConsolidatepts) return false;
139  if (myVertexnormals != src.myVertexnormals) return false;
140  if (myT != src.myT) return false;
141  if (myR != src.myR) return false;
142  if (myRad != src.myRad) return false;
143  if (myRadscale != src.myRadscale) return false;
144  if (myHeight != src.myHeight) return false;
145  if (myRows != src.myRows) return false;
146  if (myOrderu != src.myOrderu) return false;
147  if (myOrderv != src.myOrderv) return false;
148  if (myImperfect != src.myImperfect) return false;
149  if (myCols != src.myCols) return false;
150 
151  return true;
152  }
153  bool operator!=(const SOP_TubeParms &src) const
154  {
155  return !operator==(src);
156  }
160 
161 
162 
163  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
164  {
165  myType = 0;
166  if (true)
167  graph->evalOpParm(myType, nodeidx, "type", time, 0);
168  mySurftype = 4;
169  if (true && ( (true&&!(((int64(getType())==0)))) ) )
170  graph->evalOpParm(mySurftype, nodeidx, "surftype", time, 0);
171  myOrient = 1;
172  if (true)
173  graph->evalOpParm(myOrient, nodeidx, "orient", time, 0);
174  myCap = false;
175  if (true)
176  graph->evalOpParm(myCap, nodeidx, "cap", time, 0);
177  myConsolidatepts = true;
178  if (true && ( (true&&!(((getCap()==0))||((int64(getType())!=1)&&(int64(getType())!=5)))) ) )
179  graph->evalOpParm(myConsolidatepts, nodeidx, "consolidatepts", time, 0);
180  myVertexnormals = false;
181  if (true)
182  graph->evalOpParm(myVertexnormals, nodeidx, "vertexnormals", time, 0);
183  myT = UT_Vector3D(0,0,0);
184  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)!=0)))) ) )
185  graph->evalOpParm(myT, nodeidx, "t", time, 0);
186  myR = UT_Vector3D(0,0,0);
187  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)!=0)))) ) )
188  graph->evalOpParm(myR, nodeidx, "r", time, 0);
189  myRad = UT_Vector2D(1,1);
190  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)!=0)))) ) )
191  graph->evalOpParm(myRad, nodeidx, "rad", time, 0);
192  myRadscale = 1;
193  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)!=0)))) ) )
194  graph->evalOpParm(myRadscale, nodeidx, "radscale", time, 0);
195  myHeight = 1;
196  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)!=0)))) ) )
197  graph->evalOpParm(myHeight, nodeidx, "height", time, 0);
198  myRows = 2;
199  if (true && ( (true&&!(((int64(getType())==0)))) ) )
200  graph->evalOpParm(myRows, nodeidx, "rows", time, 0);
201  myOrderu = 4;
202  if (true && ( (true&&!(((int64(getType())!=3)&&(int64(getType())!=4)))) ) )
203  graph->evalOpParm(myOrderu, nodeidx, "orderu", time, 0);
204  myOrderv = 2;
205  if (true && ( (true&&!(((int64(getType())!=3)&&(int64(getType())!=4)))) ) )
206  graph->evalOpParm(myOrderv, nodeidx, "orderv", time, 0);
207  myImperfect = true;
208  if (true && ( (true&&!(((int64(getType())!=3)&&(int64(getType())!=4)))) ) )
209  graph->evalOpParm(myImperfect, nodeidx, "imperfect", time, 0);
210  myCols = 12;
211  if (true && ( (true&&!(((int64(getType())==0))||((int64(getType())==4)&&(getImperfect()==0))||((int64(getType())==3)&&(getImperfect()==0)))) ) )
212  graph->evalOpParm(myCols, nodeidx, "cols", time, 0);
213 
214  }
215 
216 
217  void loadFromOpSubclass(const LoadParms &loadparms) override
218  {
219  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
220  }
221 
222 
223  void copyFrom(const OP_NodeParms *src) override
224  {
225  *this = *((const SOP_TubeParms *)src);
226  }
227 
228  template <typename T>
229  void
230  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
231  {
232  if (idx.size() < 1)
233  return;
234  UT_ASSERT(idx.size() == instance.size()+1);
235  if (idx.size() != instance.size()+1)
236  return;
237  switch (idx[0])
238  {
239  case 0:
240  coerceValue(value, myType);
241  break;
242  case 1:
243  coerceValue(value, mySurftype);
244  break;
245  case 2:
246  coerceValue(value, myOrient);
247  break;
248  case 3:
249  coerceValue(value, myCap);
250  break;
251  case 4:
252  coerceValue(value, myConsolidatepts);
253  break;
254  case 5:
255  coerceValue(value, myVertexnormals);
256  break;
257  case 6:
258  coerceValue(value, myT);
259  break;
260  case 7:
261  coerceValue(value, myR);
262  break;
263  case 8:
264  coerceValue(value, myRad);
265  break;
266  case 9:
267  coerceValue(value, myRadscale);
268  break;
269  case 10:
270  coerceValue(value, myHeight);
271  break;
272  case 11:
273  coerceValue(value, myRows);
274  break;
275  case 12:
276  coerceValue(value, myOrderu);
277  break;
278  case 13:
279  coerceValue(value, myOrderv);
280  break;
281  case 14:
282  coerceValue(value, myImperfect);
283  break;
284  case 15:
285  coerceValue(value, myCols);
286  break;
287 
288  }
289  }
290 
291  bool isParmColorRamp(exint idx) const override
292  {
293  switch (idx)
294  {
295 
296  }
297  return false;
298  }
299 
300  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
305  { doGetParmValue(idx, instance, value); }
306  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
307  { doGetParmValue(idx, instance, value); }
308  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
309  { doGetParmValue(idx, instance, value); }
310  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
311  { doGetParmValue(idx, instance, value); }
312  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
313  { doGetParmValue(idx, instance, value); }
314  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
315  { doGetParmValue(idx, instance, value); }
316  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
317  { doGetParmValue(idx, instance, value); }
318  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
319  { doGetParmValue(idx, instance, value); }
320  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
321  { doGetParmValue(idx, instance, value); }
322 
323  template <typename T>
324  void
325  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
326  {
327  if (idx.size() < 1)
328  return;
329  UT_ASSERT(idx.size() == instance.size()+1);
330  if (idx.size() != instance.size()+1)
331  return;
332  switch (idx[0])
333  {
334  case 0:
335  coerceValue(myType, clampMinValue(0, clampMaxValue(5, value ) ));
336  break;
337  case 1:
338  coerceValue(mySurftype, clampMinValue(0, clampMaxValue(6, value ) ));
339  break;
340  case 2:
341  coerceValue(myOrient, clampMinValue(0, clampMaxValue(2, value ) ));
342  break;
343  case 3:
344  coerceValue(myCap, ( ( value ) ));
345  break;
346  case 4:
347  coerceValue(myConsolidatepts, ( ( value ) ));
348  break;
349  case 5:
350  coerceValue(myVertexnormals, ( ( value ) ));
351  break;
352  case 6:
353  coerceValue(myT, ( ( value ) ));
354  break;
355  case 7:
356  coerceValue(myR, ( ( value ) ));
357  break;
358  case 8:
359  coerceValue(myRad, clampMinValue(0, ( value ) ));
360  break;
361  case 9:
362  coerceValue(myRadscale, clampMinValue(0, ( value ) ));
363  break;
364  case 10:
365  coerceValue(myHeight, ( ( value ) ));
366  break;
367  case 11:
368  coerceValue(myRows, clampMinValue(2, ( value ) ));
369  break;
370  case 12:
371  coerceValue(myOrderu, clampMinValue(2, clampMaxValue(11, value ) ));
372  break;
373  case 13:
374  coerceValue(myOrderv, clampMinValue(2, clampMaxValue(11, value ) ));
375  break;
376  case 14:
377  coerceValue(myImperfect, ( ( value ) ));
378  break;
379  case 15:
380  coerceValue(myCols, clampMinValue(3, ( value ) ));
381  break;
382 
383  }
384  }
385 
386  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
387  { doSetParmValue(idx, instance, value); }
388  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
389  { doSetParmValue(idx, instance, value); }
390  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
391  { doSetParmValue(idx, instance, value); }
392  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
393  { doSetParmValue(idx, instance, value); }
394  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
395  { doSetParmValue(idx, instance, value); }
396  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
397  { doSetParmValue(idx, instance, value); }
398  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
399  { doSetParmValue(idx, instance, value); }
400  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
401  { doSetParmValue(idx, instance, value); }
402  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
403  { doSetParmValue(idx, instance, value); }
404  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
405  { doSetParmValue(idx, instance, value); }
406  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
407  { doSetParmValue(idx, instance, value); }
408 
409  exint getNestNumParms(TempIndex idx) const override
410  {
411  if (idx.size() == 0)
412  return 16;
413  switch (idx[0])
414  {
415 
416  }
417  // Invalid
418  return 0;
419  }
420 
421  const char *getNestParmName(TempIndex fieldnum) const override
422  {
423  if (fieldnum.size() < 1)
424  return 0;
425  switch (fieldnum[0])
426  {
427  case 0:
428  return "type";
429  case 1:
430  return "surftype";
431  case 2:
432  return "orient";
433  case 3:
434  return "cap";
435  case 4:
436  return "consolidatepts";
437  case 5:
438  return "vertexnormals";
439  case 6:
440  return "t";
441  case 7:
442  return "r";
443  case 8:
444  return "rad";
445  case 9:
446  return "radscale";
447  case 10:
448  return "height";
449  case 11:
450  return "rows";
451  case 12:
452  return "orderu";
453  case 13:
454  return "orderv";
455  case 14:
456  return "imperfect";
457  case 15:
458  return "cols";
459 
460  }
461  return 0;
462  }
463 
464  ParmType getNestParmType(TempIndex fieldnum) const override
465  {
466  if (fieldnum.size() < 1)
467  return PARM_UNSUPPORTED;
468  switch (fieldnum[0])
469  {
470  case 0:
471  return PARM_INTEGER;
472  case 1:
473  return PARM_INTEGER;
474  case 2:
475  return PARM_INTEGER;
476  case 3:
477  return PARM_INTEGER;
478  case 4:
479  return PARM_INTEGER;
480  case 5:
481  return PARM_INTEGER;
482  case 6:
483  return PARM_VECTOR3;
484  case 7:
485  return PARM_VECTOR3;
486  case 8:
487  return PARM_VECTOR2;
488  case 9:
489  return PARM_FLOAT;
490  case 10:
491  return PARM_FLOAT;
492  case 11:
493  return PARM_INTEGER;
494  case 12:
495  return PARM_INTEGER;
496  case 13:
497  return PARM_INTEGER;
498  case 14:
499  return PARM_INTEGER;
500  case 15:
501  return PARM_INTEGER;
502 
503  }
504  return PARM_UNSUPPORTED;
505  }
506 
507  // Boiler plate to load individual types.
508  static void loadData(UT_IStream &is, int64 &v)
509  { is.bread(&v, 1); }
510  static void loadData(UT_IStream &is, bool &v)
511  { int64 iv; is.bread(&iv, 1); v = iv; }
512  static void loadData(UT_IStream &is, fpreal64 &v)
513  { is.bread<fpreal64>(&v, 1); }
514  static void loadData(UT_IStream &is, UT_Vector2D &v)
515  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
516  static void loadData(UT_IStream &is, UT_Vector3D &v)
517  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
518  is.bread<fpreal64>(&v.z(), 1); }
519  static void loadData(UT_IStream &is, UT_Vector4D &v)
520  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
521  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
522  static void loadData(UT_IStream &is, UT_Matrix2D &v)
523  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
524  static void loadData(UT_IStream &is, UT_Matrix3D &v)
525  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
526  static void loadData(UT_IStream &is, UT_Matrix4D &v)
527  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
528  static void loadData(UT_IStream &is, UT_Vector2I &v)
529  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
530  static void loadData(UT_IStream &is, UT_Vector3I &v)
531  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
532  is.bread<int64>(&v.z(), 1); }
533  static void loadData(UT_IStream &is, UT_Vector4I &v)
534  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
535  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
537  { is.bread(v); }
539  { UT_StringHolder rampdata;
540  loadData(is, rampdata);
541  if (rampdata.isstring())
542  {
543  v.reset(new UT_Ramp());
544  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
545  v->load(istr);
546  }
547  else v.reset();
548  }
551  loadData(is, data);
552  if (data.isstring())
553  {
554  // Find the data type.
555  const char *colon = UT_StringWrap(data).findChar(':');
556  if (colon)
557  {
558  int typelen = colon - data.buffer();
560  type.strncpy(data.buffer(), typelen);
561  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
562 
563  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
564  }
565  }
566  else v.reset();
567  }
568 
569  static void saveData(std::ostream &os, int64 v)
570  { UTwrite(os, &v); }
571  static void saveData(std::ostream &os, bool v)
572  { int64 iv = v; UTwrite(os, &iv); }
573  static void saveData(std::ostream &os, fpreal64 v)
574  { UTwrite<fpreal64>(os, &v); }
575  static void saveData(std::ostream &os, UT_Vector2D v)
576  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
577  static void saveData(std::ostream &os, UT_Vector3D v)
578  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
579  UTwrite<fpreal64>(os, &v.z()); }
580  static void saveData(std::ostream &os, UT_Vector4D v)
581  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
582  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
583  static void saveData(std::ostream &os, UT_Matrix2D v)
585  static void saveData(std::ostream &os, UT_Matrix3D v)
587  static void saveData(std::ostream &os, UT_Matrix4D v)
589  static void saveData(std::ostream &os, UT_StringHolder s)
590  { UT_StringWrap(s).saveBinary(os); }
591  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
593  UT_OStringStream ostr;
594  if (s) s->save(ostr);
595  result = ostr.str();
596  saveData(os, result);
597  }
598  static void saveData(std::ostream &os, PRM_DataItemHandle s)
600  UT_OStringStream ostr;
601  if (s)
602  {
603  ostr << s->getDataTypeToken();
604  ostr << ":";
605  s->saveBinary(ostr);
606  }
607  result = ostr.str();
608  saveData(os, result);
609  }
610 
611 
612  void save(std::ostream &os) const
613  {
614  int32 v = version();
615  UTwrite(os, &v);
616  saveData(os, myType);
617  saveData(os, mySurftype);
618  saveData(os, myOrient);
619  saveData(os, myCap);
620  saveData(os, myConsolidatepts);
621  saveData(os, myVertexnormals);
622  saveData(os, myT);
623  saveData(os, myR);
624  saveData(os, myRad);
625  saveData(os, myRadscale);
626  saveData(os, myHeight);
627  saveData(os, myRows);
628  saveData(os, myOrderu);
629  saveData(os, myOrderv);
630  saveData(os, myImperfect);
631  saveData(os, myCols);
632 
633  }
634 
635  bool load(UT_IStream &is)
636  {
637  int32 v;
638  is.bread(&v, 1);
639  if (version() != v)
640  {
641  // Fail incompatible versions
642  return false;
643  }
644  loadData(is, myType);
645  loadData(is, mySurftype);
646  loadData(is, myOrient);
647  loadData(is, myCap);
648  loadData(is, myConsolidatepts);
649  loadData(is, myVertexnormals);
650  loadData(is, myT);
651  loadData(is, myR);
652  loadData(is, myRad);
653  loadData(is, myRadscale);
654  loadData(is, myHeight);
655  loadData(is, myRows);
656  loadData(is, myOrderu);
657  loadData(is, myOrderv);
658  loadData(is, myImperfect);
659  loadData(is, myCols);
660 
661  return true;
662  }
663 
664  Type getType() const { return Type(myType); }
665  void setType(Type val) { myType = int64(val); }
666  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
667  {
668  SOP_Node *thissop = cookparms.getNode();
669  if (!thissop) return getType();
670  int64 result;
671  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
672  return Type(result);
673  }
674  Surftype getSurftype() const { return Surftype(mySurftype); }
675  void setSurftype(Surftype val) { mySurftype = int64(val); }
677  {
678  SOP_Node *thissop = cookparms.getNode();
679  if (!thissop) return getSurftype();
680  int64 result;
681  OP_Utils::evalOpParm(result, thissop, "surftype", cookparms.getCookTime(), 0);
682  return Surftype(result);
683  }
684  Orient getOrient() const { return Orient(myOrient); }
685  void setOrient(Orient val) { myOrient = int64(val); }
686  Orient opOrient(const SOP_NodeVerb::CookParms &cookparms) const
687  {
688  SOP_Node *thissop = cookparms.getNode();
689  if (!thissop) return getOrient();
690  int64 result;
691  OP_Utils::evalOpParm(result, thissop, "orient", cookparms.getCookTime(), 0);
692  return Orient(result);
693  }
694  bool getCap() const { return myCap; }
695  void setCap(bool val) { myCap = val; }
696  bool opCap(const SOP_NodeVerb::CookParms &cookparms) const
697  {
698  SOP_Node *thissop = cookparms.getNode();
699  if (!thissop) return getCap();
700  bool result;
701  OP_Utils::evalOpParm(result, thissop, "cap", cookparms.getCookTime(), 0);
702  return result;
703  }
704  bool getConsolidatepts() const { return myConsolidatepts; }
705  void setConsolidatepts(bool val) { myConsolidatepts = val; }
706  bool opConsolidatepts(const SOP_NodeVerb::CookParms &cookparms) const
707  {
708  SOP_Node *thissop = cookparms.getNode();
709  if (!thissop) return getConsolidatepts();
710  bool result;
711  OP_Utils::evalOpParm(result, thissop, "consolidatepts", cookparms.getCookTime(), 0);
712  return result;
713  }
714  bool getVertexnormals() const { return myVertexnormals; }
715  void setVertexnormals(bool val) { myVertexnormals = val; }
716  bool opVertexnormals(const SOP_NodeVerb::CookParms &cookparms) const
717  {
718  SOP_Node *thissop = cookparms.getNode();
719  if (!thissop) return getVertexnormals();
720  bool result;
721  OP_Utils::evalOpParm(result, thissop, "vertexnormals", cookparms.getCookTime(), 0);
722  return result;
723  }
724  UT_Vector3D getT() const { return myT; }
725  void setT(UT_Vector3D val) { myT = val; }
726  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
727  {
728  SOP_Node *thissop = cookparms.getNode();
729  if (!thissop) return getT();
731  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
732  return result;
733  }
734  UT_Vector3D getR() const { return myR; }
735  void setR(UT_Vector3D val) { myR = val; }
736  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
737  {
738  SOP_Node *thissop = cookparms.getNode();
739  if (!thissop) return getR();
741  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
742  return result;
743  }
744  UT_Vector2D getRad() const { return myRad; }
745  void setRad(UT_Vector2D val) { myRad = val; }
746  UT_Vector2D opRad(const SOP_NodeVerb::CookParms &cookparms) const
747  {
748  SOP_Node *thissop = cookparms.getNode();
749  if (!thissop) return getRad();
751  OP_Utils::evalOpParm(result, thissop, "rad", cookparms.getCookTime(), 0);
752  return result;
753  }
754  fpreal64 getRadscale() const { return myRadscale; }
755  void setRadscale(fpreal64 val) { myRadscale = val; }
757  {
758  SOP_Node *thissop = cookparms.getNode();
759  if (!thissop) return getRadscale();
761  OP_Utils::evalOpParm(result, thissop, "radscale", cookparms.getCookTime(), 0);
762  return result;
763  }
764  fpreal64 getHeight() const { return myHeight; }
765  void setHeight(fpreal64 val) { myHeight = val; }
766  fpreal64 opHeight(const SOP_NodeVerb::CookParms &cookparms) const
767  {
768  SOP_Node *thissop = cookparms.getNode();
769  if (!thissop) return getHeight();
771  OP_Utils::evalOpParm(result, thissop, "height", cookparms.getCookTime(), 0);
772  return result;
773  }
774  int64 getRows() const { return myRows; }
775  void setRows(int64 val) { myRows = val; }
776  int64 opRows(const SOP_NodeVerb::CookParms &cookparms) const
777  {
778  SOP_Node *thissop = cookparms.getNode();
779  if (!thissop) return getRows();
780  int64 result;
781  OP_Utils::evalOpParm(result, thissop, "rows", cookparms.getCookTime(), 0);
782  return result;
783  }
784  int64 getOrderu() const { return myOrderu; }
785  void setOrderu(int64 val) { myOrderu = val; }
786  int64 opOrderu(const SOP_NodeVerb::CookParms &cookparms) const
787  {
788  SOP_Node *thissop = cookparms.getNode();
789  if (!thissop) return getOrderu();
790  int64 result;
791  OP_Utils::evalOpParm(result, thissop, "orderu", cookparms.getCookTime(), 0);
792  return result;
793  }
794  int64 getOrderv() const { return myOrderv; }
795  void setOrderv(int64 val) { myOrderv = val; }
796  int64 opOrderv(const SOP_NodeVerb::CookParms &cookparms) const
797  {
798  SOP_Node *thissop = cookparms.getNode();
799  if (!thissop) return getOrderv();
800  int64 result;
801  OP_Utils::evalOpParm(result, thissop, "orderv", cookparms.getCookTime(), 0);
802  return result;
803  }
804  bool getImperfect() const { return myImperfect; }
805  void setImperfect(bool val) { myImperfect = val; }
806  bool opImperfect(const SOP_NodeVerb::CookParms &cookparms) const
807  {
808  SOP_Node *thissop = cookparms.getNode();
809  if (!thissop) return getImperfect();
810  bool result;
811  OP_Utils::evalOpParm(result, thissop, "imperfect", cookparms.getCookTime(), 0);
812  return result;
813  }
814  int64 getCols() const { return myCols; }
815  void setCols(int64 val) { myCols = val; }
816  int64 opCols(const SOP_NodeVerb::CookParms &cookparms) const
817  {
818  SOP_Node *thissop = cookparms.getNode();
819  if (!thissop) return getCols();
820  int64 result;
821  OP_Utils::evalOpParm(result, thissop, "cols", cookparms.getCookTime(), 0);
822  return result;
823  }
824 
825 private:
826  int64 myType;
827  int64 mySurftype;
828  int64 myOrient;
829  bool myCap;
830  bool myConsolidatepts;
831  bool myVertexnormals;
832  UT_Vector3D myT;
833  UT_Vector3D myR;
834  UT_Vector2D myRad;
835  fpreal64 myRadscale;
836  fpreal64 myHeight;
837  int64 myRows;
838  int64 myOrderu;
839  int64 myOrderv;
840  bool myImperfect;
841  int64 myCols;
842 
843 };
void setRad(UT_Vector2D val)
UT_Vector3D getR() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool opVertexnormals(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D getRad() const
bool opImperfect(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D opRad(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, fpreal64 &v)
bool opConsolidatepts(const SOP_NodeVerb::CookParms &cookparms) const
int64 opOrderv(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setRows(int64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setCols(int64 val)
UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
bool getImperfect() const
fpreal64 getHeight() const
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
static void saveData(std::ostream &os, UT_Vector3D v)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
UT_Vector2T< fpreal64 > UT_Vector2D
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
fpreal64 opRadscale(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void setT(UT_Vector3D val)
int64 getOrderu() const
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setSurftype(Surftype val)
**But if you need a result
Definition: thread.h:613
Surftype opSurftype(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) 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.
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
fpreal64 getRadscale() const
static void saveData(std::ostream &os, bool v)
void setOrderu(int64 val)
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool load(UT_IStream &is)
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
int64 opRows(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
bool isParmColorRamp(exint idx) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setVertexnormals(bool val)
Surftype getSurftype() const
ParmType getNestParmType(TempIndex fieldnum) const override
bool getVertexnormals() const
int64 getRows() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal64 opHeight(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
exint length() const
Orient getOrient() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) 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_Vector3D &value) override
void setConsolidatepts(bool val)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
bool operator!=(const SOP_TubeParms &src) const
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
bool operator==(const SOP_TubeParms &src) const
long long int64
Definition: SYS_Types.h:116
int64 opOrderu(const SOP_NodeVerb::CookParms &cookparms) const
void setRadscale(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
UT_Vector3T< fpreal64 > UT_Vector3D
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
int64 opCols(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setCap(bool val)
static void saveData(std::ostream &os, UT_Matrix4D v)
GT_API const UT_StringHolder version
Type getType() const
static void saveData(std::ostream &os, UT_Matrix3D v)
Orient opOrient(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
void save(std::ostream &os) const
void setImperfect(bool val)
int64 getOrderv() const
static int version()
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
bool getCap() const
static void loadData(UT_IStream &is, int64 &v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setOrient(Orient val)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
void setR(UT_Vector3D val)
GLuint GLfloat * val
Definition: glcorearb.h:1608
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
#define SOP_API
Definition: SOP_API.h:10
void setOrderv(int64 val)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
UT_Vector3D getT() const
void setHeight(fpreal64 val)
Definition: core.h:1131
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
GLboolean r
Definition: glcorearb.h:1222
void setType(Type val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, UT_Vector2D v)
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
bool getConsolidatepts() const
static void saveData(std::ostream &os, UT_Matrix2D v)
exint getNestNumParms(TempIndex idx) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
int64 getCols() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool opCap(const SOP_NodeVerb::CookParms &cookparms) const
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