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  enum class Class
34  {
35  DETAIL = 0,
36  PRIMITIVE,
37  POINT,
38  VERTEX
39  };
40  enum class Combine
41  {
42  COPY = 0,
43  ADD,
44  SUB,
45  MUL,
46  DIV,
47  MAX,
48  MIN
49  };
50  enum class Adjust
51  {
52  NONE = 0,
53  SCALE,
54  SCALEADD,
56  };
57  enum class Srcinput
58  {
59  FIRST = 0,
60  SECOND
61  };
62  enum class Process
63  {
64  NONE = 0,
65  RECIPROCAL,
66  CLAMP01,
69  };
70  enum class Doblendattrib
71  {
72  OFF = 0,
73  ON
74  };
75  enum class Blendinput
76  {
77  FIRST = 0,
78  SECOND
79  };
80 }
81 
82 
84 {
85 public:
86  static int version() { return 1; }
87  struct Combinations
88  {
89  bool enable;
101 
102 
104  {
105  enable = true;
106  combine = 1;
107  adjust = 0;
108  srcattrib = ""_UTsh;
109  srcinput = 0;
110  scale = 1;
111  add = 0;
112  process = 0;
113  blend = 1;
114  doblendattrib = 0;
115  blendattrib = ""_UTsh;
116  blendinput = 0;
117 
118  }
119 
120  bool operator==(const Combinations &src) const
121  {
122  if (enable != src.enable) return false;
123  if (combine != src.combine) return false;
124  if (adjust != src.adjust) return false;
125  if (srcattrib != src.srcattrib) return false;
126  if (srcinput != src.srcinput) return false;
127  if (scale != src.scale) return false;
128  if (add != src.add) return false;
129  if (process != src.process) return false;
130  if (blend != src.blend) return false;
131  if (doblendattrib != src.doblendattrib) return false;
132  if (blendattrib != src.blendattrib) return false;
133  if (blendinput != src.blendinput) return false;
134 
135  return true;
136  }
137  bool operator!=(const Combinations &src) const
138  {
139  return !operator==(src);
140  }
141 
142  };
143 
145  {
147 
148  buf.strcat("[ ");
149  for (int i = 0; i < list.entries(); i++)
150  {
151  if (i)
152  buf.strcat(", ");
153  buf.strcat("( ");
154  buf.append("");
155  buf.appendSprintf("%s", (list(i).enable) ? "true" : "false");
156  buf.append(", ");
157  buf.appendSprintf("%d", (int) list(i).combine);
158  buf.append(", ");
159  buf.appendSprintf("%d", (int) list(i).adjust);
160  buf.append(", ");
161  { UT_String tmp; tmp = UT_StringWrap(list(i).srcattrib).makeQuotedString('"'); buf.strcat(tmp); }
162  buf.append(", ");
163  buf.appendSprintf("%d", (int) list(i).srcinput);
164  buf.append(", ");
165  buf.appendSprintf("%f", (list(i).scale));
166  buf.append(", ");
167  buf.appendSprintf("%f", (list(i).add));
168  buf.append(", ");
169  buf.appendSprintf("%d", (int) list(i).process);
170  buf.append(", ");
171  buf.appendSprintf("%f", (list(i).blend));
172  buf.append(", ");
173  buf.appendSprintf("%d", (int) list(i).doblendattrib);
174  buf.append(", ");
175  { UT_String tmp; tmp = UT_StringWrap(list(i).blendattrib).makeQuotedString('"'); buf.strcat(tmp); }
176  buf.append(", ");
177  buf.appendSprintf("%d", (int) list(i).blendinput);
178 
179  buf.strcat(" )");
180  }
181  buf.strcat(" ]");
182 
184  return result;
185  }
186 
188  {
189  myGroup = ""_UTsh;
190  myGroupType = 0;
191  myDstAttrib = ""_UTsh;
192  myClass = 2;
193  myCombinations.setSize(1);
194  myPostScale = 1;
195  myDoThreshold = false;
196  myThreshold = 0.5;
197  myDoClampMin = false;
198  myClampMin = 0;
199  myDoClampMax = false;
200  myClampMax = 1;
201  myAttribMatch = "id"_UTsh;
202  myCreateMissing = true;
203  myForceScalar = false;
204  myDeleteSource = false;
205  myErrorMissing = true;
206 
207  }
208 
209  explicit SOP_AttribCombineParms(const SOP_AttribCombineParms &) = default;
211  SOP_AttribCombineParms(SOP_AttribCombineParms &&) noexcept = default;
212  SOP_AttribCombineParms &operator=(SOP_AttribCombineParms &&) noexcept = default;
213 
214  ~SOP_AttribCombineParms() override {}
215 
217  {
218  if (myGroup != src.myGroup) return false;
219  if (myGroupType != src.myGroupType) return false;
220  if (myDstAttrib != src.myDstAttrib) return false;
221  if (myClass != src.myClass) return false;
222  if (myCombinations != src.myCombinations) return false;
223  if (myPostScale != src.myPostScale) return false;
224  if (myDoThreshold != src.myDoThreshold) return false;
225  if (myThreshold != src.myThreshold) return false;
226  if (myDoClampMin != src.myDoClampMin) return false;
227  if (myClampMin != src.myClampMin) return false;
228  if (myDoClampMax != src.myDoClampMax) return false;
229  if (myClampMax != src.myClampMax) return false;
230  if (myAttribMatch != src.myAttribMatch) return false;
231  if (myCreateMissing != src.myCreateMissing) return false;
232  if (myForceScalar != src.myForceScalar) return false;
233  if (myDeleteSource != src.myDeleteSource) return false;
234  if (myErrorMissing != src.myErrorMissing) return false;
235 
236  return true;
237  }
239  {
240  return !operator==(src);
241  }
250 
251 
252 
253  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
254  {
255  myGroup = ""_UTsh;
256  if (true)
257  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
258  myGroupType = 0;
259  if (true)
260  graph->evalOpParm(myGroupType, nodeidx, "grouptype", time, 0);
261  myDstAttrib = ""_UTsh;
262  if (true)
263  graph->evalOpParm(myDstAttrib, nodeidx, "dstattrib", time, 0);
264  myClass = 2;
265  if (true)
266  graph->evalOpParm(myClass, nodeidx, "class", time, 0);
267  if (true)
268  {
269  int64 length = 0;
270  graph->evalOpParm(length, nodeidx, "numcombines", time, 0);
271  if (length < 0) length = 0;
272  myCombinations.setSize(length);
273  for (exint i = 0; i < length; i++)
274  {
275  int parmidx[1];
276  int offsets[1];
277  parmidx[0] = i+1;
278  offsets[0] = 1;
279  auto && _curentry = myCombinations(i);
280  (void) _curentry;
281  _curentry.enable = true;
282  if (true)
283  graph->evalOpParmInst(_curentry.enable, nodeidx, "enable#", parmidx, offsets, time, 0, 2-1);
284  _curentry.combine = 1;
285  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
286  graph->evalOpParmInst(_curentry.combine, nodeidx, "combine#", parmidx, offsets, time, 0, 2-1);
287  _curentry.adjust = 0;
288  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
289  graph->evalOpParmInst(_curentry.adjust, nodeidx, "adjust#", parmidx, offsets, time, 0, 2-1);
290  _curentry.srcattrib = ""_UTsh;
291  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
292  graph->evalOpParmInst(_curentry.srcattrib, nodeidx, "srcattrib#", parmidx, offsets, time, 0, 2-1);
293  _curentry.srcinput = 0;
294  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
295  graph->evalOpParmInst(_curentry.srcinput, nodeidx, "srcinput#", parmidx, offsets, time, 0, 2-1);
296  _curentry.scale = 1;
297  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.adjust==0)))) ) )
298  graph->evalOpParmInst(_curentry.scale, nodeidx, "scale#", parmidx, offsets, time, 0, 2-1);
299  _curentry.add = 0;
300  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.adjust==0))||((_curentry.adjust==1)))) ) )
301  graph->evalOpParmInst(_curentry.add, nodeidx, "add#", parmidx, offsets, time, 0, 2-1);
302  _curentry.process = 0;
303  if (true && ( (true&&!(((_curentry.enable==0))||((_curentry.adjust==0))||((_curentry.adjust==1))||((_curentry.adjust==2)))) ) )
304  graph->evalOpParmInst(_curentry.process, nodeidx, "process#", parmidx, offsets, time, 0, 2-1);
305  _curentry.blend = 1;
306  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
307  graph->evalOpParmInst(_curentry.blend, nodeidx, "blend#", parmidx, offsets, time, 0, 2-1);
308  _curentry.doblendattrib = 0;
309  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
310  graph->evalOpParmInst(_curentry.doblendattrib, nodeidx, "doblendattrib#", parmidx, offsets, time, 0, 2-1);
311  _curentry.blendattrib = ""_UTsh;
312  if (true && ( (true&&!(((_curentry.doblendattrib==0))||((_curentry.enable==0)))) ) )
313  graph->evalOpParmInst(_curentry.blendattrib, nodeidx, "blendattrib#", parmidx, offsets, time, 0, 2-1);
314  _curentry.blendinput = 0;
315  if (true && ( (true&&!(((_curentry.doblendattrib==0))||((_curentry.enable==0)))) ) )
316  graph->evalOpParmInst(_curentry.blendinput, nodeidx, "blendinput#", parmidx, offsets, time, 0, 2-1);
317 
318  }
319  }
320  else
321  myCombinations.clear();
322  myPostScale = 1;
323  if (true)
324  graph->evalOpParm(myPostScale, nodeidx, "postscale", time, 0);
325  myDoThreshold = false;
326  if (true)
327  graph->evalOpParm(myDoThreshold, nodeidx, "dothreshold", time, 0);
328  myThreshold = 0.5;
329  if (true && ( (true&&!(((getDoThreshold()==0)))) ) )
330  graph->evalOpParm(myThreshold, nodeidx, "threshold", time, 0);
331  myDoClampMin = false;
332  if (true)
333  graph->evalOpParm(myDoClampMin, nodeidx, "doclampmin", time, 0);
334  myClampMin = 0;
335  if (true && ( (true&&!(((getDoClampMin()==0)&&(getDoThreshold()==0)))) ) )
336  graph->evalOpParm(myClampMin, nodeidx, "clampmin", time, 0);
337  myDoClampMax = false;
338  if (true)
339  graph->evalOpParm(myDoClampMax, nodeidx, "doclampmax", time, 0);
340  myClampMax = 1;
341  if (true && ( (true&&!(((getDoClampMax()==0)&&(getDoThreshold()==0)))) ) )
342  graph->evalOpParm(myClampMax, nodeidx, "clampmax", time, 0);
343  myAttribMatch = "id"_UTsh;
344  if (true)
345  graph->evalOpParm(myAttribMatch, nodeidx, "attribmatch", time, 0);
346  myCreateMissing = true;
347  if (true)
348  graph->evalOpParm(myCreateMissing, nodeidx, "createmissing", time, 0);
349  myForceScalar = false;
350  if (true && ( (true&&!(((getCreateMissing()==0)))) ) )
351  graph->evalOpParm(myForceScalar, nodeidx, "forcescalar", time, 0);
352  myDeleteSource = false;
353  if (true)
354  graph->evalOpParm(myDeleteSource, nodeidx, "deletesource", time, 0);
355  myErrorMissing = true;
356  if (true)
357  graph->evalOpParm(myErrorMissing, nodeidx, "errormissing", time, 0);
358 
359  }
360 
361 
362  void loadFromOpSubclass(const LoadParms &loadparms) override
363  {
364  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
365  }
366 
367 
368  void copyFrom(const OP_NodeParms *src) override
369  {
370  *this = *((const SOP_AttribCombineParms *)src);
371  }
372 
373  template <typename T>
374  void
375  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
376  {
377  if (idx.size() < 1)
378  return;
379  UT_ASSERT(idx.size() == instance.size()+1);
380  if (idx.size() != instance.size()+1)
381  return;
382  switch (idx[0])
383  {
384  case 0:
385  coerceValue(value, myGroup);
386  break;
387  case 1:
388  coerceValue(value, myGroupType);
389  break;
390  case 2:
391  coerceValue(value, myDstAttrib);
392  break;
393  case 3:
394  coerceValue(value, myClass);
395  break;
396  case 4:
397  if (idx.size() == 1)
398  coerceValue(value, myCombinations.entries());
399  else if (instance[0] < myCombinations.entries())
400  {
401  auto && _data = myCombinations(instance[0]);
402  switch (idx[1])
403  {
404  case 0:
405  coerceValue(value, _data.enable);
406  break;
407  case 1:
408  coerceValue(value, _data.combine);
409  break;
410  case 2:
411  coerceValue(value, _data.adjust);
412  break;
413  case 3:
414  coerceValue(value, _data.srcattrib);
415  break;
416  case 4:
417  coerceValue(value, _data.srcinput);
418  break;
419  case 5:
420  coerceValue(value, _data.scale);
421  break;
422  case 6:
423  coerceValue(value, _data.add);
424  break;
425  case 7:
426  coerceValue(value, _data.process);
427  break;
428  case 8:
429  coerceValue(value, _data.blend);
430  break;
431  case 9:
432  coerceValue(value, _data.doblendattrib);
433  break;
434  case 10:
435  coerceValue(value, _data.blendattrib);
436  break;
437  case 11:
438  coerceValue(value, _data.blendinput);
439  break;
440 
441  }
442  }
443  break;
444  case 5:
445  coerceValue(value, myPostScale);
446  break;
447  case 6:
448  coerceValue(value, myDoThreshold);
449  break;
450  case 7:
451  coerceValue(value, myThreshold);
452  break;
453  case 8:
454  coerceValue(value, myDoClampMin);
455  break;
456  case 9:
457  coerceValue(value, myClampMin);
458  break;
459  case 10:
460  coerceValue(value, myDoClampMax);
461  break;
462  case 11:
463  coerceValue(value, myClampMax);
464  break;
465  case 12:
466  coerceValue(value, myAttribMatch);
467  break;
468  case 13:
469  coerceValue(value, myCreateMissing);
470  break;
471  case 14:
472  coerceValue(value, myForceScalar);
473  break;
474  case 15:
475  coerceValue(value, myDeleteSource);
476  break;
477  case 16:
478  coerceValue(value, myErrorMissing);
479  break;
480 
481  }
482  }
483 
484  bool isParmColorRamp(exint idx) const override
485  {
486  switch (idx)
487  {
488 
489  }
490  return false;
491  }
492 
493  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
494  { doGetParmValue(idx, instance, value); }
495  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
496  { doGetParmValue(idx, instance, value); }
497  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
498  { doGetParmValue(idx, instance, value); }
499  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
500  { doGetParmValue(idx, instance, value); }
501  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
502  { doGetParmValue(idx, instance, value); }
503  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
504  { doGetParmValue(idx, instance, value); }
505  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
506  { doGetParmValue(idx, instance, value); }
507  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
508  { doGetParmValue(idx, instance, value); }
509  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
510  { doGetParmValue(idx, instance, value); }
511  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
512  { doGetParmValue(idx, instance, value); }
513  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
514  { doGetParmValue(idx, instance, value); }
515 
516  template <typename T>
517  void
518  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
519  {
520  if (idx.size() < 1)
521  return;
522  UT_ASSERT(idx.size() == instance.size()+1);
523  if (idx.size() != instance.size()+1)
524  return;
525  switch (idx[0])
526  {
527  case 0:
528  coerceValue(myGroup, ( ( value ) ));
529  break;
530  case 1:
531  coerceValue(myGroupType, clampMinValue(0, clampMaxValue(4, value ) ));
532  break;
533  case 2:
534  coerceValue(myDstAttrib, ( ( value ) ));
535  break;
536  case 3:
537  coerceValue(myClass, clampMinValue(0, clampMaxValue(3, value ) ));
538  break;
539  case 4:
540  if (idx.size() == 1)
541  {
542  exint newsize;
543  coerceValue(newsize, value);
544  if (newsize < 0) newsize = 0;
545  myCombinations.setSize(newsize);
546  }
547  else
548  {
549  if (instance[0] < 0)
550  return;
551  myCombinations.setSizeIfNeeded(instance[0]+1);
552  auto && _data = myCombinations(instance[0]);
553  switch (idx[1])
554  {
555  case 0:
556  coerceValue(_data.enable, value);
557  break;
558  case 1:
559  coerceValue(_data.combine, value);
560  break;
561  case 2:
562  coerceValue(_data.adjust, value);
563  break;
564  case 3:
565  coerceValue(_data.srcattrib, value);
566  break;
567  case 4:
568  coerceValue(_data.srcinput, value);
569  break;
570  case 5:
571  coerceValue(_data.scale, value);
572  break;
573  case 6:
574  coerceValue(_data.add, value);
575  break;
576  case 7:
577  coerceValue(_data.process, value);
578  break;
579  case 8:
580  coerceValue(_data.blend, value);
581  break;
582  case 9:
583  coerceValue(_data.doblendattrib, value);
584  break;
585  case 10:
586  coerceValue(_data.blendattrib, value);
587  break;
588  case 11:
589  coerceValue(_data.blendinput, value);
590  break;
591 
592  }
593  }
594  break;
595  case 5:
596  coerceValue(myPostScale, ( ( value ) ));
597  break;
598  case 6:
599  coerceValue(myDoThreshold, ( ( value ) ));
600  break;
601  case 7:
602  coerceValue(myThreshold, ( ( value ) ));
603  break;
604  case 8:
605  coerceValue(myDoClampMin, ( ( value ) ));
606  break;
607  case 9:
608  coerceValue(myClampMin, ( ( value ) ));
609  break;
610  case 10:
611  coerceValue(myDoClampMax, ( ( value ) ));
612  break;
613  case 11:
614  coerceValue(myClampMax, ( ( value ) ));
615  break;
616  case 12:
617  coerceValue(myAttribMatch, ( ( value ) ));
618  break;
619  case 13:
620  coerceValue(myCreateMissing, ( ( value ) ));
621  break;
622  case 14:
623  coerceValue(myForceScalar, ( ( value ) ));
624  break;
625  case 15:
626  coerceValue(myDeleteSource, ( ( value ) ));
627  break;
628  case 16:
629  coerceValue(myErrorMissing, ( ( value ) ));
630  break;
631 
632  }
633  }
634 
635  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
636  { doSetParmValue(idx, instance, value); }
637  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
638  { doSetParmValue(idx, instance, value); }
639  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
640  { doSetParmValue(idx, instance, value); }
641  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
642  { doSetParmValue(idx, instance, value); }
643  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
644  { doSetParmValue(idx, instance, value); }
645  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
646  { doSetParmValue(idx, instance, value); }
647  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
648  { doSetParmValue(idx, instance, value); }
649  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
650  { doSetParmValue(idx, instance, value); }
651  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
652  { doSetParmValue(idx, instance, value); }
653  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
654  { doSetParmValue(idx, instance, value); }
655  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
656  { doSetParmValue(idx, instance, value); }
657 
658  exint getNestNumParms(TempIndex idx) const override
659  {
660  if (idx.size() == 0)
661  return 17;
662  switch (idx[0])
663  {
664  case 4:
665  return 12;
666 
667  }
668  // Invalid
669  return 0;
670  }
671 
672  const char *getNestParmName(TempIndex fieldnum) const override
673  {
674  if (fieldnum.size() < 1)
675  return 0;
676  switch (fieldnum[0])
677  {
678  case 0:
679  return "group";
680  case 1:
681  return "grouptype";
682  case 2:
683  return "dstattrib";
684  case 3:
685  return "class";
686  case 4:
687  if (fieldnum.size() == 1)
688  return "numcombines";
689  switch (fieldnum[1])
690  {
691  case 0:
692  return "enable#";
693  case 1:
694  return "combine#";
695  case 2:
696  return "adjust#";
697  case 3:
698  return "srcattrib#";
699  case 4:
700  return "srcinput#";
701  case 5:
702  return "scale#";
703  case 6:
704  return "add#";
705  case 7:
706  return "process#";
707  case 8:
708  return "blend#";
709  case 9:
710  return "doblendattrib#";
711  case 10:
712  return "blendattrib#";
713  case 11:
714  return "blendinput#";
715 
716  }
717  return 0;
718  case 5:
719  return "postscale";
720  case 6:
721  return "dothreshold";
722  case 7:
723  return "threshold";
724  case 8:
725  return "doclampmin";
726  case 9:
727  return "clampmin";
728  case 10:
729  return "doclampmax";
730  case 11:
731  return "clampmax";
732  case 12:
733  return "attribmatch";
734  case 13:
735  return "createmissing";
736  case 14:
737  return "forcescalar";
738  case 15:
739  return "deletesource";
740  case 16:
741  return "errormissing";
742 
743  }
744  return 0;
745  }
746 
747  ParmType getNestParmType(TempIndex fieldnum) const override
748  {
749  if (fieldnum.size() < 1)
750  return PARM_UNSUPPORTED;
751  switch (fieldnum[0])
752  {
753  case 0:
754  return PARM_STRING;
755  case 1:
756  return PARM_INTEGER;
757  case 2:
758  return PARM_STRING;
759  case 3:
760  return PARM_INTEGER;
761  case 4:
762  if (fieldnum.size() == 1)
763  return PARM_MULTIPARM;
764  switch (fieldnum[1])
765  {
766  case 0:
767  return PARM_INTEGER;
768  case 1:
769  return PARM_INTEGER;
770  case 2:
771  return PARM_INTEGER;
772  case 3:
773  return PARM_STRING;
774  case 4:
775  return PARM_INTEGER;
776  case 5:
777  return PARM_FLOAT;
778  case 6:
779  return PARM_FLOAT;
780  case 7:
781  return PARM_INTEGER;
782  case 8:
783  return PARM_FLOAT;
784  case 9:
785  return PARM_INTEGER;
786  case 10:
787  return PARM_STRING;
788  case 11:
789  return PARM_INTEGER;
790 
791  }
792  return PARM_UNSUPPORTED;
793  case 5:
794  return PARM_FLOAT;
795  case 6:
796  return PARM_INTEGER;
797  case 7:
798  return PARM_FLOAT;
799  case 8:
800  return PARM_INTEGER;
801  case 9:
802  return PARM_FLOAT;
803  case 10:
804  return PARM_INTEGER;
805  case 11:
806  return PARM_FLOAT;
807  case 12:
808  return PARM_STRING;
809  case 13:
810  return PARM_INTEGER;
811  case 14:
812  return PARM_INTEGER;
813  case 15:
814  return PARM_INTEGER;
815  case 16:
816  return PARM_INTEGER;
817 
818  }
819  return PARM_UNSUPPORTED;
820  }
821 
822  // Boiler plate to load individual types.
823  static void loadData(UT_IStream &is, int64 &v)
824  { is.bread(&v, 1); }
825  static void loadData(UT_IStream &is, bool &v)
826  { int64 iv; is.bread(&iv, 1); v = iv; }
827  static void loadData(UT_IStream &is, fpreal64 &v)
828  { is.bread<fpreal64>(&v, 1); }
829  static void loadData(UT_IStream &is, UT_Vector2D &v)
830  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
831  static void loadData(UT_IStream &is, UT_Vector3D &v)
832  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
833  is.bread<fpreal64>(&v.z(), 1); }
834  static void loadData(UT_IStream &is, UT_Vector4D &v)
835  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
836  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
837  static void loadData(UT_IStream &is, UT_Matrix2D &v)
838  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
839  static void loadData(UT_IStream &is, UT_Matrix3D &v)
840  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
841  static void loadData(UT_IStream &is, UT_Matrix4D &v)
842  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
843  static void loadData(UT_IStream &is, UT_Vector2I &v)
844  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
845  static void loadData(UT_IStream &is, UT_Vector3I &v)
846  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
847  is.bread<int64>(&v.z(), 1); }
848  static void loadData(UT_IStream &is, UT_Vector4I &v)
849  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
850  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
852  { is.bread(v); }
854  { UT_StringHolder rampdata;
855  loadData(is, rampdata);
856  if (rampdata.isstring())
857  {
858  v.reset(new UT_Ramp());
859  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
860  v->load(istr);
861  }
862  else v.reset();
863  }
866  loadData(is, data);
867  if (data.isstring())
868  {
869  // Find the data type.
870  const char *colon = UT_StringWrap(data).findChar(':');
871  if (colon)
872  {
873  int typelen = colon - data.buffer();
875  type.strncpy(data.buffer(), typelen);
876  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
877 
878  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
879  }
880  }
881  else v.reset();
882  }
883 
884  static void saveData(std::ostream &os, int64 v)
885  { UTwrite(os, &v); }
886  static void saveData(std::ostream &os, bool v)
887  { int64 iv = v; UTwrite(os, &iv); }
888  static void saveData(std::ostream &os, fpreal64 v)
889  { UTwrite<fpreal64>(os, &v); }
890  static void saveData(std::ostream &os, UT_Vector2D v)
891  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
892  static void saveData(std::ostream &os, UT_Vector3D v)
893  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
894  UTwrite<fpreal64>(os, &v.z()); }
895  static void saveData(std::ostream &os, UT_Vector4D v)
896  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
897  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
898  static void saveData(std::ostream &os, UT_Matrix2D v)
900  static void saveData(std::ostream &os, UT_Matrix3D v)
902  static void saveData(std::ostream &os, UT_Matrix4D v)
904  static void saveData(std::ostream &os, UT_StringHolder s)
905  { UT_StringWrap(s).saveBinary(os); }
906  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
908  UT_OStringStream ostr;
909  if (s) s->save(ostr);
910  result = ostr.str();
911  saveData(os, result);
912  }
913  static void saveData(std::ostream &os, PRM_DataItemHandle s)
915  UT_OStringStream ostr;
916  if (s)
917  {
918  ostr << s->getDataTypeToken();
919  ostr << ":";
920  s->saveBinary(ostr);
921  }
922  result = ostr.str();
923  saveData(os, result);
924  }
925 
926 
927  void save(std::ostream &os) const
928  {
929  int32 v = version();
930  UTwrite(os, &v);
931  saveData(os, myGroup);
932  saveData(os, myGroupType);
933  saveData(os, myDstAttrib);
934  saveData(os, myClass);
935  {
936  int64 length = myCombinations.entries();
937  UTwrite(os, &length);
938  for (exint i = 0; i < length; i++)
939  {
940  auto && _curentry = myCombinations(i);
941  (void) _curentry;
942  saveData(os, _curentry.enable);
943  saveData(os, _curentry.combine);
944  saveData(os, _curentry.adjust);
945  saveData(os, _curentry.srcattrib);
946  saveData(os, _curentry.srcinput);
947  saveData(os, _curentry.scale);
948  saveData(os, _curentry.add);
949  saveData(os, _curentry.process);
950  saveData(os, _curentry.blend);
951  saveData(os, _curentry.doblendattrib);
952  saveData(os, _curentry.blendattrib);
953  saveData(os, _curentry.blendinput);
954 
955  }
956  }
957  saveData(os, myPostScale);
958  saveData(os, myDoThreshold);
959  saveData(os, myThreshold);
960  saveData(os, myDoClampMin);
961  saveData(os, myClampMin);
962  saveData(os, myDoClampMax);
963  saveData(os, myClampMax);
964  saveData(os, myAttribMatch);
965  saveData(os, myCreateMissing);
966  saveData(os, myForceScalar);
967  saveData(os, myDeleteSource);
968  saveData(os, myErrorMissing);
969 
970  }
971 
972  bool load(UT_IStream &is)
973  {
974  int32 v;
975  is.bread(&v, 1);
976  if (version() != v)
977  {
978  // Fail incompatible versions
979  return false;
980  }
981  loadData(is, myGroup);
982  loadData(is, myGroupType);
983  loadData(is, myDstAttrib);
984  loadData(is, myClass);
985  {
986  int64 length;
987  is.read(&length, 1);
988  myCombinations.setSize(length);
989  for (exint i = 0; i < length; i++)
990  {
991  auto && _curentry = myCombinations(i);
992  (void) _curentry;
993  loadData(is, _curentry.enable);
994  loadData(is, _curentry.combine);
995  loadData(is, _curentry.adjust);
996  loadData(is, _curentry.srcattrib);
997  loadData(is, _curentry.srcinput);
998  loadData(is, _curentry.scale);
999  loadData(is, _curentry.add);
1000  loadData(is, _curentry.process);
1001  loadData(is, _curentry.blend);
1002  loadData(is, _curentry.doblendattrib);
1003  loadData(is, _curentry.blendattrib);
1004  loadData(is, _curentry.blendinput);
1005 
1006  }
1007  }
1008  loadData(is, myPostScale);
1009  loadData(is, myDoThreshold);
1010  loadData(is, myThreshold);
1011  loadData(is, myDoClampMin);
1012  loadData(is, myClampMin);
1013  loadData(is, myDoClampMax);
1014  loadData(is, myClampMax);
1015  loadData(is, myAttribMatch);
1016  loadData(is, myCreateMissing);
1017  loadData(is, myForceScalar);
1018  loadData(is, myDeleteSource);
1019  loadData(is, myErrorMissing);
1020 
1021  return true;
1022  }
1023 
1024  const UT_StringHolder & getGroup() const { return myGroup; }
1025  void setGroup(const UT_StringHolder & val) { myGroup = val; }
1027  {
1028  SOP_Node *thissop = cookparms.getNode();
1029  if (!thissop) return getGroup();
1031  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
1032  return result;
1033  }
1034  GroupType getGroupType() const { return GroupType(myGroupType); }
1035  void setGroupType(GroupType val) { myGroupType = int64(val); }
1037  {
1038  SOP_Node *thissop = cookparms.getNode();
1039  if (!thissop) return getGroupType();
1040  int64 result;
1041  OP_Utils::evalOpParm(result, thissop, "grouptype", cookparms.getCookTime(), 0);
1042  return GroupType(result);
1043  }
1044  const UT_StringHolder & getDstAttrib() const { return myDstAttrib; }
1045  void setDstAttrib(const UT_StringHolder & val) { myDstAttrib = val; }
1047  {
1048  SOP_Node *thissop = cookparms.getNode();
1049  if (!thissop) return getDstAttrib();
1051  OP_Utils::evalOpParm(result, thissop, "dstattrib", cookparms.getCookTime(), 0);
1052  return result;
1053  }
1054  Class getClass() const { return Class(myClass); }
1055  void setClass(Class val) { myClass = int64(val); }
1056  Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
1057  {
1058  SOP_Node *thissop = cookparms.getNode();
1059  if (!thissop) return getClass();
1060  int64 result;
1061  OP_Utils::evalOpParm(result, thissop, "class", cookparms.getCookTime(), 0);
1062  return Class(result);
1063  }
1064  const UT_Array<Combinations> &getCombinations() const { return myCombinations; }
1065 void setCombinations(const UT_Array<Combinations> &val) { myCombinations = val; }
1067  {
1068  SOP_Node *thissop = cookparms.getNode();
1069  if (!thissop) return getCombinations().entries();
1070  exint result;
1071  OP_Utils::evalOpParm(result, thissop, "numcombines", cookparms.getCookTime(), 0);
1072  return result;
1073  }
1074  bool opCombinations_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1075  { return opinstCombinations_enable(cookparms, &_idx); }
1076  bool opinstCombinations_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1077  {
1078  SOP_Node *thissop = cookparms.getNode();
1079  if (!thissop) return (myCombinations(_idx[0]).enable);
1080  int _parmidx[2-1];
1081  _parmidx[1-1] = _idx[1-1] + 1;
1082 
1083  bool result;
1084  OP_Utils::evalOpParmInst(result, thissop, "enable#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1085  return (result);
1086  }
1087  int64 opCombinations_combine(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1088  { return opinstCombinations_combine(cookparms, &_idx); }
1089  int64 opinstCombinations_combine(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1090  {
1091  SOP_Node *thissop = cookparms.getNode();
1092  if (!thissop) return (myCombinations(_idx[0]).combine);
1093  int _parmidx[2-1];
1094  _parmidx[1-1] = _idx[1-1] + 1;
1095 
1096  int64 result;
1097  OP_Utils::evalOpParmInst(result, thissop, "combine#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1098  return (result);
1099  }
1100  int64 opCombinations_adjust(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1101  { return opinstCombinations_adjust(cookparms, &_idx); }
1102  int64 opinstCombinations_adjust(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1103  {
1104  SOP_Node *thissop = cookparms.getNode();
1105  if (!thissop) return (myCombinations(_idx[0]).adjust);
1106  int _parmidx[2-1];
1107  _parmidx[1-1] = _idx[1-1] + 1;
1108 
1109  int64 result;
1110  OP_Utils::evalOpParmInst(result, thissop, "adjust#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1111  return (result);
1112  }
1114  { return opinstCombinations_srcattrib(cookparms, &_idx); }
1116  {
1117  SOP_Node *thissop = cookparms.getNode();
1118  if (!thissop) return (myCombinations(_idx[0]).srcattrib);
1119  int _parmidx[2-1];
1120  _parmidx[1-1] = _idx[1-1] + 1;
1121 
1123  OP_Utils::evalOpParmInst(result, thissop, "srcattrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1124  return (result);
1125  }
1126  int64 opCombinations_srcinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1127  { return opinstCombinations_srcinput(cookparms, &_idx); }
1128  int64 opinstCombinations_srcinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1129  {
1130  SOP_Node *thissop = cookparms.getNode();
1131  if (!thissop) return (myCombinations(_idx[0]).srcinput);
1132  int _parmidx[2-1];
1133  _parmidx[1-1] = _idx[1-1] + 1;
1134 
1135  int64 result;
1136  OP_Utils::evalOpParmInst(result, thissop, "srcinput#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1137  return (result);
1138  }
1139  fpreal64 opCombinations_scale(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1140  { return opinstCombinations_scale(cookparms, &_idx); }
1141  fpreal64 opinstCombinations_scale(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1142  {
1143  SOP_Node *thissop = cookparms.getNode();
1144  if (!thissop) return (myCombinations(_idx[0]).scale);
1145  int _parmidx[2-1];
1146  _parmidx[1-1] = _idx[1-1] + 1;
1147 
1148  fpreal64 result;
1149  OP_Utils::evalOpParmInst(result, thissop, "scale#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1150  return (result);
1151  }
1152  fpreal64 opCombinations_add(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1153  { return opinstCombinations_add(cookparms, &_idx); }
1154  fpreal64 opinstCombinations_add(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1155  {
1156  SOP_Node *thissop = cookparms.getNode();
1157  if (!thissop) return (myCombinations(_idx[0]).add);
1158  int _parmidx[2-1];
1159  _parmidx[1-1] = _idx[1-1] + 1;
1160 
1161  fpreal64 result;
1162  OP_Utils::evalOpParmInst(result, thissop, "add#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1163  return (result);
1164  }
1165  int64 opCombinations_process(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1166  { return opinstCombinations_process(cookparms, &_idx); }
1167  int64 opinstCombinations_process(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1168  {
1169  SOP_Node *thissop = cookparms.getNode();
1170  if (!thissop) return (myCombinations(_idx[0]).process);
1171  int _parmidx[2-1];
1172  _parmidx[1-1] = _idx[1-1] + 1;
1173 
1174  int64 result;
1175  OP_Utils::evalOpParmInst(result, thissop, "process#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1176  return (result);
1177  }
1178  fpreal64 opCombinations_blend(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1179  { return opinstCombinations_blend(cookparms, &_idx); }
1180  fpreal64 opinstCombinations_blend(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1181  {
1182  SOP_Node *thissop = cookparms.getNode();
1183  if (!thissop) return (myCombinations(_idx[0]).blend);
1184  int _parmidx[2-1];
1185  _parmidx[1-1] = _idx[1-1] + 1;
1186 
1187  fpreal64 result;
1188  OP_Utils::evalOpParmInst(result, thissop, "blend#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1189  return (result);
1190  }
1192  { return opinstCombinations_doblendattrib(cookparms, &_idx); }
1193  int64 opinstCombinations_doblendattrib(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1194  {
1195  SOP_Node *thissop = cookparms.getNode();
1196  if (!thissop) return (myCombinations(_idx[0]).doblendattrib);
1197  int _parmidx[2-1];
1198  _parmidx[1-1] = _idx[1-1] + 1;
1199 
1200  int64 result;
1201  OP_Utils::evalOpParmInst(result, thissop, "doblendattrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1202  return (result);
1203  }
1205  { return opinstCombinations_blendattrib(cookparms, &_idx); }
1207  {
1208  SOP_Node *thissop = cookparms.getNode();
1209  if (!thissop) return (myCombinations(_idx[0]).blendattrib);
1210  int _parmidx[2-1];
1211  _parmidx[1-1] = _idx[1-1] + 1;
1212 
1214  OP_Utils::evalOpParmInst(result, thissop, "blendattrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1215  return (result);
1216  }
1217  int64 opCombinations_blendinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1218  { return opinstCombinations_blendinput(cookparms, &_idx); }
1219  int64 opinstCombinations_blendinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1220  {
1221  SOP_Node *thissop = cookparms.getNode();
1222  if (!thissop) return (myCombinations(_idx[0]).blendinput);
1223  int _parmidx[2-1];
1224  _parmidx[1-1] = _idx[1-1] + 1;
1225 
1226  int64 result;
1227  OP_Utils::evalOpParmInst(result, thissop, "blendinput#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1228  return (result);
1229  }
1230 
1231  fpreal64 getPostScale() const { return myPostScale; }
1232  void setPostScale(fpreal64 val) { myPostScale = val; }
1234  {
1235  SOP_Node *thissop = cookparms.getNode();
1236  if (!thissop) return getPostScale();
1237  fpreal64 result;
1238  OP_Utils::evalOpParm(result, thissop, "postscale", cookparms.getCookTime(), 0);
1239  return result;
1240  }
1241  bool getDoThreshold() const { return myDoThreshold; }
1242  void setDoThreshold(bool val) { myDoThreshold = val; }
1243  bool opDoThreshold(const SOP_NodeVerb::CookParms &cookparms) const
1244  {
1245  SOP_Node *thissop = cookparms.getNode();
1246  if (!thissop) return getDoThreshold();
1247  bool result;
1248  OP_Utils::evalOpParm(result, thissop, "dothreshold", cookparms.getCookTime(), 0);
1249  return result;
1250  }
1251  fpreal64 getThreshold() const { return myThreshold; }
1252  void setThreshold(fpreal64 val) { myThreshold = val; }
1254  {
1255  SOP_Node *thissop = cookparms.getNode();
1256  if (!thissop) return getThreshold();
1257  fpreal64 result;
1258  OP_Utils::evalOpParm(result, thissop, "threshold", cookparms.getCookTime(), 0);
1259  return result;
1260  }
1261  bool getDoClampMin() const { return myDoClampMin; }
1262  void setDoClampMin(bool val) { myDoClampMin = val; }
1263  bool opDoClampMin(const SOP_NodeVerb::CookParms &cookparms) const
1264  {
1265  SOP_Node *thissop = cookparms.getNode();
1266  if (!thissop) return getDoClampMin();
1267  bool result;
1268  OP_Utils::evalOpParm(result, thissop, "doclampmin", cookparms.getCookTime(), 0);
1269  return result;
1270  }
1271  fpreal64 getClampMin() const { return myClampMin; }
1272  void setClampMin(fpreal64 val) { myClampMin = val; }
1274  {
1275  SOP_Node *thissop = cookparms.getNode();
1276  if (!thissop) return getClampMin();
1277  fpreal64 result;
1278  OP_Utils::evalOpParm(result, thissop, "clampmin", cookparms.getCookTime(), 0);
1279  return result;
1280  }
1281  bool getDoClampMax() const { return myDoClampMax; }
1282  void setDoClampMax(bool val) { myDoClampMax = val; }
1283  bool opDoClampMax(const SOP_NodeVerb::CookParms &cookparms) const
1284  {
1285  SOP_Node *thissop = cookparms.getNode();
1286  if (!thissop) return getDoClampMax();
1287  bool result;
1288  OP_Utils::evalOpParm(result, thissop, "doclampmax", cookparms.getCookTime(), 0);
1289  return result;
1290  }
1291  fpreal64 getClampMax() const { return myClampMax; }
1292  void setClampMax(fpreal64 val) { myClampMax = val; }
1294  {
1295  SOP_Node *thissop = cookparms.getNode();
1296  if (!thissop) return getClampMax();
1297  fpreal64 result;
1298  OP_Utils::evalOpParm(result, thissop, "clampmax", cookparms.getCookTime(), 0);
1299  return result;
1300  }
1301  const UT_StringHolder & getAttribMatch() const { return myAttribMatch; }
1302  void setAttribMatch(const UT_StringHolder & val) { myAttribMatch = val; }
1304  {
1305  SOP_Node *thissop = cookparms.getNode();
1306  if (!thissop) return getAttribMatch();
1308  OP_Utils::evalOpParm(result, thissop, "attribmatch", cookparms.getCookTime(), 0);
1309  return result;
1310  }
1311  bool getCreateMissing() const { return myCreateMissing; }
1312  void setCreateMissing(bool val) { myCreateMissing = val; }
1313  bool opCreateMissing(const SOP_NodeVerb::CookParms &cookparms) const
1314  {
1315  SOP_Node *thissop = cookparms.getNode();
1316  if (!thissop) return getCreateMissing();
1317  bool result;
1318  OP_Utils::evalOpParm(result, thissop, "createmissing", cookparms.getCookTime(), 0);
1319  return result;
1320  }
1321  bool getForceScalar() const { return myForceScalar; }
1322  void setForceScalar(bool val) { myForceScalar = val; }
1323  bool opForceScalar(const SOP_NodeVerb::CookParms &cookparms) const
1324  {
1325  SOP_Node *thissop = cookparms.getNode();
1326  if (!thissop) return getForceScalar();
1327  bool result;
1328  OP_Utils::evalOpParm(result, thissop, "forcescalar", cookparms.getCookTime(), 0);
1329  return result;
1330  }
1331  bool getDeleteSource() const { return myDeleteSource; }
1332  void setDeleteSource(bool val) { myDeleteSource = val; }
1333  bool opDeleteSource(const SOP_NodeVerb::CookParms &cookparms) const
1334  {
1335  SOP_Node *thissop = cookparms.getNode();
1336  if (!thissop) return getDeleteSource();
1337  bool result;
1338  OP_Utils::evalOpParm(result, thissop, "deletesource", cookparms.getCookTime(), 0);
1339  return result;
1340  }
1341  bool getErrorMissing() const { return myErrorMissing; }
1342  void setErrorMissing(bool val) { myErrorMissing = val; }
1343  bool opErrorMissing(const SOP_NodeVerb::CookParms &cookparms) const
1344  {
1345  SOP_Node *thissop = cookparms.getNode();
1346  if (!thissop) return getErrorMissing();
1347  bool result;
1348  OP_Utils::evalOpParm(result, thissop, "errormissing", cookparms.getCookTime(), 0);
1349  return result;
1350  }
1351 
1352 private:
1353  UT_StringHolder myGroup;
1354  int64 myGroupType;
1355  UT_StringHolder myDstAttrib;
1356  int64 myClass;
1357  UT_Array<Combinations> myCombinations;
1358  fpreal64 myPostScale;
1359  bool myDoThreshold;
1360  fpreal64 myThreshold;
1361  bool myDoClampMin;
1362  fpreal64 myClampMin;
1363  bool myDoClampMax;
1364  fpreal64 myClampMax;
1365  UT_StringHolder myAttribMatch;
1366  bool myCreateMissing;
1367  bool myForceScalar;
1368  bool myDeleteSource;
1369  bool myErrorMissing;
1370 
1371 };
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
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
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
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
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
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
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
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
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
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
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:1385
#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:89
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
OP_NodeParms & operator=(const OP_NodeParms &)=default
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