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