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 <SOP/SOP_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  return true;
348  }
350  {
351  return !operator==(src);
352  }
361 
362 
363 
364  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
365  {
366  myGroup = ""_UTsh;
367  if (true)
368  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
369  myGroupType = 0;
370  if (true)
371  graph->evalOpParm(myGroupType, nodeidx, "grouptype", time, 0);
372  myDstAttrib = ""_UTsh;
373  if (true)
374  graph->evalOpParm(myDstAttrib, nodeidx, "dstattrib", time, 0);
375  myClass = 2;
376  if (true)
377  graph->evalOpParm(myClass, nodeidx, "class", time, 0);
378  if (true)
379  {
380  int64 length = 0;
381  graph->evalOpParm(length, nodeidx, "numcombines", time, 0);
382  if (length < 0) length = 0;
383  myCombinations.setSize(length);
384  for (exint i = 0; i < length; i++)
385  {
386  int parmidx[1];
387  int offsets[1];
388  parmidx[0] = i+1;
389  offsets[0] = 1;
390  auto && _curentry = myCombinations(i);
391  (void) _curentry;
392  _curentry.enable = true;
393  if (true)
394  graph->evalOpParmInst(_curentry.enable, nodeidx, "enable#", parmidx, offsets, time, 0, 2-1);
395  _curentry.combine = 1;
396  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
397  graph->evalOpParmInst(_curentry.combine, nodeidx, "combine#", parmidx, offsets, time, 0, 2-1);
398  _curentry.adjust = 0;
399  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
400  graph->evalOpParmInst(_curentry.adjust, nodeidx, "adjust#", parmidx, offsets, time, 0, 2-1);
401  _curentry.srcattrib = ""_UTsh;
402  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
403  graph->evalOpParmInst(_curentry.srcattrib, nodeidx, "srcattrib#", parmidx, offsets, time, 0, 2-1);
404  _curentry.srcinput = 0;
405  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
406  graph->evalOpParmInst(_curentry.srcinput, nodeidx, "srcinput#", parmidx, offsets, time, 0, 2-1);
407  _curentry.scale = 1;
408  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.adjust==0)))) ) )
409  graph->evalOpParmInst(_curentry.scale, nodeidx, "scale#", parmidx, offsets, time, 0, 2-1);
410  _curentry.add = 0;
411  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.adjust==0))||((_curentry.adjust==1)))) ) )
412  graph->evalOpParmInst(_curentry.add, nodeidx, "add#", parmidx, offsets, time, 0, 2-1);
413  _curentry.process = 0;
414  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.adjust==0))||((_curentry.adjust==1))||((_curentry.adjust==2)))) ) )
415  graph->evalOpParmInst(_curentry.process, nodeidx, "process#", parmidx, offsets, time, 0, 2-1);
416  _curentry.blend = 1;
417  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
418  graph->evalOpParmInst(_curentry.blend, nodeidx, "blend#", parmidx, offsets, time, 0, 2-1);
419  _curentry.doblendattrib = 0;
420  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
421  graph->evalOpParmInst(_curentry.doblendattrib, nodeidx, "doblendattrib#", parmidx, offsets, time, 0, 2-1);
422  _curentry.blendattrib = ""_UTsh;
423  if (true && ( (true&&!(((_curentry.doblendattrib==0))||((_curentry.enable==0)))) ) )
424  graph->evalOpParmInst(_curentry.blendattrib, nodeidx, "blendattrib#", parmidx, offsets, time, 0, 2-1);
425  _curentry.blendinput = 0;
426  if (true && ( (true&&!(((_curentry.doblendattrib==0))||((_curentry.enable==0)))) ) )
427  graph->evalOpParmInst(_curentry.blendinput, nodeidx, "blendinput#", parmidx, offsets, time, 0, 2-1);
428 
429  }
430  }
431  else
432  myCombinations.clear();
433  myPostScale = 1;
434  if (true)
435  graph->evalOpParm(myPostScale, nodeidx, "postscale", time, 0);
436  myDoThreshold = false;
437  if (true)
438  graph->evalOpParm(myDoThreshold, nodeidx, "dothreshold", time, 0);
439  myThreshold = 0.5;
440  if (true && ( (true&&!(((getDoThreshold()==0)))) ) )
441  graph->evalOpParm(myThreshold, nodeidx, "threshold", time, 0);
442  myDoClampMin = false;
443  if (true)
444  graph->evalOpParm(myDoClampMin, nodeidx, "doclampmin", time, 0);
445  myClampMin = 0;
446  if (true && ( (true&&!(((getDoClampMin()==0)&&(getDoThreshold()==0)))) ) )
447  graph->evalOpParm(myClampMin, nodeidx, "clampmin", time, 0);
448  myDoClampMax = false;
449  if (true)
450  graph->evalOpParm(myDoClampMax, nodeidx, "doclampmax", time, 0);
451  myClampMax = 1;
452  if (true && ( (true&&!(((getDoClampMax()==0)&&(getDoThreshold()==0)))) ) )
453  graph->evalOpParm(myClampMax, nodeidx, "clampmax", time, 0);
454  myAttribMatch = "id"_UTsh;
455  if (true)
456  graph->evalOpParm(myAttribMatch, nodeidx, "attribmatch", time, 0);
457  myCreateMissing = true;
458  if (true)
459  graph->evalOpParm(myCreateMissing, nodeidx, "createmissing", time, 0);
460  myForceScalar = false;
461  if (true && ( (true&&!(((getCreateMissing()==0)))) ) )
462  graph->evalOpParm(myForceScalar, nodeidx, "forcescalar", time, 0);
463  myDeleteSource = false;
464  if (true)
465  graph->evalOpParm(myDeleteSource, nodeidx, "deletesource", time, 0);
466  myErrorMissing = true;
467  if (true)
468  graph->evalOpParm(myErrorMissing, nodeidx, "errormissing", time, 0);
469 
470  }
471 
472 
473  void loadFromOpSubclass(const LoadParms &loadparms) override
474  {
475  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
476  }
477 
478 
479  void copyFrom(const OP_NodeParms *src) override
480  {
481  *this = *((const SOP_AttribCombineParms *)src);
482  }
483 
484  template <typename T>
485  void
486  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
487  {
488  if (idx.size() < 1)
489  return;
490  UT_ASSERT(idx.size() == instance.size()+1);
491  if (idx.size() != instance.size()+1)
492  return;
493  switch (idx[0])
494  {
495  case 0:
496  coerceValue(value, myGroup);
497  break;
498  case 1:
499  coerceValue(value, myGroupType);
500  break;
501  case 2:
502  coerceValue(value, myDstAttrib);
503  break;
504  case 3:
505  coerceValue(value, myClass);
506  break;
507  case 4:
508  if (idx.size() == 1)
509  coerceValue(value, myCombinations.entries());
510  else if (instance[0] < myCombinations.entries())
511  {
512  auto && _data = myCombinations(instance[0]);
513  switch (idx[1])
514  {
515  case 0:
516  coerceValue(value, _data.enable);
517  break;
518  case 1:
519  coerceValue(value, _data.combine);
520  break;
521  case 2:
522  coerceValue(value, _data.adjust);
523  break;
524  case 3:
525  coerceValue(value, _data.srcattrib);
526  break;
527  case 4:
528  coerceValue(value, _data.srcinput);
529  break;
530  case 5:
531  coerceValue(value, _data.scale);
532  break;
533  case 6:
534  coerceValue(value, _data.add);
535  break;
536  case 7:
537  coerceValue(value, _data.process);
538  break;
539  case 8:
540  coerceValue(value, _data.blend);
541  break;
542  case 9:
543  coerceValue(value, _data.doblendattrib);
544  break;
545  case 10:
546  coerceValue(value, _data.blendattrib);
547  break;
548  case 11:
549  coerceValue(value, _data.blendinput);
550  break;
551 
552  }
553  }
554  break;
555  case 5:
556  coerceValue(value, myPostScale);
557  break;
558  case 6:
559  coerceValue(value, myDoThreshold);
560  break;
561  case 7:
562  coerceValue(value, myThreshold);
563  break;
564  case 8:
565  coerceValue(value, myDoClampMin);
566  break;
567  case 9:
568  coerceValue(value, myClampMin);
569  break;
570  case 10:
571  coerceValue(value, myDoClampMax);
572  break;
573  case 11:
574  coerceValue(value, myClampMax);
575  break;
576  case 12:
577  coerceValue(value, myAttribMatch);
578  break;
579  case 13:
580  coerceValue(value, myCreateMissing);
581  break;
582  case 14:
583  coerceValue(value, myForceScalar);
584  break;
585  case 15:
586  coerceValue(value, myDeleteSource);
587  break;
588  case 16:
589  coerceValue(value, myErrorMissing);
590  break;
591 
592  }
593  }
594 
595  bool isParmColorRamp(exint idx) const override
596  {
597  switch (idx)
598  {
599 
600  }
601  return false;
602  }
603 
604  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
605  { doGetParmValue(idx, instance, value); }
606  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
607  { doGetParmValue(idx, instance, value); }
608  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
609  { doGetParmValue(idx, instance, value); }
610  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
611  { doGetParmValue(idx, instance, value); }
612  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
613  { doGetParmValue(idx, instance, value); }
614  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
615  { doGetParmValue(idx, instance, value); }
616  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
617  { doGetParmValue(idx, instance, value); }
618  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
619  { doGetParmValue(idx, instance, value); }
620  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
621  { doGetParmValue(idx, instance, value); }
622  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
623  { doGetParmValue(idx, instance, value); }
624  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
625  { doGetParmValue(idx, instance, value); }
626 
627  template <typename T>
628  void
629  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
630  {
631  if (idx.size() < 1)
632  return;
633  UT_ASSERT(idx.size() == instance.size()+1);
634  if (idx.size() != instance.size()+1)
635  return;
636  switch (idx[0])
637  {
638  case 0:
639  coerceValue(myGroup, ( ( value ) ));
640  break;
641  case 1:
642  coerceValue(myGroupType, clampMinValue(0, clampMaxValue(4, value ) ));
643  break;
644  case 2:
645  coerceValue(myDstAttrib, ( ( value ) ));
646  break;
647  case 3:
648  coerceValue(myClass, clampMinValue(0, clampMaxValue(3, value ) ));
649  break;
650  case 4:
651  if (idx.size() == 1)
652  {
653  exint newsize;
654  coerceValue(newsize, value);
655  if (newsize < 0) newsize = 0;
656  myCombinations.setSize(newsize);
657  }
658  else
659  {
660  if (instance[0] < 0)
661  return;
662  myCombinations.setSizeIfNeeded(instance[0]+1);
663  auto && _data = myCombinations(instance[0]);
664  switch (idx[1])
665  {
666  case 0:
667  coerceValue(_data.enable, value);
668  break;
669  case 1:
670  coerceValue(_data.combine, value);
671  break;
672  case 2:
673  coerceValue(_data.adjust, value);
674  break;
675  case 3:
676  coerceValue(_data.srcattrib, value);
677  break;
678  case 4:
679  coerceValue(_data.srcinput, value);
680  break;
681  case 5:
682  coerceValue(_data.scale, value);
683  break;
684  case 6:
685  coerceValue(_data.add, value);
686  break;
687  case 7:
688  coerceValue(_data.process, value);
689  break;
690  case 8:
691  coerceValue(_data.blend, value);
692  break;
693  case 9:
694  coerceValue(_data.doblendattrib, value);
695  break;
696  case 10:
697  coerceValue(_data.blendattrib, value);
698  break;
699  case 11:
700  coerceValue(_data.blendinput, value);
701  break;
702 
703  }
704  }
705  break;
706  case 5:
707  coerceValue(myPostScale, ( ( value ) ));
708  break;
709  case 6:
710  coerceValue(myDoThreshold, ( ( value ) ));
711  break;
712  case 7:
713  coerceValue(myThreshold, ( ( value ) ));
714  break;
715  case 8:
716  coerceValue(myDoClampMin, ( ( value ) ));
717  break;
718  case 9:
719  coerceValue(myClampMin, ( ( value ) ));
720  break;
721  case 10:
722  coerceValue(myDoClampMax, ( ( value ) ));
723  break;
724  case 11:
725  coerceValue(myClampMax, ( ( value ) ));
726  break;
727  case 12:
728  coerceValue(myAttribMatch, ( ( value ) ));
729  break;
730  case 13:
731  coerceValue(myCreateMissing, ( ( value ) ));
732  break;
733  case 14:
734  coerceValue(myForceScalar, ( ( value ) ));
735  break;
736  case 15:
737  coerceValue(myDeleteSource, ( ( value ) ));
738  break;
739  case 16:
740  coerceValue(myErrorMissing, ( ( value ) ));
741  break;
742 
743  }
744  }
745 
746  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
747  { doSetParmValue(idx, instance, value); }
748  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
749  { doSetParmValue(idx, instance, value); }
750  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
751  { doSetParmValue(idx, instance, value); }
752  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
753  { doSetParmValue(idx, instance, value); }
754  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
755  { doSetParmValue(idx, instance, value); }
756  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
757  { doSetParmValue(idx, instance, value); }
758  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
759  { doSetParmValue(idx, instance, value); }
760  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
761  { doSetParmValue(idx, instance, value); }
762  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
763  { doSetParmValue(idx, instance, value); }
764  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
765  { doSetParmValue(idx, instance, value); }
766  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
767  { doSetParmValue(idx, instance, value); }
768 
769  exint getNestNumParms(TempIndex idx) const override
770  {
771  if (idx.size() == 0)
772  return 17;
773  switch (idx[0])
774  {
775  case 4:
776  return 12;
777 
778  }
779  // Invalid
780  return 0;
781  }
782 
783  const char *getNestParmName(TempIndex fieldnum) const override
784  {
785  if (fieldnum.size() < 1)
786  return 0;
787  switch (fieldnum[0])
788  {
789  case 0:
790  return "group";
791  case 1:
792  return "grouptype";
793  case 2:
794  return "dstattrib";
795  case 3:
796  return "class";
797  case 4:
798  if (fieldnum.size() == 1)
799  return "numcombines";
800  switch (fieldnum[1])
801  {
802  case 0:
803  return "enable#";
804  case 1:
805  return "combine#";
806  case 2:
807  return "adjust#";
808  case 3:
809  return "srcattrib#";
810  case 4:
811  return "srcinput#";
812  case 5:
813  return "scale#";
814  case 6:
815  return "add#";
816  case 7:
817  return "process#";
818  case 8:
819  return "blend#";
820  case 9:
821  return "doblendattrib#";
822  case 10:
823  return "blendattrib#";
824  case 11:
825  return "blendinput#";
826 
827  }
828  return 0;
829  case 5:
830  return "postscale";
831  case 6:
832  return "dothreshold";
833  case 7:
834  return "threshold";
835  case 8:
836  return "doclampmin";
837  case 9:
838  return "clampmin";
839  case 10:
840  return "doclampmax";
841  case 11:
842  return "clampmax";
843  case 12:
844  return "attribmatch";
845  case 13:
846  return "createmissing";
847  case 14:
848  return "forcescalar";
849  case 15:
850  return "deletesource";
851  case 16:
852  return "errormissing";
853 
854  }
855  return 0;
856  }
857 
858  ParmType getNestParmType(TempIndex fieldnum) const override
859  {
860  if (fieldnum.size() < 1)
861  return PARM_UNSUPPORTED;
862  switch (fieldnum[0])
863  {
864  case 0:
865  return PARM_STRING;
866  case 1:
867  return PARM_INTEGER;
868  case 2:
869  return PARM_STRING;
870  case 3:
871  return PARM_INTEGER;
872  case 4:
873  if (fieldnum.size() == 1)
874  return PARM_MULTIPARM;
875  switch (fieldnum[1])
876  {
877  case 0:
878  return PARM_INTEGER;
879  case 1:
880  return PARM_INTEGER;
881  case 2:
882  return PARM_INTEGER;
883  case 3:
884  return PARM_STRING;
885  case 4:
886  return PARM_INTEGER;
887  case 5:
888  return PARM_FLOAT;
889  case 6:
890  return PARM_FLOAT;
891  case 7:
892  return PARM_INTEGER;
893  case 8:
894  return PARM_FLOAT;
895  case 9:
896  return PARM_INTEGER;
897  case 10:
898  return PARM_STRING;
899  case 11:
900  return PARM_INTEGER;
901 
902  }
903  return PARM_UNSUPPORTED;
904  case 5:
905  return PARM_FLOAT;
906  case 6:
907  return PARM_INTEGER;
908  case 7:
909  return PARM_FLOAT;
910  case 8:
911  return PARM_INTEGER;
912  case 9:
913  return PARM_FLOAT;
914  case 10:
915  return PARM_INTEGER;
916  case 11:
917  return PARM_FLOAT;
918  case 12:
919  return PARM_STRING;
920  case 13:
921  return PARM_INTEGER;
922  case 14:
923  return PARM_INTEGER;
924  case 15:
925  return PARM_INTEGER;
926  case 16:
927  return PARM_INTEGER;
928 
929  }
930  return PARM_UNSUPPORTED;
931  }
932 
933  // Boiler plate to load individual types.
934  static void loadData(UT_IStream &is, int64 &v)
935  { is.bread(&v, 1); }
936  static void loadData(UT_IStream &is, bool &v)
937  { int64 iv; is.bread(&iv, 1); v = iv; }
938  static void loadData(UT_IStream &is, fpreal64 &v)
939  { is.bread<fpreal64>(&v, 1); }
940  static void loadData(UT_IStream &is, UT_Vector2D &v)
941  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
942  static void loadData(UT_IStream &is, UT_Vector3D &v)
943  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
944  is.bread<fpreal64>(&v.z(), 1); }
945  static void loadData(UT_IStream &is, UT_Vector4D &v)
946  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
947  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
948  static void loadData(UT_IStream &is, UT_Matrix2D &v)
949  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
950  static void loadData(UT_IStream &is, UT_Matrix3D &v)
951  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
952  static void loadData(UT_IStream &is, UT_Matrix4D &v)
953  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
954  static void loadData(UT_IStream &is, UT_Vector2I &v)
955  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
956  static void loadData(UT_IStream &is, UT_Vector3I &v)
957  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
958  is.bread<int64>(&v.z(), 1); }
959  static void loadData(UT_IStream &is, UT_Vector4I &v)
960  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
961  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
963  { is.bread(v); }
965  { UT_StringHolder rampdata;
966  loadData(is, rampdata);
967  if (rampdata.isstring())
968  {
969  v.reset(new UT_Ramp());
970  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
971  v->load(istr);
972  }
973  else v.reset();
974  }
977  loadData(is, data);
978  if (data.isstring())
979  {
980  // Find the data type.
981  const char *colon = UT_StringWrap(data).findChar(':');
982  if (colon)
983  {
984  int typelen = colon - data.buffer();
986  type.strncpy(data.buffer(), typelen);
987  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
988 
989  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
990  }
991  }
992  else v.reset();
993  }
994 
995  static void saveData(std::ostream &os, int64 v)
996  { UTwrite(os, &v); }
997  static void saveData(std::ostream &os, bool v)
998  { int64 iv = v; UTwrite(os, &iv); }
999  static void saveData(std::ostream &os, fpreal64 v)
1000  { UTwrite<fpreal64>(os, &v); }
1001  static void saveData(std::ostream &os, UT_Vector2D v)
1002  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
1003  static void saveData(std::ostream &os, UT_Vector3D v)
1004  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
1005  UTwrite<fpreal64>(os, &v.z()); }
1006  static void saveData(std::ostream &os, UT_Vector4D v)
1007  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
1008  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
1009  static void saveData(std::ostream &os, UT_Matrix2D v)
1011  static void saveData(std::ostream &os, UT_Matrix3D v)
1013  static void saveData(std::ostream &os, UT_Matrix4D v)
1015  static void saveData(std::ostream &os, UT_StringHolder s)
1016  { UT_StringWrap(s).saveBinary(os); }
1017  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
1019  UT_OStringStream ostr;
1020  if (s) s->save(ostr);
1021  result = ostr.str();
1022  saveData(os, result);
1023  }
1024  static void saveData(std::ostream &os, PRM_DataItemHandle s)
1026  UT_OStringStream ostr;
1027  if (s)
1028  {
1029  ostr << s->getDataTypeToken();
1030  ostr << ":";
1031  s->saveBinary(ostr);
1032  }
1033  result = ostr.str();
1034  saveData(os, result);
1035  }
1036 
1037 
1038  void save(std::ostream &os) const
1039  {
1040  int32 v = version();
1041  UTwrite(os, &v);
1042  saveData(os, myGroup);
1043  saveData(os, myGroupType);
1044  saveData(os, myDstAttrib);
1045  saveData(os, myClass);
1046  {
1047  int64 length = myCombinations.entries();
1048  UTwrite(os, &length);
1049  for (exint i = 0; i < length; i++)
1050  {
1051  auto && _curentry = myCombinations(i);
1052  (void) _curentry;
1053  saveData(os, _curentry.enable);
1054  saveData(os, _curentry.combine);
1055  saveData(os, _curentry.adjust);
1056  saveData(os, _curentry.srcattrib);
1057  saveData(os, _curentry.srcinput);
1058  saveData(os, _curentry.scale);
1059  saveData(os, _curentry.add);
1060  saveData(os, _curentry.process);
1061  saveData(os, _curentry.blend);
1062  saveData(os, _curentry.doblendattrib);
1063  saveData(os, _curentry.blendattrib);
1064  saveData(os, _curentry.blendinput);
1065 
1066  }
1067  }
1068  saveData(os, myPostScale);
1069  saveData(os, myDoThreshold);
1070  saveData(os, myThreshold);
1071  saveData(os, myDoClampMin);
1072  saveData(os, myClampMin);
1073  saveData(os, myDoClampMax);
1074  saveData(os, myClampMax);
1075  saveData(os, myAttribMatch);
1076  saveData(os, myCreateMissing);
1077  saveData(os, myForceScalar);
1078  saveData(os, myDeleteSource);
1079  saveData(os, myErrorMissing);
1080 
1081  }
1082 
1083  bool load(UT_IStream &is)
1084  {
1085  int32 v;
1086  is.bread(&v, 1);
1087  if (version() != v)
1088  {
1089  // Fail incompatible versions
1090  return false;
1091  }
1092  loadData(is, myGroup);
1093  loadData(is, myGroupType);
1094  loadData(is, myDstAttrib);
1095  loadData(is, myClass);
1096  {
1097  int64 length;
1098  is.read(&length, 1);
1099  myCombinations.setSize(length);
1100  for (exint i = 0; i < length; i++)
1101  {
1102  auto && _curentry = myCombinations(i);
1103  (void) _curentry;
1104  loadData(is, _curentry.enable);
1105  loadData(is, _curentry.combine);
1106  loadData(is, _curentry.adjust);
1107  loadData(is, _curentry.srcattrib);
1108  loadData(is, _curentry.srcinput);
1109  loadData(is, _curentry.scale);
1110  loadData(is, _curentry.add);
1111  loadData(is, _curentry.process);
1112  loadData(is, _curentry.blend);
1113  loadData(is, _curentry.doblendattrib);
1114  loadData(is, _curentry.blendattrib);
1115  loadData(is, _curentry.blendinput);
1116 
1117  }
1118  }
1119  loadData(is, myPostScale);
1120  loadData(is, myDoThreshold);
1121  loadData(is, myThreshold);
1122  loadData(is, myDoClampMin);
1123  loadData(is, myClampMin);
1124  loadData(is, myDoClampMax);
1125  loadData(is, myClampMax);
1126  loadData(is, myAttribMatch);
1127  loadData(is, myCreateMissing);
1128  loadData(is, myForceScalar);
1129  loadData(is, myDeleteSource);
1130  loadData(is, myErrorMissing);
1131 
1132  return true;
1133  }
1134 
1135  const UT_StringHolder & getGroup() const { return myGroup; }
1136  void setGroup(const UT_StringHolder & val) { myGroup = val; }
1138  {
1139  SOP_Node *thissop = cookparms.getNode();
1140  if (!thissop) return getGroup();
1142  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
1143  return result;
1144  }
1145  GroupType getGroupType() const { return GroupType(myGroupType); }
1146  void setGroupType(GroupType val) { myGroupType = int64(val); }
1148  {
1149  SOP_Node *thissop = cookparms.getNode();
1150  if (!thissop) return getGroupType();
1151  int64 result;
1152  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
1153  return GroupType(result);
1154  }
1155  const UT_StringHolder & getDstAttrib() const { return myDstAttrib; }
1156  void setDstAttrib(const UT_StringHolder & val) { myDstAttrib = val; }
1158  {
1159  SOP_Node *thissop = cookparms.getNode();
1160  if (!thissop) return getDstAttrib();
1162  OP_Utils::evalOpParm(result, thissop, "dstattrib", cookparms.getCookTime(), 0);
1163  return result;
1164  }
1165  Class getClass() const { return Class(myClass); }
1166  void setClass(Class val) { myClass = int64(val); }
1167  Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
1168  {
1169  SOP_Node *thissop = cookparms.getNode();
1170  if (!thissop) return getClass();
1171  int64 result;
1172  OP_Utils::evalOpParm(result, thissop, "class", cookparms.getCookTime(), 0);
1173  return Class(result);
1174  }
1175  const UT_Array<Combinations> &getCombinations() const { return myCombinations; }
1176 void setCombinations(const UT_Array<Combinations> &val) { myCombinations = val; }
1178  {
1179  SOP_Node *thissop = cookparms.getNode();
1180  if (!thissop) return getCombinations().entries();
1181  exint result;
1182  OP_Utils::evalOpParm(result, thissop, "numcombines", cookparms.getCookTime(), 0);
1183  return result;
1184  }
1185  bool opCombinations_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1186  { return opinstCombinations_enable(cookparms, &_idx); }
1187  bool opinstCombinations_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1188  {
1189  SOP_Node *thissop = cookparms.getNode();
1190  if (!thissop) return (myCombinations(_idx[0]).enable);
1191  int _parmidx[2-1];
1192  _parmidx[1-1] = _idx[1-1] + 1;
1193 
1194  bool result;
1195  OP_Utils::evalOpParmInst(result, thissop, "enable#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1196  return (result);
1197  }
1198  int64 opCombinations_combine(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1199  { return opinstCombinations_combine(cookparms, &_idx); }
1200  int64 opinstCombinations_combine(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1201  {
1202  SOP_Node *thissop = cookparms.getNode();
1203  if (!thissop) return (myCombinations(_idx[0]).combine);
1204  int _parmidx[2-1];
1205  _parmidx[1-1] = _idx[1-1] + 1;
1206 
1207  int64 result;
1208  OP_Utils::evalOpParmInst(result, thissop, "combine#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1209  return (result);
1210  }
1211  int64 opCombinations_adjust(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1212  { return opinstCombinations_adjust(cookparms, &_idx); }
1213  int64 opinstCombinations_adjust(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1214  {
1215  SOP_Node *thissop = cookparms.getNode();
1216  if (!thissop) return (myCombinations(_idx[0]).adjust);
1217  int _parmidx[2-1];
1218  _parmidx[1-1] = _idx[1-1] + 1;
1219 
1220  int64 result;
1221  OP_Utils::evalOpParmInst(result, thissop, "adjust#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1222  return (result);
1223  }
1225  { return opinstCombinations_srcattrib(cookparms, &_idx); }
1227  {
1228  SOP_Node *thissop = cookparms.getNode();
1229  if (!thissop) return (myCombinations(_idx[0]).srcattrib);
1230  int _parmidx[2-1];
1231  _parmidx[1-1] = _idx[1-1] + 1;
1232 
1234  OP_Utils::evalOpParmInst(result, thissop, "srcattrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1235  return (result);
1236  }
1237  int64 opCombinations_srcinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1238  { return opinstCombinations_srcinput(cookparms, &_idx); }
1239  int64 opinstCombinations_srcinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1240  {
1241  SOP_Node *thissop = cookparms.getNode();
1242  if (!thissop) return (myCombinations(_idx[0]).srcinput);
1243  int _parmidx[2-1];
1244  _parmidx[1-1] = _idx[1-1] + 1;
1245 
1246  int64 result;
1247  OP_Utils::evalOpParmInst(result, thissop, "srcinput#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1248  return (result);
1249  }
1250  fpreal64 opCombinations_scale(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1251  { return opinstCombinations_scale(cookparms, &_idx); }
1252  fpreal64 opinstCombinations_scale(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1253  {
1254  SOP_Node *thissop = cookparms.getNode();
1255  if (!thissop) return (myCombinations(_idx[0]).scale);
1256  int _parmidx[2-1];
1257  _parmidx[1-1] = _idx[1-1] + 1;
1258 
1259  fpreal64 result;
1260  OP_Utils::evalOpParmInst(result, thissop, "scale#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1261  return (result);
1262  }
1263  fpreal64 opCombinations_add(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1264  { return opinstCombinations_add(cookparms, &_idx); }
1265  fpreal64 opinstCombinations_add(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1266  {
1267  SOP_Node *thissop = cookparms.getNode();
1268  if (!thissop) return (myCombinations(_idx[0]).add);
1269  int _parmidx[2-1];
1270  _parmidx[1-1] = _idx[1-1] + 1;
1271 
1272  fpreal64 result;
1273  OP_Utils::evalOpParmInst(result, thissop, "add#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1274  return (result);
1275  }
1276  int64 opCombinations_process(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1277  { return opinstCombinations_process(cookparms, &_idx); }
1278  int64 opinstCombinations_process(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1279  {
1280  SOP_Node *thissop = cookparms.getNode();
1281  if (!thissop) return (myCombinations(_idx[0]).process);
1282  int _parmidx[2-1];
1283  _parmidx[1-1] = _idx[1-1] + 1;
1284 
1285  int64 result;
1286  OP_Utils::evalOpParmInst(result, thissop, "process#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1287  return (result);
1288  }
1289  fpreal64 opCombinations_blend(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1290  { return opinstCombinations_blend(cookparms, &_idx); }
1291  fpreal64 opinstCombinations_blend(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1292  {
1293  SOP_Node *thissop = cookparms.getNode();
1294  if (!thissop) return (myCombinations(_idx[0]).blend);
1295  int _parmidx[2-1];
1296  _parmidx[1-1] = _idx[1-1] + 1;
1297 
1298  fpreal64 result;
1299  OP_Utils::evalOpParmInst(result, thissop, "blend#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1300  return (result);
1301  }
1303  { return opinstCombinations_doblendattrib(cookparms, &_idx); }
1304  int64 opinstCombinations_doblendattrib(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1305  {
1306  SOP_Node *thissop = cookparms.getNode();
1307  if (!thissop) return (myCombinations(_idx[0]).doblendattrib);
1308  int _parmidx[2-1];
1309  _parmidx[1-1] = _idx[1-1] + 1;
1310 
1311  int64 result;
1312  OP_Utils::evalOpParmInst(result, thissop, "doblendattrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1313  return (result);
1314  }
1316  { return opinstCombinations_blendattrib(cookparms, &_idx); }
1318  {
1319  SOP_Node *thissop = cookparms.getNode();
1320  if (!thissop) return (myCombinations(_idx[0]).blendattrib);
1321  int _parmidx[2-1];
1322  _parmidx[1-1] = _idx[1-1] + 1;
1323 
1325  OP_Utils::evalOpParmInst(result, thissop, "blendattrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1326  return (result);
1327  }
1328  int64 opCombinations_blendinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1329  { return opinstCombinations_blendinput(cookparms, &_idx); }
1330  int64 opinstCombinations_blendinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1331  {
1332  SOP_Node *thissop = cookparms.getNode();
1333  if (!thissop) return (myCombinations(_idx[0]).blendinput);
1334  int _parmidx[2-1];
1335  _parmidx[1-1] = _idx[1-1] + 1;
1336 
1337  int64 result;
1338  OP_Utils::evalOpParmInst(result, thissop, "blendinput#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1339  return (result);
1340  }
1341 
1342  fpreal64 getPostScale() const { return myPostScale; }
1343  void setPostScale(fpreal64 val) { myPostScale = val; }
1345  {
1346  SOP_Node *thissop = cookparms.getNode();
1347  if (!thissop) return getPostScale();
1348  fpreal64 result;
1349  OP_Utils::evalOpParm(result, thissop, "postscale", cookparms.getCookTime(), 0);
1350  return result;
1351  }
1352  bool getDoThreshold() const { return myDoThreshold; }
1353  void setDoThreshold(bool val) { myDoThreshold = val; }
1354  bool opDoThreshold(const SOP_NodeVerb::CookParms &cookparms) const
1355  {
1356  SOP_Node *thissop = cookparms.getNode();
1357  if (!thissop) return getDoThreshold();
1358  bool result;
1359  OP_Utils::evalOpParm(result, thissop, "dothreshold", cookparms.getCookTime(), 0);
1360  return result;
1361  }
1362  fpreal64 getThreshold() const { return myThreshold; }
1363  void setThreshold(fpreal64 val) { myThreshold = val; }
1365  {
1366  SOP_Node *thissop = cookparms.getNode();
1367  if (!thissop) return getThreshold();
1368  fpreal64 result;
1369  OP_Utils::evalOpParm(result, thissop, "threshold", cookparms.getCookTime(), 0);
1370  return result;
1371  }
1372  bool getDoClampMin() const { return myDoClampMin; }
1373  void setDoClampMin(bool val) { myDoClampMin = val; }
1374  bool opDoClampMin(const SOP_NodeVerb::CookParms &cookparms) const
1375  {
1376  SOP_Node *thissop = cookparms.getNode();
1377  if (!thissop) return getDoClampMin();
1378  bool result;
1379  OP_Utils::evalOpParm(result, thissop, "doclampmin", cookparms.getCookTime(), 0);
1380  return result;
1381  }
1382  fpreal64 getClampMin() const { return myClampMin; }
1383  void setClampMin(fpreal64 val) { myClampMin = val; }
1385  {
1386  SOP_Node *thissop = cookparms.getNode();
1387  if (!thissop) return getClampMin();
1388  fpreal64 result;
1389  OP_Utils::evalOpParm(result, thissop, "clampmin", cookparms.getCookTime(), 0);
1390  return result;
1391  }
1392  bool getDoClampMax() const { return myDoClampMax; }
1393  void setDoClampMax(bool val) { myDoClampMax = val; }
1394  bool opDoClampMax(const SOP_NodeVerb::CookParms &cookparms) const
1395  {
1396  SOP_Node *thissop = cookparms.getNode();
1397  if (!thissop) return getDoClampMax();
1398  bool result;
1399  OP_Utils::evalOpParm(result, thissop, "doclampmax", cookparms.getCookTime(), 0);
1400  return result;
1401  }
1402  fpreal64 getClampMax() const { return myClampMax; }
1403  void setClampMax(fpreal64 val) { myClampMax = val; }
1405  {
1406  SOP_Node *thissop = cookparms.getNode();
1407  if (!thissop) return getClampMax();
1408  fpreal64 result;
1409  OP_Utils::evalOpParm(result, thissop, "clampmax", cookparms.getCookTime(), 0);
1410  return result;
1411  }
1412  const UT_StringHolder & getAttribMatch() const { return myAttribMatch; }
1413  void setAttribMatch(const UT_StringHolder & val) { myAttribMatch = val; }
1415  {
1416  SOP_Node *thissop = cookparms.getNode();
1417  if (!thissop) return getAttribMatch();
1419  OP_Utils::evalOpParm(result, thissop, "attribmatch", cookparms.getCookTime(), 0);
1420  return result;
1421  }
1422  bool getCreateMissing() const { return myCreateMissing; }
1423  void setCreateMissing(bool val) { myCreateMissing = val; }
1424  bool opCreateMissing(const SOP_NodeVerb::CookParms &cookparms) const
1425  {
1426  SOP_Node *thissop = cookparms.getNode();
1427  if (!thissop) return getCreateMissing();
1428  bool result;
1429  OP_Utils::evalOpParm(result, thissop, "createmissing", cookparms.getCookTime(), 0);
1430  return result;
1431  }
1432  bool getForceScalar() const { return myForceScalar; }
1433  void setForceScalar(bool val) { myForceScalar = val; }
1434  bool opForceScalar(const SOP_NodeVerb::CookParms &cookparms) const
1435  {
1436  SOP_Node *thissop = cookparms.getNode();
1437  if (!thissop) return getForceScalar();
1438  bool result;
1439  OP_Utils::evalOpParm(result, thissop, "forcescalar", cookparms.getCookTime(), 0);
1440  return result;
1441  }
1442  bool getDeleteSource() const { return myDeleteSource; }
1443  void setDeleteSource(bool val) { myDeleteSource = val; }
1444  bool opDeleteSource(const SOP_NodeVerb::CookParms &cookparms) const
1445  {
1446  SOP_Node *thissop = cookparms.getNode();
1447  if (!thissop) return getDeleteSource();
1448  bool result;
1449  OP_Utils::evalOpParm(result, thissop, "deletesource", cookparms.getCookTime(), 0);
1450  return result;
1451  }
1452  bool getErrorMissing() const { return myErrorMissing; }
1453  void setErrorMissing(bool val) { myErrorMissing = val; }
1454  bool opErrorMissing(const SOP_NodeVerb::CookParms &cookparms) const
1455  {
1456  SOP_Node *thissop = cookparms.getNode();
1457  if (!thissop) return getErrorMissing();
1458  bool result;
1459  OP_Utils::evalOpParm(result, thissop, "errormissing", cookparms.getCookTime(), 0);
1460  return result;
1461  }
1462 
1463 private:
1464  UT_StringHolder myGroup;
1465  int64 myGroupType;
1466  UT_StringHolder myDstAttrib;
1467  int64 myClass;
1468  UT_Array<Combinations> myCombinations;
1469  fpreal64 myPostScale;
1470  bool myDoThreshold;
1471  fpreal64 myThreshold;
1472  bool myDoClampMin;
1473  fpreal64 myClampMin;
1474  bool myDoClampMax;
1475  fpreal64 myClampMax;
1476  UT_StringHolder myAttribMatch;
1477  bool myCreateMissing;
1478  bool myForceScalar;
1479  bool myDeleteSource;
1480  bool myErrorMissing;
1481 
1482 };
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
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:62
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
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:613
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
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:4784
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:296
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:648
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:277
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:92
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
bool opDoClampMin(const SOP_NodeVerb::CookParms &cookparms) const
#define SOP_API
Definition: SOP_API.h:10
exint getNestNumParms(TempIndex idx) const override
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:361
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:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
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
type
Definition: core.h:1059
void setGroup(const UT_StringHolder &val)
Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
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