HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_GroupCombine.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_GroupCombineEnums
24 {
25  enum class Grouptype
26  {
27  GUESS = 0,
28  POINTS,
29  PRIMS,
30  EDGES,
31  VERTICES
32  };
33  enum class Negate_a
34  {
35  OFF = 0,
36  ON
37  };
38  enum class Op_ab
39  {
40  NONE = 0,
41  OR,
42  AND,
43  XOR,
44  SUB
45  };
46  enum class Negate_b
47  {
48  OFF = 0,
49  ON
50  };
51  enum class Op_bc
52  {
53  NONE = 0,
54  OR,
55  AND,
56  XOR,
57  SUB
58  };
59  enum class Negate_c
60  {
61  OFF = 0,
62  ON
63  };
64  enum class Op_cd
65  {
66  NONE = 0,
67  OR,
68  AND,
69  XOR,
70  SUB
71  };
72  enum class Negate_d
73  {
74  OFF = 0,
75  ON
76  };
77 }
78 
79 
81 {
82 public:
83  static int version() { return 1; }
84  struct Numcombine
85  {
99 
100 
102  {
103  grouptype = 0;
104  group = ""_UTsh;
105  negate_a = 0;
106  group_a = ""_UTsh;
107  op_ab = 0;
108  negate_b = 0;
109  group_b = ""_UTsh;
110  op_bc = 0;
111  negate_c = 0;
112  group_c = ""_UTsh;
113  op_cd = 0;
114  negate_d = 0;
115  group_d = ""_UTsh;
116 
117  }
118 
119  bool operator==(const Numcombine &src) const
120  {
121  if (grouptype != src.grouptype) return false;
122  if (group != src.group) return false;
123  if (negate_a != src.negate_a) return false;
124  if (group_a != src.group_a) return false;
125  if (op_ab != src.op_ab) return false;
126  if (negate_b != src.negate_b) return false;
127  if (group_b != src.group_b) return false;
128  if (op_bc != src.op_bc) return false;
129  if (negate_c != src.negate_c) return false;
130  if (group_c != src.group_c) return false;
131  if (op_cd != src.op_cd) return false;
132  if (negate_d != src.negate_d) return false;
133  if (group_d != src.group_d) return false;
134 
135  return true;
136  }
137  bool operator!=(const Numcombine &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("%d", (int) list(i).grouptype);
156  buf.append(", ");
157  { UT_String tmp; tmp = UT_StringWrap(list(i).group).makeQuotedString('"'); buf.strcat(tmp); }
158  buf.append(", ");
159  buf.appendSprintf("%d", (int) list(i).negate_a);
160  buf.append(", ");
161  { UT_String tmp; tmp = UT_StringWrap(list(i).group_a).makeQuotedString('"'); buf.strcat(tmp); }
162  buf.append(", ");
163  buf.appendSprintf("%d", (int) list(i).op_ab);
164  buf.append(", ");
165  buf.appendSprintf("%d", (int) list(i).negate_b);
166  buf.append(", ");
167  { UT_String tmp; tmp = UT_StringWrap(list(i).group_b).makeQuotedString('"'); buf.strcat(tmp); }
168  buf.append(", ");
169  buf.appendSprintf("%d", (int) list(i).op_bc);
170  buf.append(", ");
171  buf.appendSprintf("%d", (int) list(i).negate_c);
172  buf.append(", ");
173  { UT_String tmp; tmp = UT_StringWrap(list(i).group_c).makeQuotedString('"'); buf.strcat(tmp); }
174  buf.append(", ");
175  buf.appendSprintf("%d", (int) list(i).op_cd);
176  buf.append(", ");
177  buf.appendSprintf("%d", (int) list(i).negate_d);
178  buf.append(", ");
179  { UT_String tmp; tmp = UT_StringWrap(list(i).group_d).makeQuotedString('"'); buf.strcat(tmp); }
180 
181  buf.strcat(" )");
182  }
183  buf.strcat(" ]");
184 
186  return result;
187  }
188 
190  {
191  myNumcombine.setSize(1);
192 
193  }
194 
195  explicit SOP_GroupCombineParms(const SOP_GroupCombineParms &) = default;
197  SOP_GroupCombineParms(SOP_GroupCombineParms &&) noexcept = default;
198  SOP_GroupCombineParms &operator=(SOP_GroupCombineParms &&) noexcept = default;
199 
200  ~SOP_GroupCombineParms() override {}
201 
203  {
204  if (myNumcombine != src.myNumcombine) return false;
205 
206  return true;
207  }
209  {
210  return !operator==(src);
211  }
220 
221 
222 
223  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
224  {
225  if (true)
226  {
227  int64 length = 0;
228  graph->evalOpParm(length, nodeidx, "numcombine", time, 0);
229  if (length < 0) length = 0;
230  myNumcombine.setSize(length);
231  for (exint i = 0; i < length; i++)
232  {
233  int parmidx[1];
234  int offsets[1];
235  parmidx[0] = i+1;
236  offsets[0] = 1;
237  auto && _curentry = myNumcombine(i);
238  (void) _curentry;
239  _curentry.grouptype = 0;
240  if (true)
241  graph->evalOpParmInst(_curentry.grouptype, nodeidx, "grouptype#", parmidx, offsets, time, 0, 2-1);
242  _curentry.group = ""_UTsh;
243  if (true)
244  graph->evalOpParmInst(_curentry.group, nodeidx, "group#", parmidx, offsets, time, 0, 2-1);
245  _curentry.negate_a = 0;
246  if (true)
247  graph->evalOpParmInst(_curentry.negate_a, nodeidx, "negate_a#", parmidx, offsets, time, 0, 2-1);
248  _curentry.group_a = ""_UTsh;
249  if (true)
250  graph->evalOpParmInst(_curentry.group_a, nodeidx, "group_a#", parmidx, offsets, time, 0, 2-1);
251  _curentry.op_ab = 0;
252  if (true)
253  graph->evalOpParmInst(_curentry.op_ab, nodeidx, "op_ab#", parmidx, offsets, time, 0, 2-1);
254  _curentry.negate_b = 0;
255  if (true && ( (true&&!(((_curentry.op_ab==0)))) ) )
256  graph->evalOpParmInst(_curentry.negate_b, nodeidx, "negate_b#", parmidx, offsets, time, 0, 2-1);
257  _curentry.group_b = ""_UTsh;
258  if (true && ( (true&&!(((_curentry.op_ab==0)))) ) )
259  graph->evalOpParmInst(_curentry.group_b, nodeidx, "group_b#", parmidx, offsets, time, 0, 2-1);
260  _curentry.op_bc = 0;
261  if (true)
262  graph->evalOpParmInst(_curentry.op_bc, nodeidx, "op_bc#", parmidx, offsets, time, 0, 2-1);
263  _curentry.negate_c = 0;
264  if (true && ( (true&&!(((_curentry.op_bc==0)))) ) )
265  graph->evalOpParmInst(_curentry.negate_c, nodeidx, "negate_c#", parmidx, offsets, time, 0, 2-1);
266  _curentry.group_c = ""_UTsh;
267  if (true && ( (true&&!(((_curentry.op_bc==0)))) ) )
268  graph->evalOpParmInst(_curentry.group_c, nodeidx, "group_c#", parmidx, offsets, time, 0, 2-1);
269  _curentry.op_cd = 0;
270  if (true)
271  graph->evalOpParmInst(_curentry.op_cd, nodeidx, "op_cd#", parmidx, offsets, time, 0, 2-1);
272  _curentry.negate_d = 0;
273  if (true && ( (true&&!(((_curentry.op_cd==0)))) ) )
274  graph->evalOpParmInst(_curentry.negate_d, nodeidx, "negate_d#", parmidx, offsets, time, 0, 2-1);
275  _curentry.group_d = ""_UTsh;
276  if (true && ( (true&&!(((_curentry.op_cd==0)))) ) )
277  graph->evalOpParmInst(_curentry.group_d, nodeidx, "group_d#", parmidx, offsets, time, 0, 2-1);
278 
279  }
280  }
281  else
282  myNumcombine.clear();
283 
284  }
285 
286 
287  void loadFromOpSubclass(const LoadParms &loadparms) override
288  {
289  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
290  }
291 
292 
293  void copyFrom(const OP_NodeParms *src) override
294  {
295  *this = *((const SOP_GroupCombineParms *)src);
296  }
297 
298  template <typename T>
299  void
300  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
301  {
302  if (idx.size() < 1)
303  return;
304  UT_ASSERT(idx.size() == instance.size()+1);
305  if (idx.size() != instance.size()+1)
306  return;
307  switch (idx[0])
308  {
309  case 0:
310  if (idx.size() == 1)
311  coerceValue(value, myNumcombine.entries());
312  else if (instance[0] < myNumcombine.entries())
313  {
314  auto && _data = myNumcombine(instance[0]);
315  switch (idx[1])
316  {
317  case 0:
318  coerceValue(value, _data.grouptype);
319  break;
320  case 1:
321  coerceValue(value, _data.group);
322  break;
323  case 2:
324  coerceValue(value, _data.negate_a);
325  break;
326  case 3:
327  coerceValue(value, _data.group_a);
328  break;
329  case 4:
330  coerceValue(value, _data.op_ab);
331  break;
332  case 5:
333  coerceValue(value, _data.negate_b);
334  break;
335  case 6:
336  coerceValue(value, _data.group_b);
337  break;
338  case 7:
339  coerceValue(value, _data.op_bc);
340  break;
341  case 8:
342  coerceValue(value, _data.negate_c);
343  break;
344  case 9:
345  coerceValue(value, _data.group_c);
346  break;
347  case 10:
348  coerceValue(value, _data.op_cd);
349  break;
350  case 11:
351  coerceValue(value, _data.negate_d);
352  break;
353  case 12:
354  coerceValue(value, _data.group_d);
355  break;
356 
357  }
358  }
359  break;
360 
361  }
362  }
363 
364  bool isParmColorRamp(exint idx) const override
365  {
366  switch (idx)
367  {
368 
369  }
370  return false;
371  }
372 
373  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
374  { doGetParmValue(idx, instance, value); }
375  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
376  { doGetParmValue(idx, instance, value); }
377  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
378  { doGetParmValue(idx, instance, value); }
379  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
380  { doGetParmValue(idx, instance, value); }
381  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
382  { doGetParmValue(idx, instance, value); }
383  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
384  { doGetParmValue(idx, instance, value); }
385  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
386  { doGetParmValue(idx, instance, value); }
387  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
388  { doGetParmValue(idx, instance, value); }
389  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
390  { doGetParmValue(idx, instance, value); }
391  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
392  { doGetParmValue(idx, instance, value); }
393  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
394  { doGetParmValue(idx, instance, value); }
395 
396  template <typename T>
397  void
398  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
399  {
400  if (idx.size() < 1)
401  return;
402  UT_ASSERT(idx.size() == instance.size()+1);
403  if (idx.size() != instance.size()+1)
404  return;
405  switch (idx[0])
406  {
407  case 0:
408  if (idx.size() == 1)
409  {
410  exint newsize;
411  coerceValue(newsize, value);
412  if (newsize < 0) newsize = 0;
413  myNumcombine.setSize(newsize);
414  }
415  else
416  {
417  if (instance[0] < 0)
418  return;
419  myNumcombine.setSizeIfNeeded(instance[0]+1);
420  auto && _data = myNumcombine(instance[0]);
421  switch (idx[1])
422  {
423  case 0:
424  coerceValue(_data.grouptype, value);
425  break;
426  case 1:
427  coerceValue(_data.group, value);
428  break;
429  case 2:
430  coerceValue(_data.negate_a, value);
431  break;
432  case 3:
433  coerceValue(_data.group_a, value);
434  break;
435  case 4:
436  coerceValue(_data.op_ab, value);
437  break;
438  case 5:
439  coerceValue(_data.negate_b, value);
440  break;
441  case 6:
442  coerceValue(_data.group_b, value);
443  break;
444  case 7:
445  coerceValue(_data.op_bc, value);
446  break;
447  case 8:
448  coerceValue(_data.negate_c, value);
449  break;
450  case 9:
451  coerceValue(_data.group_c, value);
452  break;
453  case 10:
454  coerceValue(_data.op_cd, value);
455  break;
456  case 11:
457  coerceValue(_data.negate_d, value);
458  break;
459  case 12:
460  coerceValue(_data.group_d, value);
461  break;
462 
463  }
464  }
465  break;
466 
467  }
468  }
469 
470  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
471  { doSetParmValue(idx, instance, value); }
472  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
473  { doSetParmValue(idx, instance, value); }
474  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
475  { doSetParmValue(idx, instance, value); }
476  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
477  { doSetParmValue(idx, instance, value); }
478  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
479  { doSetParmValue(idx, instance, value); }
480  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
481  { doSetParmValue(idx, instance, value); }
482  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
483  { doSetParmValue(idx, instance, value); }
484  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
485  { doSetParmValue(idx, instance, value); }
486  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
487  { doSetParmValue(idx, instance, value); }
488  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
489  { doSetParmValue(idx, instance, value); }
490  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
491  { doSetParmValue(idx, instance, value); }
492 
493  exint getNestNumParms(TempIndex idx) const override
494  {
495  if (idx.size() == 0)
496  return 1;
497  switch (idx[0])
498  {
499  case 0:
500  return 13;
501 
502  }
503  // Invalid
504  return 0;
505  }
506 
507  const char *getNestParmName(TempIndex fieldnum) const override
508  {
509  if (fieldnum.size() < 1)
510  return 0;
511  switch (fieldnum[0])
512  {
513  case 0:
514  if (fieldnum.size() == 1)
515  return "numcombine";
516  switch (fieldnum[1])
517  {
518  case 0:
519  return "grouptype#";
520  case 1:
521  return "group#";
522  case 2:
523  return "negate_a#";
524  case 3:
525  return "group_a#";
526  case 4:
527  return "op_ab#";
528  case 5:
529  return "negate_b#";
530  case 6:
531  return "group_b#";
532  case 7:
533  return "op_bc#";
534  case 8:
535  return "negate_c#";
536  case 9:
537  return "group_c#";
538  case 10:
539  return "op_cd#";
540  case 11:
541  return "negate_d#";
542  case 12:
543  return "group_d#";
544 
545  }
546  return 0;
547 
548  }
549  return 0;
550  }
551 
552  ParmType getNestParmType(TempIndex fieldnum) const override
553  {
554  if (fieldnum.size() < 1)
555  return PARM_UNSUPPORTED;
556  switch (fieldnum[0])
557  {
558  case 0:
559  if (fieldnum.size() == 1)
560  return PARM_MULTIPARM;
561  switch (fieldnum[1])
562  {
563  case 0:
564  return PARM_INTEGER;
565  case 1:
566  return PARM_STRING;
567  case 2:
568  return PARM_INTEGER;
569  case 3:
570  return PARM_STRING;
571  case 4:
572  return PARM_INTEGER;
573  case 5:
574  return PARM_INTEGER;
575  case 6:
576  return PARM_STRING;
577  case 7:
578  return PARM_INTEGER;
579  case 8:
580  return PARM_INTEGER;
581  case 9:
582  return PARM_STRING;
583  case 10:
584  return PARM_INTEGER;
585  case 11:
586  return PARM_INTEGER;
587  case 12:
588  return PARM_STRING;
589 
590  }
591  return PARM_UNSUPPORTED;
592 
593  }
594  return PARM_UNSUPPORTED;
595  }
596 
597  // Boiler plate to load individual types.
598  static void loadData(UT_IStream &is, int64 &v)
599  { is.bread(&v, 1); }
600  static void loadData(UT_IStream &is, bool &v)
601  { int64 iv; is.bread(&iv, 1); v = iv; }
602  static void loadData(UT_IStream &is, fpreal64 &v)
603  { is.bread<fpreal64>(&v, 1); }
604  static void loadData(UT_IStream &is, UT_Vector2D &v)
605  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
606  static void loadData(UT_IStream &is, UT_Vector3D &v)
607  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
608  is.bread<fpreal64>(&v.z(), 1); }
609  static void loadData(UT_IStream &is, UT_Vector4D &v)
610  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
611  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
612  static void loadData(UT_IStream &is, UT_Matrix2D &v)
613  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
614  static void loadData(UT_IStream &is, UT_Matrix3D &v)
615  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
616  static void loadData(UT_IStream &is, UT_Matrix4D &v)
617  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
618  static void loadData(UT_IStream &is, UT_Vector2I &v)
619  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
620  static void loadData(UT_IStream &is, UT_Vector3I &v)
621  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
622  is.bread<int64>(&v.z(), 1); }
623  static void loadData(UT_IStream &is, UT_Vector4I &v)
624  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
625  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
627  { is.bread(v); }
629  { UT_StringHolder rampdata;
630  loadData(is, rampdata);
631  if (rampdata.isstring())
632  {
633  v.reset(new UT_Ramp());
634  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
635  v->load(istr);
636  }
637  else v.reset();
638  }
641  loadData(is, data);
642  if (data.isstring())
643  {
644  // Find the data type.
645  const char *colon = UT_StringWrap(data).findChar(':');
646  if (colon)
647  {
648  int typelen = colon - data.buffer();
650  type.strncpy(data.buffer(), typelen);
651  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
652 
653  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
654  }
655  }
656  else v.reset();
657  }
658 
659  static void saveData(std::ostream &os, int64 v)
660  { UTwrite(os, &v); }
661  static void saveData(std::ostream &os, bool v)
662  { int64 iv = v; UTwrite(os, &iv); }
663  static void saveData(std::ostream &os, fpreal64 v)
664  { UTwrite<fpreal64>(os, &v); }
665  static void saveData(std::ostream &os, UT_Vector2D v)
666  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
667  static void saveData(std::ostream &os, UT_Vector3D v)
668  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
669  UTwrite<fpreal64>(os, &v.z()); }
670  static void saveData(std::ostream &os, UT_Vector4D v)
671  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
672  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
673  static void saveData(std::ostream &os, UT_Matrix2D v)
675  static void saveData(std::ostream &os, UT_Matrix3D v)
677  static void saveData(std::ostream &os, UT_Matrix4D v)
679  static void saveData(std::ostream &os, UT_StringHolder s)
680  { UT_StringWrap(s).saveBinary(os); }
681  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
683  UT_OStringStream ostr;
684  if (s) s->save(ostr);
685  result = ostr.str();
686  saveData(os, result);
687  }
688  static void saveData(std::ostream &os, PRM_DataItemHandle s)
690  UT_OStringStream ostr;
691  if (s)
692  {
693  ostr << s->getDataTypeToken();
694  ostr << ":";
695  s->saveBinary(ostr);
696  }
697  result = ostr.str();
698  saveData(os, result);
699  }
700 
701 
702  void save(std::ostream &os) const
703  {
704  int32 v = version();
705  UTwrite(os, &v);
706  {
707  int64 length = myNumcombine.entries();
708  UTwrite(os, &length);
709  for (exint i = 0; i < length; i++)
710  {
711  auto && _curentry = myNumcombine(i);
712  (void) _curentry;
713  saveData(os, _curentry.grouptype);
714  saveData(os, _curentry.group);
715  saveData(os, _curentry.negate_a);
716  saveData(os, _curentry.group_a);
717  saveData(os, _curentry.op_ab);
718  saveData(os, _curentry.negate_b);
719  saveData(os, _curentry.group_b);
720  saveData(os, _curentry.op_bc);
721  saveData(os, _curentry.negate_c);
722  saveData(os, _curentry.group_c);
723  saveData(os, _curentry.op_cd);
724  saveData(os, _curentry.negate_d);
725  saveData(os, _curentry.group_d);
726 
727  }
728  }
729 
730  }
731 
732  bool load(UT_IStream &is)
733  {
734  int32 v;
735  is.bread(&v, 1);
736  if (version() != v)
737  {
738  // Fail incompatible versions
739  return false;
740  }
741  {
742  int64 length;
743  is.read(&length, 1);
744  myNumcombine.setSize(length);
745  for (exint i = 0; i < length; i++)
746  {
747  auto && _curentry = myNumcombine(i);
748  (void) _curentry;
749  loadData(is, _curentry.grouptype);
750  loadData(is, _curentry.group);
751  loadData(is, _curentry.negate_a);
752  loadData(is, _curentry.group_a);
753  loadData(is, _curentry.op_ab);
754  loadData(is, _curentry.negate_b);
755  loadData(is, _curentry.group_b);
756  loadData(is, _curentry.op_bc);
757  loadData(is, _curentry.negate_c);
758  loadData(is, _curentry.group_c);
759  loadData(is, _curentry.op_cd);
760  loadData(is, _curentry.negate_d);
761  loadData(is, _curentry.group_d);
762 
763  }
764  }
765 
766  return true;
767  }
768 
769  const UT_Array<Numcombine> &getNumcombine() const { return myNumcombine; }
770 void setNumcombine(const UT_Array<Numcombine> &val) { myNumcombine = val; }
772  {
773  SOP_Node *thissop = cookparms.getNode();
774  if (!thissop) return getNumcombine().entries();
775  exint result;
776  OP_Utils::evalOpParm(result, thissop, "numcombine", cookparms.getCookTime(), 0);
777  return result;
778  }
779  int64 opNumcombine_grouptype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
780  { return opinstNumcombine_grouptype(cookparms, &_idx); }
781  int64 opinstNumcombine_grouptype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
782  {
783  SOP_Node *thissop = cookparms.getNode();
784  if (!thissop) return (myNumcombine(_idx[0]).grouptype);
785  int _parmidx[2-1];
786  _parmidx[1-1] = _idx[1-1] + 1;
787 
788  int64 result;
789  OP_Utils::evalOpParmInst(result, thissop, "grouptype#", _parmidx, cookparms.getCookTime(), 0, 2-1);
790  return (result);
791  }
793  { return opinstNumcombine_group(cookparms, &_idx); }
794  UT_StringHolder opinstNumcombine_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
795  {
796  SOP_Node *thissop = cookparms.getNode();
797  if (!thissop) return (myNumcombine(_idx[0]).group);
798  int _parmidx[2-1];
799  _parmidx[1-1] = _idx[1-1] + 1;
800 
802  OP_Utils::evalOpParmInst(result, thissop, "group#", _parmidx, cookparms.getCookTime(), 0, 2-1);
803  return (result);
804  }
805  int64 opNumcombine_negate_a(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
806  { return opinstNumcombine_negate_a(cookparms, &_idx); }
807  int64 opinstNumcombine_negate_a(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
808  {
809  SOP_Node *thissop = cookparms.getNode();
810  if (!thissop) return (myNumcombine(_idx[0]).negate_a);
811  int _parmidx[2-1];
812  _parmidx[1-1] = _idx[1-1] + 1;
813 
814  int64 result;
815  OP_Utils::evalOpParmInst(result, thissop, "negate_a#", _parmidx, cookparms.getCookTime(), 0, 2-1);
816  return (result);
817  }
819  { return opinstNumcombine_group_a(cookparms, &_idx); }
820  UT_StringHolder opinstNumcombine_group_a(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
821  {
822  SOP_Node *thissop = cookparms.getNode();
823  if (!thissop) return (myNumcombine(_idx[0]).group_a);
824  int _parmidx[2-1];
825  _parmidx[1-1] = _idx[1-1] + 1;
826 
828  OP_Utils::evalOpParmInst(result, thissop, "group_a#", _parmidx, cookparms.getCookTime(), 0, 2-1);
829  return (result);
830  }
831  int64 opNumcombine_op_ab(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
832  { return opinstNumcombine_op_ab(cookparms, &_idx); }
833  int64 opinstNumcombine_op_ab(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
834  {
835  SOP_Node *thissop = cookparms.getNode();
836  if (!thissop) return (myNumcombine(_idx[0]).op_ab);
837  int _parmidx[2-1];
838  _parmidx[1-1] = _idx[1-1] + 1;
839 
840  int64 result;
841  OP_Utils::evalOpParmInst(result, thissop, "op_ab#", _parmidx, cookparms.getCookTime(), 0, 2-1);
842  return (result);
843  }
844  int64 opNumcombine_negate_b(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
845  { return opinstNumcombine_negate_b(cookparms, &_idx); }
846  int64 opinstNumcombine_negate_b(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
847  {
848  SOP_Node *thissop = cookparms.getNode();
849  if (!thissop) return (myNumcombine(_idx[0]).negate_b);
850  int _parmidx[2-1];
851  _parmidx[1-1] = _idx[1-1] + 1;
852 
853  int64 result;
854  OP_Utils::evalOpParmInst(result, thissop, "negate_b#", _parmidx, cookparms.getCookTime(), 0, 2-1);
855  return (result);
856  }
858  { return opinstNumcombine_group_b(cookparms, &_idx); }
859  UT_StringHolder opinstNumcombine_group_b(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
860  {
861  SOP_Node *thissop = cookparms.getNode();
862  if (!thissop) return (myNumcombine(_idx[0]).group_b);
863  int _parmidx[2-1];
864  _parmidx[1-1] = _idx[1-1] + 1;
865 
867  OP_Utils::evalOpParmInst(result, thissop, "group_b#", _parmidx, cookparms.getCookTime(), 0, 2-1);
868  return (result);
869  }
870  int64 opNumcombine_op_bc(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
871  { return opinstNumcombine_op_bc(cookparms, &_idx); }
872  int64 opinstNumcombine_op_bc(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
873  {
874  SOP_Node *thissop = cookparms.getNode();
875  if (!thissop) return (myNumcombine(_idx[0]).op_bc);
876  int _parmidx[2-1];
877  _parmidx[1-1] = _idx[1-1] + 1;
878 
879  int64 result;
880  OP_Utils::evalOpParmInst(result, thissop, "op_bc#", _parmidx, cookparms.getCookTime(), 0, 2-1);
881  return (result);
882  }
883  int64 opNumcombine_negate_c(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
884  { return opinstNumcombine_negate_c(cookparms, &_idx); }
885  int64 opinstNumcombine_negate_c(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
886  {
887  SOP_Node *thissop = cookparms.getNode();
888  if (!thissop) return (myNumcombine(_idx[0]).negate_c);
889  int _parmidx[2-1];
890  _parmidx[1-1] = _idx[1-1] + 1;
891 
892  int64 result;
893  OP_Utils::evalOpParmInst(result, thissop, "negate_c#", _parmidx, cookparms.getCookTime(), 0, 2-1);
894  return (result);
895  }
897  { return opinstNumcombine_group_c(cookparms, &_idx); }
898  UT_StringHolder opinstNumcombine_group_c(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
899  {
900  SOP_Node *thissop = cookparms.getNode();
901  if (!thissop) return (myNumcombine(_idx[0]).group_c);
902  int _parmidx[2-1];
903  _parmidx[1-1] = _idx[1-1] + 1;
904 
906  OP_Utils::evalOpParmInst(result, thissop, "group_c#", _parmidx, cookparms.getCookTime(), 0, 2-1);
907  return (result);
908  }
909  int64 opNumcombine_op_cd(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
910  { return opinstNumcombine_op_cd(cookparms, &_idx); }
911  int64 opinstNumcombine_op_cd(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
912  {
913  SOP_Node *thissop = cookparms.getNode();
914  if (!thissop) return (myNumcombine(_idx[0]).op_cd);
915  int _parmidx[2-1];
916  _parmidx[1-1] = _idx[1-1] + 1;
917 
918  int64 result;
919  OP_Utils::evalOpParmInst(result, thissop, "op_cd#", _parmidx, cookparms.getCookTime(), 0, 2-1);
920  return (result);
921  }
922  int64 opNumcombine_negate_d(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
923  { return opinstNumcombine_negate_d(cookparms, &_idx); }
924  int64 opinstNumcombine_negate_d(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
925  {
926  SOP_Node *thissop = cookparms.getNode();
927  if (!thissop) return (myNumcombine(_idx[0]).negate_d);
928  int _parmidx[2-1];
929  _parmidx[1-1] = _idx[1-1] + 1;
930 
931  int64 result;
932  OP_Utils::evalOpParmInst(result, thissop, "negate_d#", _parmidx, cookparms.getCookTime(), 0, 2-1);
933  return (result);
934  }
936  { return opinstNumcombine_group_d(cookparms, &_idx); }
937  UT_StringHolder opinstNumcombine_group_d(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
938  {
939  SOP_Node *thissop = cookparms.getNode();
940  if (!thissop) return (myNumcombine(_idx[0]).group_d);
941  int _parmidx[2-1];
942  _parmidx[1-1] = _idx[1-1] + 1;
943 
945  OP_Utils::evalOpParmInst(result, thissop, "group_d#", _parmidx, cookparms.getCookTime(), 0, 2-1);
946  return (result);
947  }
948 
949 
950 private:
951  UT_Array<Numcombine> myNumcombine;
952 
953 };
UT_StringHolder opNumcombine_group_a(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_StringHolder opinstNumcombine_group_b(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
int64 opinstNumcombine_negate_a(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
int64 opNumcombine_op_bc(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_Matrix3D v)
bool operator==(const Numcombine &src) const
static void saveData(std::ostream &os, UT_Vector4D v)
void
Definition: png.h:1083
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
UT_StringHolder opNumcombine_group_c(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, int64 v)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
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.
static void loadData(UT_IStream &is, UT_StringHolder &v)
int64 opinstNumcombine_grouptype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
**But if you need a result
Definition: thread.h:613
int64 opinstNumcombine_op_ab(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool isParmColorRamp(exint idx) const override
int64 opinstNumcombine_negate_c(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool load(UT_IStream &is)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
UT_StringHolder opNumcombine_group(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void save(std::ostream &os) 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
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void saveData(std::ostream &os, UT_Vector2D v)
const UT_Array< Numcombine > & getNumcombine() const
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
int64 opNumcombine_negate_b(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 opinstNumcombine_negate_b(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool operator==(const SOP_GroupCombineParms &src) const
void loadFromOpSubclass(const LoadParms &loadparms) override
UT_StringHolder opNumcombine_group_b(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
exint length() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
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
exint opNumcombine(const SOP_NodeVerb::CookParms &cookparms) const
int64 opNumcombine_grouptype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 opNumcombine_negate_a(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
long long int64
Definition: SYS_Types.h:116
bool operator!=(const Numcombine &src) const
UT_StringHolder createString(const UT_Array< Numcombine > &list) const
UT_StringHolder opinstNumcombine_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, int64 &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, bool &v)
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNumcombine(const UT_Array< Numcombine > &val)
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
ParmType getNestParmType(TempIndex fieldnum) const override
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
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
static void saveData(std::ostream &os, UT_Matrix2D v)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
int64 opNumcombine_op_cd(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
const char * findChar(int c) const
Definition: UT_String.h:1385
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
int64 opinstNumcombine_negate_d(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_StringHolder opinstNumcombine_group_a(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
GLboolean r
Definition: glcorearb.h:1222
int64 opinstNumcombine_op_cd(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
exint getNestNumParms(TempIndex idx) const override
bool operator!=(const SOP_GroupCombineParms &src) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
int64 opinstNumcombine_op_bc(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
type
Definition: core.h:1059
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
UT_StringHolder opNumcombine_group_d(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_StringHolder opinstNumcombine_group_d(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
int64 opNumcombine_op_ab(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 opNumcombine_negate_c(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
int64 opNumcombine_negate_d(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
UT_StringHolder opinstNumcombine_group_c(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const