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