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