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