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