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 <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_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 
152  if (baseGetSignature() != src.baseGetSignature()) return false;
153 
154  return true;
155  }
156  bool operator!=(const SOP_TubeParms &src) const
157  {
158  return !operator==(src);
159  }
163 
164 
165 
166  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
167  {
168  myType = 0;
169  if (true)
170  graph->evalOpParm(myType, nodeidx, "type", time, graph->isDirect()?nullptr:depnode);
171  mySurftype = 4;
172  if (true && ( (true&&!(((int64(getType())==0)))) ) )
173  graph->evalOpParm(mySurftype, nodeidx, "surftype", time, graph->isDirect()?nullptr:depnode);
174  myOrient = 1;
175  if (true)
176  graph->evalOpParm(myOrient, nodeidx, "orient", time, graph->isDirect()?nullptr:depnode);
177  myCap = false;
178  if (true)
179  graph->evalOpParm(myCap, nodeidx, "cap", time, graph->isDirect()?nullptr:depnode);
180  myConsolidatepts = true;
181  if (true && ( (true&&!(((getCap()==0))||((int64(getType())!=1)&&(int64(getType())!=5)))) ) )
182  graph->evalOpParm(myConsolidatepts, nodeidx, "consolidatepts", time, graph->isDirect()?nullptr:depnode);
183  myVertexnormals = false;
184  if (true)
185  graph->evalOpParm(myVertexnormals, nodeidx, "vertexnormals", time, graph->isDirect()?nullptr:depnode);
186  myT = UT_Vector3D(0,0,0);
187  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)!=0)))) ) )
188  graph->evalOpParm(myT, nodeidx, "t", time, graph->isDirect()?nullptr:depnode);
189  myR = UT_Vector3D(0,0,0);
190  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)!=0)))) ) )
191  graph->evalOpParm(myR, nodeidx, "r", time, graph->isDirect()?nullptr:depnode);
192  myRad = UT_Vector2D(1,1);
193  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)!=0)))) ) )
194  graph->evalOpParm(myRad, nodeidx, "rad", time, graph->isDirect()?nullptr:depnode);
195  myRadscale = 1;
196  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)!=0)))) ) )
197  graph->evalOpParm(myRadscale, nodeidx, "radscale", time, graph->isDirect()?nullptr:depnode);
198  myHeight = 1;
199  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)!=0)))) ) )
200  graph->evalOpParm(myHeight, nodeidx, "height", time, graph->isDirect()?nullptr:depnode);
201  myRows = 2;
202  if (true && ( (true&&!(((int64(getType())==0)))) ) )
203  graph->evalOpParm(myRows, nodeidx, "rows", time, graph->isDirect()?nullptr:depnode);
204  myOrderu = 4;
205  if (true && ( (true&&!(((int64(getType())!=3)&&(int64(getType())!=4)))) ) )
206  graph->evalOpParm(myOrderu, nodeidx, "orderu", time, graph->isDirect()?nullptr:depnode);
207  myOrderv = 2;
208  if (true && ( (true&&!(((int64(getType())!=3)&&(int64(getType())!=4)))) ) )
209  graph->evalOpParm(myOrderv, nodeidx, "orderv", time, graph->isDirect()?nullptr:depnode);
210  myImperfect = true;
211  if (true && ( (true&&!(((int64(getType())!=3)&&(int64(getType())!=4)))) ) )
212  graph->evalOpParm(myImperfect, nodeidx, "imperfect", time, graph->isDirect()?nullptr:depnode);
213  myCols = 12;
214  if (true && ( (true&&!(((int64(getType())==0))||((int64(getType())==4)&&(getImperfect()==0))||((int64(getType())==3)&&(getImperfect()==0)))) ) )
215  graph->evalOpParm(myCols, nodeidx, "cols", time, graph->isDirect()?nullptr:depnode);
216 
217  }
218 
219 
220  void loadFromOpSubclass(const LoadParms &loadparms) override
221  {
222  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
223  }
224 
225 
226  void copyFrom(const OP_NodeParms *src) override
227  {
228  *this = *((const SOP_TubeParms *)src);
229  }
230 
231  template <typename T>
232  void
233  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
234  {
235  if (idx.size() < 1)
236  return;
237  UT_ASSERT(idx.size() == instance.size()+1);
238  if (idx.size() != instance.size()+1)
239  return;
240  switch (idx[0])
241  {
242  case 0:
243  coerceValue(value, myType);
244  break;
245  case 1:
246  coerceValue(value, mySurftype);
247  break;
248  case 2:
249  coerceValue(value, myOrient);
250  break;
251  case 3:
252  coerceValue(value, myCap);
253  break;
254  case 4:
255  coerceValue(value, myConsolidatepts);
256  break;
257  case 5:
258  coerceValue(value, myVertexnormals);
259  break;
260  case 6:
261  coerceValue(value, myT);
262  break;
263  case 7:
264  coerceValue(value, myR);
265  break;
266  case 8:
267  coerceValue(value, myRad);
268  break;
269  case 9:
270  coerceValue(value, myRadscale);
271  break;
272  case 10:
273  coerceValue(value, myHeight);
274  break;
275  case 11:
276  coerceValue(value, myRows);
277  break;
278  case 12:
279  coerceValue(value, myOrderu);
280  break;
281  case 13:
282  coerceValue(value, myOrderv);
283  break;
284  case 14:
285  coerceValue(value, myImperfect);
286  break;
287  case 15:
288  coerceValue(value, myCols);
289  break;
290 
291  }
292  }
293 
294  bool isParmColorRamp(exint idx) const override
295  {
296  switch (idx)
297  {
298 
299  }
300  return false;
301  }
302 
303  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
304  { doGetParmValue(idx, instance, value); }
305  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
306  { doGetParmValue(idx, instance, value); }
307  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
308  { doGetParmValue(idx, instance, value); }
309  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
310  { doGetParmValue(idx, instance, value); }
311  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
312  { doGetParmValue(idx, instance, value); }
313  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
314  { doGetParmValue(idx, instance, value); }
315  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
316  { doGetParmValue(idx, instance, value); }
317  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
318  { doGetParmValue(idx, instance, value); }
319  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
320  { doGetParmValue(idx, instance, value); }
321  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
322  { doGetParmValue(idx, instance, value); }
323  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
324  { doGetParmValue(idx, instance, value); }
325 
326  template <typename T>
327  void
328  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
329  {
330  if (idx.size() < 1)
331  return;
332  UT_ASSERT(idx.size() == instance.size()+1);
333  if (idx.size() != instance.size()+1)
334  return;
335  switch (idx[0])
336  {
337  case 0:
338  coerceValue(myType, clampMinValue(0, clampMaxValue(5, value ) ));
339  break;
340  case 1:
341  coerceValue(mySurftype, clampMinValue(0, clampMaxValue(6, value ) ));
342  break;
343  case 2:
344  coerceValue(myOrient, clampMinValue(0, clampMaxValue(2, value ) ));
345  break;
346  case 3:
347  coerceValue(myCap, ( ( value ) ));
348  break;
349  case 4:
350  coerceValue(myConsolidatepts, ( ( value ) ));
351  break;
352  case 5:
353  coerceValue(myVertexnormals, ( ( value ) ));
354  break;
355  case 6:
356  coerceValue(myT, ( ( value ) ));
357  break;
358  case 7:
359  coerceValue(myR, ( ( value ) ));
360  break;
361  case 8:
362  coerceValue(myRad, clampMinValue(0, ( value ) ));
363  break;
364  case 9:
365  coerceValue(myRadscale, clampMinValue(0, ( value ) ));
366  break;
367  case 10:
368  coerceValue(myHeight, ( ( value ) ));
369  break;
370  case 11:
371  coerceValue(myRows, clampMinValue(2, ( value ) ));
372  break;
373  case 12:
374  coerceValue(myOrderu, clampMinValue(2, clampMaxValue(11, value ) ));
375  break;
376  case 13:
377  coerceValue(myOrderv, clampMinValue(2, clampMaxValue(11, value ) ));
378  break;
379  case 14:
380  coerceValue(myImperfect, ( ( value ) ));
381  break;
382  case 15:
383  coerceValue(myCols, clampMinValue(3, ( value ) ));
384  break;
385 
386  }
387  }
388 
389  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
390  { doSetParmValue(idx, instance, value); }
391  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
392  { doSetParmValue(idx, instance, value); }
393  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
394  { doSetParmValue(idx, instance, value); }
395  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
396  { doSetParmValue(idx, instance, value); }
397  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
398  { doSetParmValue(idx, instance, value); }
399  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
400  { doSetParmValue(idx, instance, value); }
401  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
402  { doSetParmValue(idx, instance, value); }
403  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
404  { doSetParmValue(idx, instance, value); }
405  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
406  { doSetParmValue(idx, instance, value); }
407  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
408  { doSetParmValue(idx, instance, value); }
409  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
410  { doSetParmValue(idx, instance, value); }
411 
412  exint getNestNumParms(TempIndex idx) const override
413  {
414  if (idx.size() == 0)
415  return 16;
416  switch (idx[0])
417  {
418 
419  }
420  // Invalid
421  return 0;
422  }
423 
424  const char *getNestParmName(TempIndex fieldnum) const override
425  {
426  if (fieldnum.size() < 1)
427  return 0;
428  switch (fieldnum[0])
429  {
430  case 0:
431  return "type";
432  case 1:
433  return "surftype";
434  case 2:
435  return "orient";
436  case 3:
437  return "cap";
438  case 4:
439  return "consolidatepts";
440  case 5:
441  return "vertexnormals";
442  case 6:
443  return "t";
444  case 7:
445  return "r";
446  case 8:
447  return "rad";
448  case 9:
449  return "radscale";
450  case 10:
451  return "height";
452  case 11:
453  return "rows";
454  case 12:
455  return "orderu";
456  case 13:
457  return "orderv";
458  case 14:
459  return "imperfect";
460  case 15:
461  return "cols";
462 
463  }
464  return 0;
465  }
466 
467  ParmType getNestParmType(TempIndex fieldnum) const override
468  {
469  if (fieldnum.size() < 1)
470  return PARM_UNSUPPORTED;
471  switch (fieldnum[0])
472  {
473  case 0:
474  return PARM_INTEGER;
475  case 1:
476  return PARM_INTEGER;
477  case 2:
478  return PARM_INTEGER;
479  case 3:
480  return PARM_INTEGER;
481  case 4:
482  return PARM_INTEGER;
483  case 5:
484  return PARM_INTEGER;
485  case 6:
486  return PARM_VECTOR3;
487  case 7:
488  return PARM_VECTOR3;
489  case 8:
490  return PARM_VECTOR2;
491  case 9:
492  return PARM_FLOAT;
493  case 10:
494  return PARM_FLOAT;
495  case 11:
496  return PARM_INTEGER;
497  case 12:
498  return PARM_INTEGER;
499  case 13:
500  return PARM_INTEGER;
501  case 14:
502  return PARM_INTEGER;
503  case 15:
504  return PARM_INTEGER;
505 
506  }
507  return PARM_UNSUPPORTED;
508  }
509 
510  // Boiler plate to load individual types.
511  static void loadData(UT_IStream &is, int64 &v)
512  { is.bread(&v, 1); }
513  static void loadData(UT_IStream &is, bool &v)
514  { int64 iv; is.bread(&iv, 1); v = iv; }
515  static void loadData(UT_IStream &is, fpreal64 &v)
516  { is.bread<fpreal64>(&v, 1); }
517  static void loadData(UT_IStream &is, UT_Vector2D &v)
518  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
519  static void loadData(UT_IStream &is, UT_Vector3D &v)
520  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
521  is.bread<fpreal64>(&v.z(), 1); }
522  static void loadData(UT_IStream &is, UT_Vector4D &v)
523  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
524  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
525  static void loadData(UT_IStream &is, UT_Matrix2D &v)
526  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
527  static void loadData(UT_IStream &is, UT_Matrix3D &v)
528  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
529  static void loadData(UT_IStream &is, UT_Matrix4D &v)
530  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
531  static void loadData(UT_IStream &is, UT_Vector2I &v)
532  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
533  static void loadData(UT_IStream &is, UT_Vector3I &v)
534  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
535  is.bread<int64>(&v.z(), 1); }
536  static void loadData(UT_IStream &is, UT_Vector4I &v)
537  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
538  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
540  { is.bread(v); }
542  { UT_StringHolder rampdata;
543  loadData(is, rampdata);
544  if (rampdata.isstring())
545  {
546  v.reset(new UT_Ramp());
547  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
548  v->load(istr);
549  }
550  else v.reset();
551  }
554  loadData(is, data);
555  if (data.isstring())
556  {
557  // Find the data type.
558  const char *colon = UT_StringWrap(data).findChar(':');
559  if (colon)
560  {
561  int typelen = colon - data.buffer();
563  type.strncpy(data.buffer(), typelen);
564  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
565 
566  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
567  }
568  }
569  else v.reset();
570  }
571 
572  static void saveData(std::ostream &os, int64 v)
573  { UTwrite(os, &v); }
574  static void saveData(std::ostream &os, bool v)
575  { int64 iv = v; UTwrite(os, &iv); }
576  static void saveData(std::ostream &os, fpreal64 v)
577  { UTwrite<fpreal64>(os, &v); }
578  static void saveData(std::ostream &os, UT_Vector2D v)
579  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
580  static void saveData(std::ostream &os, UT_Vector3D v)
581  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
582  UTwrite<fpreal64>(os, &v.z()); }
583  static void saveData(std::ostream &os, UT_Vector4D v)
584  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
585  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
586  static void saveData(std::ostream &os, UT_Matrix2D v)
588  static void saveData(std::ostream &os, UT_Matrix3D v)
590  static void saveData(std::ostream &os, UT_Matrix4D v)
592  static void saveData(std::ostream &os, UT_StringHolder s)
593  { UT_StringWrap(s).saveBinary(os); }
594  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
596  UT_OStringStream ostr;
597  if (s) s->save(ostr);
598  result = ostr.str();
599  saveData(os, result);
600  }
601  static void saveData(std::ostream &os, PRM_DataItemHandle s)
603  UT_OStringStream ostr;
604  if (s)
605  {
606  ostr << s->getDataTypeToken();
607  ostr << ":";
608  s->saveBinary(ostr);
609  }
610  result = ostr.str();
611  saveData(os, result);
612  }
613 
614 
615  void save(std::ostream &os) const
616  {
617  int32 v = version();
618  UTwrite(os, &v);
619  saveData(os, myType);
620  saveData(os, mySurftype);
621  saveData(os, myOrient);
622  saveData(os, myCap);
623  saveData(os, myConsolidatepts);
624  saveData(os, myVertexnormals);
625  saveData(os, myT);
626  saveData(os, myR);
627  saveData(os, myRad);
628  saveData(os, myRadscale);
629  saveData(os, myHeight);
630  saveData(os, myRows);
631  saveData(os, myOrderu);
632  saveData(os, myOrderv);
633  saveData(os, myImperfect);
634  saveData(os, myCols);
635 
636  }
637 
638  bool load(UT_IStream &is)
639  {
640  int32 v;
641  is.bread(&v, 1);
642  if (version() != v)
643  {
644  // Fail incompatible versions
645  return false;
646  }
647  loadData(is, myType);
648  loadData(is, mySurftype);
649  loadData(is, myOrient);
650  loadData(is, myCap);
651  loadData(is, myConsolidatepts);
652  loadData(is, myVertexnormals);
653  loadData(is, myT);
654  loadData(is, myR);
655  loadData(is, myRad);
656  loadData(is, myRadscale);
657  loadData(is, myHeight);
658  loadData(is, myRows);
659  loadData(is, myOrderu);
660  loadData(is, myOrderv);
661  loadData(is, myImperfect);
662  loadData(is, myCols);
663 
664  return true;
665  }
666 
667  Type getType() const { return Type(myType); }
668  void setType(Type val) { myType = int64(val); }
669  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
670  {
671  SOP_Node *thissop = cookparms.getNode();
672  if (!thissop) return getType();
673  int64 result;
674  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
675  return Type(result);
676  }
677  Surftype getSurftype() const { return Surftype(mySurftype); }
678  void setSurftype(Surftype val) { mySurftype = int64(val); }
680  {
681  SOP_Node *thissop = cookparms.getNode();
682  if (!thissop) return getSurftype();
683  int64 result;
684  OP_Utils::evalOpParm(result, thissop, "surftype", cookparms.getCookTime(), 0);
685  return Surftype(result);
686  }
687  Orient getOrient() const { return Orient(myOrient); }
688  void setOrient(Orient val) { myOrient = int64(val); }
689  Orient opOrient(const SOP_NodeVerb::CookParms &cookparms) const
690  {
691  SOP_Node *thissop = cookparms.getNode();
692  if (!thissop) return getOrient();
693  int64 result;
694  OP_Utils::evalOpParm(result, thissop, "orient", cookparms.getCookTime(), 0);
695  return Orient(result);
696  }
697  bool getCap() const { return myCap; }
698  void setCap(bool val) { myCap = val; }
699  bool opCap(const SOP_NodeVerb::CookParms &cookparms) const
700  {
701  SOP_Node *thissop = cookparms.getNode();
702  if (!thissop) return getCap();
703  bool result;
704  OP_Utils::evalOpParm(result, thissop, "cap", cookparms.getCookTime(), 0);
705  return result;
706  }
707  bool getConsolidatepts() const { return myConsolidatepts; }
708  void setConsolidatepts(bool val) { myConsolidatepts = val; }
709  bool opConsolidatepts(const SOP_NodeVerb::CookParms &cookparms) const
710  {
711  SOP_Node *thissop = cookparms.getNode();
712  if (!thissop) return getConsolidatepts();
713  bool result;
714  OP_Utils::evalOpParm(result, thissop, "consolidatepts", cookparms.getCookTime(), 0);
715  return result;
716  }
717  bool getVertexnormals() const { return myVertexnormals; }
718  void setVertexnormals(bool val) { myVertexnormals = val; }
719  bool opVertexnormals(const SOP_NodeVerb::CookParms &cookparms) const
720  {
721  SOP_Node *thissop = cookparms.getNode();
722  if (!thissop) return getVertexnormals();
723  bool result;
724  OP_Utils::evalOpParm(result, thissop, "vertexnormals", cookparms.getCookTime(), 0);
725  return result;
726  }
727  UT_Vector3D getT() const { return myT; }
728  void setT(UT_Vector3D val) { myT = val; }
729  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
730  {
731  SOP_Node *thissop = cookparms.getNode();
732  if (!thissop) return getT();
734  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
735  return result;
736  }
737  UT_Vector3D getR() const { return myR; }
738  void setR(UT_Vector3D val) { myR = val; }
739  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
740  {
741  SOP_Node *thissop = cookparms.getNode();
742  if (!thissop) return getR();
744  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
745  return result;
746  }
747  UT_Vector2D getRad() const { return myRad; }
748  void setRad(UT_Vector2D val) { myRad = val; }
749  UT_Vector2D opRad(const SOP_NodeVerb::CookParms &cookparms) const
750  {
751  SOP_Node *thissop = cookparms.getNode();
752  if (!thissop) return getRad();
754  OP_Utils::evalOpParm(result, thissop, "rad", cookparms.getCookTime(), 0);
755  return result;
756  }
757  fpreal64 getRadscale() const { return myRadscale; }
758  void setRadscale(fpreal64 val) { myRadscale = val; }
760  {
761  SOP_Node *thissop = cookparms.getNode();
762  if (!thissop) return getRadscale();
764  OP_Utils::evalOpParm(result, thissop, "radscale", cookparms.getCookTime(), 0);
765  return result;
766  }
767  fpreal64 getHeight() const { return myHeight; }
768  void setHeight(fpreal64 val) { myHeight = val; }
769  fpreal64 opHeight(const SOP_NodeVerb::CookParms &cookparms) const
770  {
771  SOP_Node *thissop = cookparms.getNode();
772  if (!thissop) return getHeight();
774  OP_Utils::evalOpParm(result, thissop, "height", cookparms.getCookTime(), 0);
775  return result;
776  }
777  int64 getRows() const { return myRows; }
778  void setRows(int64 val) { myRows = val; }
779  int64 opRows(const SOP_NodeVerb::CookParms &cookparms) const
780  {
781  SOP_Node *thissop = cookparms.getNode();
782  if (!thissop) return getRows();
783  int64 result;
784  OP_Utils::evalOpParm(result, thissop, "rows", cookparms.getCookTime(), 0);
785  return result;
786  }
787  int64 getOrderu() const { return myOrderu; }
788  void setOrderu(int64 val) { myOrderu = val; }
789  int64 opOrderu(const SOP_NodeVerb::CookParms &cookparms) const
790  {
791  SOP_Node *thissop = cookparms.getNode();
792  if (!thissop) return getOrderu();
793  int64 result;
794  OP_Utils::evalOpParm(result, thissop, "orderu", cookparms.getCookTime(), 0);
795  return result;
796  }
797  int64 getOrderv() const { return myOrderv; }
798  void setOrderv(int64 val) { myOrderv = val; }
799  int64 opOrderv(const SOP_NodeVerb::CookParms &cookparms) const
800  {
801  SOP_Node *thissop = cookparms.getNode();
802  if (!thissop) return getOrderv();
803  int64 result;
804  OP_Utils::evalOpParm(result, thissop, "orderv", cookparms.getCookTime(), 0);
805  return result;
806  }
807  bool getImperfect() const { return myImperfect; }
808  void setImperfect(bool val) { myImperfect = val; }
809  bool opImperfect(const SOP_NodeVerb::CookParms &cookparms) const
810  {
811  SOP_Node *thissop = cookparms.getNode();
812  if (!thissop) return getImperfect();
813  bool result;
814  OP_Utils::evalOpParm(result, thissop, "imperfect", cookparms.getCookTime(), 0);
815  return result;
816  }
817  int64 getCols() const { return myCols; }
818  void setCols(int64 val) { myCols = val; }
819  int64 opCols(const SOP_NodeVerb::CookParms &cookparms) const
820  {
821  SOP_Node *thissop = cookparms.getNode();
822  if (!thissop) return getCols();
823  int64 result;
824  OP_Utils::evalOpParm(result, thissop, "cols", cookparms.getCookTime(), 0);
825  return result;
826  }
827 
828 private:
829  int64 myType;
830  int64 mySurftype;
831  int64 myOrient;
832  bool myCap;
833  bool myConsolidatepts;
834  bool myVertexnormals;
835  UT_Vector3D myT;
836  UT_Vector3D myR;
837  UT_Vector2D myRad;
838  fpreal64 myRadscale;
839  fpreal64 myHeight;
840  int64 myRows;
841  int64 myOrderu;
842  int64 myOrderv;
843  bool myImperfect;
844  int64 myCols;
845 
846 };
virtual NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused=false) const =0
void setRad(UT_Vector2D val)
type
Definition: core.h:556
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:63
UT_Vector2T< fpreal64 > UT_Vector2D
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
UT_Vector3D getT() const
void setHeight(fpreal64 val)
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
bool getConsolidatepts() const
static void saveData(std::ostream &os, UT_Matrix2D v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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)
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