HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_SwitchIf.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_SwitchIfEnums
24 {
25  enum class MergeCondition
26  {
27  ALL = 0,
28  ANY,
29  NONE,
30  MISSING
31  };
32 
34  getToken(MergeCondition enum_value)
35  {
36  using namespace UT::Literal;
37  switch (enum_value) {
38  case MergeCondition::ALL: return "all"_sh;
39  case MergeCondition::ANY: return "any"_sh;
40  case MergeCondition::NONE: return "none"_sh;
41  case MergeCondition::MISSING: return "missing"_sh;
42  default: UT_ASSERT(false); return ""_sh;
43  }
44  }
45 
46  enum class TestInput
47  {
48  FIRST = 0,
49  SECOND,
50  SPARE
51  };
52 
54  getToken(TestInput enum_value)
55  {
56  using namespace UT::Literal;
57  switch (enum_value) {
58  case TestInput::FIRST: return "first"_sh;
59  case TestInput::SECOND: return "second"_sh;
60  case TestInput::SPARE: return "spare"_sh;
61  default: UT_ASSERT(false); return ""_sh;
62  }
63  }
64 
65  enum class Type
66  {
67  EXPR = 0,
68  ATTRIB,
69  COUNT,
70  ATTRIBVAL,
71  HASINPUT
72  };
73 
75  getToken(Type enum_value)
76  {
77  using namespace UT::Literal;
78  switch (enum_value) {
79  case Type::EXPR: return "expr"_sh;
80  case Type::ATTRIB: return "attrib"_sh;
81  case Type::COUNT: return "count"_sh;
82  case Type::ATTRIBVAL: return "attribval"_sh;
83  case Type::HASINPUT: return "hasinput"_sh;
84  default: UT_ASSERT(false); return ""_sh;
85  }
86  }
87 
88  enum class Attribtype
89  {
90  ALL = 0,
91  ANY,
92  NONE,
93  MISSING
94  };
95 
97  getToken(Attribtype enum_value)
98  {
99  using namespace UT::Literal;
100  switch (enum_value) {
101  case Attribtype::ALL: return "all"_sh;
102  case Attribtype::ANY: return "any"_sh;
103  case Attribtype::NONE: return "none"_sh;
104  case Attribtype::MISSING: return "missing"_sh;
105  default: UT_ASSERT(false); return ""_sh;
106  }
107  }
108 
109  enum class Attribowner
110  {
111  ANY = 0,
112  DETAIL,
113  PRIM,
114  POINT,
115  VERTEX,
117  };
118 
120  getToken(Attribowner enum_value)
121  {
122  using namespace UT::Literal;
123  switch (enum_value) {
124  case Attribowner::ANY: return "any"_sh;
125  case Attribowner::DETAIL: return "detail"_sh;
126  case Attribowner::PRIM: return "prim"_sh;
127  case Attribowner::POINT: return "point"_sh;
128  case Attribowner::VERTEX: return "vertex"_sh;
129  case Attribowner::POINTVERTEX: return "pointvertex"_sh;
130  default: UT_ASSERT(false); return ""_sh;
131  }
132  }
133 
134  enum class Attribvaltype
135  {
136  FLT = 0,
137  STR
138  };
139 
141  getToken(Attribvaltype enum_value)
142  {
143  using namespace UT::Literal;
144  switch (enum_value) {
145  case Attribvaltype::FLT: return "flt"_sh;
146  case Attribvaltype::STR: return "str"_sh;
147  default: UT_ASSERT(false); return ""_sh;
148  }
149  }
150 
151  enum class Attribfloatcomp
152  {
153  EQUAL = 0,
154  NEQUAL,
155  GREATER,
156  LESS,
157  GEQUAL,
158  LEQUAL
159  };
160 
163  {
164  using namespace UT::Literal;
165  switch (enum_value) {
166  case Attribfloatcomp::EQUAL: return "equal"_sh;
167  case Attribfloatcomp::NEQUAL: return "nequal"_sh;
168  case Attribfloatcomp::GREATER: return "greater"_sh;
169  case Attribfloatcomp::LESS: return "less"_sh;
170  case Attribfloatcomp::GEQUAL: return "gequal"_sh;
171  case Attribfloatcomp::LEQUAL: return "lequal"_sh;
172  default: UT_ASSERT(false); return ""_sh;
173  }
174  }
175 
176  enum class Attribstringcomp
177  {
178  EQUAL = 0,
179  NEQUAL,
180  MATCH,
181  NOMATCH,
182  CONTAINS
183  };
184 
187  {
188  using namespace UT::Literal;
189  switch (enum_value) {
190  case Attribstringcomp::EQUAL: return "equal"_sh;
191  case Attribstringcomp::NEQUAL: return "nequal"_sh;
192  case Attribstringcomp::MATCH: return "match"_sh;
193  case Attribstringcomp::NOMATCH: return "nomatch"_sh;
194  case Attribstringcomp::CONTAINS: return "contains"_sh;
195  default: UT_ASSERT(false); return ""_sh;
196  }
197  }
198 
199  enum class Counttype
200  {
201  POINTS = 0,
202  PRIMS,
203  VERTICES
204  };
205 
207  getToken(Counttype enum_value)
208  {
209  using namespace UT::Literal;
210  switch (enum_value) {
211  case Counttype::POINTS: return "points"_sh;
212  case Counttype::PRIMS: return "prims"_sh;
213  case Counttype::VERTICES: return "vertices"_sh;
214  default: UT_ASSERT(false); return ""_sh;
215  }
216  }
217 
218  enum class Countcomp
219  {
220  EQUAL = 0,
221  NEQUAL,
222  GREATER,
223  LESS,
224  GEQUAL,
225  LEQUAL
226  };
227 
229  getToken(Countcomp enum_value)
230  {
231  using namespace UT::Literal;
232  switch (enum_value) {
233  case Countcomp::EQUAL: return "equal"_sh;
234  case Countcomp::NEQUAL: return "nequal"_sh;
235  case Countcomp::GREATER: return "greater"_sh;
236  case Countcomp::LESS: return "less"_sh;
237  case Countcomp::GEQUAL: return "gequal"_sh;
238  case Countcomp::LEQUAL: return "lequal"_sh;
239  default: UT_ASSERT(false); return ""_sh;
240  }
241  }
242 
243  enum class Hasinputtype
244  {
245  WIRED = 0,
246  NOTWIRED
247  };
248 
250  getToken(Hasinputtype enum_value)
251  {
252  using namespace UT::Literal;
253  switch (enum_value) {
254  case Hasinputtype::WIRED: return "wired"_sh;
255  case Hasinputtype::NOTWIRED: return "notwired"_sh;
256  default: UT_ASSERT(false); return ""_sh;
257  }
258  }
259 
260 }
261 
262 
264 {
265 public:
266  static int version() { return 1; }
267  struct Tests
268  {
269  bool enable;
285 
286 
288  {
289  enable = true;
290  type = 0;
291  expr = 1;
292  attribtype = 0;
293  attribowner = 3;
294  attributes = ""_UTsh;
295  attribvaltype = 0;
296  attribfloatcomp = 0;
297  attribstringcomp = 0;
298  attribval = 0;
299  attribsval = ""_UTsh;
300  counttype = 0;
301  countgroup = ""_UTsh;
302  countcomp = 0;
303  countval = 0;
304  hasinputtype = 0;
305 
306  }
307 
308  bool operator==(const Tests &src) const
309  {
310  if (enable != src.enable) return false;
311  if (type != src.type) return false;
312  if (expr != src.expr) return false;
313  if (attribtype != src.attribtype) return false;
314  if (attribowner != src.attribowner) return false;
315  if (attributes != src.attributes) return false;
316  if (attribvaltype != src.attribvaltype) return false;
317  if (attribfloatcomp != src.attribfloatcomp) return false;
318  if (attribstringcomp != src.attribstringcomp) return false;
319  if (attribval != src.attribval) return false;
320  if (attribsval != src.attribsval) return false;
321  if (counttype != src.counttype) return false;
322  if (countgroup != src.countgroup) return false;
323  if (countcomp != src.countcomp) return false;
324  if (countval != src.countval) return false;
325  if (hasinputtype != src.hasinputtype) return false;
326 
327  return true;
328  }
329  bool operator!=(const Tests &src) const
330  {
331  return !operator==(src);
332  }
333 
334  };
335 
337  {
339 
340  buf.strcat("[ ");
341  for (int i = 0; i < list.entries(); i++)
342  {
343  if (i)
344  buf.strcat(", ");
345  buf.strcat("( ");
346  buf.append("");
347  buf.appendSprintf("%s", (list(i).enable) ? "true" : "false");
348  buf.append(", ");
349  buf.appendSprintf("%d", (int) list(i).type);
350  buf.append(", ");
351  buf.appendSprintf("%d", (int) list(i).expr);
352  buf.append(", ");
353  buf.appendSprintf("%d", (int) list(i).attribtype);
354  buf.append(", ");
355  buf.appendSprintf("%d", (int) list(i).attribowner);
356  buf.append(", ");
357  { UT_String tmp; tmp = UT_StringWrap(list(i).attributes).makeQuotedString('"'); buf.strcat(tmp); }
358  buf.append(", ");
359  buf.appendSprintf("%d", (int) list(i).attribvaltype);
360  buf.append(", ");
361  buf.appendSprintf("%d", (int) list(i).attribfloatcomp);
362  buf.append(", ");
363  buf.appendSprintf("%d", (int) list(i).attribstringcomp);
364  buf.append(", ");
365  buf.appendSprintf("%f", (list(i).attribval));
366  buf.append(", ");
367  { UT_String tmp; tmp = UT_StringWrap(list(i).attribsval).makeQuotedString('"'); buf.strcat(tmp); }
368  buf.append(", ");
369  buf.appendSprintf("%d", (int) list(i).counttype);
370  buf.append(", ");
371  { UT_String tmp; tmp = UT_StringWrap(list(i).countgroup).makeQuotedString('"'); buf.strcat(tmp); }
372  buf.append(", ");
373  buf.appendSprintf("%d", (int) list(i).countcomp);
374  buf.append(", ");
375  buf.appendSprintf("%d", (int) list(i).countval);
376  buf.append(", ");
377  buf.appendSprintf("%d", (int) list(i).hasinputtype);
378 
379  buf.strcat(" )");
380  }
381  buf.strcat(" ]");
382 
384  return result;
385  }
386 
388  {
389  myMergeCondition = 0;
390  myTestInput = 0;
391  myTests.setSize(1);
392 
393  }
394 
395  explicit SOP_SwitchIfParms(const SOP_SwitchIfParms &) = default;
396  SOP_SwitchIfParms &operator=(const SOP_SwitchIfParms &) = default;
397  SOP_SwitchIfParms(SOP_SwitchIfParms &&) noexcept = default;
398  SOP_SwitchIfParms &operator=(SOP_SwitchIfParms &&) noexcept = default;
399 
400  ~SOP_SwitchIfParms() override {}
401 
402  bool operator==(const SOP_SwitchIfParms &src) const
403  {
404  if (myMergeCondition != src.myMergeCondition) return false;
405  if (myTestInput != src.myTestInput) return false;
406  if (myTests != src.myTests) return false;
407 
408 
409  if (baseGetSignature() != src.baseGetSignature()) return false;
410 
411  return true;
412  }
413  bool operator!=(const SOP_SwitchIfParms &src) const
414  {
415  return !operator==(src);
416  }
428 
429 
430 
431  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
432  {
433  myMergeCondition = 0;
434  if (true)
435  graph->evalOpParm(myMergeCondition, nodeidx, "mergecondition", time, graph->isDirect()?nullptr:depnode);
436  myTestInput = 0;
437  if (true)
438  graph->evalOpParm(myTestInput, nodeidx, "testinput", time, graph->isDirect()?nullptr:depnode);
439  if (true)
440  {
441  int64 length = 0;
442  graph->evalOpParm(length, nodeidx, "tests", time, graph->isDirect()?nullptr:depnode);
443  if (length < 0) length = 0;
444  myTests.setSize(length);
445  for (exint i = 0; i < length; i++)
446  {
447  int parmidx[1];
448  int offsets[1];
449  parmidx[0] = i+1;
450  offsets[0] = 1;
451  auto && _curentry = myTests(i);
452  (void) _curentry;
453  _curentry.enable = true;
454  if (true)
455  graph->evalOpParmInst(_curentry.enable, nodeidx, "enable#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
456  _curentry.type = 0;
457  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
458  graph->evalOpParmInst(_curentry.type, nodeidx, "type#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
459  _curentry.expr = 1;
460  if (true && ( (true&&!(((_curentry.type!=0))||((_curentry.enable==0)))) ) )
461  graph->evalOpParmInst(_curentry.expr, nodeidx, "expr#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
462  _curentry.attribtype = 0;
463  if (true && ( (true&&!(((_curentry.type!=1))||((_curentry.enable==0)))) ) )
464  graph->evalOpParmInst(_curentry.attribtype, nodeidx, "attribtype#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
465  _curentry.attribowner = 3;
466  if (true && ( (true&&!(((_curentry.type!=1)&&(_curentry.type!=3))||((_curentry.enable==0)))) ) )
467  graph->evalOpParmInst(_curentry.attribowner, nodeidx, "attribowner#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
468  _curentry.attributes = ""_UTsh;
469  if (true && ( (true&&!(((_curentry.type!=1)&&(_curentry.type!=3))||((_curentry.enable==0)))) ) )
470  graph->evalOpParmInst(_curentry.attributes, nodeidx, "attributes#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
471  _curentry.attribvaltype = 0;
472  if (true && ( (true&&!(((_curentry.type!=3))||((_curentry.enable==0)))) ) )
473  graph->evalOpParmInst(_curentry.attribvaltype, nodeidx, "attribvaltype#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
474  _curentry.attribfloatcomp = 0;
475  if (true && ( (true&&!(((_curentry.type!=3))||((_curentry.attribvaltype!=0))||((_curentry.enable==0)))) ) )
476  graph->evalOpParmInst(_curentry.attribfloatcomp, nodeidx, "attribfloatcomp#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
477  _curentry.attribstringcomp = 0;
478  if (true && ( (true&&!(((_curentry.type!=3))||((_curentry.attribvaltype!=1))||((_curentry.enable==0)))) ) )
479  graph->evalOpParmInst(_curentry.attribstringcomp, nodeidx, "attribstringcomp#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
480  _curentry.attribval = 0;
481  if (true && ( (true&&!(((_curentry.type!=3))||((_curentry.attribvaltype!=0))||((_curentry.enable==0)))) ) )
482  graph->evalOpParmInst(_curentry.attribval, nodeidx, "attribval#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
483  _curentry.attribsval = ""_UTsh;
484  if (true && ( (true&&!(((_curentry.type!=3))||((_curentry.attribvaltype!=1))||((_curentry.enable==0)))) ) )
485  graph->evalOpParmInst(_curentry.attribsval, nodeidx, "attribsval#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
486  _curentry.counttype = 0;
487  if (true && ( (true&&!(((_curentry.type!=2))||((_curentry.enable==0)))) ) )
488  graph->evalOpParmInst(_curentry.counttype, nodeidx, "counttype#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
489  _curentry.countgroup = ""_UTsh;
490  if (true && ( (true&&!(((_curentry.type!=2))||((_curentry.enable==0)))) ) )
491  graph->evalOpParmInst(_curentry.countgroup, nodeidx, "countgroup#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
492  _curentry.countcomp = 0;
493  if (true && ( (true&&!(((_curentry.type!=2))||((_curentry.enable==0)))) ) )
494  graph->evalOpParmInst(_curentry.countcomp, nodeidx, "countcomp#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
495  _curentry.countval = 0;
496  if (true && ( (true&&!(((_curentry.type!=2))||((_curentry.enable==0)))) ) )
497  graph->evalOpParmInst(_curentry.countval, nodeidx, "countval#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
498  _curentry.hasinputtype = 0;
499  if (true && ( (true&&!(((_curentry.type!=4))||((_curentry.enable==0)))) ) )
500  graph->evalOpParmInst(_curentry.hasinputtype, nodeidx, "hasinputtype#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
501 
502  }
503  }
504  else
505  myTests.clear();
506 
507  }
508 
509 
510  void loadFromOpSubclass(const LoadParms &loadparms) override
511  {
512  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
513  }
514 
515 
516  void copyFrom(const OP_NodeParms *src) override
517  {
518  *this = *((const SOP_SwitchIfParms *)src);
519  }
520 
521  template <typename T>
522  void
523  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
524  {
525  if (idx.size() < 1)
526  return;
527  UT_ASSERT(idx.size() == instance.size()+1);
528  if (idx.size() != instance.size()+1)
529  return;
530  switch (idx[0])
531  {
532  case 0:
533  coerceValue(value, myMergeCondition);
534  break;
535  case 1:
536  coerceValue(value, myTestInput);
537  break;
538  case 2:
539  if (idx.size() == 1)
540  coerceValue(value, myTests.entries());
541  else if (instance[0] < myTests.entries())
542  {
543  auto && _data = myTests(instance[0]);
544  switch (idx[1])
545  {
546  case 0:
547  coerceValue(value, _data.enable);
548  break;
549  case 1:
550  coerceValue(value, _data.type);
551  break;
552  case 2:
553  coerceValue(value, _data.expr);
554  break;
555  case 3:
556  coerceValue(value, _data.attribtype);
557  break;
558  case 4:
559  coerceValue(value, _data.attribowner);
560  break;
561  case 5:
562  coerceValue(value, _data.attributes);
563  break;
564  case 6:
565  coerceValue(value, _data.attribvaltype);
566  break;
567  case 7:
568  coerceValue(value, _data.attribfloatcomp);
569  break;
570  case 8:
571  coerceValue(value, _data.attribstringcomp);
572  break;
573  case 9:
574  coerceValue(value, _data.attribval);
575  break;
576  case 10:
577  coerceValue(value, _data.attribsval);
578  break;
579  case 11:
580  coerceValue(value, _data.counttype);
581  break;
582  case 12:
583  coerceValue(value, _data.countgroup);
584  break;
585  case 13:
586  coerceValue(value, _data.countcomp);
587  break;
588  case 14:
589  coerceValue(value, _data.countval);
590  break;
591  case 15:
592  coerceValue(value, _data.hasinputtype);
593  break;
594 
595  }
596  }
597  break;
598 
599  }
600  }
601 
602  bool isParmColorRamp(exint idx) const override
603  {
604  switch (idx)
605  {
606 
607  }
608  return false;
609  }
610 
611  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
612  { doGetParmValue(idx, instance, value); }
613  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
614  { doGetParmValue(idx, instance, value); }
615  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
616  { doGetParmValue(idx, instance, value); }
617  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
618  { doGetParmValue(idx, instance, value); }
619  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
620  { doGetParmValue(idx, instance, value); }
621  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
622  { doGetParmValue(idx, instance, value); }
623  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
624  { doGetParmValue(idx, instance, value); }
625  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
626  { doGetParmValue(idx, instance, value); }
627  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
628  { doGetParmValue(idx, instance, value); }
629  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
630  { doGetParmValue(idx, instance, value); }
631  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
632  { doGetParmValue(idx, instance, value); }
633 
634  template <typename T>
635  void
636  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
637  {
638  if (idx.size() < 1)
639  return;
640  UT_ASSERT(idx.size() == instance.size()+1);
641  if (idx.size() != instance.size()+1)
642  return;
643  switch (idx[0])
644  {
645  case 0:
646  coerceValue(myMergeCondition, clampMinValue(0, clampMaxValue(3, value ) ));
647  break;
648  case 1:
649  coerceValue(myTestInput, clampMinValue(0, clampMaxValue(2, value ) ));
650  break;
651  case 2:
652  if (idx.size() == 1)
653  {
654  exint newsize;
655  coerceValue(newsize, value);
656  if (newsize < 0) newsize = 0;
657  myTests.setSize(newsize);
658  }
659  else
660  {
661  if (instance[0] < 0)
662  return;
663  myTests.setSizeIfNeeded(instance[0]+1);
664  auto && _data = myTests(instance[0]);
665  switch (idx[1])
666  {
667  case 0:
668  coerceValue(_data.enable, value);
669  break;
670  case 1:
671  coerceValue(_data.type, value);
672  break;
673  case 2:
674  coerceValue(_data.expr, value);
675  break;
676  case 3:
677  coerceValue(_data.attribtype, value);
678  break;
679  case 4:
680  coerceValue(_data.attribowner, value);
681  break;
682  case 5:
683  coerceValue(_data.attributes, value);
684  break;
685  case 6:
686  coerceValue(_data.attribvaltype, value);
687  break;
688  case 7:
689  coerceValue(_data.attribfloatcomp, value);
690  break;
691  case 8:
692  coerceValue(_data.attribstringcomp, value);
693  break;
694  case 9:
695  coerceValue(_data.attribval, value);
696  break;
697  case 10:
698  coerceValue(_data.attribsval, value);
699  break;
700  case 11:
701  coerceValue(_data.counttype, value);
702  break;
703  case 12:
704  coerceValue(_data.countgroup, value);
705  break;
706  case 13:
707  coerceValue(_data.countcomp, value);
708  break;
709  case 14:
710  coerceValue(_data.countval, value);
711  break;
712  case 15:
713  coerceValue(_data.hasinputtype, value);
714  break;
715 
716  }
717  }
718  break;
719 
720  }
721  }
722 
723  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
724  { doSetParmValue(idx, instance, value); }
725  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
726  { doSetParmValue(idx, instance, value); }
727  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
728  { doSetParmValue(idx, instance, value); }
729  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
730  { doSetParmValue(idx, instance, value); }
731  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
732  { doSetParmValue(idx, instance, value); }
733  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
734  { doSetParmValue(idx, instance, value); }
735  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
736  { doSetParmValue(idx, instance, value); }
737  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
738  { doSetParmValue(idx, instance, value); }
739  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
740  { doSetParmValue(idx, instance, value); }
741  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
742  { doSetParmValue(idx, instance, value); }
743  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
744  { doSetParmValue(idx, instance, value); }
745 
746  exint getNestNumParms(TempIndex idx) const override
747  {
748  if (idx.size() == 0)
749  return 3;
750  switch (idx[0])
751  {
752  case 2:
753  return 16;
754 
755  }
756  // Invalid
757  return 0;
758  }
759 
760  const char *getNestParmName(TempIndex fieldnum) const override
761  {
762  if (fieldnum.size() < 1)
763  return 0;
764  switch (fieldnum[0])
765  {
766  case 0:
767  return "mergecondition";
768  case 1:
769  return "testinput";
770  case 2:
771  if (fieldnum.size() == 1)
772  return "tests";
773  switch (fieldnum[1])
774  {
775  case 0:
776  return "enable#";
777  case 1:
778  return "type#";
779  case 2:
780  return "expr#";
781  case 3:
782  return "attribtype#";
783  case 4:
784  return "attribowner#";
785  case 5:
786  return "attributes#";
787  case 6:
788  return "attribvaltype#";
789  case 7:
790  return "attribfloatcomp#";
791  case 8:
792  return "attribstringcomp#";
793  case 9:
794  return "attribval#";
795  case 10:
796  return "attribsval#";
797  case 11:
798  return "counttype#";
799  case 12:
800  return "countgroup#";
801  case 13:
802  return "countcomp#";
803  case 14:
804  return "countval#";
805  case 15:
806  return "hasinputtype#";
807 
808  }
809  return 0;
810 
811  }
812  return 0;
813  }
814 
815  ParmType getNestParmType(TempIndex fieldnum) const override
816  {
817  if (fieldnum.size() < 1)
818  return PARM_UNSUPPORTED;
819  switch (fieldnum[0])
820  {
821  case 0:
822  return PARM_INTEGER;
823  case 1:
824  return PARM_INTEGER;
825  case 2:
826  if (fieldnum.size() == 1)
827  return PARM_MULTIPARM;
828  switch (fieldnum[1])
829  {
830  case 0:
831  return PARM_INTEGER;
832  case 1:
833  return PARM_INTEGER;
834  case 2:
835  return PARM_INTEGER;
836  case 3:
837  return PARM_INTEGER;
838  case 4:
839  return PARM_INTEGER;
840  case 5:
841  return PARM_STRING;
842  case 6:
843  return PARM_INTEGER;
844  case 7:
845  return PARM_INTEGER;
846  case 8:
847  return PARM_INTEGER;
848  case 9:
849  return PARM_FLOAT;
850  case 10:
851  return PARM_STRING;
852  case 11:
853  return PARM_INTEGER;
854  case 12:
855  return PARM_STRING;
856  case 13:
857  return PARM_INTEGER;
858  case 14:
859  return PARM_INTEGER;
860  case 15:
861  return PARM_INTEGER;
862 
863  }
864  return PARM_UNSUPPORTED;
865 
866  }
867  return PARM_UNSUPPORTED;
868  }
869 
870  // Boiler plate to load individual types.
871  static void loadData(UT_IStream &is, int64 &v)
872  { is.bread(&v, 1); }
873  static void loadData(UT_IStream &is, bool &v)
874  { int64 iv; is.bread(&iv, 1); v = iv; }
875  static void loadData(UT_IStream &is, fpreal64 &v)
876  { is.bread<fpreal64>(&v, 1); }
877  static void loadData(UT_IStream &is, UT_Vector2D &v)
878  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
879  static void loadData(UT_IStream &is, UT_Vector3D &v)
880  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
881  is.bread<fpreal64>(&v.z(), 1); }
882  static void loadData(UT_IStream &is, UT_Vector4D &v)
883  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
884  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
885  static void loadData(UT_IStream &is, UT_Matrix2D &v)
886  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
887  static void loadData(UT_IStream &is, UT_Matrix3D &v)
888  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
889  static void loadData(UT_IStream &is, UT_Matrix4D &v)
890  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
891  static void loadData(UT_IStream &is, UT_Vector2I &v)
892  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
893  static void loadData(UT_IStream &is, UT_Vector3I &v)
894  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
895  is.bread<int64>(&v.z(), 1); }
896  static void loadData(UT_IStream &is, UT_Vector4I &v)
897  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
898  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
900  { is.bread(v); }
902  { UT_StringHolder rampdata;
903  loadData(is, rampdata);
904  if (rampdata.isstring())
905  {
906  v.reset(new UT_Ramp());
907  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
908  v->load(istr);
909  }
910  else v.reset();
911  }
914  loadData(is, data);
915  if (data.isstring())
916  {
917  // Find the data type.
918  const char *colon = UT_StringWrap(data).findChar(':');
919  if (colon)
920  {
921  int typelen = colon - data.buffer();
923  type.strncpy(data.buffer(), typelen);
924  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
925 
926  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
927  }
928  }
929  else v.reset();
930  }
931 
932  static void saveData(std::ostream &os, int64 v)
933  { UTwrite(os, &v); }
934  static void saveData(std::ostream &os, bool v)
935  { int64 iv = v; UTwrite(os, &iv); }
936  static void saveData(std::ostream &os, fpreal64 v)
937  { UTwrite<fpreal64>(os, &v); }
938  static void saveData(std::ostream &os, UT_Vector2D v)
939  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
940  static void saveData(std::ostream &os, UT_Vector3D v)
941  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
942  UTwrite<fpreal64>(os, &v.z()); }
943  static void saveData(std::ostream &os, UT_Vector4D v)
944  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
945  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
946  static void saveData(std::ostream &os, UT_Matrix2D v)
948  static void saveData(std::ostream &os, UT_Matrix3D v)
950  static void saveData(std::ostream &os, UT_Matrix4D v)
952  static void saveData(std::ostream &os, UT_StringHolder s)
953  { UT_StringWrap(s).saveBinary(os); }
954  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
956  UT_OStringStream ostr;
957  if (s) s->save(ostr);
958  result = ostr.str();
959  saveData(os, result);
960  }
961  static void saveData(std::ostream &os, PRM_DataItemHandle s)
963  UT_OStringStream ostr;
964  if (s)
965  {
966  ostr << s->getDataTypeToken();
967  ostr << ":";
968  s->saveBinary(ostr);
969  }
970  result = ostr.str();
971  saveData(os, result);
972  }
973 
974 
975  void save(std::ostream &os) const
976  {
977  int32 v = version();
978  UTwrite(os, &v);
979  saveData(os, myMergeCondition);
980  saveData(os, myTestInput);
981  {
982  int64 length = myTests.entries();
983  UTwrite(os, &length);
984  for (exint i = 0; i < length; i++)
985  {
986  auto && _curentry = myTests(i);
987  (void) _curentry;
988  saveData(os, _curentry.enable);
989  saveData(os, _curentry.type);
990  saveData(os, _curentry.expr);
991  saveData(os, _curentry.attribtype);
992  saveData(os, _curentry.attribowner);
993  saveData(os, _curentry.attributes);
994  saveData(os, _curentry.attribvaltype);
995  saveData(os, _curentry.attribfloatcomp);
996  saveData(os, _curentry.attribstringcomp);
997  saveData(os, _curentry.attribval);
998  saveData(os, _curentry.attribsval);
999  saveData(os, _curentry.counttype);
1000  saveData(os, _curentry.countgroup);
1001  saveData(os, _curentry.countcomp);
1002  saveData(os, _curentry.countval);
1003  saveData(os, _curentry.hasinputtype);
1004 
1005  }
1006  }
1007 
1008  }
1009 
1010  bool load(UT_IStream &is)
1011  {
1012  int32 v;
1013  is.bread(&v, 1);
1014  if (version() != v)
1015  {
1016  // Fail incompatible versions
1017  return false;
1018  }
1019  loadData(is, myMergeCondition);
1020  loadData(is, myTestInput);
1021  {
1022  int64 length;
1023  is.read(&length, 1);
1024  myTests.setSize(length);
1025  for (exint i = 0; i < length; i++)
1026  {
1027  auto && _curentry = myTests(i);
1028  (void) _curentry;
1029  loadData(is, _curentry.enable);
1030  loadData(is, _curentry.type);
1031  loadData(is, _curentry.expr);
1032  loadData(is, _curentry.attribtype);
1033  loadData(is, _curentry.attribowner);
1034  loadData(is, _curentry.attributes);
1035  loadData(is, _curentry.attribvaltype);
1036  loadData(is, _curentry.attribfloatcomp);
1037  loadData(is, _curentry.attribstringcomp);
1038  loadData(is, _curentry.attribval);
1039  loadData(is, _curentry.attribsval);
1040  loadData(is, _curentry.counttype);
1041  loadData(is, _curentry.countgroup);
1042  loadData(is, _curentry.countcomp);
1043  loadData(is, _curentry.countval);
1044  loadData(is, _curentry.hasinputtype);
1045 
1046  }
1047  }
1048 
1049  return true;
1050  }
1051 
1052  MergeCondition getMergeCondition() const { return MergeCondition(myMergeCondition); }
1053  void setMergeCondition(MergeCondition val) { myMergeCondition = int64(val); }
1055  {
1056  SOP_Node *thissop = cookparms.getNode();
1057  if (!thissop) return getMergeCondition();
1058  int64 result;
1059  OP_Utils::evalOpParm(result, thissop, "mergecondition", cookparms.getCookTime(), 0);
1060  return MergeCondition(result);
1061  }
1062  TestInput getTestInput() const { return TestInput(myTestInput); }
1063  void setTestInput(TestInput val) { myTestInput = int64(val); }
1065  {
1066  SOP_Node *thissop = cookparms.getNode();
1067  if (!thissop) return getTestInput();
1068  int64 result;
1069  OP_Utils::evalOpParm(result, thissop, "testinput", cookparms.getCookTime(), 0);
1070  return TestInput(result);
1071  }
1072  const UT_Array<Tests> &getTests() const { return myTests; }
1073 void setTests(const UT_Array<Tests> &val) { myTests = val; }
1074  exint opTests(const SOP_NodeVerb::CookParms &cookparms) const
1075  {
1076  SOP_Node *thissop = cookparms.getNode();
1077  if (!thissop) return getTests().entries();
1078  exint result;
1079  OP_Utils::evalOpParm(result, thissop, "tests", cookparms.getCookTime(), 0);
1080  return result;
1081  }
1082  bool opTests_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1083  { return opinstTests_enable(cookparms, &_idx); }
1084  bool opinstTests_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1085  {
1086  SOP_Node *thissop = cookparms.getNode();
1087  if (!thissop) return (myTests(_idx[0]).enable);
1088  int _parmidx[2-1];
1089  _parmidx[1-1] = _idx[1-1] + 1;
1090 
1091  bool result;
1092  OP_Utils::evalOpParmInst(result, thissop, "enable#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1093  return (result);
1094  }
1095  int64 opTests_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1096  { return opinstTests_type(cookparms, &_idx); }
1097  int64 opinstTests_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1098  {
1099  SOP_Node *thissop = cookparms.getNode();
1100  if (!thissop) return (myTests(_idx[0]).type);
1101  int _parmidx[2-1];
1102  _parmidx[1-1] = _idx[1-1] + 1;
1103 
1104  int64 result;
1105  OP_Utils::evalOpParmInst(result, thissop, "type#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1106  return (result);
1107  }
1108  int64 opTests_expr(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1109  { return opinstTests_expr(cookparms, &_idx); }
1110  int64 opinstTests_expr(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1111  {
1112  SOP_Node *thissop = cookparms.getNode();
1113  if (!thissop) return (myTests(_idx[0]).expr);
1114  int _parmidx[2-1];
1115  _parmidx[1-1] = _idx[1-1] + 1;
1116 
1117  int64 result;
1118  OP_Utils::evalOpParmInst(result, thissop, "expr#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1119  return (result);
1120  }
1121  int64 opTests_attribtype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1122  { return opinstTests_attribtype(cookparms, &_idx); }
1123  int64 opinstTests_attribtype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1124  {
1125  SOP_Node *thissop = cookparms.getNode();
1126  if (!thissop) return (myTests(_idx[0]).attribtype);
1127  int _parmidx[2-1];
1128  _parmidx[1-1] = _idx[1-1] + 1;
1129 
1130  int64 result;
1131  OP_Utils::evalOpParmInst(result, thissop, "attribtype#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1132  return (result);
1133  }
1134  int64 opTests_attribowner(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1135  { return opinstTests_attribowner(cookparms, &_idx); }
1136  int64 opinstTests_attribowner(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1137  {
1138  SOP_Node *thissop = cookparms.getNode();
1139  if (!thissop) return (myTests(_idx[0]).attribowner);
1140  int _parmidx[2-1];
1141  _parmidx[1-1] = _idx[1-1] + 1;
1142 
1143  int64 result;
1144  OP_Utils::evalOpParmInst(result, thissop, "attribowner#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1145  return (result);
1146  }
1148  { return opinstTests_attributes(cookparms, &_idx); }
1149  UT_StringHolder opinstTests_attributes(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1150  {
1151  SOP_Node *thissop = cookparms.getNode();
1152  if (!thissop) return (myTests(_idx[0]).attributes);
1153  int _parmidx[2-1];
1154  _parmidx[1-1] = _idx[1-1] + 1;
1155 
1157  OP_Utils::evalOpParmInst(result, thissop, "attributes#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1158  return (result);
1159  }
1160  int64 opTests_attribvaltype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1161  { return opinstTests_attribvaltype(cookparms, &_idx); }
1162  int64 opinstTests_attribvaltype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1163  {
1164  SOP_Node *thissop = cookparms.getNode();
1165  if (!thissop) return (myTests(_idx[0]).attribvaltype);
1166  int _parmidx[2-1];
1167  _parmidx[1-1] = _idx[1-1] + 1;
1168 
1169  int64 result;
1170  OP_Utils::evalOpParmInst(result, thissop, "attribvaltype#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1171  return (result);
1172  }
1173  int64 opTests_attribfloatcomp(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1174  { return opinstTests_attribfloatcomp(cookparms, &_idx); }
1175  int64 opinstTests_attribfloatcomp(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1176  {
1177  SOP_Node *thissop = cookparms.getNode();
1178  if (!thissop) return (myTests(_idx[0]).attribfloatcomp);
1179  int _parmidx[2-1];
1180  _parmidx[1-1] = _idx[1-1] + 1;
1181 
1182  int64 result;
1183  OP_Utils::evalOpParmInst(result, thissop, "attribfloatcomp#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1184  return (result);
1185  }
1186  int64 opTests_attribstringcomp(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1187  { return opinstTests_attribstringcomp(cookparms, &_idx); }
1188  int64 opinstTests_attribstringcomp(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1189  {
1190  SOP_Node *thissop = cookparms.getNode();
1191  if (!thissop) return (myTests(_idx[0]).attribstringcomp);
1192  int _parmidx[2-1];
1193  _parmidx[1-1] = _idx[1-1] + 1;
1194 
1195  int64 result;
1196  OP_Utils::evalOpParmInst(result, thissop, "attribstringcomp#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1197  return (result);
1198  }
1199  fpreal64 opTests_attribval(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1200  { return opinstTests_attribval(cookparms, &_idx); }
1201  fpreal64 opinstTests_attribval(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1202  {
1203  SOP_Node *thissop = cookparms.getNode();
1204  if (!thissop) return (myTests(_idx[0]).attribval);
1205  int _parmidx[2-1];
1206  _parmidx[1-1] = _idx[1-1] + 1;
1207 
1208  fpreal64 result;
1209  OP_Utils::evalOpParmInst(result, thissop, "attribval#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1210  return (result);
1211  }
1213  { return opinstTests_attribsval(cookparms, &_idx); }
1214  UT_StringHolder opinstTests_attribsval(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1215  {
1216  SOP_Node *thissop = cookparms.getNode();
1217  if (!thissop) return (myTests(_idx[0]).attribsval);
1218  int _parmidx[2-1];
1219  _parmidx[1-1] = _idx[1-1] + 1;
1220 
1222  OP_Utils::evalOpParmInst(result, thissop, "attribsval#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1223  return (result);
1224  }
1225  int64 opTests_counttype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1226  { return opinstTests_counttype(cookparms, &_idx); }
1227  int64 opinstTests_counttype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1228  {
1229  SOP_Node *thissop = cookparms.getNode();
1230  if (!thissop) return (myTests(_idx[0]).counttype);
1231  int _parmidx[2-1];
1232  _parmidx[1-1] = _idx[1-1] + 1;
1233 
1234  int64 result;
1235  OP_Utils::evalOpParmInst(result, thissop, "counttype#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1236  return (result);
1237  }
1239  { return opinstTests_countgroup(cookparms, &_idx); }
1240  UT_StringHolder opinstTests_countgroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1241  {
1242  SOP_Node *thissop = cookparms.getNode();
1243  if (!thissop) return (myTests(_idx[0]).countgroup);
1244  int _parmidx[2-1];
1245  _parmidx[1-1] = _idx[1-1] + 1;
1246 
1248  OP_Utils::evalOpParmInst(result, thissop, "countgroup#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1249  return (result);
1250  }
1251  int64 opTests_countcomp(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1252  { return opinstTests_countcomp(cookparms, &_idx); }
1253  int64 opinstTests_countcomp(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1254  {
1255  SOP_Node *thissop = cookparms.getNode();
1256  if (!thissop) return (myTests(_idx[0]).countcomp);
1257  int _parmidx[2-1];
1258  _parmidx[1-1] = _idx[1-1] + 1;
1259 
1260  int64 result;
1261  OP_Utils::evalOpParmInst(result, thissop, "countcomp#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1262  return (result);
1263  }
1264  int64 opTests_countval(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1265  { return opinstTests_countval(cookparms, &_idx); }
1266  int64 opinstTests_countval(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1267  {
1268  SOP_Node *thissop = cookparms.getNode();
1269  if (!thissop) return (myTests(_idx[0]).countval);
1270  int _parmidx[2-1];
1271  _parmidx[1-1] = _idx[1-1] + 1;
1272 
1273  int64 result;
1274  OP_Utils::evalOpParmInst(result, thissop, "countval#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1275  return (result);
1276  }
1277  int64 opTests_hasinputtype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1278  { return opinstTests_hasinputtype(cookparms, &_idx); }
1279  int64 opinstTests_hasinputtype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1280  {
1281  SOP_Node *thissop = cookparms.getNode();
1282  if (!thissop) return (myTests(_idx[0]).hasinputtype);
1283  int _parmidx[2-1];
1284  _parmidx[1-1] = _idx[1-1] + 1;
1285 
1286  int64 result;
1287  OP_Utils::evalOpParmInst(result, thissop, "hasinputtype#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1288  return (result);
1289  }
1290 
1291 
1292 private:
1293  int64 myMergeCondition;
1294  int64 myTestInput;
1295  UT_Array<Tests> myTests;
1296 
1297 };
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const char * getNestParmName(TempIndex fieldnum) const override
int64 opTests_attribvaltype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
type
Definition: core.h:556
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, UT_StringHolder &v)
exint getNestNumParms(TempIndex idx) const override
fpreal64 opinstTests_attribval(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
exint opTests(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void
Definition: png.h:1083
UT_StringHolder opTests_attributes(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint bread(int32 *buffer, exint asize=1)
static void loadData(UT_IStream &is, bool &v)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
UT_StringHolder opinstTests_attributes(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
GLsizei const GLfloat * value
Definition: glcorearb.h:824
bool operator==(const Tests &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
int64 opinstTests_attribstringcomp(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
bool opinstTests_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
SYS_FORCE_INLINE UT_StringHolder getToken(MergeCondition enum_value)
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Vector3D &v)
UT_StringHolder opTests_countgroup(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
**But if you need a result
Definition: thread.h:622
const UT_Array< Tests > & getTests() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool operator==(const SOP_SwitchIfParms &src) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
int64 opinstTests_countcomp(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
void loadFromOpSubclass(const LoadParms &loadparms) override
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
UT_StringHolder createString(const UT_Array< Tests > &list) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
int64 opTests_countcomp(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, UT_Vector2D v)
static void saveData(std::ostream &os, UT_Matrix3D v)
bool operator!=(const SOP_SwitchIfParms &src) const
void copyFrom(const OP_NodeParms *src) override
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
MergeCondition getMergeCondition() const
void setMergeCondition(MergeCondition val)
int64 opinstTests_expr(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opinstTests_attribvaltype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint length() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
UT_StringHolder opinstTests_countgroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
UT_StringHolder opTests_attribsval(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
static void saveData(std::ostream &os, UT_Vector3D v)
bool opTests_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
fpreal64 opTests_attribval(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
long long int64
Definition: SYS_Types.h:116
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
int64 opTests_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, UT_Vector4D v)
int64 opTests_attribowner(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 opinstTests_attribowner(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
MergeCondition opMergeCondition(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setTests(const UT_Array< Tests > &val)
TestInput getTestInput() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
SYS_FORCE_INLINE void strcat(const char *src)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void saveData(std::ostream &os, fpreal64 v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
GT_API const UT_StringHolder version
int64 opTests_countval(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:655
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
TestInput opTestInput(const SOP_NodeVerb::CookParms &cookparms) const
int64 opinstTests_hasinputtype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, bool v)
ParmType getNestParmType(TempIndex fieldnum) const override
bool operator!=(const Tests &src) const
int64 opTests_attribtype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setTestInput(TestInput val)
static void saveData(std::ostream &os, int64 v)
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
bool load(UT_IStream &is)
LeafData & operator=(const LeafData &)=delete
int64 opTests_attribfloatcomp(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
#define SOP_API
Definition: SOP_API.h:10
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
int64 opTests_hasinputtype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
int64 opinstTests_attribtype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void save(std::ostream &os) const
int64 opTests_attribstringcomp(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
int64 opTests_expr(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void loadData(UT_IStream &is, int64 &v)
int64 opinstTests_countval(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
GLboolean r
Definition: glcorearb.h:1222
int64 opinstTests_counttype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opinstTests_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_StringHolder opinstTests_attribsval(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
bool isParmColorRamp(exint idx) const override
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
int64 opTests_counttype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
int64 opinstTests_attribfloatcomp(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663