HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Rest.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_RestEnums
24 {
25  enum class Mode
26  {
27  STORE = 0,
28  EXTRACT,
29  SWAP
30  };
31 
33  getToken(Mode enum_value)
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case Mode::STORE: return "store"_sh;
38  case Mode::EXTRACT: return "extract"_sh;
39  case Mode::SWAP: return "swap"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class Nml
45  {
46  OFF = 0,
47  POLY,
48  ON
49  };
50 
52  getToken(Nml enum_value)
53  {
54  using namespace UT::Literal;
55  switch (enum_value) {
56  case Nml::OFF: return "off"_sh;
57  case Nml::POLY: return "poly"_sh;
58  case Nml::ON: return "on"_sh;
59  default: UT_ASSERT(false); return ""_sh;
60  }
61  }
62 
63  enum class Xform
64  {
65  OFF = 0,
66  POLY,
67  ON
68  };
69 
71  getToken(Xform enum_value)
72  {
73  using namespace UT::Literal;
74  switch (enum_value) {
75  case Xform::OFF: return "off"_sh;
76  case Xform::POLY: return "poly"_sh;
77  case Xform::ON: return "on"_sh;
78  default: UT_ASSERT(false); return ""_sh;
79  }
80  }
81 
82  enum class Quadric
83  {
84  OFF = 0,
85  POLY,
86  ON
87  };
88 
90  getToken(Quadric enum_value)
91  {
92  using namespace UT::Literal;
93  switch (enum_value) {
94  case Quadric::OFF: return "off"_sh;
95  case Quadric::POLY: return "poly"_sh;
96  case Quadric::ON: return "on"_sh;
97  default: UT_ASSERT(false); return ""_sh;
98  }
99  }
100 
101  enum class Precision
102  {
103  AUTO = 0,
104  _32,
105  _64
106  };
107 
109  getToken(Precision enum_value)
110  {
111  using namespace UT::Literal;
112  switch (enum_value) {
113  case Precision::AUTO: return "auto"_sh;
114  case Precision::_32: return "32"_sh;
115  case Precision::_64: return "64"_sh;
116  default: UT_ASSERT(false); return ""_sh;
117  }
118  }
119 
120 }
121 
122 
124 {
125 public:
126  static int version() { return 1; }
127 
129  {
130  myMode = 0;
131  myRestAttribName = "rest"_UTsh;
132  myFile = ""_UTsh;
133  myNml = 0;
134  myNormalsAttribName = "rnml"_UTsh;
135  myXform = 0;
136  myXformAttribName = "restxform"_UTsh;
137  myQuadric = 0;
138  myQuadricAttribName = "Pref"_UTsh;
139  myPrecision = 0;
140 
141  }
142 
143  explicit SOP_RestParms(const SOP_RestParms &) = default;
144  SOP_RestParms &operator=(const SOP_RestParms &) = default;
145  SOP_RestParms(SOP_RestParms &&) noexcept = default;
146  SOP_RestParms &operator=(SOP_RestParms &&) noexcept = default;
147 
148  ~SOP_RestParms() override {}
149 
150  bool operator==(const SOP_RestParms &src) const
151  {
152  if (myMode != src.myMode) return false;
153  if (myRestAttribName != src.myRestAttribName) return false;
154  if (myFile != src.myFile) return false;
155  if (myNml != src.myNml) return false;
156  if (myNormalsAttribName != src.myNormalsAttribName) return false;
157  if (myXform != src.myXform) return false;
158  if (myXformAttribName != src.myXformAttribName) return false;
159  if (myQuadric != src.myQuadric) return false;
160  if (myQuadricAttribName != src.myQuadricAttribName) return false;
161  if (myPrecision != src.myPrecision) return false;
162 
163 
164  if (baseGetSignature() != src.baseGetSignature()) return false;
165 
166  return true;
167  }
168  bool operator!=(const SOP_RestParms &src) const
169  {
170  return !operator==(src);
171  }
177 
178 
179 
180  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
181  {
182  myMode = 0;
183  if (true)
184  graph->evalOpParm(myMode, nodeidx, "mode", time, graph->isDirect()?nullptr:depnode);
185  myRestAttribName = "rest"_UTsh;
186  if (true)
187  graph->evalOpParm(myRestAttribName, nodeidx, "restattribname", time, graph->isDirect()?nullptr:depnode);
188  myFile = ""_UTsh;
189  if (true && ( (true&&!((((graph->getInput(nodeidx,1)>=0)==1))||((int64(getMode())!=0)))) ) )
190  graph->evalOpParm(myFile, nodeidx, "file", time, graph->isDirect()?nullptr:depnode);
191  myNml = 0;
192  if (true)
193  graph->evalOpParm(myNml, nodeidx, "nml", time, graph->isDirect()?nullptr:depnode);
194  myNormalsAttribName = "rnml"_UTsh;
195  if (true && ( (true&&!(((int64(getNml())==0)))) ) )
196  graph->evalOpParm(myNormalsAttribName, nodeidx, "normalattribname", time, graph->isDirect()?nullptr:depnode);
197  myXform = 0;
198  if (true)
199  graph->evalOpParm(myXform, nodeidx, "xform", time, graph->isDirect()?nullptr:depnode);
200  myXformAttribName = "restxform"_UTsh;
201  if (true && ( (true&&!(((int64(getXform())==0)))) ) )
202  graph->evalOpParm(myXformAttribName, nodeidx, "xformattribname", time, graph->isDirect()?nullptr:depnode);
203  myQuadric = 0;
204  if (true)
205  graph->evalOpParm(myQuadric, nodeidx, "quadric", time, graph->isDirect()?nullptr:depnode);
206  myQuadricAttribName = "Pref"_UTsh;
207  if (true && ( (true&&!(((int64(getQuadric())==0)))) ) )
208  graph->evalOpParm(myQuadricAttribName, nodeidx, "quadricattribname", time, graph->isDirect()?nullptr:depnode);
209  myPrecision = 0;
210  if (true)
211  graph->evalOpParm(myPrecision, nodeidx, "precision", time, graph->isDirect()?nullptr:depnode);
212 
213  }
214 
215 
216  void loadFromOpSubclass(const LoadParms &loadparms) override
217  {
218  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
219  }
220 
221 
222  void copyFrom(const OP_NodeParms *src) override
223  {
224  *this = *((const SOP_RestParms *)src);
225  }
226 
227  template <typename T>
228  void
229  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
230  {
231  if (idx.size() < 1)
232  return;
233  UT_ASSERT(idx.size() == instance.size()+1);
234  if (idx.size() != instance.size()+1)
235  return;
236  switch (idx[0])
237  {
238  case 0:
239  coerceValue(value, myMode);
240  break;
241  case 1:
242  coerceValue(value, myRestAttribName);
243  break;
244  case 2:
245  coerceValue(value, myFile);
246  break;
247  case 3:
248  coerceValue(value, myNml);
249  break;
250  case 4:
251  coerceValue(value, myNormalsAttribName);
252  break;
253  case 5:
254  coerceValue(value, myXform);
255  break;
256  case 6:
257  coerceValue(value, myXformAttribName);
258  break;
259  case 7:
260  coerceValue(value, myQuadric);
261  break;
262  case 8:
263  coerceValue(value, myQuadricAttribName);
264  break;
265  case 9:
266  coerceValue(value, myPrecision);
267  break;
268 
269  }
270  }
271 
272  bool isParmColorRamp(exint idx) const override
273  {
274  switch (idx)
275  {
276 
277  }
278  return false;
279  }
280 
281  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
282  { doGetParmValue(idx, instance, value); }
283  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
284  { doGetParmValue(idx, instance, value); }
285  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
286  { doGetParmValue(idx, instance, value); }
287  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
288  { doGetParmValue(idx, instance, value); }
289  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
290  { doGetParmValue(idx, instance, value); }
291  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
292  { doGetParmValue(idx, instance, value); }
293  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
294  { doGetParmValue(idx, instance, value); }
295  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
296  { doGetParmValue(idx, instance, value); }
297  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
298  { doGetParmValue(idx, instance, value); }
299  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
300  { doGetParmValue(idx, instance, value); }
301  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
302  { doGetParmValue(idx, instance, value); }
303 
304  template <typename T>
305  void
306  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
307  {
308  if (idx.size() < 1)
309  return;
310  UT_ASSERT(idx.size() == instance.size()+1);
311  if (idx.size() != instance.size()+1)
312  return;
313  switch (idx[0])
314  {
315  case 0:
316  coerceValue(myMode, clampMinValue(0, clampMaxValue(2, value ) ));
317  break;
318  case 1:
319  coerceValue(myRestAttribName, ( ( value ) ));
320  break;
321  case 2:
322  coerceValue(myFile, ( ( value ) ));
323  break;
324  case 3:
325  coerceValue(myNml, clampMinValue(0, clampMaxValue(2, value ) ));
326  break;
327  case 4:
328  coerceValue(myNormalsAttribName, ( ( value ) ));
329  break;
330  case 5:
331  coerceValue(myXform, clampMinValue(0, clampMaxValue(2, value ) ));
332  break;
333  case 6:
334  coerceValue(myXformAttribName, ( ( value ) ));
335  break;
336  case 7:
337  coerceValue(myQuadric, clampMinValue(0, clampMaxValue(2, value ) ));
338  break;
339  case 8:
340  coerceValue(myQuadricAttribName, ( ( value ) ));
341  break;
342  case 9:
343  coerceValue(myPrecision, clampMinValue(0, clampMaxValue(2, value ) ));
344  break;
345 
346  }
347  }
348 
349  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
350  { doSetParmValue(idx, instance, value); }
351  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
352  { doSetParmValue(idx, instance, value); }
353  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
354  { doSetParmValue(idx, instance, value); }
355  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
356  { doSetParmValue(idx, instance, value); }
357  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
358  { doSetParmValue(idx, instance, value); }
359  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
360  { doSetParmValue(idx, instance, value); }
361  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
362  { doSetParmValue(idx, instance, value); }
363  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
364  { doSetParmValue(idx, instance, value); }
365  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
366  { doSetParmValue(idx, instance, value); }
367  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
368  { doSetParmValue(idx, instance, value); }
369  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
370  { doSetParmValue(idx, instance, value); }
371 
372  exint getNestNumParms(TempIndex idx) const override
373  {
374  if (idx.size() == 0)
375  return 10;
376  switch (idx[0])
377  {
378 
379  }
380  // Invalid
381  return 0;
382  }
383 
384  const char *getNestParmName(TempIndex fieldnum) const override
385  {
386  if (fieldnum.size() < 1)
387  return 0;
388  switch (fieldnum[0])
389  {
390  case 0:
391  return "mode";
392  case 1:
393  return "restattribname";
394  case 2:
395  return "file";
396  case 3:
397  return "nml";
398  case 4:
399  return "normalattribname";
400  case 5:
401  return "xform";
402  case 6:
403  return "xformattribname";
404  case 7:
405  return "quadric";
406  case 8:
407  return "quadricattribname";
408  case 9:
409  return "precision";
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_STRING;
425  case 2:
426  return PARM_STRING;
427  case 3:
428  return PARM_INTEGER;
429  case 4:
430  return PARM_STRING;
431  case 5:
432  return PARM_INTEGER;
433  case 6:
434  return PARM_STRING;
435  case 7:
436  return PARM_INTEGER;
437  case 8:
438  return PARM_STRING;
439  case 9:
440  return PARM_INTEGER;
441 
442  }
443  return PARM_UNSUPPORTED;
444  }
445 
446  // Boiler plate to load individual types.
447  static void loadData(UT_IStream &is, int64 &v)
448  { is.bread(&v, 1); }
449  static void loadData(UT_IStream &is, bool &v)
450  { int64 iv; is.bread(&iv, 1); v = iv; }
451  static void loadData(UT_IStream &is, fpreal64 &v)
452  { is.bread<fpreal64>(&v, 1); }
453  static void loadData(UT_IStream &is, UT_Vector2D &v)
454  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
455  static void loadData(UT_IStream &is, UT_Vector3D &v)
456  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
457  is.bread<fpreal64>(&v.z(), 1); }
458  static void loadData(UT_IStream &is, UT_Vector4D &v)
459  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
460  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
461  static void loadData(UT_IStream &is, UT_Matrix2D &v)
462  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
463  static void loadData(UT_IStream &is, UT_Matrix3D &v)
464  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
465  static void loadData(UT_IStream &is, UT_Matrix4D &v)
466  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
467  static void loadData(UT_IStream &is, UT_Vector2I &v)
468  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
469  static void loadData(UT_IStream &is, UT_Vector3I &v)
470  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
471  is.bread<int64>(&v.z(), 1); }
472  static void loadData(UT_IStream &is, UT_Vector4I &v)
473  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
474  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
476  { is.bread(v); }
478  { UT_StringHolder rampdata;
479  loadData(is, rampdata);
480  if (rampdata.isstring())
481  {
482  v.reset(new UT_Ramp());
483  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
484  v->load(istr);
485  }
486  else v.reset();
487  }
490  loadData(is, data);
491  if (data.isstring())
492  {
493  // Find the data type.
494  const char *colon = UT_StringWrap(data).findChar(':');
495  if (colon)
496  {
497  int typelen = colon - data.buffer();
499  type.strncpy(data.buffer(), typelen);
500  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
501 
502  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
503  }
504  }
505  else v.reset();
506  }
507 
508  static void saveData(std::ostream &os, int64 v)
509  { UTwrite(os, &v); }
510  static void saveData(std::ostream &os, bool v)
511  { int64 iv = v; UTwrite(os, &iv); }
512  static void saveData(std::ostream &os, fpreal64 v)
513  { UTwrite<fpreal64>(os, &v); }
514  static void saveData(std::ostream &os, UT_Vector2D v)
515  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
516  static void saveData(std::ostream &os, UT_Vector3D v)
517  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
518  UTwrite<fpreal64>(os, &v.z()); }
519  static void saveData(std::ostream &os, UT_Vector4D v)
520  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
521  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
522  static void saveData(std::ostream &os, UT_Matrix2D v)
524  static void saveData(std::ostream &os, UT_Matrix3D v)
526  static void saveData(std::ostream &os, UT_Matrix4D v)
528  static void saveData(std::ostream &os, UT_StringHolder s)
529  { UT_StringWrap(s).saveBinary(os); }
530  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
532  UT_OStringStream ostr;
533  if (s) s->save(ostr);
534  result = ostr.str();
535  saveData(os, result);
536  }
537  static void saveData(std::ostream &os, PRM_DataItemHandle s)
539  UT_OStringStream ostr;
540  if (s)
541  {
542  ostr << s->getDataTypeToken();
543  ostr << ":";
544  s->saveBinary(ostr);
545  }
546  result = ostr.str();
547  saveData(os, result);
548  }
549 
550 
551  void save(std::ostream &os) const
552  {
553  int32 v = version();
554  UTwrite(os, &v);
555  saveData(os, myMode);
556  saveData(os, myRestAttribName);
557  saveData(os, myFile);
558  saveData(os, myNml);
559  saveData(os, myNormalsAttribName);
560  saveData(os, myXform);
561  saveData(os, myXformAttribName);
562  saveData(os, myQuadric);
563  saveData(os, myQuadricAttribName);
564  saveData(os, myPrecision);
565 
566  }
567 
568  bool load(UT_IStream &is)
569  {
570  int32 v;
571  is.bread(&v, 1);
572  if (version() != v)
573  {
574  // Fail incompatible versions
575  return false;
576  }
577  loadData(is, myMode);
578  loadData(is, myRestAttribName);
579  loadData(is, myFile);
580  loadData(is, myNml);
581  loadData(is, myNormalsAttribName);
582  loadData(is, myXform);
583  loadData(is, myXformAttribName);
584  loadData(is, myQuadric);
585  loadData(is, myQuadricAttribName);
586  loadData(is, myPrecision);
587 
588  return true;
589  }
590 
591  Mode getMode() const { return Mode(myMode); }
592  void setMode(Mode val) { myMode = int64(val); }
593  Mode opMode(const SOP_NodeVerb::CookParms &cookparms) const
594  {
595  SOP_Node *thissop = cookparms.getNode();
596  if (!thissop) return getMode();
597  int64 result;
598  OP_Utils::evalOpParm(result, thissop, "mode", cookparms.getCookTime(), 0);
599  return Mode(result);
600  }
601  const UT_StringHolder & getRestAttribName() const { return myRestAttribName; }
602  void setRestAttribName(const UT_StringHolder & val) { myRestAttribName = val; }
604  {
605  SOP_Node *thissop = cookparms.getNode();
606  if (!thissop) return getRestAttribName();
608  OP_Utils::evalOpParm(result, thissop, "restattribname", cookparms.getCookTime(), 0);
609  return result;
610  }
611  const UT_StringHolder & getFile() const { return myFile; }
612  void setFile(const UT_StringHolder & val) { myFile = val; }
614  {
615  SOP_Node *thissop = cookparms.getNode();
616  if (!thissop) return getFile();
618  OP_Utils::evalOpParm(result, thissop, "file", cookparms.getCookTime(), 0);
619  return result;
620  }
621  Nml getNml() const { return Nml(myNml); }
622  void setNml(Nml val) { myNml = int64(val); }
623  Nml opNml(const SOP_NodeVerb::CookParms &cookparms) const
624  {
625  SOP_Node *thissop = cookparms.getNode();
626  if (!thissop) return getNml();
627  int64 result;
628  OP_Utils::evalOpParm(result, thissop, "nml", cookparms.getCookTime(), 0);
629  return Nml(result);
630  }
631  const UT_StringHolder & getNormalsAttribName() const { return myNormalsAttribName; }
632  void setNormalsAttribName(const UT_StringHolder & val) { myNormalsAttribName = val; }
634  {
635  SOP_Node *thissop = cookparms.getNode();
636  if (!thissop) return getNormalsAttribName();
638  OP_Utils::evalOpParm(result, thissop, "normalattribname", cookparms.getCookTime(), 0);
639  return result;
640  }
641  Xform getXform() const { return Xform(myXform); }
642  void setXform(Xform val) { myXform = int64(val); }
643  Xform opXform(const SOP_NodeVerb::CookParms &cookparms) const
644  {
645  SOP_Node *thissop = cookparms.getNode();
646  if (!thissop) return getXform();
647  int64 result;
648  OP_Utils::evalOpParm(result, thissop, "xform", cookparms.getCookTime(), 0);
649  return Xform(result);
650  }
651  const UT_StringHolder & getXformAttribName() const { return myXformAttribName; }
652  void setXformAttribName(const UT_StringHolder & val) { myXformAttribName = val; }
654  {
655  SOP_Node *thissop = cookparms.getNode();
656  if (!thissop) return getXformAttribName();
658  OP_Utils::evalOpParm(result, thissop, "xformattribname", cookparms.getCookTime(), 0);
659  return result;
660  }
661  Quadric getQuadric() const { return Quadric(myQuadric); }
662  void setQuadric(Quadric val) { myQuadric = int64(val); }
663  Quadric opQuadric(const SOP_NodeVerb::CookParms &cookparms) const
664  {
665  SOP_Node *thissop = cookparms.getNode();
666  if (!thissop) return getQuadric();
667  int64 result;
668  OP_Utils::evalOpParm(result, thissop, "quadric", cookparms.getCookTime(), 0);
669  return Quadric(result);
670  }
671  const UT_StringHolder & getQuadricAttribName() const { return myQuadricAttribName; }
672  void setQuadricAttribName(const UT_StringHolder & val) { myQuadricAttribName = val; }
674  {
675  SOP_Node *thissop = cookparms.getNode();
676  if (!thissop) return getQuadricAttribName();
678  OP_Utils::evalOpParm(result, thissop, "quadricattribname", cookparms.getCookTime(), 0);
679  return result;
680  }
681  Precision getPrecision() const { return Precision(myPrecision); }
682  void setPrecision(Precision val) { myPrecision = int64(val); }
684  {
685  SOP_Node *thissop = cookparms.getNode();
686  if (!thissop) return getPrecision();
687  int64 result;
688  OP_Utils::evalOpParm(result, thissop, "precision", cookparms.getCookTime(), 0);
689  return Precision(result);
690  }
691 
692 private:
693  int64 myMode;
694  UT_StringHolder myRestAttribName;
695  UT_StringHolder myFile;
696  int64 myNml;
697  UT_StringHolder myNormalsAttribName;
698  int64 myXform;
699  UT_StringHolder myXformAttribName;
700  int64 myQuadric;
701  UT_StringHolder myQuadricAttribName;
702  int64 myPrecision;
703 
704 };
virtual NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused=false) const =0
void setRestAttribName(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
type
Definition: core.h:556
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
Quadric getQuadric() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
UT_StringHolder opQuadricAttribName(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getXformAttribName() const
Nml getNml() const
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
UT_StringHolder opRestAttribName(const SOP_NodeVerb::CookParms &cookparms) const
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
GLsizei const GLfloat * value
Definition: glcorearb.h:824
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setMode(Mode val)
static void saveData(std::ostream &os, UT_Matrix3D v)
const OP_Context & context() const
Definition: OP_NodeParms.h:97
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
SYS_FORCE_INLINE const char * buffer() const
const UT_StringHolder & getNormalsAttribName() const
void setNml(Nml val)
GLdouble s
Definition: glad.h:3009
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
**But if you need a result
Definition: thread.h:622
void setXform(Xform val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
Quadric opQuadric(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
const UT_StringHolder & getFile() const
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Matrix2D v)
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setPrecision(Precision val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool isParmColorRamp(exint idx) const override
bool operator==(const SOP_RestParms &src) const
exint length() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void loadData(UT_IStream &is, UT_Vector4D &v)
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
UT_StringHolder opFile(const SOP_NodeVerb::CookParms &cookparms) const
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
long long int64
Definition: SYS_Types.h:116
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
Mode getMode() const
Precision opPrecision(const SOP_NodeVerb::CookParms &cookparms) const
Nml opNml(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
Xform getXform() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
const UT_StringHolder & getRestAttribName() const
GT_API const UT_StringHolder version
SYS_FORCE_INLINE UT_StringHolder getToken(Mode enum_value)
void setNormalsAttribName(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, int64 &v)
bool operator!=(const SOP_RestParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void saveData(std::ostream &os, UT_Matrix4D v)
fpreal64 fpreal
Definition: SYS_Types.h:278
void copyFrom(const OP_NodeParms *src) override
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
static void saveData(std::ostream &os, UT_Vector4D v)
void setQuadricAttribName(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
static void saveData(std::ostream &os, UT_Vector3D v)
#define SOP_API
Definition: SOP_API.h:10
exint getNestNumParms(TempIndex idx) const override
const UT_StringHolder & getQuadricAttribName() const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
void setFile(const UT_StringHolder &val)
void setXformAttribName(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, fpreal64 v)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
Xform opXform(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
GLboolean r
Definition: glcorearb.h:1222
void setQuadric(Quadric val)
static int version()
Precision getPrecision() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static void loadData(UT_IStream &is, UT_Matrix2D &v)
UT_StringHolder opXformAttribName(const SOP_NodeVerb::CookParms &cookparms) const
void save(std::ostream &os) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void saveData(std::ostream &os, bool v)
Mode opMode(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
static void loadData(UT_IStream &is, UT_Vector3D &v)
SYS_FORCE_INLINE bool isstring() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
ParmType getNestParmType(TempIndex fieldnum) const override
GLenum src
Definition: glcorearb.h:1793
UT_StringHolder opNormalsAttribName(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
static void loadData(UT_IStream &is, UT_Vector2I &v)