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_NodeVerb.h>
7 #include <OP/OP_Utils.h>
8 #include <PRM/PRM_Parm.h>
9 #include <UT/UT_IStream.h>
10 #include <UT/UT_NTStreamUtil.h>
11 #include <UT/UT_Ramp.h>
12 #include <UT/UT_SharedPtr.h>
13 #include <UT/UT_StringHolder.h>
14 #include <UT/UT_StringStream.h>
15 #include <UT/UT_VectorTypes.h>
16 #include <SYS/SYS_Types.h>
17 
18 using namespace UT::Literal;
19 
20 class DEP_MicroNode;
21 namespace SOP_AttribCreate_2_0Enums
22 {
23  enum class Grouptype
24  {
25  GUESS = 0,
26  VERTICES,
27  EDGES,
28  POINTS,
29  PRIMS
30  };
31  enum class Existing
32  {
33  ERROR = 0,
34  WARN,
35  REPLACE,
36  BETTER
37  };
38  enum class Class
39  {
40  DETAIL = 0,
41  PRIMITIVE,
42  POINT,
43  VERTEX
44  };
45  enum class Type
46  {
47  FLOAT = 0,
48  INT,
49  VECTOR,
50  INDEX,
51  FLOATARRAY,
52  INTARRAY,
54  };
55  enum class Typeinfo
56  {
57  GUESS = 0,
58  NONE,
59  POINT,
60  VECTOR,
61  NORMAL,
62  COLOR,
63  QUATERNION,
64  TRANFORM,
66  };
67  enum class Precision
68  {
69  _8 = 0,
70  _16,
71  _32,
72  _64
73  };
74 }
75 
76 
78 {
79 public:
80  static int version() { return 1; }
81  struct Numattr
82  {
83  bool enable;
89  bool savetoinfo;
96  bool uselocal;
99 
100 
102  {
103  enable = false;
104  name = "attribute#"_sh;
105  existing = 3;
106  createvarmap = false;
107  varname = ""_sh;
108  _class = 2;
109  savetoinfo = false;
110  type = 0;
111  typeinfo = 0;
112  precision = 2;
113  size = 1;
114  defaultv = UT_Vector4D(0,0,0,0);
115  writevalues = false;
116  uselocal = false;
117  valuev = UT_Vector4D(0,0,0,0);
118  string = ""_sh;
119 
120  }
121 
122  bool operator==(const Numattr &src) const
123  {
124  if (enable != src.enable) return false;
125  if (name != src.name) return false;
126  if (existing != src.existing) return false;
127  if (createvarmap != src.createvarmap) return false;
128  if (varname != src.varname) return false;
129  if (_class != src._class) return false;
130  if (savetoinfo != src.savetoinfo) return false;
131  if (type != src.type) return false;
132  if (typeinfo != src.typeinfo) return false;
133  if (precision != src.precision) return false;
134  if (size != src.size) return false;
135  if (defaultv != src.defaultv) return false;
136  if (writevalues != src.writevalues) return false;
137  if (uselocal != src.uselocal) return false;
138  if (valuev != src.valuev) return false;
139  if (string != src.string) return false;
140 
141  return true;
142  }
143  bool operator!=(const Numattr &src) const
144  {
145  return !operator==(src);
146  }
147 
148  };
149 
151  {
153 
154  buf.strcat("[ ");
155  for (int i = 0; i < list.entries(); i++)
156  {
157  if (i)
158  buf.strcat(", ");
159  buf.strcat("( ");
160  buf.append("");
161  buf.appendSprintf("%s", (list(i).enable) ? "true" : "false");
162  buf.append(", ");
163  { UT_String tmp; tmp = UT_StringWrap(list(i).name).makeQuotedString('"'); buf.strcat(tmp); }
164  buf.append(", ");
165  buf.appendSprintf("%d", (int) list(i).existing);
166  buf.append(", ");
167  buf.appendSprintf("%s", (list(i).createvarmap) ? "true" : "false");
168  buf.append(", ");
169  { UT_String tmp; tmp = UT_StringWrap(list(i).varname).makeQuotedString('"'); buf.strcat(tmp); }
170  buf.append(", ");
171  buf.appendSprintf("%d", (int) list(i)._class);
172  buf.append(", ");
173  buf.appendSprintf("%s", (list(i).savetoinfo) ? "true" : "false");
174  buf.append(", ");
175  buf.appendSprintf("%d", (int) list(i).type);
176  buf.append(", ");
177  buf.appendSprintf("%d", (int) list(i).typeinfo);
178  buf.append(", ");
179  buf.appendSprintf("%d", (int) list(i).precision);
180  buf.append(", ");
181  buf.appendSprintf("%d", (int) list(i).size);
182  buf.append(", ");
183  buf.appendSprintf("(%f, %f, %f, %f)", list(i).defaultv.x(), list(i).defaultv.y(), list(i).defaultv.z(), list(i).defaultv.w());
184  buf.append(", ");
185  buf.appendSprintf("%s", (list(i).writevalues) ? "true" : "false");
186  buf.append(", ");
187  buf.appendSprintf("%s", (list(i).uselocal) ? "true" : "false");
188  buf.append(", ");
189  buf.appendSprintf("(%f, %f, %f, %f)", list(i).valuev.x(), list(i).valuev.y(), list(i).valuev.z(), list(i).valuev.w());
190  buf.append(", ");
191  { UT_String tmp; tmp = UT_StringWrap(list(i).string).makeQuotedString('"'); buf.strcat(tmp); }
192 
193  buf.strcat(" )");
194  }
195  buf.strcat(" ]");
196 
197  UT_StringHolder result = buf;
198  return result;
199  }
200 
202  {
203  myGroup = ""_sh;
204  myGrouptype = 0;
205 
206  }
207 
208  explicit SOP_AttribCreate_2_0Parms(const SOP_AttribCreate_2_0Parms &) = default;
209 
211 
213  {
214  if (myGroup != src.myGroup) return false;
215  if (myGrouptype != src.myGrouptype) return false;
216  if (myNumattr != src.myNumattr) return false;
217 
218  return true;
219  }
221  {
222  return !operator==(src);
223  }
230 
231 
232 
233  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
234  {
235  if (true)
236  OP_Utils::evalOpParm(myGroup, node, "group", time, 0);
237  else myGroup = ""_sh;
238  if (true)
239  OP_Utils::evalOpParm(myGrouptype, node, "grouptype", time, 0);
240  else myGrouptype = 0;
241  if (true)
242  {
243  int64 length;
244  OP_Utils::evalOpParm(length, node, "numattr", time, 0);
245  myNumattr.entries(length);
246  for (exint i = 0; i < length; i++)
247  {
248  int parmidx = i+1;
249  auto && _curentry = myNumattr(i);
250  (void) _curentry;
251  if (true)
252  OP_Utils::evalOpParmInst(myNumattr(i).enable, node, "enable#", &parmidx, time, 0);
253  else myNumattr(i).enable = false;
254  if (true && ( (!(((_curentry.enable==0)))) ) )
255  OP_Utils::evalOpParmInst(myNumattr(i).name, node, "name#", &parmidx, time, 0);
256  else myNumattr(i).name = "attribute#"_sh;
257  if (true && ( (!(((_curentry.enable==0)))) ) )
258  OP_Utils::evalOpParmInst(myNumattr(i).existing, node, "existing#", &parmidx, time, 0);
259  else myNumattr(i).existing = 3;
260  if (true && ( (!(((_curentry.enable==0)))) ) )
261  OP_Utils::evalOpParmInst(myNumattr(i).createvarmap, node, "createvarmap#", &parmidx, time, 0);
262  else myNumattr(i).createvarmap = false;
263  if (true && ( (!(((_curentry.enable==0))||((_curentry.createvarmap==0)))) ) )
264  OP_Utils::evalOpParmInst(myNumattr(i).varname, node, "varname#", &parmidx, time, 0);
265  else myNumattr(i).varname = ""_sh;
266  if (true && ( (!(((_curentry.enable==0)))) ) )
267  OP_Utils::evalOpParmInst(myNumattr(i)._class, node, "class#", &parmidx, time, 0);
268  else myNumattr(i)._class = 2;
269  if (true && ( (!(((_curentry.enable==0))||((_curentry._class!=0)))) ) )
270  OP_Utils::evalOpParmInst(myNumattr(i).savetoinfo, node, "savetoinfo#", &parmidx, time, 0);
271  else myNumattr(i).savetoinfo = false;
272  if (true && ( (!(((_curentry.enable==0)))) ) )
273  OP_Utils::evalOpParmInst(myNumattr(i).type, node, "type#", &parmidx, time, 0);
274  else myNumattr(i).type = 0;
275  if (true && ( (!(((_curentry.enable==0))||((_curentry.type!=0)))) ) )
276  OP_Utils::evalOpParmInst(myNumattr(i).typeinfo, node, "typeinfo#", &parmidx, time, 0);
277  else myNumattr(i).typeinfo = 0;
278  if (true && ( (!(((_curentry.enable==0))||((_curentry.type==3))||((_curentry.type==6)))) ) )
279  OP_Utils::evalOpParmInst(myNumattr(i).precision, node, "precision#", &parmidx, time, 0);
280  else myNumattr(i).precision = 2;
281  if (true && ( (!(((_curentry.enable==0))||((_curentry.type==2))||((_curentry.type==3)))) ) )
282  OP_Utils::evalOpParmInst(myNumattr(i).size, node, "size#", &parmidx, time, 0);
283  else myNumattr(i).size = 1;
284  if (true && ( (!(((_curentry.enable==0))||((_curentry.type==3))||((_curentry.type==4))||((_curentry.type==5))||((_curentry.type==6)))) ) )
285  OP_Utils::evalOpParmInst(myNumattr(i).defaultv, node, "default#v", &parmidx, time, 0);
286  else myNumattr(i).defaultv = UT_Vector4D(0,0,0,0);
287  if (true && ( (!(((_curentry.enable==0))||((_curentry.type==4))||((_curentry.type==5))||((_curentry.type==6)))) ) )
288  OP_Utils::evalOpParmInst(myNumattr(i).writevalues, node, "writevalues#", &parmidx, time, 0);
289  else myNumattr(i).writevalues = false;
290  if (true && ( (!(((_curentry.enable==0))||((_curentry.writevalues==0))||((_curentry.type==4))||((_curentry.type==5))||((_curentry.type==6)))) ) )
291  OP_Utils::evalOpParmInst(myNumattr(i).uselocal, node, "uselocal#", &parmidx, time, 0);
292  else myNumattr(i).uselocal = false;
293  if (true && ( (!(((_curentry.enable==0))||((_curentry.writevalues==0))||((_curentry.type!=0)&&(_curentry.type!=1)&&(_curentry.type!=2)))) ) )
294  OP_Utils::evalOpParmInst(myNumattr(i).valuev, node, "value#v", &parmidx, time, 0);
295  else myNumattr(i).valuev = UT_Vector4D(0,0,0,0);
296  if (true && ( (!(((_curentry.enable==0))||((_curentry.writevalues==0))||((_curentry.type!=3)))) ) )
297  OP_Utils::evalOpParmInst(myNumattr(i).string, node, "string#", &parmidx, time, 0);
298  else myNumattr(i).string = ""_sh;
299 
300  }
301  }
302  else
303  myNumattr.clear();
304 
305  }
306 
307 
308  virtual void loadFromOpSubclass(const LoadParms &loadparms)
309  {
310  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
311  }
312 
313 
314  virtual void copyFrom(const SOP_NodeParms *src)
315  {
316  *this = *((const SOP_AttribCreate_2_0Parms *)src);
317  }
318 
319  template <typename T>
320  void
321  doGetParmValue(exint idx, T &value) const
322  {
323  switch (idx)
324  {
325  case 0:
326  coerceValue(value, myGroup);
327  break;
328  case 1:
329  coerceValue(value, myGrouptype);
330  break;
331 
332  }
333  }
334 
335  void getParmValue(exint idx, exint &value) const
336  { doGetParmValue(idx, value); }
337  void getParmValue(exint idx, fpreal &value) const
338  { doGetParmValue(idx, value); }
340  { doGetParmValue(idx, value); }
342  { doGetParmValue(idx, value); }
344  { doGetParmValue(idx, value); }
346  { doGetParmValue(idx, value); }
348  { doGetParmValue(idx, value); }
350  { doGetParmValue(idx, value); }
352  { doGetParmValue(idx, value); }
354  { doGetParmValue(idx, value); }
356  { doGetParmValue(idx, value); }
357 
358  template <typename T>
359  void
360  doSetParmValue(exint idx, const T &value)
361  {
362  switch (idx)
363  {
364  case 0:
365  coerceValue(myGroup, value);
366  break;
367  case 1:
368  coerceValue(myGrouptype, value);
369  break;
370 
371  }
372  }
373 
374  void setParmValue(exint idx, const exint &value)
375  { doSetParmValue(idx, value); }
376  void setParmValue(exint idx, const fpreal &value)
377  { doSetParmValue(idx, value); }
378  void setParmValue(exint idx, const UT_Vector2D &value)
379  { doSetParmValue(idx, value); }
380  void setParmValue(exint idx, const UT_Vector3D &value)
381  { doSetParmValue(idx, value); }
382  void setParmValue(exint idx, const UT_Vector4D &value)
383  { doSetParmValue(idx, value); }
384  void setParmValue(exint idx, const UT_Matrix2D &value)
385  { doSetParmValue(idx, value); }
386  void setParmValue(exint idx, const UT_Matrix3D &value)
387  { doSetParmValue(idx, value); }
388  void setParmValue(exint idx, const UT_Matrix4D &value)
389  { doSetParmValue(idx, value); }
391  { doSetParmValue(idx, value); }
393  { doSetParmValue(idx, value); }
395  { doSetParmValue(idx, value); }
396 
397  virtual exint getNumParms() const
398  {
399  return 3;
400  }
401 
402  virtual const char *getParmName(exint fieldnum) const
403  {
404  switch (fieldnum)
405  {
406  case 0:
407  return "group";
408  case 1:
409  return "grouptype";
410  case 2:
411  return "numattr";
412 
413  }
414  return 0;
415  }
416 
417  virtual ParmType getParmType(exint fieldnum) const
418  {
419  switch (fieldnum)
420  {
421  case 0:
422  return PARM_STRING;
423  case 1:
424  return PARM_INTEGER;
425 
426  }
427  return PARM_UNSUPPORTED;
428  }
429 
430  // Boiler plate to load individual types.
431  static void loadData(UT_IStream &is, int64 &v)
432  { is.bread(&v, 1); }
433  static void loadData(UT_IStream &is, bool &v)
434  { int64 iv; is.bread(&iv, 1); v = iv; }
435  static void loadData(UT_IStream &is, fpreal64 &v)
436  { is.bread<fpreal64>(&v, 1); }
437  static void loadData(UT_IStream &is, UT_Vector2D &v)
438  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
439  static void loadData(UT_IStream &is, UT_Vector3D &v)
440  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
441  is.bread<fpreal64>(&v.z(), 1); }
442  static void loadData(UT_IStream &is, UT_Vector4D &v)
443  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
444  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
445  static void loadData(UT_IStream &is, UT_Matrix2D &v)
446  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
447  static void loadData(UT_IStream &is, UT_Matrix3D &v)
448  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
449  static void loadData(UT_IStream &is, UT_Matrix4D &v)
450  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
451  static void loadData(UT_IStream &is, UT_Vector2I &v)
452  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
453  static void loadData(UT_IStream &is, UT_Vector3I &v)
454  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
455  is.bread<int64>(&v.z(), 1); }
456  static void loadData(UT_IStream &is, UT_Vector4I &v)
457  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
458  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
460  { is.bread(v); }
462  { UT_StringHolder rampdata;
463  loadData(is, rampdata);
464  if (rampdata.isstring())
465  {
466  v.reset(new UT_Ramp());
467  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
468  v->load(istr);
469  }
470  else v.reset();
471  }
474  loadData(is, data);
475  if (data.isstring())
476  {
477  // Find the data type.
478  char *colon = UT_StringWrap(data).findChar(':');
479  if (colon)
480  {
481  int typelen = colon - data.buffer();
483  type.strncpy(data.buffer(), typelen);
484  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
485 
486  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
487  }
488  }
489  else v.reset();
490  }
491 
492  static void saveData(std::ostream &os, int64 v)
493  { UTwrite(os, &v); }
494  static void saveData(std::ostream &os, bool v)
495  { int64 iv = v; UTwrite(os, &iv); }
496  static void saveData(std::ostream &os, fpreal64 v)
497  { UTwrite<fpreal64>(os, &v); }
498  static void saveData(std::ostream &os, UT_Vector2D v)
499  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
500  static void saveData(std::ostream &os, UT_Vector3D v)
501  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
502  UTwrite<fpreal64>(os, &v.z()); }
503  static void saveData(std::ostream &os, UT_Vector4D v)
504  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
505  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
506  static void saveData(std::ostream &os, UT_Matrix2D v)
508  static void saveData(std::ostream &os, UT_Matrix3D v)
510  static void saveData(std::ostream &os, UT_Matrix4D v)
512  static void saveData(std::ostream &os, UT_StringHolder s)
513  { UT_StringWrap(s).saveBinary(os); }
514  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
515  { UT_StringHolder result;
516  UT_OStringStream ostr;
517  if (s) s->save(ostr);
518  result = ostr.str();
519  saveData(os, result);
520  }
521  static void saveData(std::ostream &os, PRM_DataItemHandle s)
522  { UT_StringHolder result;
523  UT_OStringStream ostr;
524  if (s)
525  {
526  ostr << s->getDataTypeToken();
527  ostr << ":";
528  s->saveBinary(ostr);
529  }
530  result = ostr.str();
531  saveData(os, result);
532  }
533 
534 
535  void save(std::ostream &os) const
536  {
537  int32 v = version();
538  UTwrite(os, &v);
539  saveData(os, myGroup);
540  saveData(os, myGrouptype);
541  {
542  int64 length = myNumattr.entries();
543  UTwrite(os, &length);
544  for (exint i = 0; i < length; i++)
545  {
546  saveData(os, myNumattr(i).enable);
547  saveData(os, myNumattr(i).name);
548  saveData(os, myNumattr(i).existing);
549  saveData(os, myNumattr(i).createvarmap);
550  saveData(os, myNumattr(i).varname);
551  saveData(os, myNumattr(i)._class);
552  saveData(os, myNumattr(i).savetoinfo);
553  saveData(os, myNumattr(i).type);
554  saveData(os, myNumattr(i).typeinfo);
555  saveData(os, myNumattr(i).precision);
556  saveData(os, myNumattr(i).size);
557  saveData(os, myNumattr(i).defaultv);
558  saveData(os, myNumattr(i).writevalues);
559  saveData(os, myNumattr(i).uselocal);
560  saveData(os, myNumattr(i).valuev);
561  saveData(os, myNumattr(i).string);
562 
563  }
564  }
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, myGroup);
578  loadData(is, myGrouptype);
579  {
580  int64 length;
581  is.read(&length, 1);
582  myNumattr.entries(length);
583  for (exint i = 0; i < length; i++)
584  {
585  loadData(is, myNumattr(i).enable);
586  loadData(is, myNumattr(i).name);
587  loadData(is, myNumattr(i).existing);
588  loadData(is, myNumattr(i).createvarmap);
589  loadData(is, myNumattr(i).varname);
590  loadData(is, myNumattr(i)._class);
591  loadData(is, myNumattr(i).savetoinfo);
592  loadData(is, myNumattr(i).type);
593  loadData(is, myNumattr(i).typeinfo);
594  loadData(is, myNumattr(i).precision);
595  loadData(is, myNumattr(i).size);
596  loadData(is, myNumattr(i).defaultv);
597  loadData(is, myNumattr(i).writevalues);
598  loadData(is, myNumattr(i).uselocal);
599  loadData(is, myNumattr(i).valuev);
600  loadData(is, myNumattr(i).string);
601 
602  }
603  }
604 
605  return true;
606  }
607 
608  const UT_StringHolder & getGroup() const { return myGroup; }
609  void setGroup(const UT_StringHolder & val) { myGroup = val; }
611  {
612  SOP_Node *thissop = cookparms.getNode();
613  if (!thissop) return getGroup();
614  UT_StringHolder result;
615  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
616  return result;
617  }
618  Grouptype getGrouptype() const { return Grouptype(myGrouptype); }
619  void setGrouptype(Grouptype val) { myGrouptype = int64(val); }
621  {
622  SOP_Node *thissop = cookparms.getNode();
623  if (!thissop) return getGrouptype();
624  int64 result;
625  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
626  return Grouptype(result);
627  }
628  const UT_Array<Numattr> &getNumattr() const { return myNumattr; }
629  void setNumattr(const UT_Array<Numattr> &val) { myNumattr = val; }
630  exint opNumattr(const SOP_NodeVerb::CookParms &cookparms) const
631  {
632  SOP_Node *thissop = cookparms.getNode();
633  if (!thissop) return getNumattr().entries();
634  exint result;
635  OP_Utils::evalOpParm(result, thissop, "numattr", cookparms.getCookTime(), 0);
636  return result;
637  }
638  bool opNumattr_enable(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
639  {
640  SOP_Node *thissop = cookparms.getNode();
641  if (!thissop) return (myNumattr(_idx).enable);
642  int _parmidx = _idx + 1;
643  bool result;
644  OP_Utils::evalOpParmInst(result, thissop, "enable#", &_parmidx, cookparms.getCookTime(), 0);
645  return (result);
646  }
648  {
649  SOP_Node *thissop = cookparms.getNode();
650  if (!thissop) return (myNumattr(_idx).name);
651  int _parmidx = _idx + 1;
652  UT_StringHolder result;
653  OP_Utils::evalOpParmInst(result, thissop, "name#", &_parmidx, cookparms.getCookTime(), 0);
654  return (result);
655  }
657  {
658  SOP_Node *thissop = cookparms.getNode();
659  if (!thissop) return (myNumattr(_idx).existing);
660  int _parmidx = _idx + 1;
661  int64 result;
662  OP_Utils::evalOpParmInst(result, thissop, "existing#", &_parmidx, cookparms.getCookTime(), 0);
663  return (result);
664  }
665  bool opNumattr_createvarmap(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
666  {
667  SOP_Node *thissop = cookparms.getNode();
668  if (!thissop) return (myNumattr(_idx).createvarmap);
669  int _parmidx = _idx + 1;
670  bool result;
671  OP_Utils::evalOpParmInst(result, thissop, "createvarmap#", &_parmidx, cookparms.getCookTime(), 0);
672  return (result);
673  }
675  {
676  SOP_Node *thissop = cookparms.getNode();
677  if (!thissop) return (myNumattr(_idx).varname);
678  int _parmidx = _idx + 1;
679  UT_StringHolder result;
680  OP_Utils::evalOpParmInst(result, thissop, "varname#", &_parmidx, cookparms.getCookTime(), 0);
681  return (result);
682  }
683  int64 opNumattr__class(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
684  {
685  SOP_Node *thissop = cookparms.getNode();
686  if (!thissop) return (myNumattr(_idx)._class);
687  int _parmidx = _idx + 1;
688  int64 result;
689  OP_Utils::evalOpParmInst(result, thissop, "class#", &_parmidx, cookparms.getCookTime(), 0);
690  return (result);
691  }
692  bool opNumattr_savetoinfo(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
693  {
694  SOP_Node *thissop = cookparms.getNode();
695  if (!thissop) return (myNumattr(_idx).savetoinfo);
696  int _parmidx = _idx + 1;
697  bool result;
698  OP_Utils::evalOpParmInst(result, thissop, "savetoinfo#", &_parmidx, cookparms.getCookTime(), 0);
699  return (result);
700  }
701  int64 opNumattr_type(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
702  {
703  SOP_Node *thissop = cookparms.getNode();
704  if (!thissop) return (myNumattr(_idx).type);
705  int _parmidx = _idx + 1;
706  int64 result;
707  OP_Utils::evalOpParmInst(result, thissop, "type#", &_parmidx, cookparms.getCookTime(), 0);
708  return (result);
709  }
711  {
712  SOP_Node *thissop = cookparms.getNode();
713  if (!thissop) return (myNumattr(_idx).typeinfo);
714  int _parmidx = _idx + 1;
715  int64 result;
716  OP_Utils::evalOpParmInst(result, thissop, "typeinfo#", &_parmidx, cookparms.getCookTime(), 0);
717  return (result);
718  }
720  {
721  SOP_Node *thissop = cookparms.getNode();
722  if (!thissop) return (myNumattr(_idx).precision);
723  int _parmidx = _idx + 1;
724  int64 result;
725  OP_Utils::evalOpParmInst(result, thissop, "precision#", &_parmidx, cookparms.getCookTime(), 0);
726  return (result);
727  }
728  int64 opNumattr_size(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return (myNumattr(_idx).size);
732  int _parmidx = _idx + 1;
733  int64 result;
734  OP_Utils::evalOpParmInst(result, thissop, "size#", &_parmidx, cookparms.getCookTime(), 0);
735  return (result);
736  }
738  {
739  SOP_Node *thissop = cookparms.getNode();
740  if (!thissop) return (myNumattr(_idx).defaultv);
741  int _parmidx = _idx + 1;
742  UT_Vector4D result;
743  OP_Utils::evalOpParmInst(result, thissop, "default#v", &_parmidx, cookparms.getCookTime(), 0);
744  return (result);
745  }
746  bool opNumattr_writevalues(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
747  {
748  SOP_Node *thissop = cookparms.getNode();
749  if (!thissop) return (myNumattr(_idx).writevalues);
750  int _parmidx = _idx + 1;
751  bool result;
752  OP_Utils::evalOpParmInst(result, thissop, "writevalues#", &_parmidx, cookparms.getCookTime(), 0);
753  return (result);
754  }
755  bool opNumattr_uselocal(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
756  {
757  SOP_Node *thissop = cookparms.getNode();
758  if (!thissop) return (myNumattr(_idx).uselocal);
759  int _parmidx = _idx + 1;
760  bool result;
761  OP_Utils::evalOpParmInst(result, thissop, "uselocal#", &_parmidx, cookparms.getCookTime(), 0);
762  return (result);
763  }
765  {
766  SOP_Node *thissop = cookparms.getNode();
767  if (!thissop) return (myNumattr(_idx).valuev);
768  int _parmidx = _idx + 1;
769  UT_Vector4D result;
770  OP_Utils::evalOpParmInst(result, thissop, "value#v", &_parmidx, cookparms.getCookTime(), 0);
771  return (result);
772  }
774  {
775  SOP_Node *thissop = cookparms.getNode();
776  if (!thissop) return (myNumattr(_idx).string);
777  int _parmidx = _idx + 1;
778  UT_StringHolder result;
779  OP_Utils::evalOpParmInst(result, thissop, "string#", &_parmidx, cookparms.getCookTime(), 0);
780  return (result);
781  }
782 
783 
784 private:
785  UT_StringHolder myGroup;
786  int64 myGrouptype;
787  UT_Array<Numattr> myNumattr;
788 
789 };
static void loadData(UT_IStream &is, UT_Vector4D &v)
virtual ParmType getParmType(exint fieldnum) const
void setParmValue(exint idx, const UT_Matrix3D &value)
bool opNumattr_enable(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_StringHolder s)
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:494
void setParmValue(exint idx, const exint &value)
T & z(void)
Definition: UT_Vector4.h:379
void getParmValue(exint idx, UT_Vector4D &value) const
void setNumattr(const UT_Array< Numattr > &val)
exint bread(int32 *buffer, exint asize=1)
static void saveData(std::ostream &os, UT_Vector4D v)
GT_API const UT_StringHolder time
fpreal getTime() const
Definition: OP_Context.h:60
const GLdouble * v
Definition: glcorearb.h:836
UT_StringHolder opNumattr_string(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
static void loadData(UT_IStream &is, fpreal64 &v)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
UT_Vector4D opNumattr_defaultv(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
bool opNumattr_writevalues(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
SYS_FORCE_INLINE const char * buffer() const
T & x(void)
Definition: UT_Vector2.h:285
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool operator==(const Numattr &src) const
void setParmValue(exint idx, const UT_Vector3D &value)
An output stream object that owns its own string buffer storage.
bool operator==(const SOP_AttribCreate_2_0Parms &src) const
bool operator!=(const SOP_AttribCreate_2_0Parms &src) const
const UT_WorkBuffer & str() const
Returns a read-only reference to the underlying UT_WorkBuffer.
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:498
int64 opNumattr_existing(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
virtual void copyFrom(const SOP_NodeParms *src)
int64 opNumattr_type(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
bool opNumattr_savetoinfo(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
png_uint_32 i
Definition: png.h:2877
static void saveData(std::ostream &os, UT_Vector3D v)
GLsizeiptr size
Definition: glcorearb.h:663
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
static void saveData(std::ostream &os, bool v)
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:502
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
long long int64
Definition: SYS_Types.h:107
int64 opNumattr_typeinfo(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
exint length() const
char * findChar(int c) const
Find first occurrance of character. Returns NULL upon failure.
Definition: UT_String.h:550
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
int64 exint
Definition: SYS_Types.h:116
bool opNumattr_uselocal(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void setGroup(const UT_StringHolder &val)
const OP_Node * node() const
Definition: SOP_NodeVerb.h:104
static void saveData(std::ostream &os, PRM_DataItemHandle s)
double fpreal64
Definition: SYS_Types.h:192
void setParmValue(exint idx, const UT_Vector4D &value)
int64 opNumattr_precision(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:284
void setParmValue(exint idx, const UT_StringHolder &value)
void getParmValue(exint idx, UT_Vector2D &value) const
UT_Vector4D opNumattr_valuev(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
int64 opNumattr__class(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void getParmValue(exint idx, UT_Vector3D &value) const
void getParmValue(exint idx, exint &value) const
void getParmValue(exint idx, UT_StringHolder &value) const
void getParmValue(exint idx, UT_Matrix3D &value) const
bool opNumattr_createvarmap(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
virtual void loadFromOpSubclass(const LoadParms &loadparms)
exint opNumattr(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getParmValue(exint idx, UT_Matrix2D &value) const
GLboolean * data
Definition: glcorearb.h:130
UT_StringHolder opNumattr_varname(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
GLuint const GLchar * name
Definition: glcorearb.h:785
static void saveData(std::ostream &os, int64 v)
int int32
Definition: SYS_Types.h:35
static void saveData(std::ostream &os, UT_Matrix2D v)
T & y(void)
Definition: UT_Vector4.h:377
void getParmValue(exint idx, PRM_DataItemHandle &value) const
UT_StringHolder opNumattr_name(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void save(std::ostream &os) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
static void saveData(std::ostream &os, UT_Matrix4D v)
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:111
void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
GLenum GLint GLint * precision
Definition: glcorearb.h:1924
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:453
UT_StringHolder createString(const UT_Array< Numattr > &list) const
void setParmValue(exint idx, const fpreal &value)
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:500
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:270
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setParmValue(exint idx, const UT_Matrix2D &value)
static void loadData(UT_IStream &is, UT_Vector2I &v)
const UT_Array< Numattr > & getNumattr() const
void doSetParmValue(exint idx, const T &value)
bool operator!=(const Numattr &src) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void append(char character)
GLuint GLfloat * val
Definition: glcorearb.h:1607
void doGetParmValue(exint idx, T &value) const
#define SOP_API
Definition: SOP_API.h:10
static void saveData(std::ostream &os, fpreal64 v)
void getParmValue(exint idx, UT_Matrix4D &value) const
void setParmValue(exint idx, const UT_Matrix4D &value)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:501
T & x(void)
Definition: UT_Vector4.h:375
int64 opNumattr_size(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
T & y(void)
Definition: UT_Vector2.h:287
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setParmValue(exint idx, const PRM_DataItemHandle &value)
GLboolean r
Definition: glcorearb.h:1221
void getParmValue(exint idx, fpreal &value) const
UT_Vector4T< fpreal64 > UT_Vector4D
virtual const char * getParmName(exint fieldnum) const
T & w(void)
Definition: UT_Vector4.h:381
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)
static void loadData(UT_IStream &is, bool &v)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:109
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:88
SYS_FORCE_INLINE bool isstring() const
Grouptype opGrouptype(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setParmValue(exint idx, const UT_Vector2D &value)
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794
GLenum src
Definition: glcorearb.h:1792