HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_AttribCombine.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_AttribCombineEnums
24 {
25  enum class GroupType
26  {
27  GUESS = 0,
28  VERTICES,
29  EDGES,
30  POINTS,
31  PRIMS
32  };
33 
35  getToken(GroupType enum_value)
36  {
37  using namespace UT::Literal;
38  switch (enum_value) {
39  case GroupType::GUESS: return "guess"_sh;
40  case GroupType::VERTICES: return "vertices"_sh;
41  case GroupType::EDGES: return "edges"_sh;
42  case GroupType::POINTS: return "points"_sh;
43  case GroupType::PRIMS: return "prims"_sh;
44  default: UT_ASSERT(false); return ""_sh;
45  }
46  }
47 
48  enum class Class
49  {
50  DETAIL = 0,
51  PRIMITIVE,
52  POINT,
53  VERTEX
54  };
55 
57  getToken(Class enum_value)
58  {
59  using namespace UT::Literal;
60  switch (enum_value) {
61  case Class::DETAIL: return "detail"_sh;
62  case Class::PRIMITIVE: return "primitive"_sh;
63  case Class::POINT: return "point"_sh;
64  case Class::VERTEX: return "vertex"_sh;
65  default: UT_ASSERT(false); return ""_sh;
66  }
67  }
68 
69  enum class Combine
70  {
71  COPY = 0,
72  ADD,
73  SUB,
74  MUL,
75  DIV,
76  MAX,
77  MIN
78  };
79 
81  getToken(Combine enum_value)
82  {
83  using namespace UT::Literal;
84  switch (enum_value) {
85  case Combine::COPY: return "copy"_sh;
86  case Combine::ADD: return "add"_sh;
87  case Combine::SUB: return "sub"_sh;
88  case Combine::MUL: return "mul"_sh;
89  case Combine::DIV: return "div"_sh;
90  case Combine::MAX: return "max"_sh;
91  case Combine::MIN: return "min"_sh;
92  default: UT_ASSERT(false); return ""_sh;
93  }
94  }
95 
96  enum class Adjust
97  {
98  NONE = 0,
99  SCALE,
100  SCALEADD,
102  };
103 
105  getToken(Adjust enum_value)
106  {
107  using namespace UT::Literal;
108  switch (enum_value) {
109  case Adjust::NONE: return "none"_sh;
110  case Adjust::SCALE: return "scale"_sh;
111  case Adjust::SCALEADD: return "scaleadd"_sh;
112  case Adjust::SCALEADDPROCESS: return "scaleaddprocess"_sh;
113  default: UT_ASSERT(false); return ""_sh;
114  }
115  }
116 
117  enum class Srcinput
118  {
119  FIRST = 0,
120  SECOND
121  };
122 
124  getToken(Srcinput enum_value)
125  {
126  using namespace UT::Literal;
127  switch (enum_value) {
128  case Srcinput::FIRST: return "first"_sh;
129  case Srcinput::SECOND: return "second"_sh;
130  default: UT_ASSERT(false); return ""_sh;
131  }
132  }
133 
134  enum class Process
135  {
136  NONE = 0,
137  RECIPROCAL,
138  CLAMP01,
139  COMPLEMENT01,
141  };
142 
144  getToken(Process enum_value)
145  {
146  using namespace UT::Literal;
147  switch (enum_value) {
148  case Process::NONE: return "none"_sh;
149  case Process::RECIPROCAL: return "reciprocal"_sh;
150  case Process::CLAMP01: return "clamp01"_sh;
151  case Process::COMPLEMENT01: return "complement01"_sh;
152  case Process::THRESHOLD05: return "threshold05"_sh;
153  default: UT_ASSERT(false); return ""_sh;
154  }
155  }
156 
157  enum class Doblendattrib
158  {
159  OFF = 0,
160  ON
161  };
162 
164  getToken(Doblendattrib enum_value)
165  {
166  using namespace UT::Literal;
167  switch (enum_value) {
168  case Doblendattrib::OFF: return "off"_sh;
169  case Doblendattrib::ON: return "on"_sh;
170  default: UT_ASSERT(false); return ""_sh;
171  }
172  }
173 
174  enum class Blendinput
175  {
176  FIRST = 0,
177  SECOND
178  };
179 
181  getToken(Blendinput enum_value)
182  {
183  using namespace UT::Literal;
184  switch (enum_value) {
185  case Blendinput::FIRST: return "first"_sh;
186  case Blendinput::SECOND: return "second"_sh;
187  default: UT_ASSERT(false); return ""_sh;
188  }
189  }
190 
191 }
192 
193 
195 {
196 public:
197  static int version() { return 1; }
199  {
200  bool enable;
212 
213 
215  {
216  enable = true;
217  combine = 1;
218  adjust = 0;
219  srcattrib = ""_UTsh;
220  srcinput = 0;
221  scale = 1;
222  add = 0;
223  process = 0;
224  blend = 1;
225  doblendattrib = 0;
226  blendattrib = ""_UTsh;
227  blendinput = 0;
228 
229  }
230 
231  bool operator==(const Combinations &src) const
232  {
233  if (enable != src.enable) return false;
234  if (combine != src.combine) return false;
235  if (adjust != src.adjust) return false;
236  if (srcattrib != src.srcattrib) return false;
237  if (srcinput != src.srcinput) return false;
238  if (scale != src.scale) return false;
239  if (add != src.add) return false;
240  if (process != src.process) return false;
241  if (blend != src.blend) return false;
242  if (doblendattrib != src.doblendattrib) return false;
243  if (blendattrib != src.blendattrib) return false;
244  if (blendinput != src.blendinput) return false;
245 
246  return true;
247  }
248  bool operator!=(const Combinations &src) const
249  {
250  return !operator==(src);
251  }
252 
253  };
254 
256  {
258 
259  buf.strcat("[ ");
260  for (int i = 0; i < list.entries(); i++)
261  {
262  if (i)
263  buf.strcat(", ");
264  buf.strcat("( ");
265  buf.append("");
266  buf.appendSprintf("%s", (list(i).enable) ? "true" : "false");
267  buf.append(", ");
268  buf.appendSprintf("%d", (int) list(i).combine);
269  buf.append(", ");
270  buf.appendSprintf("%d", (int) list(i).adjust);
271  buf.append(", ");
272  { UT_String tmp; tmp = UT_StringWrap(list(i).srcattrib).makeQuotedString('"'); buf.strcat(tmp); }
273  buf.append(", ");
274  buf.appendSprintf("%d", (int) list(i).srcinput);
275  buf.append(", ");
276  buf.appendSprintf("%f", (list(i).scale));
277  buf.append(", ");
278  buf.appendSprintf("%f", (list(i).add));
279  buf.append(", ");
280  buf.appendSprintf("%d", (int) list(i).process);
281  buf.append(", ");
282  buf.appendSprintf("%f", (list(i).blend));
283  buf.append(", ");
284  buf.appendSprintf("%d", (int) list(i).doblendattrib);
285  buf.append(", ");
286  { UT_String tmp; tmp = UT_StringWrap(list(i).blendattrib).makeQuotedString('"'); buf.strcat(tmp); }
287  buf.append(", ");
288  buf.appendSprintf("%d", (int) list(i).blendinput);
289 
290  buf.strcat(" )");
291  }
292  buf.strcat(" ]");
293 
295  return result;
296  }
297 
299  {
300  myGroup = ""_UTsh;
301  myGroupType = 0;
302  myDstAttrib = ""_UTsh;
303  myClass = 2;
304  myCombinations.setSize(1);
305  myPostScale = 1;
306  myDoThreshold = false;
307  myThreshold = 0.5;
308  myDoClampMin = false;
309  myClampMin = 0;
310  myDoClampMax = false;
311  myClampMax = 1;
312  myAttribMatch = "id"_UTsh;
313  myCreateMissing = true;
314  myForceScalar = false;
315  myDeleteSource = false;
316  myErrorMissing = true;
317 
318  }
319 
320  explicit SOP_AttribCombineParms(const SOP_AttribCombineParms &) = default;
322  SOP_AttribCombineParms(SOP_AttribCombineParms &&) noexcept = default;
323  SOP_AttribCombineParms &operator=(SOP_AttribCombineParms &&) noexcept = default;
324 
325  ~SOP_AttribCombineParms() override {}
326 
328  {
329  if (myGroup != src.myGroup) return false;
330  if (myGroupType != src.myGroupType) return false;
331  if (myDstAttrib != src.myDstAttrib) return false;
332  if (myClass != src.myClass) return false;
333  if (myCombinations != src.myCombinations) return false;
334  if (myPostScale != src.myPostScale) return false;
335  if (myDoThreshold != src.myDoThreshold) return false;
336  if (myThreshold != src.myThreshold) return false;
337  if (myDoClampMin != src.myDoClampMin) return false;
338  if (myClampMin != src.myClampMin) return false;
339  if (myDoClampMax != src.myDoClampMax) return false;
340  if (myClampMax != src.myClampMax) return false;
341  if (myAttribMatch != src.myAttribMatch) return false;
342  if (myCreateMissing != src.myCreateMissing) return false;
343  if (myForceScalar != src.myForceScalar) return false;
344  if (myDeleteSource != src.myDeleteSource) return false;
345  if (myErrorMissing != src.myErrorMissing) return false;
346 
347 
348  if (baseGetSignature() != src.baseGetSignature()) return false;
349 
350  return true;
351  }
353  {
354  return !operator==(src);
355  }
364 
365 
366 
367  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
368  {
369  myGroup = ""_UTsh;
370  if (true)
371  graph->evalOpParm(myGroup, nodeidx, "group", time, graph->isDirect()?nullptr:depnode);
372  myGroupType = 0;
373  if (true)
374  graph->evalOpParm(myGroupType, nodeidx, "grouptype", time, graph->isDirect()?nullptr:depnode);
375  myDstAttrib = ""_UTsh;
376  if (true)
377  graph->evalOpParm(myDstAttrib, nodeidx, "dstattrib", time, graph->isDirect()?nullptr:depnode);
378  myClass = 2;
379  if (true)
380  graph->evalOpParm(myClass, nodeidx, "class", time, graph->isDirect()?nullptr:depnode);
381  if (true)
382  {
383  int64 length = 0;
384  graph->evalOpParm(length, nodeidx, "numcombines", time, graph->isDirect()?nullptr:depnode);
385  if (length < 0) length = 0;
386  myCombinations.setSize(length);
387  for (exint i = 0; i < length; i++)
388  {
389  int parmidx[1];
390  int offsets[1];
391  parmidx[0] = i+1;
392  offsets[0] = 1;
393  auto && _curentry = myCombinations(i);
394  (void) _curentry;
395  _curentry.enable = true;
396  if (true)
397  graph->evalOpParmInst(_curentry.enable, nodeidx, "enable#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
398  _curentry.combine = 1;
399  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
400  graph->evalOpParmInst(_curentry.combine, nodeidx, "combine#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
401  _curentry.adjust = 0;
402  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
403  graph->evalOpParmInst(_curentry.adjust, nodeidx, "adjust#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
404  _curentry.srcattrib = ""_UTsh;
405  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
406  graph->evalOpParmInst(_curentry.srcattrib, nodeidx, "srcattrib#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
407  _curentry.srcinput = 0;
408  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
409  graph->evalOpParmInst(_curentry.srcinput, nodeidx, "srcinput#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
410  _curentry.scale = 1;
411  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.adjust==0)))) ) )
412  graph->evalOpParmInst(_curentry.scale, nodeidx, "scale#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
413  _curentry.add = 0;
414  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.adjust==0))||((_curentry.adjust==1)))) ) )
415  graph->evalOpParmInst(_curentry.add, nodeidx, "add#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
416  _curentry.process = 0;
417  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.adjust==0))||((_curentry.adjust==1))||((_curentry.adjust==2)))) ) )
418  graph->evalOpParmInst(_curentry.process, nodeidx, "process#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
419  _curentry.blend = 1;
420  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
421  graph->evalOpParmInst(_curentry.blend, nodeidx, "blend#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
422  _curentry.doblendattrib = 0;
423  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
424  graph->evalOpParmInst(_curentry.doblendattrib, nodeidx, "doblendattrib#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
425  _curentry.blendattrib = ""_UTsh;
426  if (true && ( (true&&!(((_curentry.doblendattrib==0))||((_curentry.enable==0)))) ) )
427  graph->evalOpParmInst(_curentry.blendattrib, nodeidx, "blendattrib#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
428  _curentry.blendinput = 0;
429  if (true && ( (true&&!(((_curentry.doblendattrib==0))||((_curentry.enable==0)))) ) )
430  graph->evalOpParmInst(_curentry.blendinput, nodeidx, "blendinput#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
431 
432  }
433  }
434  else
435  myCombinations.clear();
436  myPostScale = 1;
437  if (true)
438  graph->evalOpParm(myPostScale, nodeidx, "postscale", time, graph->isDirect()?nullptr:depnode);
439  myDoThreshold = false;
440  if (true)
441  graph->evalOpParm(myDoThreshold, nodeidx, "dothreshold", time, graph->isDirect()?nullptr:depnode);
442  myThreshold = 0.5;
443  if (true && ( (true&&!(((getDoThreshold()==0)))) ) )
444  graph->evalOpParm(myThreshold, nodeidx, "threshold", time, graph->isDirect()?nullptr:depnode);
445  myDoClampMin = false;
446  if (true)
447  graph->evalOpParm(myDoClampMin, nodeidx, "doclampmin", time, graph->isDirect()?nullptr:depnode);
448  myClampMin = 0;
449  if (true && ( (true&&!(((getDoClampMin()==0)&&(getDoThreshold()==0)))) ) )
450  graph->evalOpParm(myClampMin, nodeidx, "clampmin", time, graph->isDirect()?nullptr:depnode);
451  myDoClampMax = false;
452  if (true)
453  graph->evalOpParm(myDoClampMax, nodeidx, "doclampmax", time, graph->isDirect()?nullptr:depnode);
454  myClampMax = 1;
455  if (true && ( (true&&!(((getDoClampMax()==0)&&(getDoThreshold()==0)))) ) )
456  graph->evalOpParm(myClampMax, nodeidx, "clampmax", time, graph->isDirect()?nullptr:depnode);
457  myAttribMatch = "id"_UTsh;
458  if (true)
459  graph->evalOpParm(myAttribMatch, nodeidx, "attribmatch", time, graph->isDirect()?nullptr:depnode);
460  myCreateMissing = true;
461  if (true)
462  graph->evalOpParm(myCreateMissing, nodeidx, "createmissing", time, graph->isDirect()?nullptr:depnode);
463  myForceScalar = false;
464  if (true && ( (true&&!(((getCreateMissing()==0)))) ) )
465  graph->evalOpParm(myForceScalar, nodeidx, "forcescalar", time, graph->isDirect()?nullptr:depnode);
466  myDeleteSource = false;
467  if (true)
468  graph->evalOpParm(myDeleteSource, nodeidx, "deletesource", time, graph->isDirect()?nullptr:depnode);
469  myErrorMissing = true;
470  if (true)
471  graph->evalOpParm(myErrorMissing, nodeidx, "errormissing", time, graph->isDirect()?nullptr:depnode);
472 
473  }
474 
475 
476  void loadFromOpSubclass(const LoadParms &loadparms) override
477  {
478  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
479  }
480 
481 
482  void copyFrom(const OP_NodeParms *src) override
483  {
484  *this = *((const SOP_AttribCombineParms *)src);
485  }
486 
487  template <typename T>
488  void
489  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
490  {
491  if (idx.size() < 1)
492  return;
493  UT_ASSERT(idx.size() == instance.size()+1);
494  if (idx.size() != instance.size()+1)
495  return;
496  switch (idx[0])
497  {
498  case 0:
499  coerceValue(value, myGroup);
500  break;
501  case 1:
502  coerceValue(value, myGroupType);
503  break;
504  case 2:
505  coerceValue(value, myDstAttrib);
506  break;
507  case 3:
508  coerceValue(value, myClass);
509  break;
510  case 4:
511  if (idx.size() == 1)
512  coerceValue(value, myCombinations.entries());
513  else if (instance[0] < myCombinations.entries())
514  {
515  auto && _data = myCombinations(instance[0]);
516  switch (idx[1])
517  {
518  case 0:
519  coerceValue(value, _data.enable);
520  break;
521  case 1:
522  coerceValue(value, _data.combine);
523  break;
524  case 2:
525  coerceValue(value, _data.adjust);
526  break;
527  case 3:
528  coerceValue(value, _data.srcattrib);
529  break;
530  case 4:
531  coerceValue(value, _data.srcinput);
532  break;
533  case 5:
534  coerceValue(value, _data.scale);
535  break;
536  case 6:
537  coerceValue(value, _data.add);
538  break;
539  case 7:
540  coerceValue(value, _data.process);
541  break;
542  case 8:
543  coerceValue(value, _data.blend);
544  break;
545  case 9:
546  coerceValue(value, _data.doblendattrib);
547  break;
548  case 10:
549  coerceValue(value, _data.blendattrib);
550  break;
551  case 11:
552  coerceValue(value, _data.blendinput);
553  break;
554 
555  }
556  }
557  break;
558  case 5:
559  coerceValue(value, myPostScale);
560  break;
561  case 6:
562  coerceValue(value, myDoThreshold);
563  break;
564  case 7:
565  coerceValue(value, myThreshold);
566  break;
567  case 8:
568  coerceValue(value, myDoClampMin);
569  break;
570  case 9:
571  coerceValue(value, myClampMin);
572  break;
573  case 10:
574  coerceValue(value, myDoClampMax);
575  break;
576  case 11:
577  coerceValue(value, myClampMax);
578  break;
579  case 12:
580  coerceValue(value, myAttribMatch);
581  break;
582  case 13:
583  coerceValue(value, myCreateMissing);
584  break;
585  case 14:
586  coerceValue(value, myForceScalar);
587  break;
588  case 15:
589  coerceValue(value, myDeleteSource);
590  break;
591  case 16:
592  coerceValue(value, myErrorMissing);
593  break;
594 
595  }
596  }
597 
598  bool isParmColorRamp(exint idx) const override
599  {
600  switch (idx)
601  {
602 
603  }
604  return false;
605  }
606 
607  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
608  { doGetParmValue(idx, instance, value); }
609  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
610  { doGetParmValue(idx, instance, value); }
611  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
612  { doGetParmValue(idx, instance, value); }
613  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
614  { doGetParmValue(idx, instance, value); }
615  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
616  { doGetParmValue(idx, instance, value); }
617  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
618  { doGetParmValue(idx, instance, value); }
619  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
620  { doGetParmValue(idx, instance, value); }
621  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
622  { doGetParmValue(idx, instance, value); }
623  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
624  { doGetParmValue(idx, instance, value); }
625  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
626  { doGetParmValue(idx, instance, value); }
627  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
628  { doGetParmValue(idx, instance, value); }
629 
630  template <typename T>
631  void
632  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
633  {
634  if (idx.size() < 1)
635  return;
636  UT_ASSERT(idx.size() == instance.size()+1);
637  if (idx.size() != instance.size()+1)
638  return;
639  switch (idx[0])
640  {
641  case 0:
642  coerceValue(myGroup, ( ( value ) ));
643  break;
644  case 1:
645  coerceValue(myGroupType, clampMinValue(0, clampMaxValue(4, value ) ));
646  break;
647  case 2:
648  coerceValue(myDstAttrib, ( ( value ) ));
649  break;
650  case 3:
651  coerceValue(myClass, clampMinValue(0, clampMaxValue(3, value ) ));
652  break;
653  case 4:
654  if (idx.size() == 1)
655  {
656  exint newsize;
657  coerceValue(newsize, value);
658  if (newsize < 0) newsize = 0;
659  myCombinations.setSize(newsize);
660  }
661  else
662  {
663  if (instance[0] < 0)
664  return;
665  myCombinations.setSizeIfNeeded(instance[0]+1);
666  auto && _data = myCombinations(instance[0]);
667  switch (idx[1])
668  {
669  case 0:
670  coerceValue(_data.enable, value);
671  break;
672  case 1:
673  coerceValue(_data.combine, value);
674  break;
675  case 2:
676  coerceValue(_data.adjust, value);
677  break;
678  case 3:
679  coerceValue(_data.srcattrib, value);
680  break;
681  case 4:
682  coerceValue(_data.srcinput, value);
683  break;
684  case 5:
685  coerceValue(_data.scale, value);
686  break;
687  case 6:
688  coerceValue(_data.add, value);
689  break;
690  case 7:
691  coerceValue(_data.process, value);
692  break;
693  case 8:
694  coerceValue(_data.blend, value);
695  break;
696  case 9:
697  coerceValue(_data.doblendattrib, value);
698  break;
699  case 10:
700  coerceValue(_data.blendattrib, value);
701  break;
702  case 11:
703  coerceValue(_data.blendinput, value);
704  break;
705 
706  }
707  }
708  break;
709  case 5:
710  coerceValue(myPostScale, ( ( value ) ));
711  break;
712  case 6:
713  coerceValue(myDoThreshold, ( ( value ) ));
714  break;
715  case 7:
716  coerceValue(myThreshold, ( ( value ) ));
717  break;
718  case 8:
719  coerceValue(myDoClampMin, ( ( value ) ));
720  break;
721  case 9:
722  coerceValue(myClampMin, ( ( value ) ));
723  break;
724  case 10:
725  coerceValue(myDoClampMax, ( ( value ) ));
726  break;
727  case 11:
728  coerceValue(myClampMax, ( ( value ) ));
729  break;
730  case 12:
731  coerceValue(myAttribMatch, ( ( value ) ));
732  break;
733  case 13:
734  coerceValue(myCreateMissing, ( ( value ) ));
735  break;
736  case 14:
737  coerceValue(myForceScalar, ( ( value ) ));
738  break;
739  case 15:
740  coerceValue(myDeleteSource, ( ( value ) ));
741  break;
742  case 16:
743  coerceValue(myErrorMissing, ( ( value ) ));
744  break;
745 
746  }
747  }
748 
749  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
750  { doSetParmValue(idx, instance, value); }
751  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
752  { doSetParmValue(idx, instance, value); }
753  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
754  { doSetParmValue(idx, instance, value); }
755  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
756  { doSetParmValue(idx, instance, value); }
757  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
758  { doSetParmValue(idx, instance, value); }
759  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
760  { doSetParmValue(idx, instance, value); }
761  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
762  { doSetParmValue(idx, instance, value); }
763  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
764  { doSetParmValue(idx, instance, value); }
765  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
766  { doSetParmValue(idx, instance, value); }
767  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
768  { doSetParmValue(idx, instance, value); }
769  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
770  { doSetParmValue(idx, instance, value); }
771 
772  exint getNestNumParms(TempIndex idx) const override
773  {
774  if (idx.size() == 0)
775  return 17;
776  switch (idx[0])
777  {
778  case 4:
779  return 12;
780 
781  }
782  // Invalid
783  return 0;
784  }
785 
786  const char *getNestParmName(TempIndex fieldnum) const override
787  {
788  if (fieldnum.size() < 1)
789  return 0;
790  switch (fieldnum[0])
791  {
792  case 0:
793  return "group";
794  case 1:
795  return "grouptype";
796  case 2:
797  return "dstattrib";
798  case 3:
799  return "class";
800  case 4:
801  if (fieldnum.size() == 1)
802  return "numcombines";
803  switch (fieldnum[1])
804  {
805  case 0:
806  return "enable#";
807  case 1:
808  return "combine#";
809  case 2:
810  return "adjust#";
811  case 3:
812  return "srcattrib#";
813  case 4:
814  return "srcinput#";
815  case 5:
816  return "scale#";
817  case 6:
818  return "add#";
819  case 7:
820  return "process#";
821  case 8:
822  return "blend#";
823  case 9:
824  return "doblendattrib#";
825  case 10:
826  return "blendattrib#";
827  case 11:
828  return "blendinput#";
829 
830  }
831  return 0;
832  case 5:
833  return "postscale";
834  case 6:
835  return "dothreshold";
836  case 7:
837  return "threshold";
838  case 8:
839  return "doclampmin";
840  case 9:
841  return "clampmin";
842  case 10:
843  return "doclampmax";
844  case 11:
845  return "clampmax";
846  case 12:
847  return "attribmatch";
848  case 13:
849  return "createmissing";
850  case 14:
851  return "forcescalar";
852  case 15:
853  return "deletesource";
854  case 16:
855  return "errormissing";
856 
857  }
858  return 0;
859  }
860 
861  ParmType getNestParmType(TempIndex fieldnum) const override
862  {
863  if (fieldnum.size() < 1)
864  return PARM_UNSUPPORTED;
865  switch (fieldnum[0])
866  {
867  case 0:
868  return PARM_STRING;
869  case 1:
870  return PARM_INTEGER;
871  case 2:
872  return PARM_STRING;
873  case 3:
874  return PARM_INTEGER;
875  case 4:
876  if (fieldnum.size() == 1)
877  return PARM_MULTIPARM;
878  switch (fieldnum[1])
879  {
880  case 0:
881  return PARM_INTEGER;
882  case 1:
883  return PARM_INTEGER;
884  case 2:
885  return PARM_INTEGER;
886  case 3:
887  return PARM_STRING;
888  case 4:
889  return PARM_INTEGER;
890  case 5:
891  return PARM_FLOAT;
892  case 6:
893  return PARM_FLOAT;
894  case 7:
895  return PARM_INTEGER;
896  case 8:
897  return PARM_FLOAT;
898  case 9:
899  return PARM_INTEGER;
900  case 10:
901  return PARM_STRING;
902  case 11:
903  return PARM_INTEGER;
904 
905  }
906  return PARM_UNSUPPORTED;
907  case 5:
908  return PARM_FLOAT;
909  case 6:
910  return PARM_INTEGER;
911  case 7:
912  return PARM_FLOAT;
913  case 8:
914  return PARM_INTEGER;
915  case 9:
916  return PARM_FLOAT;
917  case 10:
918  return PARM_INTEGER;
919  case 11:
920  return PARM_FLOAT;
921  case 12:
922  return PARM_STRING;
923  case 13:
924  return PARM_INTEGER;
925  case 14:
926  return PARM_INTEGER;
927  case 15:
928  return PARM_INTEGER;
929  case 16:
930  return PARM_INTEGER;
931 
932  }
933  return PARM_UNSUPPORTED;
934  }
935 
936  // Boiler plate to load individual types.
937  static void loadData(UT_IStream &is, int64 &v)
938  { is.bread(&v, 1); }
939  static void loadData(UT_IStream &is, bool &v)
940  { int64 iv; is.bread(&iv, 1); v = iv; }
941  static void loadData(UT_IStream &is, fpreal64 &v)
942  { is.bread<fpreal64>(&v, 1); }
943  static void loadData(UT_IStream &is, UT_Vector2D &v)
944  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
945  static void loadData(UT_IStream &is, UT_Vector3D &v)
946  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
947  is.bread<fpreal64>(&v.z(), 1); }
948  static void loadData(UT_IStream &is, UT_Vector4D &v)
949  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
950  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
951  static void loadData(UT_IStream &is, UT_Matrix2D &v)
952  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
953  static void loadData(UT_IStream &is, UT_Matrix3D &v)
954  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
955  static void loadData(UT_IStream &is, UT_Matrix4D &v)
956  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
957  static void loadData(UT_IStream &is, UT_Vector2I &v)
958  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
959  static void loadData(UT_IStream &is, UT_Vector3I &v)
960  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
961  is.bread<int64>(&v.z(), 1); }
962  static void loadData(UT_IStream &is, UT_Vector4I &v)
963  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
964  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
966  { is.bread(v); }
968  { UT_StringHolder rampdata;
969  loadData(is, rampdata);
970  if (rampdata.isstring())
971  {
972  v.reset(new UT_Ramp());
973  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
974  v->load(istr);
975  }
976  else v.reset();
977  }
980  loadData(is, data);
981  if (data.isstring())
982  {
983  // Find the data type.
984  const char *colon = UT_StringWrap(data).findChar(':');
985  if (colon)
986  {
987  int typelen = colon - data.buffer();
989  type.strncpy(data.buffer(), typelen);
990  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
991 
992  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
993  }
994  }
995  else v.reset();
996  }
997 
998  static void saveData(std::ostream &os, int64 v)
999  { UTwrite(os, &v); }
1000  static void saveData(std::ostream &os, bool v)
1001  { int64 iv = v; UTwrite(os, &iv); }
1002  static void saveData(std::ostream &os, fpreal64 v)
1003  { UTwrite<fpreal64>(os, &v); }
1004  static void saveData(std::ostream &os, UT_Vector2D v)
1005  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
1006  static void saveData(std::ostream &os, UT_Vector3D v)
1007  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
1008  UTwrite<fpreal64>(os, &v.z()); }
1009  static void saveData(std::ostream &os, UT_Vector4D v)
1010  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
1011  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
1012  static void saveData(std::ostream &os, UT_Matrix2D v)
1014  static void saveData(std::ostream &os, UT_Matrix3D v)
1016  static void saveData(std::ostream &os, UT_Matrix4D v)
1018  static void saveData(std::ostream &os, UT_StringHolder s)
1019  { UT_StringWrap(s).saveBinary(os); }
1020  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
1022  UT_OStringStream ostr;
1023  if (s) s->save(ostr);
1024  result = ostr.str();
1025  saveData(os, result);
1026  }
1027  static void saveData(std::ostream &os, PRM_DataItemHandle s)
1029  UT_OStringStream ostr;
1030  if (s)
1031  {
1032  ostr << s->getDataTypeToken();
1033  ostr << ":";
1034  s->saveBinary(ostr);
1035  }
1036  result = ostr.str();
1037  saveData(os, result);
1038  }
1039 
1040 
1041  void save(std::ostream &os) const
1042  {
1043  int32 v = version();
1044  UTwrite(os, &v);
1045  saveData(os, myGroup);
1046  saveData(os, myGroupType);
1047  saveData(os, myDstAttrib);
1048  saveData(os, myClass);
1049  {
1050  int64 length = myCombinations.entries();
1051  UTwrite(os, &length);
1052  for (exint i = 0; i < length; i++)
1053  {
1054  auto && _curentry = myCombinations(i);
1055  (void) _curentry;
1056  saveData(os, _curentry.enable);
1057  saveData(os, _curentry.combine);
1058  saveData(os, _curentry.adjust);
1059  saveData(os, _curentry.srcattrib);
1060  saveData(os, _curentry.srcinput);
1061  saveData(os, _curentry.scale);
1062  saveData(os, _curentry.add);
1063  saveData(os, _curentry.process);
1064  saveData(os, _curentry.blend);
1065  saveData(os, _curentry.doblendattrib);
1066  saveData(os, _curentry.blendattrib);
1067  saveData(os, _curentry.blendinput);
1068 
1069  }
1070  }
1071  saveData(os, myPostScale);
1072  saveData(os, myDoThreshold);
1073  saveData(os, myThreshold);
1074  saveData(os, myDoClampMin);
1075  saveData(os, myClampMin);
1076  saveData(os, myDoClampMax);
1077  saveData(os, myClampMax);
1078  saveData(os, myAttribMatch);
1079  saveData(os, myCreateMissing);
1080  saveData(os, myForceScalar);
1081  saveData(os, myDeleteSource);
1082  saveData(os, myErrorMissing);
1083 
1084  }
1085 
1086  bool load(UT_IStream &is)
1087  {
1088  int32 v;
1089  is.bread(&v, 1);
1090  if (version() != v)
1091  {
1092  // Fail incompatible versions
1093  return false;
1094  }
1095  loadData(is, myGroup);
1096  loadData(is, myGroupType);
1097  loadData(is, myDstAttrib);
1098  loadData(is, myClass);
1099  {
1100  int64 length;
1101  is.read(&length, 1);
1102  myCombinations.setSize(length);
1103  for (exint i = 0; i < length; i++)
1104  {
1105  auto && _curentry = myCombinations(i);
1106  (void) _curentry;
1107  loadData(is, _curentry.enable);
1108  loadData(is, _curentry.combine);
1109  loadData(is, _curentry.adjust);
1110  loadData(is, _curentry.srcattrib);
1111  loadData(is, _curentry.srcinput);
1112  loadData(is, _curentry.scale);
1113  loadData(is, _curentry.add);
1114  loadData(is, _curentry.process);
1115  loadData(is, _curentry.blend);
1116  loadData(is, _curentry.doblendattrib);
1117  loadData(is, _curentry.blendattrib);
1118  loadData(is, _curentry.blendinput);
1119 
1120  }
1121  }
1122  loadData(is, myPostScale);
1123  loadData(is, myDoThreshold);
1124  loadData(is, myThreshold);
1125  loadData(is, myDoClampMin);
1126  loadData(is, myClampMin);
1127  loadData(is, myDoClampMax);
1128  loadData(is, myClampMax);
1129  loadData(is, myAttribMatch);
1130  loadData(is, myCreateMissing);
1131  loadData(is, myForceScalar);
1132  loadData(is, myDeleteSource);
1133  loadData(is, myErrorMissing);
1134 
1135  return true;
1136  }
1137 
1138  const UT_StringHolder & getGroup() const { return myGroup; }
1139  void setGroup(const UT_StringHolder & val) { myGroup = val; }
1141  {
1142  SOP_Node *thissop = cookparms.getNode();
1143  if (!thissop) return getGroup();
1145  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
1146  return result;
1147  }
1148  GroupType getGroupType() const { return GroupType(myGroupType); }
1149  void setGroupType(GroupType val) { myGroupType = int64(val); }
1151  {
1152  SOP_Node *thissop = cookparms.getNode();
1153  if (!thissop) return getGroupType();
1154  int64 result;
1155  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
1156  return GroupType(result);
1157  }
1158  const UT_StringHolder & getDstAttrib() const { return myDstAttrib; }
1159  void setDstAttrib(const UT_StringHolder & val) { myDstAttrib = val; }
1161  {
1162  SOP_Node *thissop = cookparms.getNode();
1163  if (!thissop) return getDstAttrib();
1165  OP_Utils::evalOpParm(result, thissop, "dstattrib", cookparms.getCookTime(), 0);
1166  return result;
1167  }
1168  Class getClass() const { return Class(myClass); }
1169  void setClass(Class val) { myClass = int64(val); }
1170  Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
1171  {
1172  SOP_Node *thissop = cookparms.getNode();
1173  if (!thissop) return getClass();
1174  int64 result;
1175  OP_Utils::evalOpParm(result, thissop, "class", cookparms.getCookTime(), 0);
1176  return Class(result);
1177  }
1178  const UT_Array<Combinations> &getCombinations() const { return myCombinations; }
1179 void setCombinations(const UT_Array<Combinations> &val) { myCombinations = val; }
1181  {
1182  SOP_Node *thissop = cookparms.getNode();
1183  if (!thissop) return getCombinations().entries();
1184  exint result;
1185  OP_Utils::evalOpParm(result, thissop, "numcombines", cookparms.getCookTime(), 0);
1186  return result;
1187  }
1188  bool opCombinations_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1189  { return opinstCombinations_enable(cookparms, &_idx); }
1190  bool opinstCombinations_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1191  {
1192  SOP_Node *thissop = cookparms.getNode();
1193  if (!thissop) return (myCombinations(_idx[0]).enable);
1194  int _parmidx[2-1];
1195  _parmidx[1-1] = _idx[1-1] + 1;
1196 
1197  bool result;
1198  OP_Utils::evalOpParmInst(result, thissop, "enable#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1199  return (result);
1200  }
1201  int64 opCombinations_combine(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1202  { return opinstCombinations_combine(cookparms, &_idx); }
1203  int64 opinstCombinations_combine(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1204  {
1205  SOP_Node *thissop = cookparms.getNode();
1206  if (!thissop) return (myCombinations(_idx[0]).combine);
1207  int _parmidx[2-1];
1208  _parmidx[1-1] = _idx[1-1] + 1;
1209 
1210  int64 result;
1211  OP_Utils::evalOpParmInst(result, thissop, "combine#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1212  return (result);
1213  }
1214  int64 opCombinations_adjust(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1215  { return opinstCombinations_adjust(cookparms, &_idx); }
1216  int64 opinstCombinations_adjust(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1217  {
1218  SOP_Node *thissop = cookparms.getNode();
1219  if (!thissop) return (myCombinations(_idx[0]).adjust);
1220  int _parmidx[2-1];
1221  _parmidx[1-1] = _idx[1-1] + 1;
1222 
1223  int64 result;
1224  OP_Utils::evalOpParmInst(result, thissop, "adjust#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1225  return (result);
1226  }
1228  { return opinstCombinations_srcattrib(cookparms, &_idx); }
1230  {
1231  SOP_Node *thissop = cookparms.getNode();
1232  if (!thissop) return (myCombinations(_idx[0]).srcattrib);
1233  int _parmidx[2-1];
1234  _parmidx[1-1] = _idx[1-1] + 1;
1235 
1237  OP_Utils::evalOpParmInst(result, thissop, "srcattrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1238  return (result);
1239  }
1240  int64 opCombinations_srcinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1241  { return opinstCombinations_srcinput(cookparms, &_idx); }
1242  int64 opinstCombinations_srcinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1243  {
1244  SOP_Node *thissop = cookparms.getNode();
1245  if (!thissop) return (myCombinations(_idx[0]).srcinput);
1246  int _parmidx[2-1];
1247  _parmidx[1-1] = _idx[1-1] + 1;
1248 
1249  int64 result;
1250  OP_Utils::evalOpParmInst(result, thissop, "srcinput#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1251  return (result);
1252  }
1253  fpreal64 opCombinations_scale(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1254  { return opinstCombinations_scale(cookparms, &_idx); }
1255  fpreal64 opinstCombinations_scale(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1256  {
1257  SOP_Node *thissop = cookparms.getNode();
1258  if (!thissop) return (myCombinations(_idx[0]).scale);
1259  int _parmidx[2-1];
1260  _parmidx[1-1] = _idx[1-1] + 1;
1261 
1262  fpreal64 result;
1263  OP_Utils::evalOpParmInst(result, thissop, "scale#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1264  return (result);
1265  }
1266  fpreal64 opCombinations_add(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1267  { return opinstCombinations_add(cookparms, &_idx); }
1268  fpreal64 opinstCombinations_add(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1269  {
1270  SOP_Node *thissop = cookparms.getNode();
1271  if (!thissop) return (myCombinations(_idx[0]).add);
1272  int _parmidx[2-1];
1273  _parmidx[1-1] = _idx[1-1] + 1;
1274 
1275  fpreal64 result;
1276  OP_Utils::evalOpParmInst(result, thissop, "add#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1277  return (result);
1278  }
1279  int64 opCombinations_process(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1280  { return opinstCombinations_process(cookparms, &_idx); }
1281  int64 opinstCombinations_process(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1282  {
1283  SOP_Node *thissop = cookparms.getNode();
1284  if (!thissop) return (myCombinations(_idx[0]).process);
1285  int _parmidx[2-1];
1286  _parmidx[1-1] = _idx[1-1] + 1;
1287 
1288  int64 result;
1289  OP_Utils::evalOpParmInst(result, thissop, "process#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1290  return (result);
1291  }
1292  fpreal64 opCombinations_blend(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1293  { return opinstCombinations_blend(cookparms, &_idx); }
1294  fpreal64 opinstCombinations_blend(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1295  {
1296  SOP_Node *thissop = cookparms.getNode();
1297  if (!thissop) return (myCombinations(_idx[0]).blend);
1298  int _parmidx[2-1];
1299  _parmidx[1-1] = _idx[1-1] + 1;
1300 
1301  fpreal64 result;
1302  OP_Utils::evalOpParmInst(result, thissop, "blend#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1303  return (result);
1304  }
1306  { return opinstCombinations_doblendattrib(cookparms, &_idx); }
1307  int64 opinstCombinations_doblendattrib(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1308  {
1309  SOP_Node *thissop = cookparms.getNode();
1310  if (!thissop) return (myCombinations(_idx[0]).doblendattrib);
1311  int _parmidx[2-1];
1312  _parmidx[1-1] = _idx[1-1] + 1;
1313 
1314  int64 result;
1315  OP_Utils::evalOpParmInst(result, thissop, "doblendattrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1316  return (result);
1317  }
1319  { return opinstCombinations_blendattrib(cookparms, &_idx); }
1321  {
1322  SOP_Node *thissop = cookparms.getNode();
1323  if (!thissop) return (myCombinations(_idx[0]).blendattrib);
1324  int _parmidx[2-1];
1325  _parmidx[1-1] = _idx[1-1] + 1;
1326 
1328  OP_Utils::evalOpParmInst(result, thissop, "blendattrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1329  return (result);
1330  }
1331  int64 opCombinations_blendinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1332  { return opinstCombinations_blendinput(cookparms, &_idx); }
1333  int64 opinstCombinations_blendinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1334  {
1335  SOP_Node *thissop = cookparms.getNode();
1336  if (!thissop) return (myCombinations(_idx[0]).blendinput);
1337  int _parmidx[2-1];
1338  _parmidx[1-1] = _idx[1-1] + 1;
1339 
1340  int64 result;
1341  OP_Utils::evalOpParmInst(result, thissop, "blendinput#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1342  return (result);
1343  }
1344 
1345  fpreal64 getPostScale() const { return myPostScale; }
1346  void setPostScale(fpreal64 val) { myPostScale = val; }
1348  {
1349  SOP_Node *thissop = cookparms.getNode();
1350  if (!thissop) return getPostScale();
1351  fpreal64 result;
1352  OP_Utils::evalOpParm(result, thissop, "postscale", cookparms.getCookTime(), 0);
1353  return result;
1354  }
1355  bool getDoThreshold() const { return myDoThreshold; }
1356  void setDoThreshold(bool val) { myDoThreshold = val; }
1357  bool opDoThreshold(const SOP_NodeVerb::CookParms &cookparms) const
1358  {
1359  SOP_Node *thissop = cookparms.getNode();
1360  if (!thissop) return getDoThreshold();
1361  bool result;
1362  OP_Utils::evalOpParm(result, thissop, "dothreshold", cookparms.getCookTime(), 0);
1363  return result;
1364  }
1365  fpreal64 getThreshold() const { return myThreshold; }
1366  void setThreshold(fpreal64 val) { myThreshold = val; }
1368  {
1369  SOP_Node *thissop = cookparms.getNode();
1370  if (!thissop) return getThreshold();
1371  fpreal64 result;
1372  OP_Utils::evalOpParm(result, thissop, "threshold", cookparms.getCookTime(), 0);
1373  return result;
1374  }
1375  bool getDoClampMin() const { return myDoClampMin; }
1376  void setDoClampMin(bool val) { myDoClampMin = val; }
1377  bool opDoClampMin(const SOP_NodeVerb::CookParms &cookparms) const
1378  {
1379  SOP_Node *thissop = cookparms.getNode();
1380  if (!thissop) return getDoClampMin();
1381  bool result;
1382  OP_Utils::evalOpParm(result, thissop, "doclampmin", cookparms.getCookTime(), 0);
1383  return result;
1384  }
1385  fpreal64 getClampMin() const { return myClampMin; }
1386  void setClampMin(fpreal64 val) { myClampMin = val; }
1388  {
1389  SOP_Node *thissop = cookparms.getNode();
1390  if (!thissop) return getClampMin();
1391  fpreal64 result;
1392  OP_Utils::evalOpParm(result, thissop, "clampmin", cookparms.getCookTime(), 0);
1393  return result;
1394  }
1395  bool getDoClampMax() const { return myDoClampMax; }
1396  void setDoClampMax(bool val) { myDoClampMax = val; }
1397  bool opDoClampMax(const SOP_NodeVerb::CookParms &cookparms) const
1398  {
1399  SOP_Node *thissop = cookparms.getNode();
1400  if (!thissop) return getDoClampMax();
1401  bool result;
1402  OP_Utils::evalOpParm(result, thissop, "doclampmax", cookparms.getCookTime(), 0);
1403  return result;
1404  }
1405  fpreal64 getClampMax() const { return myClampMax; }
1406  void setClampMax(fpreal64 val) { myClampMax = val; }
1408  {
1409  SOP_Node *thissop = cookparms.getNode();
1410  if (!thissop) return getClampMax();
1411  fpreal64 result;
1412  OP_Utils::evalOpParm(result, thissop, "clampmax", cookparms.getCookTime(), 0);
1413  return result;
1414  }
1415  const UT_StringHolder & getAttribMatch() const { return myAttribMatch; }
1416  void setAttribMatch(const UT_StringHolder & val) { myAttribMatch = val; }
1418  {
1419  SOP_Node *thissop = cookparms.getNode();
1420  if (!thissop) return getAttribMatch();
1422  OP_Utils::evalOpParm(result, thissop, "attribmatch", cookparms.getCookTime(), 0);
1423  return result;
1424  }
1425  bool getCreateMissing() const { return myCreateMissing; }
1426  void setCreateMissing(bool val) { myCreateMissing = val; }
1427  bool opCreateMissing(const SOP_NodeVerb::CookParms &cookparms) const
1428  {
1429  SOP_Node *thissop = cookparms.getNode();
1430  if (!thissop) return getCreateMissing();
1431  bool result;
1432  OP_Utils::evalOpParm(result, thissop, "createmissing", cookparms.getCookTime(), 0);
1433  return result;
1434  }
1435  bool getForceScalar() const { return myForceScalar; }
1436  void setForceScalar(bool val) { myForceScalar = val; }
1437  bool opForceScalar(const SOP_NodeVerb::CookParms &cookparms) const
1438  {
1439  SOP_Node *thissop = cookparms.getNode();
1440  if (!thissop) return getForceScalar();
1441  bool result;
1442  OP_Utils::evalOpParm(result, thissop, "forcescalar", cookparms.getCookTime(), 0);
1443  return result;
1444  }
1445  bool getDeleteSource() const { return myDeleteSource; }
1446  void setDeleteSource(bool val) { myDeleteSource = val; }
1447  bool opDeleteSource(const SOP_NodeVerb::CookParms &cookparms) const
1448  {
1449  SOP_Node *thissop = cookparms.getNode();
1450  if (!thissop) return getDeleteSource();
1451  bool result;
1452  OP_Utils::evalOpParm(result, thissop, "deletesource", cookparms.getCookTime(), 0);
1453  return result;
1454  }
1455  bool getErrorMissing() const { return myErrorMissing; }
1456  void setErrorMissing(bool val) { myErrorMissing = val; }
1457  bool opErrorMissing(const SOP_NodeVerb::CookParms &cookparms) const
1458  {
1459  SOP_Node *thissop = cookparms.getNode();
1460  if (!thissop) return getErrorMissing();
1461  bool result;
1462  OP_Utils::evalOpParm(result, thissop, "errormissing", cookparms.getCookTime(), 0);
1463  return result;
1464  }
1465 
1466 private:
1467  UT_StringHolder myGroup;
1468  int64 myGroupType;
1469  UT_StringHolder myDstAttrib;
1470  int64 myClass;
1471  UT_Array<Combinations> myCombinations;
1472  fpreal64 myPostScale;
1473  bool myDoThreshold;
1474  fpreal64 myThreshold;
1475  bool myDoClampMin;
1476  fpreal64 myClampMin;
1477  bool myDoClampMax;
1478  fpreal64 myClampMax;
1479  UT_StringHolder myAttribMatch;
1480  bool myCreateMissing;
1481  bool myForceScalar;
1482  bool myDeleteSource;
1483  bool myErrorMissing;
1484 
1485 };
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
UT_StringHolder opinstCombinations_srcattrib(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
type
Definition: core.h:556
ParmType getNestParmType(TempIndex fieldnum) const override
bool operator==(const Combinations &src) const
fpreal64 opCombinations_add(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool operator==(const SOP_AttribCombineParms &src) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void copyFrom(const OP_NodeParms *src) override
void
Definition: png.h:1083
int64 opinstCombinations_srcinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_StringHolder opCombinations_srcattrib(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint bread(int32 *buffer, exint asize=1)
static void saveData(std::ostream &os, UT_Matrix4D 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
static void saveData(std::ostream &os, UT_Vector4D v)
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:63
static void saveData(std::ostream &os, bool v)
const UT_StringHolder & getAttribMatch() const
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
GLsizei const GLfloat * value
Definition: glcorearb.h:824
int64 opinstCombinations_process(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
fpreal64 opCombinations_blend(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
int64 opCombinations_combine(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
An output stream object that owns its own string buffer storage.
exint opCombinations(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
**But if you need a result
Definition: thread.h:622
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
UT_StringHolder opAttribMatch(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, fpreal64 &v)
int64 opCombinations_doblendattrib(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool opinstCombinations_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, UT_StringHolder s)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
double fpreal64
Definition: SYS_Types.h:201
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
vint4 blend(const vint4 &a, const vint4 &b, const vbool4 &mask)
Definition: simd.h:4949
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
GA_API const UT_StringHolder scale
int64 opinstCombinations_combine(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
int64 opCombinations_process(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
exint length() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
int64 opinstCombinations_doblendattrib(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
const UT_StringHolder & getDstAttrib() const
static void saveData(std::ostream &os, int64 v)
int64 opCombinations_srcinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 opinstCombinations_adjust(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
bool opDoThreshold(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, int64 &v)
fpreal64 opinstCombinations_add(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opDeleteSource(const SOP_NodeVerb::CookParms &cookparms) 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
static void saveData(std::ostream &os, UT_Vector3D v)
long long int64
Definition: SYS_Types.h:116
int64 opinstCombinations_blendinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
fpreal64 opinstCombinations_blend(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const UT_Array< Combinations > & getCombinations() const
bool opDoClampMax(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool opCombinations_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:303
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Matrix3D &v)
fpreal64 opClampMax(const SOP_NodeVerb::CookParms &cookparms) const
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:655
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
fpreal64 opPostScale(const SOP_NodeVerb::CookParms &cookparms) const
int64 opCombinations_blendinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
fpreal64 opCombinations_scale(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool opErrorMissing(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
fpreal64 opinstCombinations_scale(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
fpreal64 fpreal
Definition: SYS_Types.h:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
fpreal64 opClampMin(const SOP_NodeVerb::CookParms &cookparms) const
int64 opCombinations_adjust(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setAttribMatch(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
GLuint GLfloat * val
Definition: glcorearb.h:1608
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
bool opDoClampMin(const SOP_NodeVerb::CookParms &cookparms) const
#define SOP_API
Definition: SOP_API.h:10
exint getNestNumParms(TempIndex idx) const override
bool process(T &func, UT_WorkBuffer &fullpath, exint fullpath_len, const UT_StringArray &paths, const UT_Array< FS_Stat > &stats)
Utility function to process the contents of the traverse() function.
Definition: FS_Traverse.h:24
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:372
SYS_FORCE_INLINE UT_StringHolder getToken(GroupType enum_value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool operator!=(const Combinations &src) const
const char * findChar(int c) const
Definition: UT_String.h:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool opForceScalar(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opCombinations_blendattrib(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
static void loadData(UT_IStream &is, UT_Vector3I &v)
GLboolean r
Definition: glcorearb.h:1222
void setGroupType(GroupType val)
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
UT_StringHolder opDstAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
fpreal64 opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, bool &v)
void setCombinations(const UT_Array< Combinations > &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
void save(std::ostream &os) const
SYS_FORCE_INLINE bool isstring() const
bool opCreateMissing(const SOP_NodeVerb::CookParms &cookparms) const
GroupType opGroupType(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_AttribCombineParms &src) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
UT_StringHolder createString(const UT_Array< Combinations > &list) const
static void saveData(std::ostream &os, UT_Matrix3D v)
void setDstAttrib(const UT_StringHolder &val)
UT_StringHolder opinstCombinations_blendattrib(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override