HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 
144  };
145 
147  {
149 
150  buf.strcat("[ ");
151  for (int i = 0; i < list.entries(); i++)
152  {
153  if (i)
154  buf.strcat(", ");
155  buf.strcat("( ");
156  buf.append("");
157  buf.appendSprintf("%s", (list(i).enable) ? "true" : "false");
158  buf.append(", ");
159  { UT_String tmp; tmp = UT_StringWrap(list(i).name).makeQuotedString('"'); buf.strcat(tmp); }
160  buf.append(", ");
161  buf.appendSprintf("%d", (int) list(i).existing);
162  buf.append(", ");
163  buf.appendSprintf("%s", (list(i).createvarmap) ? "true" : "false");
164  buf.append(", ");
165  { UT_String tmp; tmp = UT_StringWrap(list(i).varname).makeQuotedString('"'); buf.strcat(tmp); }
166  buf.append(", ");
167  buf.appendSprintf("%d", (int) list(i)._class);
168  buf.append(", ");
169  buf.appendSprintf("%s", (list(i).savetoinfo) ? "true" : "false");
170  buf.append(", ");
171  buf.appendSprintf("%d", (int) list(i).type);
172  buf.append(", ");
173  buf.appendSprintf("%d", (int) list(i).typeinfo);
174  buf.append(", ");
175  buf.appendSprintf("%d", (int) list(i).precision);
176  buf.append(", ");
177  buf.appendSprintf("%d", (int) list(i).size);
178  buf.append(", ");
179  buf.appendSprintf("(%f, %f, %f, %f)", list(i).defaultv.x(), list(i).defaultv.y(), list(i).defaultv.z(), list(i).defaultv.w());
180  buf.append(", ");
181  buf.appendSprintf("%s", (list(i).writevalues) ? "true" : "false");
182  buf.append(", ");
183  buf.appendSprintf("%s", (list(i).uselocal) ? "true" : "false");
184  buf.append(", ");
185  buf.appendSprintf("(%f, %f, %f, %f)", list(i).valuev.x(), list(i).valuev.y(), list(i).valuev.z(), list(i).valuev.w());
186  buf.append(", ");
187  { UT_String tmp; tmp = UT_StringWrap(list(i).string).makeQuotedString('"'); buf.strcat(tmp); }
188 
189  buf.strcat(" )");
190  }
191  buf.strcat(" ]");
192 
193  UT_StringHolder result = buf;
194  return result;
195  }
196 
198  {
199  myGroup = ""_sh;
200  myGrouptype = 0;
201 
202  }
203 
204  explicit SOP_AttribCreate_2_0Parms(const SOP_AttribCreate_2_0Parms &) = default;
205 
207 
209  {
210  if (myGroup != src.myGroup) return false;
211  if (myGrouptype != src.myGrouptype) return false;
212  if (myNumattr != src.myNumattr) return false;
213 
214  return true;
215  }
222 
223 
224 
225  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
226  {
227  if (true)
228  OP_Utils::evalOpParm(myGroup, node, "group", time, 0);
229  else myGroup = ""_sh;
230  if (true)
231  OP_Utils::evalOpParm(myGrouptype, node, "grouptype", time, 0);
232  else myGrouptype = 0;
233  if (true)
234  {
235  int64 length;
236  OP_Utils::evalOpParm(length, node, "numattr", time, 0);
237  myNumattr.entries(length);
238  for (exint i = 0; i < length; i++)
239  {
240  int parmidx = i+1;
241  auto && _curentry = myNumattr(i);
242  (void) _curentry;
243  if (true)
244  OP_Utils::evalOpParmInst(myNumattr(i).enable, node, "enable#", &parmidx, time, 0);
245  else myNumattr(i).enable = false;
246  if (true && ( (!(((_curentry.enable==0)))) ) )
247  OP_Utils::evalOpParmInst(myNumattr(i).name, node, "name#", &parmidx, time, 0);
248  else myNumattr(i).name = "attribute#"_sh;
249  if (true && ( (!(((_curentry.enable==0)))) ) )
250  OP_Utils::evalOpParmInst(myNumattr(i).existing, node, "existing#", &parmidx, time, 0);
251  else myNumattr(i).existing = 3;
252  if (true && ( (!(((_curentry.enable==0)))) ) )
253  OP_Utils::evalOpParmInst(myNumattr(i).createvarmap, node, "createvarmap#", &parmidx, time, 0);
254  else myNumattr(i).createvarmap = false;
255  if (true && ( (!(((_curentry.enable==0))||((_curentry.createvarmap==0)))) ) )
256  OP_Utils::evalOpParmInst(myNumattr(i).varname, node, "varname#", &parmidx, time, 0);
257  else myNumattr(i).varname = ""_sh;
258  if (true && ( (!(((_curentry.enable==0)))) ) )
259  OP_Utils::evalOpParmInst(myNumattr(i)._class, node, "class#", &parmidx, time, 0);
260  else myNumattr(i)._class = 2;
261  if (true && ( (!(((_curentry.enable==0))||((_curentry._class!=0)))) ) )
262  OP_Utils::evalOpParmInst(myNumattr(i).savetoinfo, node, "savetoinfo#", &parmidx, time, 0);
263  else myNumattr(i).savetoinfo = false;
264  if (true && ( (!(((_curentry.enable==0)))) ) )
265  OP_Utils::evalOpParmInst(myNumattr(i).type, node, "type#", &parmidx, time, 0);
266  else myNumattr(i).type = 0;
267  if (true && ( (!(((_curentry.enable==0))||((_curentry.type!=0)))) ) )
268  OP_Utils::evalOpParmInst(myNumattr(i).typeinfo, node, "typeinfo#", &parmidx, time, 0);
269  else myNumattr(i).typeinfo = 0;
270  if (true && ( (!(((_curentry.enable==0))||((_curentry.type==3))||((_curentry.type==6)))) ) )
271  OP_Utils::evalOpParmInst(myNumattr(i).precision, node, "precision#", &parmidx, time, 0);
272  else myNumattr(i).precision = 2;
273  if (true && ( (!(((_curentry.enable==0))||((_curentry.type==2))||((_curentry.type==3)))) ) )
274  OP_Utils::evalOpParmInst(myNumattr(i).size, node, "size#", &parmidx, time, 0);
275  else myNumattr(i).size = 1;
276  if (true && ( (!(((_curentry.enable==0))||((_curentry.type==3))||((_curentry.type==4))||((_curentry.type==5))||((_curentry.type==6)))) ) )
277  OP_Utils::evalOpParmInst(myNumattr(i).defaultv, node, "default#v", &parmidx, time, 0);
278  else myNumattr(i).defaultv = UT_Vector4D(0,0,0,0);
279  if (true && ( (!(((_curentry.enable==0))||((_curentry.type==4))||((_curentry.type==5))||((_curentry.type==6)))) ) )
280  OP_Utils::evalOpParmInst(myNumattr(i).writevalues, node, "writevalues#", &parmidx, time, 0);
281  else myNumattr(i).writevalues = false;
282  if (true && ( (!(((_curentry.enable==0))||((_curentry.writevalues==0))||((_curentry.type==4))||((_curentry.type==5))||((_curentry.type==6)))) ) )
283  OP_Utils::evalOpParmInst(myNumattr(i).uselocal, node, "uselocal#", &parmidx, time, 0);
284  else myNumattr(i).uselocal = false;
285  if (true && ( (!(((_curentry.enable==0))||((_curentry.writevalues==0))||((_curentry.type!=0)&&(_curentry.type!=1)&&(_curentry.type!=2)))) ) )
286  OP_Utils::evalOpParmInst(myNumattr(i).valuev, node, "value#v", &parmidx, time, 0);
287  else myNumattr(i).valuev = UT_Vector4D(0,0,0,0);
288  if (true && ( (!(((_curentry.enable==0))||((_curentry.writevalues==0))||((_curentry.type!=3)))) ) )
289  OP_Utils::evalOpParmInst(myNumattr(i).string, node, "string#", &parmidx, time, 0);
290  else myNumattr(i).string = ""_sh;
291 
292  }
293  }
294  else
295  myNumattr.clear();
296 
297  }
298 
299 
300  virtual void loadFromOpSubclass(const LoadParms &loadparms)
301  {
302  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
303  }
304 
305 
306  virtual void copyFrom(const SOP_NodeParms *src)
307  {
308  *this = *((const SOP_AttribCreate_2_0Parms *)src);
309  }
310 
311  template <typename T>
312  void
313  doGetParmValue(exint idx, T &value) const
314  {
315  switch (idx)
316  {
317  case 0:
318  coerceValue(value, myGroup);
319  break;
320  case 1:
321  coerceValue(value, myGrouptype);
322  break;
323 
324  }
325  }
326 
327  void getParmValue(exint idx, exint &value) const
328  { doGetParmValue(idx, value); }
329  void getParmValue(exint idx, fpreal &value) const
330  { doGetParmValue(idx, value); }
332  { doGetParmValue(idx, value); }
334  { doGetParmValue(idx, value); }
336  { doGetParmValue(idx, value); }
338  { doGetParmValue(idx, value); }
340  { doGetParmValue(idx, value); }
342  { doGetParmValue(idx, value); }
344  { doGetParmValue(idx, value); }
346  { doGetParmValue(idx, value); }
348  { doGetParmValue(idx, value); }
349 
350  template <typename T>
351  void
352  doSetParmValue(exint idx, const T &value)
353  {
354  switch (idx)
355  {
356  case 0:
357  coerceValue(myGroup, value);
358  break;
359  case 1:
360  coerceValue(myGrouptype, value);
361  break;
362 
363  }
364  }
365 
366  void setParmValue(exint idx, const exint &value)
367  { doSetParmValue(idx, value); }
368  void setParmValue(exint idx, const fpreal &value)
369  { doSetParmValue(idx, value); }
370  void setParmValue(exint idx, const UT_Vector2D &value)
371  { doSetParmValue(idx, value); }
372  void setParmValue(exint idx, const UT_Vector3D &value)
373  { doSetParmValue(idx, value); }
374  void setParmValue(exint idx, const UT_Vector4D &value)
375  { doSetParmValue(idx, value); }
376  void setParmValue(exint idx, const UT_Matrix2D &value)
377  { doSetParmValue(idx, value); }
378  void setParmValue(exint idx, const UT_Matrix3D &value)
379  { doSetParmValue(idx, value); }
380  void setParmValue(exint idx, const UT_Matrix4D &value)
381  { doSetParmValue(idx, value); }
383  { doSetParmValue(idx, value); }
385  { doSetParmValue(idx, value); }
387  { doSetParmValue(idx, value); }
388 
389  virtual exint getNumParms() const
390  {
391  return 3;
392  }
393 
394  virtual const char *getParmName(exint fieldnum) const
395  {
396  switch (fieldnum)
397  {
398  case 0:
399  return "group";
400  case 1:
401  return "grouptype";
402  case 2:
403  return "numattr";
404 
405  }
406  return 0;
407  }
408 
409  virtual ParmType getParmType(exint fieldnum) const
410  {
411  switch (fieldnum)
412  {
413  case 0:
414  return PARM_STRING;
415  case 1:
416  return PARM_INTEGER;
417 
418  }
419  return PARM_UNSUPPORTED;
420  }
421 
422  // Boiler plate to load individual types.
423  static void loadData(UT_IStream &is, int64 &v)
424  { is.bread(&v, 1); }
425  static void loadData(UT_IStream &is, bool &v)
426  { int64 iv; is.bread(&iv, 1); v = iv; }
427  static void loadData(UT_IStream &is, fpreal64 &v)
428  { is.bread<fpreal64>(&v, 1); }
429  static void loadData(UT_IStream &is, UT_Vector2D &v)
430  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
431  static void loadData(UT_IStream &is, UT_Vector3D &v)
432  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
433  is.bread<fpreal64>(&v.z(), 1); }
434  static void loadData(UT_IStream &is, UT_Vector4D &v)
435  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
436  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
437  static void loadData(UT_IStream &is, UT_Matrix2D &v)
438  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
439  static void loadData(UT_IStream &is, UT_Matrix3D &v)
440  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
441  static void loadData(UT_IStream &is, UT_Matrix4D &v)
442  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
443  static void loadData(UT_IStream &is, UT_Vector2I &v)
444  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
445  static void loadData(UT_IStream &is, UT_Vector3I &v)
446  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
447  is.bread<int64>(&v.z(), 1); }
448  static void loadData(UT_IStream &is, UT_Vector4I &v)
449  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
450  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
452  { is.bread(v); }
454  { UT_StringHolder rampdata;
455  loadData(is, rampdata);
456  if (rampdata.isstring())
457  {
458  v.reset(new UT_Ramp());
459  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
460  v->load(istr);
461  }
462  else v.reset();
463  }
466  loadData(is, data);
467  if (data.isstring())
468  {
469  // Find the data type.
470  char *colon = UT_StringWrap(data).findChar(':');
471  if (colon)
472  {
473  int typelen = colon - data.buffer();
475  type.strncpy(data.buffer(), typelen);
476  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
477 
478  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
479  }
480  }
481  else v.reset();
482  }
483 
484  static void saveData(std::ostream &os, int64 v)
485  { UTwrite(os, &v); }
486  static void saveData(std::ostream &os, bool v)
487  { int64 iv = v; UTwrite(os, &iv); }
488  static void saveData(std::ostream &os, fpreal64 v)
489  { UTwrite<fpreal64>(os, &v); }
490  static void saveData(std::ostream &os, UT_Vector2D v)
491  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
492  static void saveData(std::ostream &os, UT_Vector3D v)
493  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
494  UTwrite<fpreal64>(os, &v.z()); }
495  static void saveData(std::ostream &os, UT_Vector4D v)
496  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
497  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
498  static void saveData(std::ostream &os, UT_Matrix2D v)
500  static void saveData(std::ostream &os, UT_Matrix3D v)
502  static void saveData(std::ostream &os, UT_Matrix4D v)
504  static void saveData(std::ostream &os, UT_StringHolder s)
505  { UT_StringWrap(s).saveBinary(os); }
506  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
507  { UT_StringHolder result;
508  UT_OStringStream ostr;
509  if (s) s->save(ostr);
510  result = ostr.str();
511  saveData(os, result);
512  }
513  static void saveData(std::ostream &os, PRM_DataItemHandle s)
514  { UT_StringHolder result;
515  UT_OStringStream ostr;
516  if (s)
517  {
518  ostr << s->getDataTypeToken();
519  ostr << ":";
520  s->saveBinary(ostr);
521  }
522  result = ostr.str();
523  saveData(os, result);
524  }
525 
526 
527  void save(std::ostream &os) const
528  {
529  int32 v = version();
530  UTwrite(os, &v);
531  saveData(os, myGroup);
532  saveData(os, myGrouptype);
533  {
534  int64 length = myNumattr.entries();
535  UTwrite(os, &length);
536  for (exint i = 0; i < length; i++)
537  {
538  saveData(os, myNumattr(i).enable);
539  saveData(os, myNumattr(i).name);
540  saveData(os, myNumattr(i).existing);
541  saveData(os, myNumattr(i).createvarmap);
542  saveData(os, myNumattr(i).varname);
543  saveData(os, myNumattr(i)._class);
544  saveData(os, myNumattr(i).savetoinfo);
545  saveData(os, myNumattr(i).type);
546  saveData(os, myNumattr(i).typeinfo);
547  saveData(os, myNumattr(i).precision);
548  saveData(os, myNumattr(i).size);
549  saveData(os, myNumattr(i).defaultv);
550  saveData(os, myNumattr(i).writevalues);
551  saveData(os, myNumattr(i).uselocal);
552  saveData(os, myNumattr(i).valuev);
553  saveData(os, myNumattr(i).string);
554 
555  }
556  }
557 
558  }
559 
560  bool load(UT_IStream &is)
561  {
562  int32 v;
563  is.bread(&v, 1);
564  if (version() != v)
565  {
566  // Fail incompatible versions
567  return false;
568  }
569  loadData(is, myGroup);
570  loadData(is, myGrouptype);
571  {
572  int64 length;
573  is.read(&length, 1);
574  myNumattr.entries(length);
575  for (exint i = 0; i < length; i++)
576  {
577  loadData(is, myNumattr(i).enable);
578  loadData(is, myNumattr(i).name);
579  loadData(is, myNumattr(i).existing);
580  loadData(is, myNumattr(i).createvarmap);
581  loadData(is, myNumattr(i).varname);
582  loadData(is, myNumattr(i)._class);
583  loadData(is, myNumattr(i).savetoinfo);
584  loadData(is, myNumattr(i).type);
585  loadData(is, myNumattr(i).typeinfo);
586  loadData(is, myNumattr(i).precision);
587  loadData(is, myNumattr(i).size);
588  loadData(is, myNumattr(i).defaultv);
589  loadData(is, myNumattr(i).writevalues);
590  loadData(is, myNumattr(i).uselocal);
591  loadData(is, myNumattr(i).valuev);
592  loadData(is, myNumattr(i).string);
593 
594  }
595  }
596 
597  return true;
598  }
599 
600  const UT_StringHolder & getGroup() const { return myGroup; }
601  void setGroup(const UT_StringHolder & val) { myGroup = val; }
603  {
604  SOP_Node *thissop = cookparms.getNode();
605  if (!thissop) return getGroup();
606  UT_StringHolder result;
607  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
608  return result;
609  }
610  Grouptype getGrouptype() const { return Grouptype(myGrouptype); }
611  void setGrouptype(Grouptype val) { myGrouptype = int64(val); }
613  {
614  SOP_Node *thissop = cookparms.getNode();
615  if (!thissop) return getGrouptype();
616  int64 result;
617  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
618  return Grouptype(result);
619  }
620  const UT_Array<Numattr> &getNumattr() const { return myNumattr; }
621  void setNumattr(const UT_Array<Numattr> &val) { myNumattr = val; }
622  exint opNumattr(const SOP_NodeVerb::CookParms &cookparms) const
623  {
624  SOP_Node *thissop = cookparms.getNode();
625  if (!thissop) return getNumattr().entries();
626  exint result;
627  OP_Utils::evalOpParm(result, thissop, "numattr", cookparms.getCookTime(), 0);
628  return result;
629  }
630  bool opNumattr_enable(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
631  {
632  SOP_Node *thissop = cookparms.getNode();
633  if (!thissop) return (myNumattr(_idx).enable);
634  int _parmidx = _idx + 1;
635  bool result;
636  OP_Utils::evalOpParmInst(result, thissop, "enable#", &_parmidx, cookparms.getCookTime(), 0);
637  return (result);
638  }
640  {
641  SOP_Node *thissop = cookparms.getNode();
642  if (!thissop) return (myNumattr(_idx).name);
643  int _parmidx = _idx + 1;
644  UT_StringHolder result;
645  OP_Utils::evalOpParmInst(result, thissop, "name#", &_parmidx, cookparms.getCookTime(), 0);
646  return (result);
647  }
649  {
650  SOP_Node *thissop = cookparms.getNode();
651  if (!thissop) return (myNumattr(_idx).existing);
652  int _parmidx = _idx + 1;
653  int64 result;
654  OP_Utils::evalOpParmInst(result, thissop, "existing#", &_parmidx, cookparms.getCookTime(), 0);
655  return (result);
656  }
657  bool opNumattr_createvarmap(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
658  {
659  SOP_Node *thissop = cookparms.getNode();
660  if (!thissop) return (myNumattr(_idx).createvarmap);
661  int _parmidx = _idx + 1;
662  bool result;
663  OP_Utils::evalOpParmInst(result, thissop, "createvarmap#", &_parmidx, cookparms.getCookTime(), 0);
664  return (result);
665  }
667  {
668  SOP_Node *thissop = cookparms.getNode();
669  if (!thissop) return (myNumattr(_idx).varname);
670  int _parmidx = _idx + 1;
671  UT_StringHolder result;
672  OP_Utils::evalOpParmInst(result, thissop, "varname#", &_parmidx, cookparms.getCookTime(), 0);
673  return (result);
674  }
675  int64 opNumattr__class(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
676  {
677  SOP_Node *thissop = cookparms.getNode();
678  if (!thissop) return (myNumattr(_idx)._class);
679  int _parmidx = _idx + 1;
680  int64 result;
681  OP_Utils::evalOpParmInst(result, thissop, "class#", &_parmidx, cookparms.getCookTime(), 0);
682  return (result);
683  }
684  bool opNumattr_savetoinfo(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
685  {
686  SOP_Node *thissop = cookparms.getNode();
687  if (!thissop) return (myNumattr(_idx).savetoinfo);
688  int _parmidx = _idx + 1;
689  bool result;
690  OP_Utils::evalOpParmInst(result, thissop, "savetoinfo#", &_parmidx, cookparms.getCookTime(), 0);
691  return (result);
692  }
693  int64 opNumattr_type(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
694  {
695  SOP_Node *thissop = cookparms.getNode();
696  if (!thissop) return (myNumattr(_idx).type);
697  int _parmidx = _idx + 1;
698  int64 result;
699  OP_Utils::evalOpParmInst(result, thissop, "type#", &_parmidx, cookparms.getCookTime(), 0);
700  return (result);
701  }
703  {
704  SOP_Node *thissop = cookparms.getNode();
705  if (!thissop) return (myNumattr(_idx).typeinfo);
706  int _parmidx = _idx + 1;
707  int64 result;
708  OP_Utils::evalOpParmInst(result, thissop, "typeinfo#", &_parmidx, cookparms.getCookTime(), 0);
709  return (result);
710  }
712  {
713  SOP_Node *thissop = cookparms.getNode();
714  if (!thissop) return (myNumattr(_idx).precision);
715  int _parmidx = _idx + 1;
716  int64 result;
717  OP_Utils::evalOpParmInst(result, thissop, "precision#", &_parmidx, cookparms.getCookTime(), 0);
718  return (result);
719  }
720  int64 opNumattr_size(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
721  {
722  SOP_Node *thissop = cookparms.getNode();
723  if (!thissop) return (myNumattr(_idx).size);
724  int _parmidx = _idx + 1;
725  int64 result;
726  OP_Utils::evalOpParmInst(result, thissop, "size#", &_parmidx, cookparms.getCookTime(), 0);
727  return (result);
728  }
730  {
731  SOP_Node *thissop = cookparms.getNode();
732  if (!thissop) return (myNumattr(_idx).defaultv);
733  int _parmidx = _idx + 1;
734  UT_Vector4D result;
735  OP_Utils::evalOpParmInst(result, thissop, "default#v", &_parmidx, cookparms.getCookTime(), 0);
736  return (result);
737  }
738  bool opNumattr_writevalues(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
739  {
740  SOP_Node *thissop = cookparms.getNode();
741  if (!thissop) return (myNumattr(_idx).writevalues);
742  int _parmidx = _idx + 1;
743  bool result;
744  OP_Utils::evalOpParmInst(result, thissop, "writevalues#", &_parmidx, cookparms.getCookTime(), 0);
745  return (result);
746  }
747  bool opNumattr_uselocal(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
748  {
749  SOP_Node *thissop = cookparms.getNode();
750  if (!thissop) return (myNumattr(_idx).uselocal);
751  int _parmidx = _idx + 1;
752  bool result;
753  OP_Utils::evalOpParmInst(result, thissop, "uselocal#", &_parmidx, cookparms.getCookTime(), 0);
754  return (result);
755  }
757  {
758  SOP_Node *thissop = cookparms.getNode();
759  if (!thissop) return (myNumattr(_idx).valuev);
760  int _parmidx = _idx + 1;
761  UT_Vector4D result;
762  OP_Utils::evalOpParmInst(result, thissop, "value#v", &_parmidx, cookparms.getCookTime(), 0);
763  return (result);
764  }
766  {
767  SOP_Node *thissop = cookparms.getNode();
768  if (!thissop) return (myNumattr(_idx).string);
769  int _parmidx = _idx + 1;
770  UT_StringHolder result;
771  OP_Utils::evalOpParmInst(result, thissop, "string#", &_parmidx, cookparms.getCookTime(), 0);
772  return (result);
773  }
774 
775 
776 private:
777  UT_StringHolder myGroup;
778  int64 myGrouptype;
779  UT_Array<Numattr> myNumattr;
780 
781 };
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:492
void setParmValue(exint idx, const exint &value)
T & z(void)
Definition: UT_Vector4.h:372
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)
fpreal getTime() const
Definition: OP_Context.h:34
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
T & x(void)
Definition: UT_Vector2.h:284
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
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:581
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:585
long long int64
Definition: SYS_Types.h:100
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
void append(char character)
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
int64 exint
Definition: SYS_Types.h:109
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:185
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:280
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:28
static void saveData(std::ostream &os, UT_Matrix2D v)
T & y(void)
Definition: UT_Vector4.h:370
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
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)
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:446
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:583
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:263
void strncpy(const char *src, exint maxlen)
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)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
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
const char * buffer() 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:499
T & x(void)
Definition: UT_Vector4.h:368
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:286
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
void strcat(const char *src)
virtual const char * getParmName(exint fieldnum) const
T & w(void)
Definition: UT_Vector4.h:374
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
SYS_FORCE_INLINE bool isstring() const
Grouptype opGrouptype(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const UT_Vector2D &value)
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794
GLenum src
Definition: glcorearb.h:1792