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