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 <OP/OP_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 
144  if (baseGetSignature() != src.baseGetSignature()) return false;
145 
146  return true;
147  }
148  bool operator!=(const SOP_GridParms &src) const
149  {
150  return !operator==(src);
151  }
155 
156 
157 
158  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
159  {
160  myType = 0;
161  if (true)
162  graph->evalOpParm(myType, nodeidx, "type", time, graph->isDirect()?nullptr:depnode);
163  mySurftype = 4;
164  if (true && ( (true&&!(((int64(getType())==4)))) ) )
165  graph->evalOpParm(mySurftype, nodeidx, "surftype", time, graph->isDirect()?nullptr:depnode);
166  myOrient = 2;
167  if (true)
168  graph->evalOpParm(myOrient, nodeidx, "orient", time, graph->isDirect()?nullptr:depnode);
169  mySize = UT_Vector2D(10,10);
170  if (true)
171  graph->evalOpParm(mySize, nodeidx, "size", time, graph->isDirect()?nullptr:depnode);
172  myT = UT_Vector3D(0,0,0);
173  if (true)
174  graph->evalOpParm(myT, nodeidx, "t", time, graph->isDirect()?nullptr:depnode);
175  myR = UT_Vector3D(0,0,0);
176  if (true)
177  graph->evalOpParm(myR, nodeidx, "r", time, graph->isDirect()?nullptr:depnode);
178  myRows = 10;
179  if (true)
180  graph->evalOpParm(myRows, nodeidx, "rows", time, graph->isDirect()?nullptr:depnode);
181  myCols = 10;
182  if (true)
183  graph->evalOpParm(myCols, nodeidx, "cols", time, graph->isDirect()?nullptr:depnode);
184  myOrderu = 4;
185  if (true && ( (true&&!(((int64(getType())!=2)&&(int64(getType())!=3)))) ) )
186  graph->evalOpParm(myOrderu, nodeidx, "orderu", time, graph->isDirect()?nullptr:depnode);
187  myOrderv = 4;
188  if (true && ( (true&&!(((int64(getType())!=2)&&(int64(getType())!=3)))) ) )
189  graph->evalOpParm(myOrderv, nodeidx, "orderv", time, graph->isDirect()?nullptr:depnode);
190  myInterpu = true;
191  if (true && ( (true&&!(((int64(getType())!=2)))) ) )
192  graph->evalOpParm(myInterpu, nodeidx, "interpu", time, graph->isDirect()?nullptr:depnode);
193  myInterpv = true;
194  if (true && ( (true&&!(((int64(getType())!=2)))) ) )
195  graph->evalOpParm(myInterpv, nodeidx, "interpv", time, graph->isDirect()?nullptr:depnode);
196 
197  }
198 
199 
200  void loadFromOpSubclass(const LoadParms &loadparms) override
201  {
202  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
203  }
204 
205 
206  void copyFrom(const OP_NodeParms *src) override
207  {
208  *this = *((const SOP_GridParms *)src);
209  }
210 
211  template <typename T>
212  void
213  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
214  {
215  if (idx.size() < 1)
216  return;
217  UT_ASSERT(idx.size() == instance.size()+1);
218  if (idx.size() != instance.size()+1)
219  return;
220  switch (idx[0])
221  {
222  case 0:
223  coerceValue(value, myType);
224  break;
225  case 1:
226  coerceValue(value, mySurftype);
227  break;
228  case 2:
229  coerceValue(value, myOrient);
230  break;
231  case 3:
232  coerceValue(value, mySize);
233  break;
234  case 4:
235  coerceValue(value, myT);
236  break;
237  case 5:
238  coerceValue(value, myR);
239  break;
240  case 6:
241  coerceValue(value, myRows);
242  break;
243  case 7:
244  coerceValue(value, myCols);
245  break;
246  case 8:
247  coerceValue(value, myOrderu);
248  break;
249  case 9:
250  coerceValue(value, myOrderv);
251  break;
252  case 10:
253  coerceValue(value, myInterpu);
254  break;
255  case 11:
256  coerceValue(value, myInterpv);
257  break;
258 
259  }
260  }
261 
262  bool isParmColorRamp(exint idx) const override
263  {
264  switch (idx)
265  {
266 
267  }
268  return false;
269  }
270 
271  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
272  { doGetParmValue(idx, instance, value); }
273  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
274  { doGetParmValue(idx, instance, value); }
275  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
276  { doGetParmValue(idx, instance, value); }
277  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
278  { doGetParmValue(idx, instance, value); }
279  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
280  { doGetParmValue(idx, instance, value); }
281  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
282  { doGetParmValue(idx, instance, value); }
283  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
284  { doGetParmValue(idx, instance, value); }
285  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
286  { doGetParmValue(idx, instance, value); }
287  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
288  { doGetParmValue(idx, instance, value); }
289  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
290  { doGetParmValue(idx, instance, value); }
291  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
292  { doGetParmValue(idx, instance, value); }
293 
294  template <typename T>
295  void
296  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
297  {
298  if (idx.size() < 1)
299  return;
300  UT_ASSERT(idx.size() == instance.size()+1);
301  if (idx.size() != instance.size()+1)
302  return;
303  switch (idx[0])
304  {
305  case 0:
306  coerceValue(myType, clampMinValue(0, clampMaxValue(5, value ) ));
307  break;
308  case 1:
309  coerceValue(mySurftype, clampMinValue(0, clampMaxValue(6, value ) ));
310  break;
311  case 2:
312  coerceValue(myOrient, clampMinValue(0, clampMaxValue(2, value ) ));
313  break;
314  case 3:
315  coerceValue(mySize, ( ( value ) ));
316  break;
317  case 4:
318  coerceValue(myT, ( ( value ) ));
319  break;
320  case 5:
321  coerceValue(myR, ( ( value ) ));
322  break;
323  case 6:
324  coerceValue(myRows, clampMinValue(1, ( value ) ));
325  break;
326  case 7:
327  coerceValue(myCols, clampMinValue(1, ( value ) ));
328  break;
329  case 8:
330  coerceValue(myOrderu, clampMinValue(2, clampMaxValue(11, value ) ));
331  break;
332  case 9:
333  coerceValue(myOrderv, clampMinValue(2, clampMaxValue(11, value ) ));
334  break;
335  case 10:
336  coerceValue(myInterpu, ( ( value ) ));
337  break;
338  case 11:
339  coerceValue(myInterpv, ( ( value ) ));
340  break;
341 
342  }
343  }
344 
345  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
346  { doSetParmValue(idx, instance, value); }
347  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
348  { doSetParmValue(idx, instance, value); }
349  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
350  { doSetParmValue(idx, instance, value); }
351  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
352  { doSetParmValue(idx, instance, value); }
353  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
354  { doSetParmValue(idx, instance, value); }
355  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
356  { doSetParmValue(idx, instance, value); }
357  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
358  { doSetParmValue(idx, instance, value); }
359  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
360  { doSetParmValue(idx, instance, value); }
361  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
362  { doSetParmValue(idx, instance, value); }
363  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
364  { doSetParmValue(idx, instance, value); }
365  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
366  { doSetParmValue(idx, instance, value); }
367 
368  exint getNestNumParms(TempIndex idx) const override
369  {
370  if (idx.size() == 0)
371  return 12;
372  switch (idx[0])
373  {
374 
375  }
376  // Invalid
377  return 0;
378  }
379 
380  const char *getNestParmName(TempIndex fieldnum) const override
381  {
382  if (fieldnum.size() < 1)
383  return 0;
384  switch (fieldnum[0])
385  {
386  case 0:
387  return "type";
388  case 1:
389  return "surftype";
390  case 2:
391  return "orient";
392  case 3:
393  return "size";
394  case 4:
395  return "t";
396  case 5:
397  return "r";
398  case 6:
399  return "rows";
400  case 7:
401  return "cols";
402  case 8:
403  return "orderu";
404  case 9:
405  return "orderv";
406  case 10:
407  return "interpu";
408  case 11:
409  return "interpv";
410 
411  }
412  return 0;
413  }
414 
415  ParmType getNestParmType(TempIndex fieldnum) const override
416  {
417  if (fieldnum.size() < 1)
418  return PARM_UNSUPPORTED;
419  switch (fieldnum[0])
420  {
421  case 0:
422  return PARM_INTEGER;
423  case 1:
424  return PARM_INTEGER;
425  case 2:
426  return PARM_INTEGER;
427  case 3:
428  return PARM_VECTOR2;
429  case 4:
430  return PARM_VECTOR3;
431  case 5:
432  return PARM_VECTOR3;
433  case 6:
434  return PARM_INTEGER;
435  case 7:
436  return PARM_INTEGER;
437  case 8:
438  return PARM_INTEGER;
439  case 9:
440  return PARM_INTEGER;
441  case 10:
442  return PARM_INTEGER;
443  case 11:
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, myOrient);
562  saveData(os, mySize);
563  saveData(os, myT);
564  saveData(os, myR);
565  saveData(os, myRows);
566  saveData(os, myCols);
567  saveData(os, myOrderu);
568  saveData(os, myOrderv);
569  saveData(os, myInterpu);
570  saveData(os, myInterpv);
571 
572  }
573 
574  bool load(UT_IStream &is)
575  {
576  int32 v;
577  is.bread(&v, 1);
578  if (version() != v)
579  {
580  // Fail incompatible versions
581  return false;
582  }
583  loadData(is, myType);
584  loadData(is, mySurftype);
585  loadData(is, myOrient);
586  loadData(is, mySize);
587  loadData(is, myT);
588  loadData(is, myR);
589  loadData(is, myRows);
590  loadData(is, myCols);
591  loadData(is, myOrderu);
592  loadData(is, myOrderv);
593  loadData(is, myInterpu);
594  loadData(is, myInterpv);
595 
596  return true;
597  }
598 
599  Type getType() const { return Type(myType); }
600  void setType(Type val) { myType = int64(val); }
601  Type opType(const SOP_NodeVerb::CookParms &cookparms) const
602  {
603  SOP_Node *thissop = cookparms.getNode();
604  if (!thissop) return getType();
605  int64 result;
606  OP_Utils::evalOpParm(result, thissop, "type", cookparms.getCookTime(), 0);
607  return Type(result);
608  }
609  Surftype getSurftype() const { return Surftype(mySurftype); }
610  void setSurftype(Surftype val) { mySurftype = int64(val); }
612  {
613  SOP_Node *thissop = cookparms.getNode();
614  if (!thissop) return getSurftype();
615  int64 result;
616  OP_Utils::evalOpParm(result, thissop, "surftype", cookparms.getCookTime(), 0);
617  return Surftype(result);
618  }
619  Orient getOrient() const { return Orient(myOrient); }
620  void setOrient(Orient val) { myOrient = int64(val); }
621  Orient opOrient(const SOP_NodeVerb::CookParms &cookparms) const
622  {
623  SOP_Node *thissop = cookparms.getNode();
624  if (!thissop) return getOrient();
625  int64 result;
626  OP_Utils::evalOpParm(result, thissop, "orient", cookparms.getCookTime(), 0);
627  return Orient(result);
628  }
629  UT_Vector2D getSize() const { return mySize; }
630  void setSize(UT_Vector2D val) { mySize = val; }
632  {
633  SOP_Node *thissop = cookparms.getNode();
634  if (!thissop) return getSize();
636  OP_Utils::evalOpParm(result, thissop, "size", cookparms.getCookTime(), 0);
637  return result;
638  }
639  UT_Vector3D getT() const { return myT; }
640  void setT(UT_Vector3D val) { myT = val; }
641  UT_Vector3D opT(const SOP_NodeVerb::CookParms &cookparms) const
642  {
643  SOP_Node *thissop = cookparms.getNode();
644  if (!thissop) return getT();
646  OP_Utils::evalOpParm(result, thissop, "t", cookparms.getCookTime(), 0);
647  return result;
648  }
649  UT_Vector3D getR() const { return myR; }
650  void setR(UT_Vector3D val) { myR = val; }
651  UT_Vector3D opR(const SOP_NodeVerb::CookParms &cookparms) const
652  {
653  SOP_Node *thissop = cookparms.getNode();
654  if (!thissop) return getR();
656  OP_Utils::evalOpParm(result, thissop, "r", cookparms.getCookTime(), 0);
657  return result;
658  }
659  int64 getRows() const { return myRows; }
660  void setRows(int64 val) { myRows = val; }
661  int64 opRows(const SOP_NodeVerb::CookParms &cookparms) const
662  {
663  SOP_Node *thissop = cookparms.getNode();
664  if (!thissop) return getRows();
665  int64 result;
666  OP_Utils::evalOpParm(result, thissop, "rows", cookparms.getCookTime(), 0);
667  return result;
668  }
669  int64 getCols() const { return myCols; }
670  void setCols(int64 val) { myCols = val; }
671  int64 opCols(const SOP_NodeVerb::CookParms &cookparms) const
672  {
673  SOP_Node *thissop = cookparms.getNode();
674  if (!thissop) return getCols();
675  int64 result;
676  OP_Utils::evalOpParm(result, thissop, "cols", cookparms.getCookTime(), 0);
677  return result;
678  }
679  int64 getOrderu() const { return myOrderu; }
680  void setOrderu(int64 val) { myOrderu = val; }
681  int64 opOrderu(const SOP_NodeVerb::CookParms &cookparms) const
682  {
683  SOP_Node *thissop = cookparms.getNode();
684  if (!thissop) return getOrderu();
685  int64 result;
686  OP_Utils::evalOpParm(result, thissop, "orderu", cookparms.getCookTime(), 0);
687  return result;
688  }
689  int64 getOrderv() const { return myOrderv; }
690  void setOrderv(int64 val) { myOrderv = val; }
691  int64 opOrderv(const SOP_NodeVerb::CookParms &cookparms) const
692  {
693  SOP_Node *thissop = cookparms.getNode();
694  if (!thissop) return getOrderv();
695  int64 result;
696  OP_Utils::evalOpParm(result, thissop, "orderv", cookparms.getCookTime(), 0);
697  return result;
698  }
699  bool getInterpu() const { return myInterpu; }
700  void setInterpu(bool val) { myInterpu = val; }
701  bool opInterpu(const SOP_NodeVerb::CookParms &cookparms) const
702  {
703  SOP_Node *thissop = cookparms.getNode();
704  if (!thissop) return getInterpu();
705  bool result;
706  OP_Utils::evalOpParm(result, thissop, "interpu", cookparms.getCookTime(), 0);
707  return result;
708  }
709  bool getInterpv() const { return myInterpv; }
710  void setInterpv(bool val) { myInterpv = val; }
711  bool opInterpv(const SOP_NodeVerb::CookParms &cookparms) const
712  {
713  SOP_Node *thissop = cookparms.getNode();
714  if (!thissop) return getInterpv();
715  bool result;
716  OP_Utils::evalOpParm(result, thissop, "interpv", cookparms.getCookTime(), 0);
717  return result;
718  }
719 
720 private:
721  int64 myType;
722  int64 mySurftype;
723  int64 myOrient;
724  UT_Vector2D mySize;
725  UT_Vector3D myT;
726  UT_Vector3D myR;
727  int64 myRows;
728  int64 myCols;
729  int64 myOrderu;
730  int64 myOrderv;
731  bool myInterpu;
732  bool myInterpv;
733 
734 };
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int64 getOrderv() const
type
Definition: core.h:556
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:63
void save(std::ostream &os) const
UT_Vector2T< fpreal64 > UT_Vector2D
static void loadData(UT_IStream &is, UT_Vector2D &v)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
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