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