HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_AttribCreate-2.0.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_AttribCreate_2_0Enums
24 {
25  enum class Grouptype
26  {
27  GUESS = 0,
28  VERTICES,
29  EDGES,
30  POINTS,
31  PRIMS
32  };
33 
35  getToken(Grouptype enum_value)
36  {
37  using namespace UT::Literal;
38  switch (enum_value) {
39  case Grouptype::GUESS: return "guess"_sh;
40  case Grouptype::VERTICES: return "vertices"_sh;
41  case Grouptype::EDGES: return "edges"_sh;
42  case Grouptype::POINTS: return "points"_sh;
43  case Grouptype::PRIMS: return "prims"_sh;
44  default: UT_ASSERT(false); return ""_sh;
45  }
46  }
47 
48  enum class Existing
49  {
50  ERROR = 0,
51  WARN,
52  REPLACE,
53  BETTER
54  };
55 
57  getToken(Existing enum_value)
58  {
59  using namespace UT::Literal;
60  switch (enum_value) {
61  case Existing::ERROR: return "error"_sh;
62  case Existing::WARN: return "warn"_sh;
63  case Existing::REPLACE: return "replace"_sh;
64  case Existing::BETTER: return "better"_sh;
65  default: UT_ASSERT(false); return ""_sh;
66  }
67  }
68 
69  enum class Class
70  {
71  DETAIL = 0,
72  PRIMITIVE,
73  POINT,
74  VERTEX
75  };
76 
78  getToken(Class enum_value)
79  {
80  using namespace UT::Literal;
81  switch (enum_value) {
82  case Class::DETAIL: return "detail"_sh;
83  case Class::PRIMITIVE: return "primitive"_sh;
84  case Class::POINT: return "point"_sh;
85  case Class::VERTEX: return "vertex"_sh;
86  default: UT_ASSERT(false); return ""_sh;
87  }
88  }
89 
90  enum class Type
91  {
92  FLOAT = 0,
93  INT,
94  VECTOR,
95  INDEX,
96  FLOATARRAY,
97  INTARRAY,
99  DICT,
100  DICTARRAY
101  };
102 
104  getToken(Type enum_value)
105  {
106  using namespace UT::Literal;
107  switch (enum_value) {
108  case Type::FLOAT: return "float"_sh;
109  case Type::INT: return "int"_sh;
110  case Type::VECTOR: return "vector"_sh;
111  case Type::INDEX: return "index"_sh;
112  case Type::FLOATARRAY: return "floatarray"_sh;
113  case Type::INTARRAY: return "intarray"_sh;
114  case Type::STRINGARRAY: return "stringarray"_sh;
115  case Type::DICT: return "dict"_sh;
116  case Type::DICTARRAY: return "dictarray"_sh;
117  default: UT_ASSERT(false); return ""_sh;
118  }
119  }
120 
121  enum class Typeinfo
122  {
123  GUESS = 0,
124  NONE,
125  POINT,
126  VECTOR,
127  NORMAL,
128  COLOR,
129  QUATERNION,
130  TRANFORM,
132  };
133 
135  getToken(Typeinfo enum_value)
136  {
137  using namespace UT::Literal;
138  switch (enum_value) {
139  case Typeinfo::GUESS: return "guess"_sh;
140  case Typeinfo::NONE: return "none"_sh;
141  case Typeinfo::POINT: return "point"_sh;
142  case Typeinfo::VECTOR: return "vector"_sh;
143  case Typeinfo::NORMAL: return "normal"_sh;
144  case Typeinfo::COLOR: return "color"_sh;
145  case Typeinfo::QUATERNION: return "quaternion"_sh;
146  case Typeinfo::TRANFORM: return "tranform"_sh;
147  case Typeinfo::TEXTURECOORD: return "texturecoord"_sh;
148  default: UT_ASSERT(false); return ""_sh;
149  }
150  }
151 
152  enum class Precision
153  {
154  _8 = 0,
155  _16,
156  _32,
157  _64,
158  AUTO
159  };
160 
162  getToken(Precision enum_value)
163  {
164  using namespace UT::Literal;
165  switch (enum_value) {
166  case Precision::_8: return "8"_sh;
167  case Precision::_16: return "16"_sh;
168  case Precision::_32: return "32"_sh;
169  case Precision::_64: return "64"_sh;
170  case Precision::AUTO: return "auto"_sh;
171  default: UT_ASSERT(false); return ""_sh;
172  }
173  }
174 
175 }
176 
177 
179 {
180 public:
181  static int version() { return 1; }
182  struct Numattr
183  {
184  bool enable;
197  bool uselocal;
200 
201 
203  {
204  enable = true;
205  name = "attribute#"_UTsh;
206  existing = 3;
207  createvarmap = false;
208  varname = ""_UTsh;
209  _class = 2;
210  savetoinfo = false;
211  type = 0;
212  typeinfo = 0;
213  precision = 4;
214  size = 1;
215  defaultv = UT_Vector4D(0,0,0,0);
216  writevalues = true;
217  uselocal = true;
218  valuev = UT_Vector4D(0,0,0,0);
219  string = ""_UTsh;
220 
221  }
222 
223  bool operator==(const Numattr &src) const
224  {
225  if (enable != src.enable) return false;
226  if (name != src.name) return false;
227  if (existing != src.existing) return false;
228  if (createvarmap != src.createvarmap) return false;
229  if (varname != src.varname) return false;
230  if (_class != src._class) return false;
231  if (savetoinfo != src.savetoinfo) return false;
232  if (type != src.type) return false;
233  if (typeinfo != src.typeinfo) return false;
234  if (precision != src.precision) return false;
235  if (size != src.size) return false;
236  if (defaultv != src.defaultv) return false;
237  if (writevalues != src.writevalues) return false;
238  if (uselocal != src.uselocal) return false;
239  if (valuev != src.valuev) return false;
240  if (string != src.string) return false;
241 
242  return true;
243  }
244  bool operator!=(const Numattr &src) const
245  {
246  return !operator==(src);
247  }
248 
249  };
250 
252  {
254 
255  buf.strcat("[ ");
256  for (int i = 0; i < list.entries(); i++)
257  {
258  if (i)
259  buf.strcat(", ");
260  buf.strcat("( ");
261  buf.append("");
262  buf.appendSprintf("%s", (list(i).enable) ? "true" : "false");
263  buf.append(", ");
264  { UT_String tmp; tmp = UT_StringWrap(list(i).name).makeQuotedString('"'); buf.strcat(tmp); }
265  buf.append(", ");
266  buf.appendSprintf("%d", (int) list(i).existing);
267  buf.append(", ");
268  buf.appendSprintf("%s", (list(i).createvarmap) ? "true" : "false");
269  buf.append(", ");
270  { UT_String tmp; tmp = UT_StringWrap(list(i).varname).makeQuotedString('"'); buf.strcat(tmp); }
271  buf.append(", ");
272  buf.appendSprintf("%d", (int) list(i)._class);
273  buf.append(", ");
274  buf.appendSprintf("%s", (list(i).savetoinfo) ? "true" : "false");
275  buf.append(", ");
276  buf.appendSprintf("%d", (int) list(i).type);
277  buf.append(", ");
278  buf.appendSprintf("%d", (int) list(i).typeinfo);
279  buf.append(", ");
280  buf.appendSprintf("%d", (int) list(i).precision);
281  buf.append(", ");
282  buf.appendSprintf("%d", (int) list(i).size);
283  buf.append(", ");
284  buf.appendSprintf("(%f, %f, %f, %f)", list(i).defaultv.x(), list(i).defaultv.y(), list(i).defaultv.z(), list(i).defaultv.w());
285  buf.append(", ");
286  buf.appendSprintf("%s", (list(i).writevalues) ? "true" : "false");
287  buf.append(", ");
288  buf.appendSprintf("%s", (list(i).uselocal) ? "true" : "false");
289  buf.append(", ");
290  buf.appendSprintf("(%f, %f, %f, %f)", list(i).valuev.x(), list(i).valuev.y(), list(i).valuev.z(), list(i).valuev.w());
291  buf.append(", ");
292  { UT_String tmp; tmp = UT_StringWrap(list(i).string).makeQuotedString('"'); buf.strcat(tmp); }
293 
294  buf.strcat(" )");
295  }
296  buf.strcat(" ]");
297 
299  return result;
300  }
301 
303  {
304  myGroup = ""_UTsh;
305  myGrouptype = 0;
306  myEncodenames = false;
307  myNumattr.setSize(1);
308 
309  }
310 
311  explicit SOP_AttribCreate_2_0Parms(const SOP_AttribCreate_2_0Parms &) = default;
314  SOP_AttribCreate_2_0Parms &operator=(SOP_AttribCreate_2_0Parms &&) noexcept = default;
315 
317 
319  {
320  if (myGroup != src.myGroup) return false;
321  if (myGrouptype != src.myGrouptype) return false;
322  if (myEncodenames != src.myEncodenames) return false;
323  if (myNumattr != src.myNumattr) return false;
324 
325 
326  if (baseGetSignature() != src.baseGetSignature()) return false;
327 
328  return true;
329  }
331  {
332  return !operator==(src);
333  }
340 
341 
342 
343  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
344  {
345  myGroup = ""_UTsh;
346  if (true)
347  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
348  myGrouptype = 0;
349  if (true)
350  graph->evalOpParm(myGrouptype, nodeidx, "grouptype", time, graph->isDirect()?nullptr:depnode);
351  myEncodenames = false;
352  if (true)
353  graph->evalOpParm(myEncodenames, nodeidx, "encodenames", time, graph->isDirect()?nullptr:depnode);
354  if (true)
355  {
356  int64 length = 0;
357  graph->evalOpParm(length, nodeidx, "numattr", time, graph->isDirect()?nullptr:depnode);
358  if (length < 0) length = 0;
359  myNumattr.setSize(length);
360  for (exint i = 0; i < length; i++)
361  {
362  int parmidx[1];
363  int offsets[1];
364  parmidx[0] = i+1;
365  offsets[0] = 1;
366  auto && _curentry = myNumattr(i);
367  (void) _curentry;
368  _curentry.enable = true;
369  if (true)
370  graph->evalOpParmInst(_curentry.enable, nodeidx, "enable#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
371  _curentry.name = "attribute#"_UTsh;
372  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
373  graph->evalOpParmInst(_curentry.name, nodeidx, "name#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
374  _curentry.existing = 3;
375  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
376  graph->evalOpParmInst(_curentry.existing, nodeidx, "existing#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
377  _curentry.createvarmap = false;
378  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
379  graph->evalOpParmInst(_curentry.createvarmap, nodeidx, "createvarmap#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
380  _curentry.varname = ""_UTsh;
381  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.createvarmap==0)))) ) )
382  graph->evalOpParmInst(_curentry.varname, nodeidx, "varname#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
383  _curentry._class = 2;
384  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
385  graph->evalOpParmInst(_curentry._class, nodeidx, "class#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
386  _curentry.savetoinfo = false;
387  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry._class!=0)))) ) )
388  graph->evalOpParmInst(_curentry.savetoinfo, nodeidx, "savetoinfo#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
389  _curentry.type = 0;
390  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
391  graph->evalOpParmInst(_curentry.type, nodeidx, "type#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
392  _curentry.typeinfo = 0;
393  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.type!=0)&&(_curentry.type!=4)))) ) )
394  graph->evalOpParmInst(_curentry.typeinfo, nodeidx, "typeinfo#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
395  _curentry.precision = 4;
396  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.type==3))||((_curentry.type==6))||((_curentry.type==7))||((_curentry.type==8)))) ) )
397  graph->evalOpParmInst(_curentry.precision, nodeidx, "precision#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
398  _curentry.size = 1;
399  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.type==2))||((_curentry.type==3)))) ) )
400  graph->evalOpParmInst(_curentry.size, nodeidx, "size#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
401  _curentry.defaultv = UT_Vector4D(0,0,0,0);
402  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.type==3))||((_curentry.type==4))||((_curentry.type==5))||((_curentry.type==6))||((_curentry.type==7))||((_curentry.type==8)))) ) )
403  graph->evalOpParmInst(_curentry.defaultv, nodeidx, "default#v", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
404  _curentry.writevalues = true;
405  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.type==4))||((_curentry.type==5))||((_curentry.type==6))||((_curentry.type==7))||((_curentry.type==8)))) ) )
406  graph->evalOpParmInst(_curentry.writevalues, nodeidx, "writevalues#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
407  _curentry.uselocal = true;
408  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.writevalues==0))||((_curentry.type==4))||((_curentry.type==5))||((_curentry.type==6))||((_curentry.type==7))||((_curentry.type==8)))) ) )
409  graph->evalOpParmInst(_curentry.uselocal, nodeidx, "uselocal#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
410  _curentry.valuev = UT_Vector4D(0,0,0,0);
411  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.writevalues==0))||((_curentry.type!=0)&&(_curentry.type!=1)&&(_curentry.type!=2)))) ) )
412  graph->evalOpParmInst(_curentry.valuev, nodeidx, "value#v", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
413  _curentry.string = ""_UTsh;
414  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.writevalues==0))||((_curentry.type!=3)))) ) )
415  graph->evalOpParmInst(_curentry.string, nodeidx, "string#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
416 
417  }
418  }
419  else
420  myNumattr.clear();
421 
422  }
423 
424 
425  void loadFromOpSubclass(const LoadParms &loadparms) override
426  {
427  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
428  }
429 
430 
431  void copyFrom(const OP_NodeParms *src) override
432  {
433  *this = *((const SOP_AttribCreate_2_0Parms *)src);
434  }
435 
436  template <typename T>
437  void
438  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
439  {
440  if (idx.size() < 1)
441  return;
442  UT_ASSERT(idx.size() == instance.size()+1);
443  if (idx.size() != instance.size()+1)
444  return;
445  switch (idx[0])
446  {
447  case 0:
448  coerceValue(value, myGroup);
449  break;
450  case 1:
451  coerceValue(value, myGrouptype);
452  break;
453  case 2:
454  coerceValue(value, myEncodenames);
455  break;
456  case 3:
457  if (idx.size() == 1)
458  coerceValue(value, myNumattr.entries());
459  else if (instance[0] < myNumattr.entries())
460  {
461  auto && _data = myNumattr(instance[0]);
462  switch (idx[1])
463  {
464  case 0:
465  coerceValue(value, _data.enable);
466  break;
467  case 1:
468  coerceValue(value, _data.name);
469  break;
470  case 2:
471  coerceValue(value, _data.existing);
472  break;
473  case 3:
474  coerceValue(value, _data.createvarmap);
475  break;
476  case 4:
477  coerceValue(value, _data.varname);
478  break;
479  case 5:
480  coerceValue(value, _data._class);
481  break;
482  case 6:
483  coerceValue(value, _data.savetoinfo);
484  break;
485  case 7:
486  coerceValue(value, _data.type);
487  break;
488  case 8:
489  coerceValue(value, _data.typeinfo);
490  break;
491  case 9:
492  coerceValue(value, _data.precision);
493  break;
494  case 10:
495  coerceValue(value, _data.size);
496  break;
497  case 11:
498  coerceValue(value, _data.defaultv);
499  break;
500  case 12:
501  coerceValue(value, _data.writevalues);
502  break;
503  case 13:
504  coerceValue(value, _data.uselocal);
505  break;
506  case 14:
507  coerceValue(value, _data.valuev);
508  break;
509  case 15:
510  coerceValue(value, _data.string);
511  break;
512 
513  }
514  }
515  break;
516 
517  }
518  }
519 
520  bool isParmColorRamp(exint idx) const override
521  {
522  switch (idx)
523  {
524 
525  }
526  return false;
527  }
528 
529  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
530  { doGetParmValue(idx, instance, value); }
531  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
532  { doGetParmValue(idx, instance, value); }
533  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
534  { doGetParmValue(idx, instance, value); }
535  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
536  { doGetParmValue(idx, instance, value); }
537  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
538  { doGetParmValue(idx, instance, value); }
539  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
540  { doGetParmValue(idx, instance, value); }
541  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
542  { doGetParmValue(idx, instance, value); }
543  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
544  { doGetParmValue(idx, instance, value); }
545  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
546  { doGetParmValue(idx, instance, value); }
547  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
548  { doGetParmValue(idx, instance, value); }
549  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
550  { doGetParmValue(idx, instance, value); }
551 
552  template <typename T>
553  void
554  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
555  {
556  if (idx.size() < 1)
557  return;
558  UT_ASSERT(idx.size() == instance.size()+1);
559  if (idx.size() != instance.size()+1)
560  return;
561  switch (idx[0])
562  {
563  case 0:
564  coerceValue(myGroup, ( ( value ) ));
565  break;
566  case 1:
567  coerceValue(myGrouptype, clampMinValue(0, clampMaxValue(4, value ) ));
568  break;
569  case 2:
570  coerceValue(myEncodenames, ( ( value ) ));
571  break;
572  case 3:
573  if (idx.size() == 1)
574  {
575  exint newsize;
576  coerceValue(newsize, value);
577  if (newsize < 0) newsize = 0;
578  myNumattr.setSize(newsize);
579  }
580  else
581  {
582  if (instance[0] < 0)
583  return;
584  myNumattr.setSizeIfNeeded(instance[0]+1);
585  auto && _data = myNumattr(instance[0]);
586  switch (idx[1])
587  {
588  case 0:
589  coerceValue(_data.enable, value);
590  break;
591  case 1:
592  coerceValue(_data.name, value);
593  break;
594  case 2:
595  coerceValue(_data.existing, value);
596  break;
597  case 3:
598  coerceValue(_data.createvarmap, value);
599  break;
600  case 4:
601  coerceValue(_data.varname, value);
602  break;
603  case 5:
604  coerceValue(_data._class, value);
605  break;
606  case 6:
607  coerceValue(_data.savetoinfo, value);
608  break;
609  case 7:
610  coerceValue(_data.type, value);
611  break;
612  case 8:
613  coerceValue(_data.typeinfo, value);
614  break;
615  case 9:
616  coerceValue(_data.precision, value);
617  break;
618  case 10:
619  coerceValue(_data.size, value);
620  break;
621  case 11:
622  coerceValue(_data.defaultv, value);
623  break;
624  case 12:
625  coerceValue(_data.writevalues, value);
626  break;
627  case 13:
628  coerceValue(_data.uselocal, value);
629  break;
630  case 14:
631  coerceValue(_data.valuev, value);
632  break;
633  case 15:
634  coerceValue(_data.string, value);
635  break;
636 
637  }
638  }
639  break;
640 
641  }
642  }
643 
644  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
645  { doSetParmValue(idx, instance, value); }
646  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
647  { doSetParmValue(idx, instance, value); }
648  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
649  { doSetParmValue(idx, instance, value); }
650  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
651  { doSetParmValue(idx, instance, value); }
652  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
653  { doSetParmValue(idx, instance, value); }
654  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
655  { doSetParmValue(idx, instance, value); }
656  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
657  { doSetParmValue(idx, instance, value); }
658  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
659  { doSetParmValue(idx, instance, value); }
660  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
661  { doSetParmValue(idx, instance, value); }
662  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
663  { doSetParmValue(idx, instance, value); }
664  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
665  { doSetParmValue(idx, instance, value); }
666 
667  exint getNestNumParms(TempIndex idx) const override
668  {
669  if (idx.size() == 0)
670  return 4;
671  switch (idx[0])
672  {
673  case 3:
674  return 16;
675 
676  }
677  // Invalid
678  return 0;
679  }
680 
681  const char *getNestParmName(TempIndex fieldnum) const override
682  {
683  if (fieldnum.size() < 1)
684  return 0;
685  switch (fieldnum[0])
686  {
687  case 0:
688  return "group";
689  case 1:
690  return "grouptype";
691  case 2:
692  return "encodenames";
693  case 3:
694  if (fieldnum.size() == 1)
695  return "numattr";
696  switch (fieldnum[1])
697  {
698  case 0:
699  return "enable#";
700  case 1:
701  return "name#";
702  case 2:
703  return "existing#";
704  case 3:
705  return "createvarmap#";
706  case 4:
707  return "varname#";
708  case 5:
709  return "class#";
710  case 6:
711  return "savetoinfo#";
712  case 7:
713  return "type#";
714  case 8:
715  return "typeinfo#";
716  case 9:
717  return "precision#";
718  case 10:
719  return "size#";
720  case 11:
721  return "default#v";
722  case 12:
723  return "writevalues#";
724  case 13:
725  return "uselocal#";
726  case 14:
727  return "value#v";
728  case 15:
729  return "string#";
730 
731  }
732  return 0;
733 
734  }
735  return 0;
736  }
737 
738  ParmType getNestParmType(TempIndex fieldnum) const override
739  {
740  if (fieldnum.size() < 1)
741  return PARM_UNSUPPORTED;
742  switch (fieldnum[0])
743  {
744  case 0:
745  return PARM_STRING;
746  case 1:
747  return PARM_INTEGER;
748  case 2:
749  return PARM_INTEGER;
750  case 3:
751  if (fieldnum.size() == 1)
752  return PARM_MULTIPARM;
753  switch (fieldnum[1])
754  {
755  case 0:
756  return PARM_INTEGER;
757  case 1:
758  return PARM_STRING;
759  case 2:
760  return PARM_INTEGER;
761  case 3:
762  return PARM_INTEGER;
763  case 4:
764  return PARM_STRING;
765  case 5:
766  return PARM_INTEGER;
767  case 6:
768  return PARM_INTEGER;
769  case 7:
770  return PARM_INTEGER;
771  case 8:
772  return PARM_INTEGER;
773  case 9:
774  return PARM_INTEGER;
775  case 10:
776  return PARM_INTEGER;
777  case 11:
778  return PARM_VECTOR4;
779  case 12:
780  return PARM_INTEGER;
781  case 13:
782  return PARM_INTEGER;
783  case 14:
784  return PARM_VECTOR4;
785  case 15:
786  return PARM_STRING;
787 
788  }
789  return PARM_UNSUPPORTED;
790 
791  }
792  return PARM_UNSUPPORTED;
793  }
794 
795  // Boiler plate to load individual types.
796  static void loadData(UT_IStream &is, int64 &v)
797  { is.bread(&v, 1); }
798  static void loadData(UT_IStream &is, bool &v)
799  { int64 iv; is.bread(&iv, 1); v = iv; }
800  static void loadData(UT_IStream &is, fpreal64 &v)
801  { is.bread<fpreal64>(&v, 1); }
802  static void loadData(UT_IStream &is, UT_Vector2D &v)
803  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
804  static void loadData(UT_IStream &is, UT_Vector3D &v)
805  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
806  is.bread<fpreal64>(&v.z(), 1); }
807  static void loadData(UT_IStream &is, UT_Vector4D &v)
808  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
809  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
810  static void loadData(UT_IStream &is, UT_Matrix2D &v)
811  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
812  static void loadData(UT_IStream &is, UT_Matrix3D &v)
813  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
814  static void loadData(UT_IStream &is, UT_Matrix4D &v)
815  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
816  static void loadData(UT_IStream &is, UT_Vector2I &v)
817  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
818  static void loadData(UT_IStream &is, UT_Vector3I &v)
819  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
820  is.bread<int64>(&v.z(), 1); }
821  static void loadData(UT_IStream &is, UT_Vector4I &v)
822  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
823  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
825  { is.bread(v); }
827  { UT_StringHolder rampdata;
828  loadData(is, rampdata);
829  if (rampdata.isstring())
830  {
831  v.reset(new UT_Ramp());
832  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
833  v->load(istr);
834  }
835  else v.reset();
836  }
839  loadData(is, data);
840  if (data.isstring())
841  {
842  // Find the data type.
843  const char *colon = UT_StringWrap(data).findChar(':');
844  if (colon)
845  {
846  int typelen = colon - data.buffer();
848  type.strncpy(data.buffer(), typelen);
849  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
850 
851  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
852  }
853  }
854  else v.reset();
855  }
856 
857  static void saveData(std::ostream &os, int64 v)
858  { UTwrite(os, &v); }
859  static void saveData(std::ostream &os, bool v)
860  { int64 iv = v; UTwrite(os, &iv); }
861  static void saveData(std::ostream &os, fpreal64 v)
862  { UTwrite<fpreal64>(os, &v); }
863  static void saveData(std::ostream &os, UT_Vector2D v)
864  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
865  static void saveData(std::ostream &os, UT_Vector3D v)
866  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
867  UTwrite<fpreal64>(os, &v.z()); }
868  static void saveData(std::ostream &os, UT_Vector4D v)
869  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
870  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
871  static void saveData(std::ostream &os, UT_Matrix2D v)
873  static void saveData(std::ostream &os, UT_Matrix3D v)
875  static void saveData(std::ostream &os, UT_Matrix4D v)
877  static void saveData(std::ostream &os, UT_StringHolder s)
878  { UT_StringWrap(s).saveBinary(os); }
879  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
881  UT_OStringStream ostr;
882  if (s) s->save(ostr);
883  result = ostr.str();
884  saveData(os, result);
885  }
886  static void saveData(std::ostream &os, PRM_DataItemHandle s)
888  UT_OStringStream ostr;
889  if (s)
890  {
891  ostr << s->getDataTypeToken();
892  ostr << ":";
893  s->saveBinary(ostr);
894  }
895  result = ostr.str();
896  saveData(os, result);
897  }
898 
899 
900  void save(std::ostream &os) const
901  {
902  int32 v = version();
903  UTwrite(os, &v);
904  saveData(os, myGroup);
905  saveData(os, myGrouptype);
906  saveData(os, myEncodenames);
907  {
908  int64 length = myNumattr.entries();
909  UTwrite(os, &length);
910  for (exint i = 0; i < length; i++)
911  {
912  auto && _curentry = myNumattr(i);
913  (void) _curentry;
914  saveData(os, _curentry.enable);
915  saveData(os, _curentry.name);
916  saveData(os, _curentry.existing);
917  saveData(os, _curentry.createvarmap);
918  saveData(os, _curentry.varname);
919  saveData(os, _curentry._class);
920  saveData(os, _curentry.savetoinfo);
921  saveData(os, _curentry.type);
922  saveData(os, _curentry.typeinfo);
923  saveData(os, _curentry.precision);
924  saveData(os, _curentry.size);
925  saveData(os, _curentry.defaultv);
926  saveData(os, _curentry.writevalues);
927  saveData(os, _curentry.uselocal);
928  saveData(os, _curentry.valuev);
929  saveData(os, _curentry.string);
930 
931  }
932  }
933 
934  }
935 
936  bool load(UT_IStream &is)
937  {
938  int32 v;
939  is.bread(&v, 1);
940  if (version() != v)
941  {
942  // Fail incompatible versions
943  return false;
944  }
945  loadData(is, myGroup);
946  loadData(is, myGrouptype);
947  loadData(is, myEncodenames);
948  {
949  int64 length;
950  is.read(&length, 1);
951  myNumattr.setSize(length);
952  for (exint i = 0; i < length; i++)
953  {
954  auto && _curentry = myNumattr(i);
955  (void) _curentry;
956  loadData(is, _curentry.enable);
957  loadData(is, _curentry.name);
958  loadData(is, _curentry.existing);
959  loadData(is, _curentry.createvarmap);
960  loadData(is, _curentry.varname);
961  loadData(is, _curentry._class);
962  loadData(is, _curentry.savetoinfo);
963  loadData(is, _curentry.type);
964  loadData(is, _curentry.typeinfo);
965  loadData(is, _curentry.precision);
966  loadData(is, _curentry.size);
967  loadData(is, _curentry.defaultv);
968  loadData(is, _curentry.writevalues);
969  loadData(is, _curentry.uselocal);
970  loadData(is, _curentry.valuev);
971  loadData(is, _curentry.string);
972 
973  }
974  }
975 
976  return true;
977  }
978 
979  const UT_StringHolder & getGroup() const { return myGroup; }
980  void setGroup(const UT_StringHolder & val) { myGroup = val; }
982  {
983  SOP_Node *thissop = cookparms.getNode();
984  if (!thissop) return getGroup();
986  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
987  return result;
988  }
989  Grouptype getGrouptype() const { return Grouptype(myGrouptype); }
990  void setGrouptype(Grouptype val) { myGrouptype = int64(val); }
992  {
993  SOP_Node *thissop = cookparms.getNode();
994  if (!thissop) return getGrouptype();
995  int64 result;
996  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
997  return Grouptype(result);
998  }
999  bool getEncodenames() const { return myEncodenames; }
1000  void setEncodenames(bool val) { myEncodenames = val; }
1001  bool opEncodenames(const SOP_NodeVerb::CookParms &cookparms) const
1002  {
1003  SOP_Node *thissop = cookparms.getNode();
1004  if (!thissop) return getEncodenames();
1005  bool result;
1006  OP_Utils::evalOpParm(result, thissop, "encodenames", cookparms.getCookTime(), 0);
1007  return result;
1008  }
1009  const UT_Array<Numattr> &getNumattr() const { return myNumattr; }
1010 void setNumattr(const UT_Array<Numattr> &val) { myNumattr = val; }
1011  exint opNumattr(const SOP_NodeVerb::CookParms &cookparms) const
1012  {
1013  SOP_Node *thissop = cookparms.getNode();
1014  if (!thissop) return getNumattr().entries();
1015  exint result;
1016  OP_Utils::evalOpParm(result, thissop, "numattr", cookparms.getCookTime(), 0);
1017  return result;
1018  }
1019  bool opNumattr_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1020  { return opinstNumattr_enable(cookparms, &_idx); }
1021  bool opinstNumattr_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1022  {
1023  SOP_Node *thissop = cookparms.getNode();
1024  if (!thissop) return (myNumattr(_idx[0]).enable);
1025  int _parmidx[2-1];
1026  _parmidx[1-1] = _idx[1-1] + 1;
1027 
1028  bool result;
1029  OP_Utils::evalOpParmInst(result, thissop, "enable#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1030  return (result);
1031  }
1032  UT_StringHolder opNumattr_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1033  { return opinstNumattr_name(cookparms, &_idx); }
1034  UT_StringHolder opinstNumattr_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1035  {
1036  SOP_Node *thissop = cookparms.getNode();
1037  if (!thissop) return (myNumattr(_idx[0]).name);
1038  int _parmidx[2-1];
1039  _parmidx[1-1] = _idx[1-1] + 1;
1040 
1042  OP_Utils::evalOpParmInst(result, thissop, "name#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1043  return (result);
1044  }
1045  int64 opNumattr_existing(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1046  { return opinstNumattr_existing(cookparms, &_idx); }
1047  int64 opinstNumattr_existing(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1048  {
1049  SOP_Node *thissop = cookparms.getNode();
1050  if (!thissop) return (myNumattr(_idx[0]).existing);
1051  int _parmidx[2-1];
1052  _parmidx[1-1] = _idx[1-1] + 1;
1053 
1054  int64 result;
1055  OP_Utils::evalOpParmInst(result, thissop, "existing#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1056  return (result);
1057  }
1058  bool opNumattr_createvarmap(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1059  { return opinstNumattr_createvarmap(cookparms, &_idx); }
1060  bool opinstNumattr_createvarmap(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1061  {
1062  SOP_Node *thissop = cookparms.getNode();
1063  if (!thissop) return (myNumattr(_idx[0]).createvarmap);
1064  int _parmidx[2-1];
1065  _parmidx[1-1] = _idx[1-1] + 1;
1066 
1067  bool result;
1068  OP_Utils::evalOpParmInst(result, thissop, "createvarmap#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1069  return (result);
1070  }
1072  { return opinstNumattr_varname(cookparms, &_idx); }
1073  UT_StringHolder opinstNumattr_varname(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1074  {
1075  SOP_Node *thissop = cookparms.getNode();
1076  if (!thissop) return (myNumattr(_idx[0]).varname);
1077  int _parmidx[2-1];
1078  _parmidx[1-1] = _idx[1-1] + 1;
1079 
1081  OP_Utils::evalOpParmInst(result, thissop, "varname#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1082  return (result);
1083  }
1084  int64 opNumattr__class(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1085  { return opinstNumattr__class(cookparms, &_idx); }
1086  int64 opinstNumattr__class(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1087  {
1088  SOP_Node *thissop = cookparms.getNode();
1089  if (!thissop) return (myNumattr(_idx[0])._class);
1090  int _parmidx[2-1];
1091  _parmidx[1-1] = _idx[1-1] + 1;
1092 
1093  int64 result;
1094  OP_Utils::evalOpParmInst(result, thissop, "class#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1095  return (result);
1096  }
1097  bool opNumattr_savetoinfo(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1098  { return opinstNumattr_savetoinfo(cookparms, &_idx); }
1099  bool opinstNumattr_savetoinfo(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1100  {
1101  SOP_Node *thissop = cookparms.getNode();
1102  if (!thissop) return (myNumattr(_idx[0]).savetoinfo);
1103  int _parmidx[2-1];
1104  _parmidx[1-1] = _idx[1-1] + 1;
1105 
1106  bool result;
1107  OP_Utils::evalOpParmInst(result, thissop, "savetoinfo#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1108  return (result);
1109  }
1110  int64 opNumattr_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1111  { return opinstNumattr_type(cookparms, &_idx); }
1112  int64 opinstNumattr_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1113  {
1114  SOP_Node *thissop = cookparms.getNode();
1115  if (!thissop) return (myNumattr(_idx[0]).type);
1116  int _parmidx[2-1];
1117  _parmidx[1-1] = _idx[1-1] + 1;
1118 
1119  int64 result;
1120  OP_Utils::evalOpParmInst(result, thissop, "type#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1121  return (result);
1122  }
1123  int64 opNumattr_typeinfo(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1124  { return opinstNumattr_typeinfo(cookparms, &_idx); }
1125  int64 opinstNumattr_typeinfo(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1126  {
1127  SOP_Node *thissop = cookparms.getNode();
1128  if (!thissop) return (myNumattr(_idx[0]).typeinfo);
1129  int _parmidx[2-1];
1130  _parmidx[1-1] = _idx[1-1] + 1;
1131 
1132  int64 result;
1133  OP_Utils::evalOpParmInst(result, thissop, "typeinfo#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1134  return (result);
1135  }
1136  int64 opNumattr_precision(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1137  { return opinstNumattr_precision(cookparms, &_idx); }
1138  int64 opinstNumattr_precision(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1139  {
1140  SOP_Node *thissop = cookparms.getNode();
1141  if (!thissop) return (myNumattr(_idx[0]).precision);
1142  int _parmidx[2-1];
1143  _parmidx[1-1] = _idx[1-1] + 1;
1144 
1145  int64 result;
1146  OP_Utils::evalOpParmInst(result, thissop, "precision#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1147  return (result);
1148  }
1149  int64 opNumattr_size(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1150  { return opinstNumattr_size(cookparms, &_idx); }
1151  int64 opinstNumattr_size(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1152  {
1153  SOP_Node *thissop = cookparms.getNode();
1154  if (!thissop) return (myNumattr(_idx[0]).size);
1155  int _parmidx[2-1];
1156  _parmidx[1-1] = _idx[1-1] + 1;
1157 
1158  int64 result;
1159  OP_Utils::evalOpParmInst(result, thissop, "size#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1160  return (result);
1161  }
1162  UT_Vector4D opNumattr_defaultv(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1163  { return opinstNumattr_defaultv(cookparms, &_idx); }
1164  UT_Vector4D opinstNumattr_defaultv(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1165  {
1166  SOP_Node *thissop = cookparms.getNode();
1167  if (!thissop) return (myNumattr(_idx[0]).defaultv);
1168  int _parmidx[2-1];
1169  _parmidx[1-1] = _idx[1-1] + 1;
1170 
1172  OP_Utils::evalOpParmInst(result, thissop, "default#v", _parmidx, cookparms.getCookTime(), 0, 2-1);
1173  return (result);
1174  }
1175  bool opNumattr_writevalues(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1176  { return opinstNumattr_writevalues(cookparms, &_idx); }
1177  bool opinstNumattr_writevalues(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1178  {
1179  SOP_Node *thissop = cookparms.getNode();
1180  if (!thissop) return (myNumattr(_idx[0]).writevalues);
1181  int _parmidx[2-1];
1182  _parmidx[1-1] = _idx[1-1] + 1;
1183 
1184  bool result;
1185  OP_Utils::evalOpParmInst(result, thissop, "writevalues#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1186  return (result);
1187  }
1188  bool opNumattr_uselocal(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1189  { return opinstNumattr_uselocal(cookparms, &_idx); }
1190  bool opinstNumattr_uselocal(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1191  {
1192  SOP_Node *thissop = cookparms.getNode();
1193  if (!thissop) return (myNumattr(_idx[0]).uselocal);
1194  int _parmidx[2-1];
1195  _parmidx[1-1] = _idx[1-1] + 1;
1196 
1197  bool result;
1198  OP_Utils::evalOpParmInst(result, thissop, "uselocal#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1199  return (result);
1200  }
1201  UT_Vector4D opNumattr_valuev(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1202  { return opinstNumattr_valuev(cookparms, &_idx); }
1203  UT_Vector4D opinstNumattr_valuev(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1204  {
1205  SOP_Node *thissop = cookparms.getNode();
1206  if (!thissop) return (myNumattr(_idx[0]).valuev);
1207  int _parmidx[2-1];
1208  _parmidx[1-1] = _idx[1-1] + 1;
1209 
1211  OP_Utils::evalOpParmInst(result, thissop, "value#v", _parmidx, cookparms.getCookTime(), 0, 2-1);
1212  return (result);
1213  }
1215  { return opinstNumattr_string(cookparms, &_idx); }
1216  UT_StringHolder opinstNumattr_string(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1217  {
1218  SOP_Node *thissop = cookparms.getNode();
1219  if (!thissop) return (myNumattr(_idx[0]).string);
1220  int _parmidx[2-1];
1221  _parmidx[1-1] = _idx[1-1] + 1;
1222 
1224  OP_Utils::evalOpParmInst(result, thissop, "string#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1225  return (result);
1226  }
1227 
1228 
1229 private:
1230  UT_StringHolder myGroup;
1231  int64 myGrouptype;
1232  bool myEncodenames;
1233  UT_Array<Numattr> myNumattr;
1234 
1235 };
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
type
Definition: core.h:556
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_StringHolder s)
bool opNumattr_savetoinfo(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNumattr(const UT_Array< Numattr > &val)
void
Definition: png.h:1083
exint bread(int32 *buffer, exint asize=1)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
GLboolean * data
Definition: glcorearb.h:131
static void saveData(std::ostream &os, UT_Vector4D v)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
fpreal getTime() const
Definition: OP_Context.h:63
exint getNestNumParms(TempIndex idx) const override
GLsizei const GLfloat * value
Definition: glcorearb.h:824
int64 opinstNumattr_typeinfo(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_StringHolder opNumattr_varname(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, fpreal64 &v)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
bool opNumattr_uselocal(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 opNumattr_precision(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
UT_StringHolder opinstNumattr_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE const char * buffer() const
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool operator==(const Numattr &src) const
GLdouble s
Definition: glad.h:3009
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool operator==(const SOP_AttribCreate_2_0Parms &src) const
bool operator!=(const SOP_AttribCreate_2_0Parms &src) const
bool opinstNumattr_writevalues(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opNumattr__class(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
**But if you need a result
Definition: thread.h:622
bool opNumattr_createvarmap(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void loadFromOpSubclass(const LoadParms &loadparms) override
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.
static void loadData(UT_IStream &is, UT_Matrix2D &v)
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
bool opinstNumattr_savetoinfo(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool isParmColorRamp(exint idx) const override
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
static void saveData(std::ostream &os, bool v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int64 opNumattr_size(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_StringHolder opNumattr_string(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
exint length() const
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
int64 opinstNumattr_size(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) 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
ParmType getNestParmType(TempIndex fieldnum) const override
void setGroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_StringHolder opinstNumattr_string(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
bool opinstNumattr_createvarmap(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
long long int64
Definition: SYS_Types.h:116
exint opNumattr(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool opinstNumattr_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
GLuint const GLchar * name
Definition: glcorearb.h:786
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
UT_Vector4D opNumattr_valuev(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool opinstNumattr_uselocal(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void save(std::ostream &os) const
SYS_FORCE_INLINE void strcat(const char *src)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
static void saveData(std::ostream &os, UT_Matrix4D v)
GT_API const UT_StringHolder version
GLenum GLint GLint * precision
Definition: glcorearb.h:1925
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:655
int64 opinstNumattr__class(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opNumattr_writevalues(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_StringHolder createString(const UT_Array< Numattr > &list) const
GLsizeiptr size
Definition: glcorearb.h:664
UT_StringHolder opNumattr_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
UT_Vector4D opinstNumattr_valuev(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opNumattr_typeinfo(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
const UT_Array< Numattr > & getNumattr() const
int64 opinstNumattr_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void copyFrom(const OP_NodeParms *src) override
UT_StringHolder opinstNumattr_varname(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opinstNumattr_precision(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
bool operator!=(const Numattr &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
int64 opinstNumattr_existing(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opNumattr_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
#define SOP_API
Definition: SOP_API.h:10
static void saveData(std::ostream &os, fpreal64 v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
SYS_FORCE_INLINE UT_StringHolder getToken(Grouptype enum_value)
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
GLboolean r
Definition: glcorearb.h:1222
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
UT_Vector4T< fpreal64 > UT_Vector4D
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
bool opNumattr_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_Vector4D opNumattr_defaultv(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, bool &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
Grouptype opGrouptype(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector4D opinstNumattr_defaultv(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
int64 opNumattr_existing(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool opEncodenames(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663