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