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