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