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 <SOP/SOP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_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  return true;
164  }
165  bool operator!=(const SOP_RestParms &src) const
166  {
167  return !operator==(src);
168  }
174 
175 
176 
177  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
178  {
179  myMode = 0;
180  if (true)
181  graph->evalOpParm(myMode, nodeidx, "mode", time, 0);
182  myRestAttribName = "rest"_UTsh;
183  if (true)
184  graph->evalOpParm(myRestAttribName, nodeidx, "restattribname", time, 0);
185  myFile = ""_UTsh;
186  if (true && ( (true&&!((((graph->getInput(nodeidx,1)>=0)==1))||((int64(getMode())!=0)))) ) )
187  graph->evalOpParm(myFile, nodeidx, "file", time, 0);
188  myNml = 0;
189  if (true)
190  graph->evalOpParm(myNml, nodeidx, "nml", time, 0);
191  myNormalsAttribName = "rnml"_UTsh;
192  if (true && ( (true&&!(((int64(getNml())==0)))) ) )
193  graph->evalOpParm(myNormalsAttribName, nodeidx, "normalattribname", time, 0);
194  myXform = 0;
195  if (true)
196  graph->evalOpParm(myXform, nodeidx, "xform", time, 0);
197  myXformAttribName = "restxform"_UTsh;
198  if (true && ( (true&&!(((int64(getXform())==0)))) ) )
199  graph->evalOpParm(myXformAttribName, nodeidx, "xformattribname", time, 0);
200  myQuadric = 0;
201  if (true)
202  graph->evalOpParm(myQuadric, nodeidx, "quadric", time, 0);
203  myQuadricAttribName = "Pref"_UTsh;
204  if (true && ( (true&&!(((int64(getQuadric())==0)))) ) )
205  graph->evalOpParm(myQuadricAttribName, nodeidx, "quadricattribname", time, 0);
206  myPrecision = 0;
207  if (true)
208  graph->evalOpParm(myPrecision, nodeidx, "precision", time, 0);
209 
210  }
211 
212 
213  void loadFromOpSubclass(const LoadParms &loadparms) override
214  {
215  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
216  }
217 
218 
219  void copyFrom(const OP_NodeParms *src) override
220  {
221  *this = *((const SOP_RestParms *)src);
222  }
223 
224  template <typename T>
225  void
226  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
227  {
228  if (idx.size() < 1)
229  return;
230  UT_ASSERT(idx.size() == instance.size()+1);
231  if (idx.size() != instance.size()+1)
232  return;
233  switch (idx[0])
234  {
235  case 0:
236  coerceValue(value, myMode);
237  break;
238  case 1:
239  coerceValue(value, myRestAttribName);
240  break;
241  case 2:
242  coerceValue(value, myFile);
243  break;
244  case 3:
245  coerceValue(value, myNml);
246  break;
247  case 4:
248  coerceValue(value, myNormalsAttribName);
249  break;
250  case 5:
251  coerceValue(value, myXform);
252  break;
253  case 6:
254  coerceValue(value, myXformAttribName);
255  break;
256  case 7:
257  coerceValue(value, myQuadric);
258  break;
259  case 8:
260  coerceValue(value, myQuadricAttribName);
261  break;
262  case 9:
263  coerceValue(value, myPrecision);
264  break;
265 
266  }
267  }
268 
269  bool isParmColorRamp(exint idx) const override
270  {
271  switch (idx)
272  {
273 
274  }
275  return false;
276  }
277 
278  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
279  { doGetParmValue(idx, instance, value); }
280  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
281  { doGetParmValue(idx, instance, value); }
282  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
283  { doGetParmValue(idx, instance, value); }
284  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
285  { doGetParmValue(idx, instance, value); }
286  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
287  { doGetParmValue(idx, instance, value); }
288  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
289  { doGetParmValue(idx, instance, value); }
290  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
291  { doGetParmValue(idx, instance, value); }
292  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
293  { doGetParmValue(idx, instance, value); }
294  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
299  { doGetParmValue(idx, instance, value); }
300 
301  template <typename T>
302  void
303  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
304  {
305  if (idx.size() < 1)
306  return;
307  UT_ASSERT(idx.size() == instance.size()+1);
308  if (idx.size() != instance.size()+1)
309  return;
310  switch (idx[0])
311  {
312  case 0:
313  coerceValue(myMode, clampMinValue(0, clampMaxValue(2, value ) ));
314  break;
315  case 1:
316  coerceValue(myRestAttribName, ( ( value ) ));
317  break;
318  case 2:
319  coerceValue(myFile, ( ( value ) ));
320  break;
321  case 3:
322  coerceValue(myNml, clampMinValue(0, clampMaxValue(2, value ) ));
323  break;
324  case 4:
325  coerceValue(myNormalsAttribName, ( ( value ) ));
326  break;
327  case 5:
328  coerceValue(myXform, clampMinValue(0, clampMaxValue(2, value ) ));
329  break;
330  case 6:
331  coerceValue(myXformAttribName, ( ( value ) ));
332  break;
333  case 7:
334  coerceValue(myQuadric, clampMinValue(0, clampMaxValue(2, value ) ));
335  break;
336  case 8:
337  coerceValue(myQuadricAttribName, ( ( value ) ));
338  break;
339  case 9:
340  coerceValue(myPrecision, clampMinValue(0, clampMaxValue(2, value ) ));
341  break;
342 
343  }
344  }
345 
346  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
347  { doSetParmValue(idx, instance, value); }
348  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
349  { doSetParmValue(idx, instance, value); }
350  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
351  { doSetParmValue(idx, instance, value); }
352  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
353  { doSetParmValue(idx, instance, value); }
354  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
355  { doSetParmValue(idx, instance, value); }
356  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
357  { doSetParmValue(idx, instance, value); }
358  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
359  { doSetParmValue(idx, instance, value); }
360  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
361  { doSetParmValue(idx, instance, value); }
362  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
363  { doSetParmValue(idx, instance, value); }
364  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
365  { doSetParmValue(idx, instance, value); }
366  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
367  { doSetParmValue(idx, instance, value); }
368 
369  exint getNestNumParms(TempIndex idx) const override
370  {
371  if (idx.size() == 0)
372  return 10;
373  switch (idx[0])
374  {
375 
376  }
377  // Invalid
378  return 0;
379  }
380 
381  const char *getNestParmName(TempIndex fieldnum) const override
382  {
383  if (fieldnum.size() < 1)
384  return 0;
385  switch (fieldnum[0])
386  {
387  case 0:
388  return "mode";
389  case 1:
390  return "restattribname";
391  case 2:
392  return "file";
393  case 3:
394  return "nml";
395  case 4:
396  return "normalattribname";
397  case 5:
398  return "xform";
399  case 6:
400  return "xformattribname";
401  case 7:
402  return "quadric";
403  case 8:
404  return "quadricattribname";
405  case 9:
406  return "precision";
407 
408  }
409  return 0;
410  }
411 
412  ParmType getNestParmType(TempIndex fieldnum) const override
413  {
414  if (fieldnum.size() < 1)
415  return PARM_UNSUPPORTED;
416  switch (fieldnum[0])
417  {
418  case 0:
419  return PARM_INTEGER;
420  case 1:
421  return PARM_STRING;
422  case 2:
423  return PARM_STRING;
424  case 3:
425  return PARM_INTEGER;
426  case 4:
427  return PARM_STRING;
428  case 5:
429  return PARM_INTEGER;
430  case 6:
431  return PARM_STRING;
432  case 7:
433  return PARM_INTEGER;
434  case 8:
435  return PARM_STRING;
436  case 9:
437  return PARM_INTEGER;
438 
439  }
440  return PARM_UNSUPPORTED;
441  }
442 
443  // Boiler plate to load individual types.
444  static void loadData(UT_IStream &is, int64 &v)
445  { is.bread(&v, 1); }
446  static void loadData(UT_IStream &is, bool &v)
447  { int64 iv; is.bread(&iv, 1); v = iv; }
448  static void loadData(UT_IStream &is, fpreal64 &v)
449  { is.bread<fpreal64>(&v, 1); }
450  static void loadData(UT_IStream &is, UT_Vector2D &v)
451  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
452  static void loadData(UT_IStream &is, UT_Vector3D &v)
453  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
454  is.bread<fpreal64>(&v.z(), 1); }
455  static void loadData(UT_IStream &is, UT_Vector4D &v)
456  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
457  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
458  static void loadData(UT_IStream &is, UT_Matrix2D &v)
459  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
460  static void loadData(UT_IStream &is, UT_Matrix3D &v)
461  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
462  static void loadData(UT_IStream &is, UT_Matrix4D &v)
463  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
464  static void loadData(UT_IStream &is, UT_Vector2I &v)
465  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
466  static void loadData(UT_IStream &is, UT_Vector3I &v)
467  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
468  is.bread<int64>(&v.z(), 1); }
469  static void loadData(UT_IStream &is, UT_Vector4I &v)
470  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
471  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
473  { is.bread(v); }
475  { UT_StringHolder rampdata;
476  loadData(is, rampdata);
477  if (rampdata.isstring())
478  {
479  v.reset(new UT_Ramp());
480  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
481  v->load(istr);
482  }
483  else v.reset();
484  }
487  loadData(is, data);
488  if (data.isstring())
489  {
490  // Find the data type.
491  const char *colon = UT_StringWrap(data).findChar(':');
492  if (colon)
493  {
494  int typelen = colon - data.buffer();
496  type.strncpy(data.buffer(), typelen);
497  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
498 
499  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
500  }
501  }
502  else v.reset();
503  }
504 
505  static void saveData(std::ostream &os, int64 v)
506  { UTwrite(os, &v); }
507  static void saveData(std::ostream &os, bool v)
508  { int64 iv = v; UTwrite(os, &iv); }
509  static void saveData(std::ostream &os, fpreal64 v)
510  { UTwrite<fpreal64>(os, &v); }
511  static void saveData(std::ostream &os, UT_Vector2D v)
512  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
513  static void saveData(std::ostream &os, UT_Vector3D v)
514  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
515  UTwrite<fpreal64>(os, &v.z()); }
516  static void saveData(std::ostream &os, UT_Vector4D v)
517  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
518  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
519  static void saveData(std::ostream &os, UT_Matrix2D v)
521  static void saveData(std::ostream &os, UT_Matrix3D v)
523  static void saveData(std::ostream &os, UT_Matrix4D v)
525  static void saveData(std::ostream &os, UT_StringHolder s)
526  { UT_StringWrap(s).saveBinary(os); }
527  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
529  UT_OStringStream ostr;
530  if (s) s->save(ostr);
531  result = ostr.str();
532  saveData(os, result);
533  }
534  static void saveData(std::ostream &os, PRM_DataItemHandle s)
536  UT_OStringStream ostr;
537  if (s)
538  {
539  ostr << s->getDataTypeToken();
540  ostr << ":";
541  s->saveBinary(ostr);
542  }
543  result = ostr.str();
544  saveData(os, result);
545  }
546 
547 
548  void save(std::ostream &os) const
549  {
550  int32 v = version();
551  UTwrite(os, &v);
552  saveData(os, myMode);
553  saveData(os, myRestAttribName);
554  saveData(os, myFile);
555  saveData(os, myNml);
556  saveData(os, myNormalsAttribName);
557  saveData(os, myXform);
558  saveData(os, myXformAttribName);
559  saveData(os, myQuadric);
560  saveData(os, myQuadricAttribName);
561  saveData(os, myPrecision);
562 
563  }
564 
565  bool load(UT_IStream &is)
566  {
567  int32 v;
568  is.bread(&v, 1);
569  if (version() != v)
570  {
571  // Fail incompatible versions
572  return false;
573  }
574  loadData(is, myMode);
575  loadData(is, myRestAttribName);
576  loadData(is, myFile);
577  loadData(is, myNml);
578  loadData(is, myNormalsAttribName);
579  loadData(is, myXform);
580  loadData(is, myXformAttribName);
581  loadData(is, myQuadric);
582  loadData(is, myQuadricAttribName);
583  loadData(is, myPrecision);
584 
585  return true;
586  }
587 
588  Mode getMode() const { return Mode(myMode); }
589  void setMode(Mode val) { myMode = int64(val); }
590  Mode opMode(const SOP_NodeVerb::CookParms &cookparms) const
591  {
592  SOP_Node *thissop = cookparms.getNode();
593  if (!thissop) return getMode();
594  int64 result;
595  OP_Utils::evalOpParm(result, thissop, "mode", cookparms.getCookTime(), 0);
596  return Mode(result);
597  }
598  const UT_StringHolder & getRestAttribName() const { return myRestAttribName; }
599  void setRestAttribName(const UT_StringHolder & val) { myRestAttribName = val; }
601  {
602  SOP_Node *thissop = cookparms.getNode();
603  if (!thissop) return getRestAttribName();
605  OP_Utils::evalOpParm(result, thissop, "restattribname", cookparms.getCookTime(), 0);
606  return result;
607  }
608  const UT_StringHolder & getFile() const { return myFile; }
609  void setFile(const UT_StringHolder & val) { myFile = val; }
611  {
612  SOP_Node *thissop = cookparms.getNode();
613  if (!thissop) return getFile();
615  OP_Utils::evalOpParm(result, thissop, "file", cookparms.getCookTime(), 0);
616  return result;
617  }
618  Nml getNml() const { return Nml(myNml); }
619  void setNml(Nml val) { myNml = int64(val); }
620  Nml opNml(const SOP_NodeVerb::CookParms &cookparms) const
621  {
622  SOP_Node *thissop = cookparms.getNode();
623  if (!thissop) return getNml();
624  int64 result;
625  OP_Utils::evalOpParm(result, thissop, "nml", cookparms.getCookTime(), 0);
626  return Nml(result);
627  }
628  const UT_StringHolder & getNormalsAttribName() const { return myNormalsAttribName; }
629  void setNormalsAttribName(const UT_StringHolder & val) { myNormalsAttribName = val; }
631  {
632  SOP_Node *thissop = cookparms.getNode();
633  if (!thissop) return getNormalsAttribName();
635  OP_Utils::evalOpParm(result, thissop, "normalattribname", cookparms.getCookTime(), 0);
636  return result;
637  }
638  Xform getXform() const { return Xform(myXform); }
639  void setXform(Xform val) { myXform = int64(val); }
640  Xform opXform(const SOP_NodeVerb::CookParms &cookparms) const
641  {
642  SOP_Node *thissop = cookparms.getNode();
643  if (!thissop) return getXform();
644  int64 result;
645  OP_Utils::evalOpParm(result, thissop, "xform", cookparms.getCookTime(), 0);
646  return Xform(result);
647  }
648  const UT_StringHolder & getXformAttribName() const { return myXformAttribName; }
649  void setXformAttribName(const UT_StringHolder & val) { myXformAttribName = val; }
651  {
652  SOP_Node *thissop = cookparms.getNode();
653  if (!thissop) return getXformAttribName();
655  OP_Utils::evalOpParm(result, thissop, "xformattribname", cookparms.getCookTime(), 0);
656  return result;
657  }
658  Quadric getQuadric() const { return Quadric(myQuadric); }
659  void setQuadric(Quadric val) { myQuadric = int64(val); }
660  Quadric opQuadric(const SOP_NodeVerb::CookParms &cookparms) const
661  {
662  SOP_Node *thissop = cookparms.getNode();
663  if (!thissop) return getQuadric();
664  int64 result;
665  OP_Utils::evalOpParm(result, thissop, "quadric", cookparms.getCookTime(), 0);
666  return Quadric(result);
667  }
668  const UT_StringHolder & getQuadricAttribName() const { return myQuadricAttribName; }
669  void setQuadricAttribName(const UT_StringHolder & val) { myQuadricAttribName = val; }
671  {
672  SOP_Node *thissop = cookparms.getNode();
673  if (!thissop) return getQuadricAttribName();
675  OP_Utils::evalOpParm(result, thissop, "quadricattribname", cookparms.getCookTime(), 0);
676  return result;
677  }
678  Precision getPrecision() const { return Precision(myPrecision); }
679  void setPrecision(Precision val) { myPrecision = int64(val); }
681  {
682  SOP_Node *thissop = cookparms.getNode();
683  if (!thissop) return getPrecision();
684  int64 result;
685  OP_Utils::evalOpParm(result, thissop, "precision", cookparms.getCookTime(), 0);
686  return Precision(result);
687  }
688 
689 private:
690  int64 myMode;
691  UT_StringHolder myRestAttribName;
692  UT_StringHolder myFile;
693  int64 myNml;
694  UT_StringHolder myNormalsAttribName;
695  int64 myXform;
696  UT_StringHolder myXformAttribName;
697  int64 myQuadric;
698  UT_StringHolder myQuadricAttribName;
699  int64 myPrecision;
700 
701 };
void setRestAttribName(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
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:62
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:613
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)
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
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
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:296
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:277
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:92
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
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:361
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:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
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
type
Definition: core.h:1059
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
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)