HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Add.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_AddEnums
22 {
23  enum class Add
24  {
25  ALL = 0,
26  GROUP,
27  SKIP,
28  SEP,
29  ATTRIBUTE
30  };
31 }
32 
33 
35 {
36 public:
37  static int version() { return 1; }
38  struct Points
39  {
40  bool usept;
43 
44 
46  {
47  usept = false;
48  pt = UT_Vector3D(0,0,0);
49  weight = 1;
50 
51  }
52 
53  bool operator==(const Points &src) const
54  {
55  if (usept != src.usept) return false;
56  if (pt != src.pt) return false;
57  if (weight != src.weight) return false;
58 
59  return true;
60  }
61  bool operator!=(const Points &src) const
62  {
63  return !operator==(src);
64  }
65 
66  };
67 
69  {
71 
72  buf.strcat("[ ");
73  for (int i = 0; i < list.entries(); i++)
74  {
75  if (i)
76  buf.strcat(", ");
77  buf.strcat("( ");
78  buf.append("");
79  buf.appendSprintf("%s", (list(i).usept) ? "true" : "false");
80  buf.append(", ");
81  buf.appendSprintf("(%f, %f, %f)", list(i).pt.x(), list(i).pt.y(), list(i).pt.z());
82  buf.append(", ");
83  buf.appendSprintf("%f", (list(i).weight));
84 
85  buf.strcat(" )");
86  }
87  buf.strcat(" ]");
88 
89  UT_StringHolder result = buf;
90  return result;
91  }
92  struct Prims
93  {
95  bool closed;
96 
97 
99  {
100  prim = ""_sh;
101  closed = false;
102 
103  }
104 
105  bool operator==(const Prims &src) const
106  {
107  if (prim != src.prim) return false;
108  if (closed != src.closed) return false;
109 
110  return true;
111  }
112  bool operator!=(const Prims &src) const
113  {
114  return !operator==(src);
115  }
116 
117  };
118 
120  {
122 
123  buf.strcat("[ ");
124  for (int i = 0; i < list.entries(); i++)
125  {
126  if (i)
127  buf.strcat(", ");
128  buf.strcat("( ");
129  buf.append("");
130  { UT_String tmp; tmp = UT_StringWrap(list(i).prim).makeQuotedString('"'); buf.strcat(tmp); }
131  buf.append(", ");
132  buf.appendSprintf("%s", (list(i).closed) ? "true" : "false");
133 
134  buf.strcat(" )");
135  }
136  buf.strcat(" ]");
137 
138  UT_StringHolder result = buf;
139  return result;
140  }
141 
143  {
144  myKeep = false;
145  myRemove = false;
146  mySwitcher = 0;
147  myGroup = ""_sh;
148  myAdd = 0;
149  myInc = 2;
150  myAttrname = ""_sh;
151  myClosedall = false;
152  myAddparticlesystem = false;
153  myParticlegroup = ""_sh;
154  myAppendunusedtoparticlesystem = false;
155 
156  }
157 
158  explicit SOP_AddParms(const SOP_AddParms &) = default;
159 
160  virtual ~SOP_AddParms() {}
161 
162  bool operator==(const SOP_AddParms &src) const
163  {
164  if (myKeep != src.myKeep) return false;
165  if (myPoints != src.myPoints) return false;
166  if (myRemove != src.myRemove) return false;
167  if (myPrims != src.myPrims) return false;
168  if (mySwitcher != src.mySwitcher) return false;
169  if (myGroup != src.myGroup) return false;
170  if (myAdd != src.myAdd) return false;
171  if (myInc != src.myInc) return false;
172  if (myAttrname != src.myAttrname) return false;
173  if (myClosedall != src.myClosedall) return false;
174  if (myAddparticlesystem != src.myAddparticlesystem) return false;
175  if (myParticlegroup != src.myParticlegroup) return false;
176  if (myAppendunusedtoparticlesystem != src.myAppendunusedtoparticlesystem) return false;
177 
178  return true;
179  }
180  bool operator!=(const SOP_AddParms &src) const
181  {
182  return !operator==(src);
183  }
185 
186 
187 
188  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
189  {
190  if (true && ( (!((((node->getInput(0)!=0)==0)))) ) )
191  OP_Utils::evalOpParm(myKeep, node, "keep", time, 0);
192  else myKeep = false;
193  if (true)
194  {
195  int64 length;
196  OP_Utils::evalOpParm(length, node, "points", time, 0);
197  myPoints.entries(length);
198  for (exint i = 0; i < length; i++)
199  {
200  int parmidx = i+0;
201  auto && _curentry = myPoints(i);
202  (void) _curentry;
203  if (true)
204  OP_Utils::evalOpParmInst(myPoints(i).usept, node, "usept#", &parmidx, time, 0);
205  else myPoints(i).usept = false;
206  if (true && ( (!(((_curentry.usept==0)))) ) )
207  OP_Utils::evalOpParmInst(myPoints(i).pt, node, "pt#", &parmidx, time, 0);
208  else myPoints(i).pt = UT_Vector3D(0,0,0);
209  if (true && ( (!(((_curentry.usept==0)))) ) )
210  OP_Utils::evalOpParmInst(myPoints(i).weight, node, "weight#", &parmidx, time, 0);
211  else myPoints(i).weight = 1;
212 
213  }
214  }
215  else
216  myPoints.clear();
217  if (true)
218  OP_Utils::evalOpParm(myRemove, node, "remove", time, 0);
219  else myRemove = false;
220  if (true)
221  {
222  int64 length;
223  OP_Utils::evalOpParm(length, node, "prims", time, 0);
224  myPrims.entries(length);
225  for (exint i = 0; i < length; i++)
226  {
227  int parmidx = i+0;
228  auto && _curentry = myPrims(i);
229  (void) _curentry;
230  if (true)
231  OP_Utils::evalOpParmInst(myPrims(i).prim, node, "prim#", &parmidx, time, 0);
232  else myPrims(i).prim = ""_sh;
233  if (true)
234  OP_Utils::evalOpParmInst(myPrims(i).closed, node, "closed#", &parmidx, time, 0);
235  else myPrims(i).closed = false;
236 
237  }
238  }
239  else
240  myPrims.clear();
241  if (true)
242  OP_Utils::evalOpParm(mySwitcher, node, "switcher", time, 0);
243  else mySwitcher = 0;
244  if (true)
245  OP_Utils::evalOpParm(myGroup, node, "group", time, 0);
246  else myGroup = ""_sh;
247  if (true)
248  OP_Utils::evalOpParm(myAdd, node, "add", time, 0);
249  else myAdd = 0;
250  if (true && ( (!(((int64(getAdd())==0))||((int64(getAdd())==3))||((int64(getAdd())==4)))) ) )
251  OP_Utils::evalOpParm(myInc, node, "inc", time, 0);
252  else myInc = 2;
253  if (true && ( (!(((int64(getAdd())!=4)))) ) )
254  OP_Utils::evalOpParm(myAttrname, node, "attrname", time, 0);
255  else myAttrname = ""_sh;
256  if (true)
257  OP_Utils::evalOpParm(myClosedall, node, "closedall", time, 0);
258  else myClosedall = false;
259  if (true)
260  OP_Utils::evalOpParm(myAddparticlesystem, node, "addparticlesystem", time, 0);
261  else myAddparticlesystem = false;
262  if (true && ( (!(((getAddparticlesystem()==0)))) ) )
263  OP_Utils::evalOpParm(myParticlegroup, node, "particlegroup", time, 0);
264  else myParticlegroup = ""_sh;
265  if (true)
266  OP_Utils::evalOpParm(myAppendunusedtoparticlesystem, node, "appendunusedtoparticlesystem", time, 0);
267  else myAppendunusedtoparticlesystem = false;
268 
269  }
270 
271 
272  virtual void loadFromOpSubclass(const LoadParms &loadparms)
273  {
274  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
275  }
276 
277 
278  virtual void copyFrom(const SOP_NodeParms *src)
279  {
280  *this = *((const SOP_AddParms *)src);
281  }
282 
283  template <typename T>
284  void
285  doGetParmValue(exint idx, T &value) const
286  {
287  switch (idx)
288  {
289  case 0:
290  coerceValue(value, myKeep);
291  break;
292  case 2:
293  coerceValue(value, myRemove);
294  break;
295  case 4:
296  coerceValue(value, mySwitcher);
297  break;
298  case 5:
299  coerceValue(value, myGroup);
300  break;
301  case 6:
302  coerceValue(value, myAdd);
303  break;
304  case 7:
305  coerceValue(value, myInc);
306  break;
307  case 8:
308  coerceValue(value, myAttrname);
309  break;
310  case 9:
311  coerceValue(value, myClosedall);
312  break;
313  case 10:
314  coerceValue(value, myAddparticlesystem);
315  break;
316  case 11:
317  coerceValue(value, myParticlegroup);
318  break;
319  case 12:
320  coerceValue(value, myAppendunusedtoparticlesystem);
321  break;
322 
323  }
324  }
325 
326  void getParmValue(exint idx, exint &value) const
327  { doGetParmValue(idx, value); }
328  void getParmValue(exint idx, fpreal &value) const
329  { doGetParmValue(idx, value); }
331  { doGetParmValue(idx, value); }
333  { doGetParmValue(idx, value); }
335  { doGetParmValue(idx, value); }
337  { doGetParmValue(idx, value); }
339  { doGetParmValue(idx, value); }
341  { doGetParmValue(idx, value); }
343  { doGetParmValue(idx, value); }
345  { doGetParmValue(idx, value); }
347  { doGetParmValue(idx, value); }
348 
349  template <typename T>
350  void
351  doSetParmValue(exint idx, const T &value)
352  {
353  switch (idx)
354  {
355  case 0:
356  coerceValue(myKeep, value);
357  break;
358  case 2:
359  coerceValue(myRemove, value);
360  break;
361  case 4:
362  coerceValue(mySwitcher, value);
363  break;
364  case 5:
365  coerceValue(myGroup, value);
366  break;
367  case 6:
368  coerceValue(myAdd, value);
369  break;
370  case 7:
371  coerceValue(myInc, value);
372  break;
373  case 8:
374  coerceValue(myAttrname, value);
375  break;
376  case 9:
377  coerceValue(myClosedall, value);
378  break;
379  case 10:
380  coerceValue(myAddparticlesystem, value);
381  break;
382  case 11:
383  coerceValue(myParticlegroup, value);
384  break;
385  case 12:
386  coerceValue(myAppendunusedtoparticlesystem, value);
387  break;
388 
389  }
390  }
391 
392  void setParmValue(exint idx, const exint &value)
393  { doSetParmValue(idx, value); }
394  void setParmValue(exint idx, const fpreal &value)
395  { doSetParmValue(idx, value); }
396  void setParmValue(exint idx, const UT_Vector2D &value)
397  { doSetParmValue(idx, value); }
398  void setParmValue(exint idx, const UT_Vector3D &value)
399  { doSetParmValue(idx, value); }
400  void setParmValue(exint idx, const UT_Vector4D &value)
401  { doSetParmValue(idx, value); }
402  void setParmValue(exint idx, const UT_Matrix2D &value)
403  { doSetParmValue(idx, value); }
404  void setParmValue(exint idx, const UT_Matrix3D &value)
405  { doSetParmValue(idx, value); }
406  void setParmValue(exint idx, const UT_Matrix4D &value)
407  { doSetParmValue(idx, value); }
409  { doSetParmValue(idx, value); }
411  { doSetParmValue(idx, value); }
413  { doSetParmValue(idx, value); }
414 
415  virtual exint getNumParms() const
416  {
417  return 13;
418  }
419 
420  virtual const char *getParmName(exint fieldnum) const
421  {
422  switch (fieldnum)
423  {
424  case 0:
425  return "keep";
426  case 1:
427  return "points";
428  case 2:
429  return "remove";
430  case 3:
431  return "prims";
432  case 4:
433  return "switcher";
434  case 5:
435  return "group";
436  case 6:
437  return "add";
438  case 7:
439  return "inc";
440  case 8:
441  return "attrname";
442  case 9:
443  return "closedall";
444  case 10:
445  return "addparticlesystem";
446  case 11:
447  return "particlegroup";
448  case 12:
449  return "appendunusedtoparticlesystem";
450 
451  }
452  return 0;
453  }
454 
455  virtual ParmType getParmType(exint fieldnum) const
456  {
457  switch (fieldnum)
458  {
459  case 0:
460  return PARM_INTEGER;
461  case 2:
462  return PARM_INTEGER;
463  case 4:
464  return PARM_INTEGER;
465  case 5:
466  return PARM_STRING;
467  case 6:
468  return PARM_INTEGER;
469  case 7:
470  return PARM_INTEGER;
471  case 8:
472  return PARM_STRING;
473  case 9:
474  return PARM_INTEGER;
475  case 10:
476  return PARM_INTEGER;
477  case 11:
478  return PARM_STRING;
479  case 12:
480  return PARM_INTEGER;
481 
482  }
483  return PARM_UNSUPPORTED;
484  }
485 
486  // Boiler plate to load individual types.
487  static void loadData(UT_IStream &is, int64 &v)
488  { is.bread(&v, 1); }
489  static void loadData(UT_IStream &is, bool &v)
490  { int64 iv; is.bread(&iv, 1); v = iv; }
491  static void loadData(UT_IStream &is, fpreal64 &v)
492  { is.bread<fpreal64>(&v, 1); }
493  static void loadData(UT_IStream &is, UT_Vector2D &v)
494  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
495  static void loadData(UT_IStream &is, UT_Vector3D &v)
496  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
497  is.bread<fpreal64>(&v.z(), 1); }
498  static void loadData(UT_IStream &is, UT_Vector4D &v)
499  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
500  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
501  static void loadData(UT_IStream &is, UT_Matrix2D &v)
502  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
503  static void loadData(UT_IStream &is, UT_Matrix3D &v)
504  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
505  static void loadData(UT_IStream &is, UT_Matrix4D &v)
506  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
507  static void loadData(UT_IStream &is, UT_Vector2I &v)
508  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
509  static void loadData(UT_IStream &is, UT_Vector3I &v)
510  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
511  is.bread<int64>(&v.z(), 1); }
512  static void loadData(UT_IStream &is, UT_Vector4I &v)
513  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
514  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
516  { is.bread(v); }
518  { UT_StringHolder rampdata;
519  loadData(is, rampdata);
520  if (rampdata.isstring())
521  {
522  v.reset(new UT_Ramp());
523  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
524  v->load(istr);
525  }
526  else v.reset();
527  }
530  loadData(is, data);
531  if (data.isstring())
532  {
533  // Find the data type.
534  char *colon = UT_StringWrap(data).findChar(':');
535  if (colon)
536  {
537  int typelen = colon - data.buffer();
539  type.strncpy(data.buffer(), typelen);
540  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
541 
542  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
543  }
544  }
545  else v.reset();
546  }
547 
548  static void saveData(std::ostream &os, int64 v)
549  { UTwrite(os, &v); }
550  static void saveData(std::ostream &os, bool v)
551  { int64 iv = v; UTwrite(os, &iv); }
552  static void saveData(std::ostream &os, fpreal64 v)
553  { UTwrite<fpreal64>(os, &v); }
554  static void saveData(std::ostream &os, UT_Vector2D v)
555  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
556  static void saveData(std::ostream &os, UT_Vector3D v)
557  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
558  UTwrite<fpreal64>(os, &v.z()); }
559  static void saveData(std::ostream &os, UT_Vector4D v)
560  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
561  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
562  static void saveData(std::ostream &os, UT_Matrix2D v)
564  static void saveData(std::ostream &os, UT_Matrix3D v)
566  static void saveData(std::ostream &os, UT_Matrix4D v)
568  static void saveData(std::ostream &os, UT_StringHolder s)
569  { UT_StringWrap(s).saveBinary(os); }
570  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
571  { UT_StringHolder result;
572  UT_OStringStream ostr;
573  if (s) s->save(ostr);
574  result = ostr.str();
575  saveData(os, result);
576  }
577  static void saveData(std::ostream &os, PRM_DataItemHandle s)
578  { UT_StringHolder result;
579  UT_OStringStream ostr;
580  if (s)
581  {
582  ostr << s->getDataTypeToken();
583  ostr << ":";
584  s->saveBinary(ostr);
585  }
586  result = ostr.str();
587  saveData(os, result);
588  }
589 
590 
591  void save(std::ostream &os) const
592  {
593  int32 v = version();
594  UTwrite(os, &v);
595  saveData(os, myKeep);
596  {
597  int64 length = myPoints.entries();
598  UTwrite(os, &length);
599  for (exint i = 0; i < length; i++)
600  {
601  saveData(os, myPoints(i).usept);
602  saveData(os, myPoints(i).pt);
603  saveData(os, myPoints(i).weight);
604 
605  }
606  }
607  saveData(os, myRemove);
608  {
609  int64 length = myPrims.entries();
610  UTwrite(os, &length);
611  for (exint i = 0; i < length; i++)
612  {
613  saveData(os, myPrims(i).prim);
614  saveData(os, myPrims(i).closed);
615 
616  }
617  }
618  saveData(os, mySwitcher);
619  saveData(os, myGroup);
620  saveData(os, myAdd);
621  saveData(os, myInc);
622  saveData(os, myAttrname);
623  saveData(os, myClosedall);
624  saveData(os, myAddparticlesystem);
625  saveData(os, myParticlegroup);
626  saveData(os, myAppendunusedtoparticlesystem);
627 
628  }
629 
630  bool load(UT_IStream &is)
631  {
632  int32 v;
633  is.bread(&v, 1);
634  if (version() != v)
635  {
636  // Fail incompatible versions
637  return false;
638  }
639  loadData(is, myKeep);
640  {
641  int64 length;
642  is.read(&length, 1);
643  myPoints.entries(length);
644  for (exint i = 0; i < length; i++)
645  {
646  loadData(is, myPoints(i).usept);
647  loadData(is, myPoints(i).pt);
648  loadData(is, myPoints(i).weight);
649 
650  }
651  }
652  loadData(is, myRemove);
653  {
654  int64 length;
655  is.read(&length, 1);
656  myPrims.entries(length);
657  for (exint i = 0; i < length; i++)
658  {
659  loadData(is, myPrims(i).prim);
660  loadData(is, myPrims(i).closed);
661 
662  }
663  }
664  loadData(is, mySwitcher);
665  loadData(is, myGroup);
666  loadData(is, myAdd);
667  loadData(is, myInc);
668  loadData(is, myAttrname);
669  loadData(is, myClosedall);
670  loadData(is, myAddparticlesystem);
671  loadData(is, myParticlegroup);
672  loadData(is, myAppendunusedtoparticlesystem);
673 
674  return true;
675  }
676 
677  bool getKeep() const { return myKeep; }
678  void setKeep(bool val) { myKeep = val; }
679  bool opKeep(const SOP_NodeVerb::CookParms &cookparms) const
680  {
681  SOP_Node *thissop = cookparms.getNode();
682  if (!thissop) return getKeep();
683  bool result;
684  OP_Utils::evalOpParm(result, thissop, "keep", cookparms.getCookTime(), 0);
685  return result;
686  }
687  const UT_Array<Points> &getPoints() const { return myPoints; }
688  void setPoints(const UT_Array<Points> &val) { myPoints = val; }
689  exint opPoints(const SOP_NodeVerb::CookParms &cookparms) const
690  {
691  SOP_Node *thissop = cookparms.getNode();
692  if (!thissop) return getPoints().entries();
693  exint result;
694  OP_Utils::evalOpParm(result, thissop, "points", cookparms.getCookTime(), 0);
695  return result;
696  }
697  bool opPoints_usept(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
698  {
699  SOP_Node *thissop = cookparms.getNode();
700  if (!thissop) return (myPoints(_idx).usept);
701  int _parmidx = _idx + 0;
702  bool result;
703  OP_Utils::evalOpParmInst(result, thissop, "usept#", &_parmidx, cookparms.getCookTime(), 0);
704  return (result);
705  }
706  UT_Vector3D opPoints_pt(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
707  {
708  SOP_Node *thissop = cookparms.getNode();
709  if (!thissop) return (myPoints(_idx).pt);
710  int _parmidx = _idx + 0;
711  UT_Vector3D result;
712  OP_Utils::evalOpParmInst(result, thissop, "pt#", &_parmidx, cookparms.getCookTime(), 0);
713  return (result);
714  }
716  {
717  SOP_Node *thissop = cookparms.getNode();
718  if (!thissop) return (myPoints(_idx).weight);
719  int _parmidx = _idx + 0;
720  fpreal64 result;
721  OP_Utils::evalOpParmInst(result, thissop, "weight#", &_parmidx, cookparms.getCookTime(), 0);
722  return (result);
723  }
724 
725  bool getRemove() const { return myRemove; }
726  void setRemove(bool val) { myRemove = val; }
727  bool opRemove(const SOP_NodeVerb::CookParms &cookparms) const
728  {
729  SOP_Node *thissop = cookparms.getNode();
730  if (!thissop) return getRemove();
731  bool result;
732  OP_Utils::evalOpParm(result, thissop, "remove", cookparms.getCookTime(), 0);
733  return result;
734  }
735  const UT_Array<Prims> &getPrims() const { return myPrims; }
736  void setPrims(const UT_Array<Prims> &val) { myPrims = val; }
737  exint opPrims(const SOP_NodeVerb::CookParms &cookparms) const
738  {
739  SOP_Node *thissop = cookparms.getNode();
740  if (!thissop) return getPrims().entries();
741  exint result;
742  OP_Utils::evalOpParm(result, thissop, "prims", cookparms.getCookTime(), 0);
743  return result;
744  }
746  {
747  SOP_Node *thissop = cookparms.getNode();
748  if (!thissop) return (myPrims(_idx).prim);
749  int _parmidx = _idx + 0;
750  UT_StringHolder result;
751  OP_Utils::evalOpParmInst(result, thissop, "prim#", &_parmidx, cookparms.getCookTime(), 0);
752  return (result);
753  }
754  bool opPrims_closed(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
755  {
756  SOP_Node *thissop = cookparms.getNode();
757  if (!thissop) return (myPrims(_idx).closed);
758  int _parmidx = _idx + 0;
759  bool result;
760  OP_Utils::evalOpParmInst(result, thissop, "closed#", &_parmidx, cookparms.getCookTime(), 0);
761  return (result);
762  }
763 
764  int64 getSwitcher() const { return mySwitcher; }
765  void setSwitcher(int64 val) { mySwitcher = val; }
766  int64 opSwitcher(const SOP_NodeVerb::CookParms &cookparms) const
767  {
768  SOP_Node *thissop = cookparms.getNode();
769  if (!thissop) return getSwitcher();
770  int64 result;
771  OP_Utils::evalOpParm(result, thissop, "switcher", cookparms.getCookTime(), 0);
772  return result;
773  }
774  const UT_StringHolder & getGroup() const { return myGroup; }
775  void setGroup(const UT_StringHolder & val) { myGroup = val; }
777  {
778  SOP_Node *thissop = cookparms.getNode();
779  if (!thissop) return getGroup();
780  UT_StringHolder result;
781  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
782  return result;
783  }
784  Add getAdd() const { return Add(myAdd); }
785  void setAdd(Add val) { myAdd = int64(val); }
786  Add opAdd(const SOP_NodeVerb::CookParms &cookparms) const
787  {
788  SOP_Node *thissop = cookparms.getNode();
789  if (!thissop) return getAdd();
790  int64 result;
791  OP_Utils::evalOpParm(result, thissop, "add", cookparms.getCookTime(), 0);
792  return Add(result);
793  }
794  int64 getInc() const { return myInc; }
795  void setInc(int64 val) { myInc = val; }
796  int64 opInc(const SOP_NodeVerb::CookParms &cookparms) const
797  {
798  SOP_Node *thissop = cookparms.getNode();
799  if (!thissop) return getInc();
800  int64 result;
801  OP_Utils::evalOpParm(result, thissop, "inc", cookparms.getCookTime(), 0);
802  return result;
803  }
804  const UT_StringHolder & getAttrname() const { return myAttrname; }
805  void setAttrname(const UT_StringHolder & val) { myAttrname = val; }
807  {
808  SOP_Node *thissop = cookparms.getNode();
809  if (!thissop) return getAttrname();
810  UT_StringHolder result;
811  OP_Utils::evalOpParm(result, thissop, "attrname", cookparms.getCookTime(), 0);
812  return result;
813  }
814  bool getClosedall() const { return myClosedall; }
815  void setClosedall(bool val) { myClosedall = val; }
816  bool opClosedall(const SOP_NodeVerb::CookParms &cookparms) const
817  {
818  SOP_Node *thissop = cookparms.getNode();
819  if (!thissop) return getClosedall();
820  bool result;
821  OP_Utils::evalOpParm(result, thissop, "closedall", cookparms.getCookTime(), 0);
822  return result;
823  }
824  bool getAddparticlesystem() const { return myAddparticlesystem; }
825  void setAddparticlesystem(bool val) { myAddparticlesystem = val; }
826  bool opAddparticlesystem(const SOP_NodeVerb::CookParms &cookparms) const
827  {
828  SOP_Node *thissop = cookparms.getNode();
829  if (!thissop) return getAddparticlesystem();
830  bool result;
831  OP_Utils::evalOpParm(result, thissop, "addparticlesystem", cookparms.getCookTime(), 0);
832  return result;
833  }
834  const UT_StringHolder & getParticlegroup() const { return myParticlegroup; }
835  void setParticlegroup(const UT_StringHolder & val) { myParticlegroup = val; }
837  {
838  SOP_Node *thissop = cookparms.getNode();
839  if (!thissop) return getParticlegroup();
840  UT_StringHolder result;
841  OP_Utils::evalOpParm(result, thissop, "particlegroup", cookparms.getCookTime(), 0);
842  return result;
843  }
844  bool getAppendunusedtoparticlesystem() const { return myAppendunusedtoparticlesystem; }
845  void setAppendunusedtoparticlesystem(bool val) { myAppendunusedtoparticlesystem = val; }
847  {
848  SOP_Node *thissop = cookparms.getNode();
849  if (!thissop) return getAppendunusedtoparticlesystem();
850  bool result;
851  OP_Utils::evalOpParm(result, thissop, "appendunusedtoparticlesystem", cookparms.getCookTime(), 0);
852  return result;
853  }
854 
855 private:
856  bool myKeep;
857  UT_Array<Points> myPoints;
858  bool myRemove;
859  UT_Array<Prims> myPrims;
860  int64 mySwitcher;
861  UT_StringHolder myGroup;
862  int64 myAdd;
863  int64 myInc;
864  UT_StringHolder myAttrname;
865  bool myClosedall;
866  bool myAddparticlesystem;
867  UT_StringHolder myParticlegroup;
868  bool myAppendunusedtoparticlesystem;
869 
870 };
const UT_StringHolder & getGroup() const
bool operator==(const SOP_AddParms &src) const
bool opClosedall(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const Prims &src) const
Add getAdd() const
const UT_StringHolder & getParticlegroup() const
fpreal64 opPoints_weight(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
static void saveData(std::ostream &os, UT_Matrix3D v)
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:494
T & z(void)
Definition: UT_Vector4.h:379
const UT_StringHolder & getAttrname() const
static void saveData(std::ostream &os, UT_Matrix2D v)
UT_StringHolder prim
Definition: SOP_Add.proto.h:94
void getParmValue(exint idx, UT_StringHolder &value) const
bool opKeep(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool operator!=(const SOP_AddParms &src) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
bool opPoints_usept(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
fpreal getTime() const
Definition: OP_Context.h:60
const GLdouble * v
Definition: glcorearb.h:836
static void loadData(UT_IStream &is, UT_Vector4I &v)
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
void setSwitcher(int64 val)
void setClosedall(bool val)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
T & x(void)
Definition: UT_Vector2.h:285
void setPrims(const UT_Array< Prims > &val)
An output stream object that owns its own string buffer storage.
virtual ~SOP_AddParms()
static void saveData(std::ostream &os, UT_Vector4D v)
bool getRemove() const
const UT_WorkBuffer & str() const
Returns a read-only reference to the underlying UT_WorkBuffer.
virtual exint getNumParms() const
void setAdd(Add val)
static void saveData(std::ostream &os, UT_StringHolder s)
void setParticlegroup(const UT_StringHolder &val)
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:498
UT_StringHolder createString(const UT_Array< Prims > &list) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
png_uint_32 i
Definition: png.h:2877
void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
static void saveData(std::ostream &os, UT_Matrix4D v)
void getParmValue(exint idx, UT_Matrix4D &value) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
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
static void loadData(UT_IStream &is, int64 &v)
long long int64
Definition: SYS_Types.h:107
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void getParmValue(exint idx, PRM_DataItemHandle &value) const
void setParmValue(exint idx, const UT_Matrix2D &value)
virtual const char * getParmName(exint fieldnum) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
exint length() const
char * findChar(int c) const
Find first occurrance of character. Returns NULL upon failure.
Definition: UT_String.h:550
void setParmValue(exint idx, const exint &value)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
SYS_FORCE_INLINE const char * buffer() const
bool operator==(const Points &src) const
Definition: SOP_Add.proto.h:53
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
void getParmValue(exint idx, UT_Vector4D &value) const
int64 exint
Definition: SYS_Types.h:116
bool getAppendunusedtoparticlesystem() const
const OP_Node * node() const
Definition: SOP_NodeVerb.h:104
double fpreal64
Definition: SYS_Types.h:192
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:284
bool opAddparticlesystem(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const UT_Vector3D &value)
exint opPoints(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const fpreal &value)
OP_Node * getInput(unsigned idx, bool mark_used=false) const
Returns the node connected to a particular input (may be null).
bool getKeep() const
exint opPrims(const SOP_NodeVerb::CookParms &cookparms) const
bool getAddparticlesystem() const
UT_Vector3T< fpreal64 > UT_Vector3D
void getParmValue(exint idx, exint &value) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void doSetParmValue(exint idx, const T &value)
GLboolean * data
Definition: glcorearb.h:130
bool opRemove(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:35
T & y(void)
Definition: UT_Vector4.h:377
int64 opSwitcher(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, UT_Vector3D v)
void getParmValue(exint idx, UT_Vector2D &value) 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
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:111
static void loadData(UT_IStream &is, fpreal64 &v)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
void setParmValue(exint idx, const UT_Vector4D &value)
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:453
void setParmValue(exint idx, const UT_Matrix3D &value)
bool operator!=(const Points &src) const
Definition: SOP_Add.proto.h:61
void getParmValue(exint idx, fpreal &value) const
void setInc(int64 val)
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
static void saveData(std::ostream &os, bool v)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
bool load(UT_IStream &is)
UT_StringHolder opAttrname(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const Prims &src) const
int64 getSwitcher() const
bool opPrims_closed(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
int64 opInc(const SOP_NodeVerb::CookParms &cookparms) const
void getParmValue(exint idx, UT_Matrix3D &value) const
void setParmValue(exint idx, const UT_Vector2D &value)
void setAppendunusedtoparticlesystem(bool val)
virtual ParmType getParmType(exint fieldnum) const
void setGroup(const UT_StringHolder &val)
Add opAdd(const SOP_NodeVerb::CookParms &cookparms) const
void getParmValue(exint idx, UT_Matrix2D &value) const
bool getClosedall() const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
static void saveData(std::ostream &os, int64 v)
const UT_Array< Points > & getPoints() const
SYS_FORCE_INLINE void append(char character)
GLuint GLfloat * val
Definition: glcorearb.h:1607
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
int64 getInc() const
#define SOP_API
Definition: SOP_API.h:10
static int version()
Definition: SOP_Add.proto.h:37
const UT_Array< Prims > & getPrims() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:501
void setPoints(const UT_Array< Points > &val)
void setParmValue(exint idx, const UT_StringHolder &value)
T & x(void)
Definition: UT_Vector4.h:375
void setAttrname(const UT_StringHolder &val)
void getParmValue(exint idx, UT_Vector3D &value) const
void setParmValue(exint idx, const PRM_DataItemHandle &value)
T & y(void)
Definition: UT_Vector2.h:287
void setAddparticlesystem(bool val)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
GLboolean r
Definition: glcorearb.h:1221
T & w(void)
Definition: UT_Vector4.h:381
static void loadData(UT_IStream &is, UT_Matrix2D &v)
virtual void loadFromOpSubclass(const LoadParms &loadparms)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
UT_StringHolder opParticlegroup(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPrims_prim(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void save(std::ostream &os) const
bool opAppendunusedtoparticlesystem(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: SOP_NodeVerb.h:109
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:88
static void saveData(std::ostream &os, UT_Vector2D v)
SYS_FORCE_INLINE bool isstring() const
UT_Vector3D opPoints_pt(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void doGetParmValue(exint idx, T &value) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setParmValue(exint idx, const UT_Matrix4D &value)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794
virtual void copyFrom(const SOP_NodeParms *src)
void setKeep(bool val)
GLenum src
Definition: glcorearb.h:1792
UT_StringHolder createString(const UT_Array< Points > &list) const
Definition: SOP_Add.proto.h:68
void setRemove(bool val)