HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_GroupRange.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_GroupRangeEnums
24 {
25  enum class Grouptype
26  {
27  POINTS = 0,
28  PRIMS,
29  VERTICES
30  };
31 
33  getToken(Grouptype enum_value)
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case Grouptype::POINTS: return "points"_sh;
38  case Grouptype::PRIMS: return "prims"_sh;
39  case Grouptype::VERTICES: return "vertices"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class Mergeop
45  {
46  REPLACE = 0,
47  UNION,
48  INTERSECT,
49  SUBTRACT
50  };
51 
53  getToken(Mergeop enum_value)
54  {
55  using namespace UT::Literal;
56  switch (enum_value) {
57  case Mergeop::REPLACE: return "replace"_sh;
58  case Mergeop::UNION: return "union"_sh;
59  case Mergeop::INTERSECT: return "intersect"_sh;
60  case Mergeop::SUBTRACT: return "subtract"_sh;
61  default: UT_ASSERT(false); return ""_sh;
62  }
63  }
64 
65  enum class Method
66  {
67  ABSOLUTE = 0,
68  RELATIVE,
69  LENGTH,
70  PARTITION
71  };
72 
74  getToken(Method enum_value)
75  {
76  using namespace UT::Literal;
77  switch (enum_value) {
78  case Method::ABSOLUTE: return "absolute"_sh;
79  case Method::RELATIVE: return "relative"_sh;
80  case Method::LENGTH: return "length"_sh;
81  case Method::PARTITION: return "partition"_sh;
82  default: UT_ASSERT(false); return ""_sh;
83  }
84  }
85 
86  enum class Colgrouptype
87  {
88  EDGES = 0,
89  POINTS,
90  PRIMS,
91  VERTICES
92  };
93 
95  getToken(Colgrouptype enum_value)
96  {
97  using namespace UT::Literal;
98  switch (enum_value) {
99  case Colgrouptype::EDGES: return "edges"_sh;
100  case Colgrouptype::POINTS: return "points"_sh;
101  case Colgrouptype::PRIMS: return "prims"_sh;
102  case Colgrouptype::VERTICES: return "vertices"_sh;
103  default: UT_ASSERT(false); return ""_sh;
104  }
105  }
106 
107 }
108 
109 
111 {
112 public:
113  static int version() { return 1; }
114  struct Numrange
115  {
116  bool enable;
127  bool invert;
132  bool useattrib;
141 
142 
144  {
145  enable = true;
146  groupname = "group#"_UTsh;
147  group = ""_UTsh;
148  grouptype = 1;
149  mergeop = 0;
150  method = 1;
151  start = 0;
152  end = 0;
153  length = 1;
154  partition = 0;
155  numpartition = 1;
156  invert = false;
157  selectamount = 1;
158  selecttotal = 1;
159  selectoffset = 0;
160  connectedgeo = false;
161  useattrib = false;
162  attrib = ""_UTsh;
163  usecolgroup = false;
164  colgroup = ""_UTsh;
165  colgrouptype = 0;
166  colallowonbnd = true;
167  usepartnum = false;
168  keeponlypartnum = true;
169  partnum = 0;
170 
171  }
172 
173  bool operator==(const Numrange &src) const
174  {
175  if (enable != src.enable) return false;
176  if (groupname != src.groupname) return false;
177  if (group != src.group) return false;
178  if (grouptype != src.grouptype) return false;
179  if (mergeop != src.mergeop) return false;
180  if (method != src.method) return false;
181  if (start != src.start) return false;
182  if (end != src.end) return false;
183  if (length != src.length) return false;
184  if (partition != src.partition) return false;
185  if (numpartition != src.numpartition) return false;
186  if (invert != src.invert) return false;
187  if (selectamount != src.selectamount) return false;
188  if (selecttotal != src.selecttotal) return false;
189  if (selectoffset != src.selectoffset) return false;
190  if (connectedgeo != src.connectedgeo) return false;
191  if (useattrib != src.useattrib) return false;
192  if (attrib != src.attrib) return false;
193  if (usecolgroup != src.usecolgroup) return false;
194  if (colgroup != src.colgroup) return false;
195  if (colgrouptype != src.colgrouptype) return false;
196  if (colallowonbnd != src.colallowonbnd) return false;
197  if (usepartnum != src.usepartnum) return false;
198  if (keeponlypartnum != src.keeponlypartnum) return false;
199  if (partnum != src.partnum) return false;
200 
201  return true;
202  }
203  bool operator!=(const Numrange &src) const
204  {
205  return !operator==(src);
206  }
207 
208  };
209 
211  {
213 
214  buf.strcat("[ ");
215  for (int i = 0; i < list.entries(); i++)
216  {
217  if (i)
218  buf.strcat(", ");
219  buf.strcat("( ");
220  buf.append("");
221  buf.appendSprintf("%s", (list(i).enable) ? "true" : "false");
222  buf.append(", ");
223  { UT_String tmp; tmp = UT_StringWrap(list(i).groupname).makeQuotedString('"'); buf.strcat(tmp); }
224  buf.append(", ");
225  { UT_String tmp; tmp = UT_StringWrap(list(i).group).makeQuotedString('"'); buf.strcat(tmp); }
226  buf.append(", ");
227  buf.appendSprintf("%d", (int) list(i).grouptype);
228  buf.append(", ");
229  buf.appendSprintf("%d", (int) list(i).mergeop);
230  buf.append(", ");
231  buf.appendSprintf("%d", (int) list(i).method);
232  buf.append(", ");
233  buf.appendSprintf("%d", (int) list(i).start);
234  buf.append(", ");
235  buf.appendSprintf("%d", (int) list(i).end);
236  buf.append(", ");
237  buf.appendSprintf("%d", (int) list(i).length);
238  buf.append(", ");
239  buf.appendSprintf("%d", (int) list(i).partition);
240  buf.append(", ");
241  buf.appendSprintf("%d", (int) list(i).numpartition);
242  buf.append(", ");
243  buf.appendSprintf("%s", (list(i).invert) ? "true" : "false");
244  buf.append(", ");
245  buf.appendSprintf("%d", (int) list(i).selectamount);
246  buf.append(", ");
247  buf.appendSprintf("%d", (int) list(i).selecttotal);
248  buf.append(", ");
249  buf.appendSprintf("%d", (int) list(i).selectoffset);
250  buf.append(", ");
251  buf.appendSprintf("%s", (list(i).connectedgeo) ? "true" : "false");
252  buf.append(", ");
253  buf.appendSprintf("%s", (list(i).useattrib) ? "true" : "false");
254  buf.append(", ");
255  { UT_String tmp; tmp = UT_StringWrap(list(i).attrib).makeQuotedString('"'); buf.strcat(tmp); }
256  buf.append(", ");
257  buf.appendSprintf("%s", (list(i).usecolgroup) ? "true" : "false");
258  buf.append(", ");
259  { UT_String tmp; tmp = UT_StringWrap(list(i).colgroup).makeQuotedString('"'); buf.strcat(tmp); }
260  buf.append(", ");
261  buf.appendSprintf("%d", (int) list(i).colgrouptype);
262  buf.append(", ");
263  buf.appendSprintf("%s", (list(i).colallowonbnd) ? "true" : "false");
264  buf.append(", ");
265  buf.appendSprintf("%s", (list(i).usepartnum) ? "true" : "false");
266  buf.append(", ");
267  buf.appendSprintf("%s", (list(i).keeponlypartnum) ? "true" : "false");
268  buf.append(", ");
269  buf.appendSprintf("%d", (int) list(i).partnum);
270 
271  buf.strcat(" )");
272  }
273  buf.strcat(" ]");
274 
276  return result;
277  }
278 
280  {
281  myNumrange.setSize(1);
282 
283  }
284 
285  explicit SOP_GroupRangeParms(const SOP_GroupRangeParms &) = default;
287  SOP_GroupRangeParms(SOP_GroupRangeParms &&) noexcept = default;
288  SOP_GroupRangeParms &operator=(SOP_GroupRangeParms &&) noexcept = default;
289 
290  ~SOP_GroupRangeParms() override {}
291 
292  bool operator==(const SOP_GroupRangeParms &src) const
293  {
294  if (myNumrange != src.myNumrange) return false;
295 
296  return true;
297  }
298  bool operator!=(const SOP_GroupRangeParms &src) const
299  {
300  return !operator==(src);
301  }
306 
307 
308 
309  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
310  {
311  if (true)
312  {
313  int64 length = 0;
314  graph->evalOpParm(length, nodeidx, "numrange", time, 0);
315  if (length < 0) length = 0;
316  myNumrange.setSize(length);
317  for (exint i = 0; i < length; i++)
318  {
319  int parmidx[1];
320  int offsets[1];
321  parmidx[0] = i+1;
322  offsets[0] = 1;
323  auto && _curentry = myNumrange(i);
324  (void) _curentry;
325  _curentry.enable = true;
326  if (true)
327  graph->evalOpParmInst(_curentry.enable, nodeidx, "enable#", parmidx, offsets, time, 0, 2-1);
328  _curentry.groupname = "group#"_UTsh;
329  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
330  graph->evalOpParmInst(_curentry.groupname, nodeidx, "groupname#", parmidx, offsets, time, 0, 2-1);
331  _curentry.group = ""_UTsh;
332  if (true)
333  graph->evalOpParmInst(_curentry.group, nodeidx, "group#", parmidx, offsets, time, 0, 2-1);
334  _curentry.grouptype = 1;
335  if (true)
336  graph->evalOpParmInst(_curentry.grouptype, nodeidx, "grouptype#", parmidx, offsets, time, 0, 2-1);
337  _curentry.mergeop = 0;
338  if (true)
339  graph->evalOpParmInst(_curentry.mergeop, nodeidx, "mergeop#", parmidx, offsets, time, 0, 2-1);
340  _curentry.method = 1;
341  if (true)
342  graph->evalOpParmInst(_curentry.method, nodeidx, "method#", parmidx, offsets, time, 0, 2-1);
343  _curentry.start = 0;
344  if (true && ( (true&&!(((_curentry.method==3)))) ) )
345  graph->evalOpParmInst(_curentry.start, nodeidx, "start#", parmidx, offsets, time, 0, 2-1);
346  _curentry.end = 0;
347  if (true && ( (true&&!(((_curentry.method!=0)&&(_curentry.method!=1)))) ) )
348  graph->evalOpParmInst(_curentry.end, nodeidx, "end#", parmidx, offsets, time, 0, 2-1);
349  _curentry.length = 1;
350  if (true && ( (true&&!(((_curentry.method!=2)))) ) )
351  graph->evalOpParmInst(_curentry.length, nodeidx, "length#", parmidx, offsets, time, 0, 2-1);
352  _curentry.partition = 0;
353  if (true && ( (true&&!(((_curentry.method!=3)))) ) )
354  graph->evalOpParmInst(_curentry.partition, nodeidx, "partition#", parmidx, offsets, time, 0, 2-1);
355  _curentry.numpartition = 1;
356  if (true && ( (true&&!(((_curentry.method!=3)))) ) )
357  graph->evalOpParmInst(_curentry.numpartition, nodeidx, "numpartition#", parmidx, offsets, time, 0, 2-1);
358  _curentry.invert = false;
359  if (true)
360  graph->evalOpParmInst(_curentry.invert, nodeidx, "invert#", parmidx, offsets, time, 0, 2-1);
361  _curentry.selectamount = 1;
362  if (true)
363  graph->evalOpParmInst(_curentry.selectamount, nodeidx, "selectamount#", parmidx, offsets, time, 0, 2-1);
364  _curentry.selecttotal = 1;
365  if (true)
366  graph->evalOpParmInst(_curentry.selecttotal, nodeidx, "selecttotal#", parmidx, offsets, time, 0, 2-1);
367  _curentry.selectoffset = 0;
368  if (true)
369  graph->evalOpParmInst(_curentry.selectoffset, nodeidx, "selectoffset#", parmidx, offsets, time, 0, 2-1);
370  _curentry.connectedgeo = false;
371  if (true)
372  graph->evalOpParmInst(_curentry.connectedgeo, nodeidx, "connectedgeo#", parmidx, offsets, time, 0, 2-1);
373  _curentry.useattrib = false;
374  if (true)
375  graph->evalOpParmInst(_curentry.useattrib, nodeidx, "useattrib#", parmidx, offsets, time, 0, 2-1);
376  _curentry.attrib = ""_UTsh;
377  if (true && ( (true&&!(((_curentry.useattrib==0)))) ) )
378  graph->evalOpParmInst(_curentry.attrib, nodeidx, "attrib#", parmidx, offsets, time, 0, 2-1);
379  _curentry.usecolgroup = false;
380  if (true)
381  graph->evalOpParmInst(_curentry.usecolgroup, nodeidx, "usecolgroup#", parmidx, offsets, time, 0, 2-1);
382  _curentry.colgroup = ""_UTsh;
383  if (true && ( (true&&!(((_curentry.usecolgroup==0)))) ) )
384  graph->evalOpParmInst(_curentry.colgroup, nodeidx, "colgroup#", parmidx, offsets, time, 0, 2-1);
385  _curentry.colgrouptype = 0;
386  if (true && ( (true&&!(((_curentry.usecolgroup==0)))) ) )
387  graph->evalOpParmInst(_curentry.colgrouptype, nodeidx, "colgrouptype#", parmidx, offsets, time, 0, 2-1);
388  _curentry.colallowonbnd = true;
389  if (true && ( (true&&!(((_curentry.usecolgroup==0)))) ) )
390  graph->evalOpParmInst(_curentry.colallowonbnd, nodeidx, "colallowonbnd#", parmidx, offsets, time, 0, 2-1);
391  _curentry.usepartnum = false;
392  if (true)
393  graph->evalOpParmInst(_curentry.usepartnum, nodeidx, "usepartnum#", parmidx, offsets, time, 0, 2-1);
394  _curentry.keeponlypartnum = true;
395  if (true && ( (true&&!(((_curentry.usepartnum==0)))) ) )
396  graph->evalOpParmInst(_curentry.keeponlypartnum, nodeidx, "keeponlypartnum#", parmidx, offsets, time, 0, 2-1);
397  _curentry.partnum = 0;
398  if (true && ( (true&&!(((_curentry.usepartnum==0)))) ) )
399  graph->evalOpParmInst(_curentry.partnum, nodeidx, "partnum#", parmidx, offsets, time, 0, 2-1);
400 
401  }
402  }
403  else
404  myNumrange.clear();
405 
406  }
407 
408 
409  void loadFromOpSubclass(const LoadParms &loadparms) override
410  {
411  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
412  }
413 
414 
415  void copyFrom(const OP_NodeParms *src) override
416  {
417  *this = *((const SOP_GroupRangeParms *)src);
418  }
419 
420  template <typename T>
421  void
422  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
423  {
424  if (idx.size() < 1)
425  return;
426  UT_ASSERT(idx.size() == instance.size()+1);
427  if (idx.size() != instance.size()+1)
428  return;
429  switch (idx[0])
430  {
431  case 0:
432  if (idx.size() == 1)
433  coerceValue(value, myNumrange.entries());
434  else if (instance[0] < myNumrange.entries())
435  {
436  auto && _data = myNumrange(instance[0]);
437  switch (idx[1])
438  {
439  case 0:
440  coerceValue(value, _data.enable);
441  break;
442  case 1:
443  coerceValue(value, _data.groupname);
444  break;
445  case 2:
446  coerceValue(value, _data.group);
447  break;
448  case 3:
449  coerceValue(value, _data.grouptype);
450  break;
451  case 4:
452  coerceValue(value, _data.mergeop);
453  break;
454  case 5:
455  coerceValue(value, _data.method);
456  break;
457  case 6:
458  coerceValue(value, _data.start);
459  break;
460  case 7:
461  coerceValue(value, _data.end);
462  break;
463  case 8:
464  coerceValue(value, _data.length);
465  break;
466  case 9:
467  coerceValue(value, _data.partition);
468  break;
469  case 10:
470  coerceValue(value, _data.numpartition);
471  break;
472  case 11:
473  coerceValue(value, _data.invert);
474  break;
475  case 12:
476  coerceValue(value, _data.selectamount);
477  break;
478  case 13:
479  coerceValue(value, _data.selecttotal);
480  break;
481  case 14:
482  coerceValue(value, _data.selectoffset);
483  break;
484  case 15:
485  coerceValue(value, _data.connectedgeo);
486  break;
487  case 16:
488  coerceValue(value, _data.useattrib);
489  break;
490  case 17:
491  coerceValue(value, _data.attrib);
492  break;
493  case 18:
494  coerceValue(value, _data.usecolgroup);
495  break;
496  case 19:
497  coerceValue(value, _data.colgroup);
498  break;
499  case 20:
500  coerceValue(value, _data.colgrouptype);
501  break;
502  case 21:
503  coerceValue(value, _data.colallowonbnd);
504  break;
505  case 22:
506  coerceValue(value, _data.usepartnum);
507  break;
508  case 23:
509  coerceValue(value, _data.keeponlypartnum);
510  break;
511  case 24:
512  coerceValue(value, _data.partnum);
513  break;
514 
515  }
516  }
517  break;
518 
519  }
520  }
521 
522  bool isParmColorRamp(exint idx) const override
523  {
524  switch (idx)
525  {
526 
527  }
528  return false;
529  }
530 
531  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
532  { doGetParmValue(idx, instance, value); }
533  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
534  { doGetParmValue(idx, instance, value); }
535  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
536  { doGetParmValue(idx, instance, value); }
537  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
538  { doGetParmValue(idx, instance, value); }
539  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
540  { doGetParmValue(idx, instance, value); }
541  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
542  { doGetParmValue(idx, instance, value); }
543  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
544  { doGetParmValue(idx, instance, value); }
545  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
546  { doGetParmValue(idx, instance, value); }
547  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
548  { doGetParmValue(idx, instance, value); }
549  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
550  { doGetParmValue(idx, instance, value); }
551  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
552  { doGetParmValue(idx, instance, value); }
553 
554  template <typename T>
555  void
556  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
557  {
558  if (idx.size() < 1)
559  return;
560  UT_ASSERT(idx.size() == instance.size()+1);
561  if (idx.size() != instance.size()+1)
562  return;
563  switch (idx[0])
564  {
565  case 0:
566  if (idx.size() == 1)
567  {
568  exint newsize;
569  coerceValue(newsize, value);
570  if (newsize < 0) newsize = 0;
571  myNumrange.setSize(newsize);
572  }
573  else
574  {
575  if (instance[0] < 0)
576  return;
577  myNumrange.setSizeIfNeeded(instance[0]+1);
578  auto && _data = myNumrange(instance[0]);
579  switch (idx[1])
580  {
581  case 0:
582  coerceValue(_data.enable, value);
583  break;
584  case 1:
585  coerceValue(_data.groupname, value);
586  break;
587  case 2:
588  coerceValue(_data.group, value);
589  break;
590  case 3:
591  coerceValue(_data.grouptype, value);
592  break;
593  case 4:
594  coerceValue(_data.mergeop, value);
595  break;
596  case 5:
597  coerceValue(_data.method, value);
598  break;
599  case 6:
600  coerceValue(_data.start, value);
601  break;
602  case 7:
603  coerceValue(_data.end, value);
604  break;
605  case 8:
606  coerceValue(_data.length, value);
607  break;
608  case 9:
609  coerceValue(_data.partition, value);
610  break;
611  case 10:
612  coerceValue(_data.numpartition, value);
613  break;
614  case 11:
615  coerceValue(_data.invert, value);
616  break;
617  case 12:
618  coerceValue(_data.selectamount, value);
619  break;
620  case 13:
621  coerceValue(_data.selecttotal, value);
622  break;
623  case 14:
624  coerceValue(_data.selectoffset, value);
625  break;
626  case 15:
627  coerceValue(_data.connectedgeo, value);
628  break;
629  case 16:
630  coerceValue(_data.useattrib, value);
631  break;
632  case 17:
633  coerceValue(_data.attrib, value);
634  break;
635  case 18:
636  coerceValue(_data.usecolgroup, value);
637  break;
638  case 19:
639  coerceValue(_data.colgroup, value);
640  break;
641  case 20:
642  coerceValue(_data.colgrouptype, value);
643  break;
644  case 21:
645  coerceValue(_data.colallowonbnd, value);
646  break;
647  case 22:
648  coerceValue(_data.usepartnum, value);
649  break;
650  case 23:
651  coerceValue(_data.keeponlypartnum, value);
652  break;
653  case 24:
654  coerceValue(_data.partnum, value);
655  break;
656 
657  }
658  }
659  break;
660 
661  }
662  }
663 
664  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
665  { doSetParmValue(idx, instance, value); }
666  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
667  { doSetParmValue(idx, instance, value); }
668  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
669  { doSetParmValue(idx, instance, value); }
670  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
671  { doSetParmValue(idx, instance, value); }
672  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
673  { doSetParmValue(idx, instance, value); }
674  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
675  { doSetParmValue(idx, instance, value); }
676  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
677  { doSetParmValue(idx, instance, value); }
678  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
679  { doSetParmValue(idx, instance, value); }
680  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
681  { doSetParmValue(idx, instance, value); }
682  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
683  { doSetParmValue(idx, instance, value); }
684  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
685  { doSetParmValue(idx, instance, value); }
686 
687  exint getNestNumParms(TempIndex idx) const override
688  {
689  if (idx.size() == 0)
690  return 1;
691  switch (idx[0])
692  {
693  case 0:
694  return 25;
695 
696  }
697  // Invalid
698  return 0;
699  }
700 
701  const char *getNestParmName(TempIndex fieldnum) const override
702  {
703  if (fieldnum.size() < 1)
704  return 0;
705  switch (fieldnum[0])
706  {
707  case 0:
708  if (fieldnum.size() == 1)
709  return "numrange";
710  switch (fieldnum[1])
711  {
712  case 0:
713  return "enable#";
714  case 1:
715  return "groupname#";
716  case 2:
717  return "group#";
718  case 3:
719  return "grouptype#";
720  case 4:
721  return "mergeop#";
722  case 5:
723  return "method#";
724  case 6:
725  return "start#";
726  case 7:
727  return "end#";
728  case 8:
729  return "length#";
730  case 9:
731  return "partition#";
732  case 10:
733  return "numpartition#";
734  case 11:
735  return "invert#";
736  case 12:
737  return "selectamount#";
738  case 13:
739  return "selecttotal#";
740  case 14:
741  return "selectoffset#";
742  case 15:
743  return "connectedgeo#";
744  case 16:
745  return "useattrib#";
746  case 17:
747  return "attrib#";
748  case 18:
749  return "usecolgroup#";
750  case 19:
751  return "colgroup#";
752  case 20:
753  return "colgrouptype#";
754  case 21:
755  return "colallowonbnd#";
756  case 22:
757  return "usepartnum#";
758  case 23:
759  return "keeponlypartnum#";
760  case 24:
761  return "partnum#";
762 
763  }
764  return 0;
765 
766  }
767  return 0;
768  }
769 
770  ParmType getNestParmType(TempIndex fieldnum) const override
771  {
772  if (fieldnum.size() < 1)
773  return PARM_UNSUPPORTED;
774  switch (fieldnum[0])
775  {
776  case 0:
777  if (fieldnum.size() == 1)
778  return PARM_MULTIPARM;
779  switch (fieldnum[1])
780  {
781  case 0:
782  return PARM_INTEGER;
783  case 1:
784  return PARM_STRING;
785  case 2:
786  return PARM_STRING;
787  case 3:
788  return PARM_INTEGER;
789  case 4:
790  return PARM_INTEGER;
791  case 5:
792  return PARM_INTEGER;
793  case 6:
794  return PARM_INTEGER;
795  case 7:
796  return PARM_INTEGER;
797  case 8:
798  return PARM_INTEGER;
799  case 9:
800  return PARM_INTEGER;
801  case 10:
802  return PARM_INTEGER;
803  case 11:
804  return PARM_INTEGER;
805  case 12:
806  return PARM_INTEGER;
807  case 13:
808  return PARM_INTEGER;
809  case 14:
810  return PARM_INTEGER;
811  case 15:
812  return PARM_INTEGER;
813  case 16:
814  return PARM_INTEGER;
815  case 17:
816  return PARM_STRING;
817  case 18:
818  return PARM_INTEGER;
819  case 19:
820  return PARM_STRING;
821  case 20:
822  return PARM_INTEGER;
823  case 21:
824  return PARM_INTEGER;
825  case 22:
826  return PARM_INTEGER;
827  case 23:
828  return PARM_INTEGER;
829  case 24:
830  return PARM_INTEGER;
831 
832  }
833  return PARM_UNSUPPORTED;
834 
835  }
836  return PARM_UNSUPPORTED;
837  }
838 
839  // Boiler plate to load individual types.
840  static void loadData(UT_IStream &is, int64 &v)
841  { is.bread(&v, 1); }
842  static void loadData(UT_IStream &is, bool &v)
843  { int64 iv; is.bread(&iv, 1); v = iv; }
844  static void loadData(UT_IStream &is, fpreal64 &v)
845  { is.bread<fpreal64>(&v, 1); }
846  static void loadData(UT_IStream &is, UT_Vector2D &v)
847  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
848  static void loadData(UT_IStream &is, UT_Vector3D &v)
849  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
850  is.bread<fpreal64>(&v.z(), 1); }
851  static void loadData(UT_IStream &is, UT_Vector4D &v)
852  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
853  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
854  static void loadData(UT_IStream &is, UT_Matrix2D &v)
855  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
856  static void loadData(UT_IStream &is, UT_Matrix3D &v)
857  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
858  static void loadData(UT_IStream &is, UT_Matrix4D &v)
859  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
860  static void loadData(UT_IStream &is, UT_Vector2I &v)
861  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
862  static void loadData(UT_IStream &is, UT_Vector3I &v)
863  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
864  is.bread<int64>(&v.z(), 1); }
865  static void loadData(UT_IStream &is, UT_Vector4I &v)
866  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
867  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
869  { is.bread(v); }
871  { UT_StringHolder rampdata;
872  loadData(is, rampdata);
873  if (rampdata.isstring())
874  {
875  v.reset(new UT_Ramp());
876  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
877  v->load(istr);
878  }
879  else v.reset();
880  }
883  loadData(is, data);
884  if (data.isstring())
885  {
886  // Find the data type.
887  const char *colon = UT_StringWrap(data).findChar(':');
888  if (colon)
889  {
890  int typelen = colon - data.buffer();
892  type.strncpy(data.buffer(), typelen);
893  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
894 
895  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
896  }
897  }
898  else v.reset();
899  }
900 
901  static void saveData(std::ostream &os, int64 v)
902  { UTwrite(os, &v); }
903  static void saveData(std::ostream &os, bool v)
904  { int64 iv = v; UTwrite(os, &iv); }
905  static void saveData(std::ostream &os, fpreal64 v)
906  { UTwrite<fpreal64>(os, &v); }
907  static void saveData(std::ostream &os, UT_Vector2D v)
908  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
909  static void saveData(std::ostream &os, UT_Vector3D v)
910  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
911  UTwrite<fpreal64>(os, &v.z()); }
912  static void saveData(std::ostream &os, UT_Vector4D v)
913  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
914  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
915  static void saveData(std::ostream &os, UT_Matrix2D v)
917  static void saveData(std::ostream &os, UT_Matrix3D v)
919  static void saveData(std::ostream &os, UT_Matrix4D v)
921  static void saveData(std::ostream &os, UT_StringHolder s)
922  { UT_StringWrap(s).saveBinary(os); }
923  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
925  UT_OStringStream ostr;
926  if (s) s->save(ostr);
927  result = ostr.str();
928  saveData(os, result);
929  }
930  static void saveData(std::ostream &os, PRM_DataItemHandle s)
932  UT_OStringStream ostr;
933  if (s)
934  {
935  ostr << s->getDataTypeToken();
936  ostr << ":";
937  s->saveBinary(ostr);
938  }
939  result = ostr.str();
940  saveData(os, result);
941  }
942 
943 
944  void save(std::ostream &os) const
945  {
946  int32 v = version();
947  UTwrite(os, &v);
948  {
949  int64 length = myNumrange.entries();
950  UTwrite(os, &length);
951  for (exint i = 0; i < length; i++)
952  {
953  auto && _curentry = myNumrange(i);
954  (void) _curentry;
955  saveData(os, _curentry.enable);
956  saveData(os, _curentry.groupname);
957  saveData(os, _curentry.group);
958  saveData(os, _curentry.grouptype);
959  saveData(os, _curentry.mergeop);
960  saveData(os, _curentry.method);
961  saveData(os, _curentry.start);
962  saveData(os, _curentry.end);
963  saveData(os, _curentry.length);
964  saveData(os, _curentry.partition);
965  saveData(os, _curentry.numpartition);
966  saveData(os, _curentry.invert);
967  saveData(os, _curentry.selectamount);
968  saveData(os, _curentry.selecttotal);
969  saveData(os, _curentry.selectoffset);
970  saveData(os, _curentry.connectedgeo);
971  saveData(os, _curentry.useattrib);
972  saveData(os, _curentry.attrib);
973  saveData(os, _curentry.usecolgroup);
974  saveData(os, _curentry.colgroup);
975  saveData(os, _curentry.colgrouptype);
976  saveData(os, _curentry.colallowonbnd);
977  saveData(os, _curentry.usepartnum);
978  saveData(os, _curentry.keeponlypartnum);
979  saveData(os, _curentry.partnum);
980 
981  }
982  }
983 
984  }
985 
986  bool load(UT_IStream &is)
987  {
988  int32 v;
989  is.bread(&v, 1);
990  if (version() != v)
991  {
992  // Fail incompatible versions
993  return false;
994  }
995  {
996  int64 length;
997  is.read(&length, 1);
998  myNumrange.setSize(length);
999  for (exint i = 0; i < length; i++)
1000  {
1001  auto && _curentry = myNumrange(i);
1002  (void) _curentry;
1003  loadData(is, _curentry.enable);
1004  loadData(is, _curentry.groupname);
1005  loadData(is, _curentry.group);
1006  loadData(is, _curentry.grouptype);
1007  loadData(is, _curentry.mergeop);
1008  loadData(is, _curentry.method);
1009  loadData(is, _curentry.start);
1010  loadData(is, _curentry.end);
1011  loadData(is, _curentry.length);
1012  loadData(is, _curentry.partition);
1013  loadData(is, _curentry.numpartition);
1014  loadData(is, _curentry.invert);
1015  loadData(is, _curentry.selectamount);
1016  loadData(is, _curentry.selecttotal);
1017  loadData(is, _curentry.selectoffset);
1018  loadData(is, _curentry.connectedgeo);
1019  loadData(is, _curentry.useattrib);
1020  loadData(is, _curentry.attrib);
1021  loadData(is, _curentry.usecolgroup);
1022  loadData(is, _curentry.colgroup);
1023  loadData(is, _curentry.colgrouptype);
1024  loadData(is, _curentry.colallowonbnd);
1025  loadData(is, _curentry.usepartnum);
1026  loadData(is, _curentry.keeponlypartnum);
1027  loadData(is, _curentry.partnum);
1028 
1029  }
1030  }
1031 
1032  return true;
1033  }
1034 
1035  const UT_Array<Numrange> &getNumrange() const { return myNumrange; }
1036 void setNumrange(const UT_Array<Numrange> &val) { myNumrange = val; }
1037  exint opNumrange(const SOP_NodeVerb::CookParms &cookparms) const
1038  {
1039  SOP_Node *thissop = cookparms.getNode();
1040  if (!thissop) return getNumrange().entries();
1041  exint result;
1042  OP_Utils::evalOpParm(result, thissop, "numrange", cookparms.getCookTime(), 0);
1043  return result;
1044  }
1045  bool opNumrange_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1046  { return opinstNumrange_enable(cookparms, &_idx); }
1047  bool opinstNumrange_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1048  {
1049  SOP_Node *thissop = cookparms.getNode();
1050  if (!thissop) return (myNumrange(_idx[0]).enable);
1051  int _parmidx[2-1];
1052  _parmidx[1-1] = _idx[1-1] + 1;
1053 
1054  bool result;
1055  OP_Utils::evalOpParmInst(result, thissop, "enable#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1056  return (result);
1057  }
1059  { return opinstNumrange_groupname(cookparms, &_idx); }
1060  UT_StringHolder opinstNumrange_groupname(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1061  {
1062  SOP_Node *thissop = cookparms.getNode();
1063  if (!thissop) return (myNumrange(_idx[0]).groupname);
1064  int _parmidx[2-1];
1065  _parmidx[1-1] = _idx[1-1] + 1;
1066 
1068  OP_Utils::evalOpParmInst(result, thissop, "groupname#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1069  return (result);
1070  }
1072  { return opinstNumrange_group(cookparms, &_idx); }
1073  UT_StringHolder opinstNumrange_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1074  {
1075  SOP_Node *thissop = cookparms.getNode();
1076  if (!thissop) return (myNumrange(_idx[0]).group);
1077  int _parmidx[2-1];
1078  _parmidx[1-1] = _idx[1-1] + 1;
1079 
1081  OP_Utils::evalOpParmInst(result, thissop, "group#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1082  return (result);
1083  }
1084  int64 opNumrange_grouptype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1085  { return opinstNumrange_grouptype(cookparms, &_idx); }
1086  int64 opinstNumrange_grouptype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1087  {
1088  SOP_Node *thissop = cookparms.getNode();
1089  if (!thissop) return (myNumrange(_idx[0]).grouptype);
1090  int _parmidx[2-1];
1091  _parmidx[1-1] = _idx[1-1] + 1;
1092 
1093  int64 result;
1094  OP_Utils::evalOpParmInst(result, thissop, "grouptype#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1095  return (result);
1096  }
1097  int64 opNumrange_mergeop(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1098  { return opinstNumrange_mergeop(cookparms, &_idx); }
1099  int64 opinstNumrange_mergeop(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1100  {
1101  SOP_Node *thissop = cookparms.getNode();
1102  if (!thissop) return (myNumrange(_idx[0]).mergeop);
1103  int _parmidx[2-1];
1104  _parmidx[1-1] = _idx[1-1] + 1;
1105 
1106  int64 result;
1107  OP_Utils::evalOpParmInst(result, thissop, "mergeop#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1108  return (result);
1109  }
1110  int64 opNumrange_method(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1111  { return opinstNumrange_method(cookparms, &_idx); }
1112  int64 opinstNumrange_method(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1113  {
1114  SOP_Node *thissop = cookparms.getNode();
1115  if (!thissop) return (myNumrange(_idx[0]).method);
1116  int _parmidx[2-1];
1117  _parmidx[1-1] = _idx[1-1] + 1;
1118 
1119  int64 result;
1120  OP_Utils::evalOpParmInst(result, thissop, "method#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1121  return (result);
1122  }
1123  int64 opNumrange_start(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1124  { return opinstNumrange_start(cookparms, &_idx); }
1125  int64 opinstNumrange_start(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1126  {
1127  SOP_Node *thissop = cookparms.getNode();
1128  if (!thissop) return (myNumrange(_idx[0]).start);
1129  int _parmidx[2-1];
1130  _parmidx[1-1] = _idx[1-1] + 1;
1131 
1132  int64 result;
1133  OP_Utils::evalOpParmInst(result, thissop, "start#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1134  return (result);
1135  }
1136  int64 opNumrange_end(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1137  { return opinstNumrange_end(cookparms, &_idx); }
1138  int64 opinstNumrange_end(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1139  {
1140  SOP_Node *thissop = cookparms.getNode();
1141  if (!thissop) return (myNumrange(_idx[0]).end);
1142  int _parmidx[2-1];
1143  _parmidx[1-1] = _idx[1-1] + 1;
1144 
1145  int64 result;
1146  OP_Utils::evalOpParmInst(result, thissop, "end#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1147  return (result);
1148  }
1149  int64 opNumrange_length(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1150  { return opinstNumrange_length(cookparms, &_idx); }
1151  int64 opinstNumrange_length(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1152  {
1153  SOP_Node *thissop = cookparms.getNode();
1154  if (!thissop) return (myNumrange(_idx[0]).length);
1155  int _parmidx[2-1];
1156  _parmidx[1-1] = _idx[1-1] + 1;
1157 
1158  int64 result;
1159  OP_Utils::evalOpParmInst(result, thissop, "length#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1160  return (result);
1161  }
1162  int64 opNumrange_partition(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1163  { return opinstNumrange_partition(cookparms, &_idx); }
1164  int64 opinstNumrange_partition(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1165  {
1166  SOP_Node *thissop = cookparms.getNode();
1167  if (!thissop) return (myNumrange(_idx[0]).partition);
1168  int _parmidx[2-1];
1169  _parmidx[1-1] = _idx[1-1] + 1;
1170 
1171  int64 result;
1172  OP_Utils::evalOpParmInst(result, thissop, "partition#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1173  return (result);
1174  }
1175  int64 opNumrange_numpartition(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1176  { return opinstNumrange_numpartition(cookparms, &_idx); }
1177  int64 opinstNumrange_numpartition(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1178  {
1179  SOP_Node *thissop = cookparms.getNode();
1180  if (!thissop) return (myNumrange(_idx[0]).numpartition);
1181  int _parmidx[2-1];
1182  _parmidx[1-1] = _idx[1-1] + 1;
1183 
1184  int64 result;
1185  OP_Utils::evalOpParmInst(result, thissop, "numpartition#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1186  return (result);
1187  }
1188  bool opNumrange_invert(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1189  { return opinstNumrange_invert(cookparms, &_idx); }
1190  bool opinstNumrange_invert(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1191  {
1192  SOP_Node *thissop = cookparms.getNode();
1193  if (!thissop) return (myNumrange(_idx[0]).invert);
1194  int _parmidx[2-1];
1195  _parmidx[1-1] = _idx[1-1] + 1;
1196 
1197  bool result;
1198  OP_Utils::evalOpParmInst(result, thissop, "invert#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1199  return (result);
1200  }
1201  int64 opNumrange_selectamount(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1202  { return opinstNumrange_selectamount(cookparms, &_idx); }
1203  int64 opinstNumrange_selectamount(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1204  {
1205  SOP_Node *thissop = cookparms.getNode();
1206  if (!thissop) return (myNumrange(_idx[0]).selectamount);
1207  int _parmidx[2-1];
1208  _parmidx[1-1] = _idx[1-1] + 1;
1209 
1210  int64 result;
1211  OP_Utils::evalOpParmInst(result, thissop, "selectamount#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1212  return (result);
1213  }
1214  int64 opNumrange_selecttotal(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1215  { return opinstNumrange_selecttotal(cookparms, &_idx); }
1216  int64 opinstNumrange_selecttotal(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1217  {
1218  SOP_Node *thissop = cookparms.getNode();
1219  if (!thissop) return (myNumrange(_idx[0]).selecttotal);
1220  int _parmidx[2-1];
1221  _parmidx[1-1] = _idx[1-1] + 1;
1222 
1223  int64 result;
1224  OP_Utils::evalOpParmInst(result, thissop, "selecttotal#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1225  return (result);
1226  }
1227  int64 opNumrange_selectoffset(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1228  { return opinstNumrange_selectoffset(cookparms, &_idx); }
1229  int64 opinstNumrange_selectoffset(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1230  {
1231  SOP_Node *thissop = cookparms.getNode();
1232  if (!thissop) return (myNumrange(_idx[0]).selectoffset);
1233  int _parmidx[2-1];
1234  _parmidx[1-1] = _idx[1-1] + 1;
1235 
1236  int64 result;
1237  OP_Utils::evalOpParmInst(result, thissop, "selectoffset#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1238  return (result);
1239  }
1240  bool opNumrange_connectedgeo(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1241  { return opinstNumrange_connectedgeo(cookparms, &_idx); }
1242  bool opinstNumrange_connectedgeo(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1243  {
1244  SOP_Node *thissop = cookparms.getNode();
1245  if (!thissop) return (myNumrange(_idx[0]).connectedgeo);
1246  int _parmidx[2-1];
1247  _parmidx[1-1] = _idx[1-1] + 1;
1248 
1249  bool result;
1250  OP_Utils::evalOpParmInst(result, thissop, "connectedgeo#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1251  return (result);
1252  }
1253  bool opNumrange_useattrib(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1254  { return opinstNumrange_useattrib(cookparms, &_idx); }
1255  bool opinstNumrange_useattrib(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1256  {
1257  SOP_Node *thissop = cookparms.getNode();
1258  if (!thissop) return (myNumrange(_idx[0]).useattrib);
1259  int _parmidx[2-1];
1260  _parmidx[1-1] = _idx[1-1] + 1;
1261 
1262  bool result;
1263  OP_Utils::evalOpParmInst(result, thissop, "useattrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1264  return (result);
1265  }
1267  { return opinstNumrange_attrib(cookparms, &_idx); }
1268  UT_StringHolder opinstNumrange_attrib(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1269  {
1270  SOP_Node *thissop = cookparms.getNode();
1271  if (!thissop) return (myNumrange(_idx[0]).attrib);
1272  int _parmidx[2-1];
1273  _parmidx[1-1] = _idx[1-1] + 1;
1274 
1276  OP_Utils::evalOpParmInst(result, thissop, "attrib#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1277  return (result);
1278  }
1279  bool opNumrange_usecolgroup(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1280  { return opinstNumrange_usecolgroup(cookparms, &_idx); }
1281  bool opinstNumrange_usecolgroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1282  {
1283  SOP_Node *thissop = cookparms.getNode();
1284  if (!thissop) return (myNumrange(_idx[0]).usecolgroup);
1285  int _parmidx[2-1];
1286  _parmidx[1-1] = _idx[1-1] + 1;
1287 
1288  bool result;
1289  OP_Utils::evalOpParmInst(result, thissop, "usecolgroup#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1290  return (result);
1291  }
1293  { return opinstNumrange_colgroup(cookparms, &_idx); }
1294  UT_StringHolder opinstNumrange_colgroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1295  {
1296  SOP_Node *thissop = cookparms.getNode();
1297  if (!thissop) return (myNumrange(_idx[0]).colgroup);
1298  int _parmidx[2-1];
1299  _parmidx[1-1] = _idx[1-1] + 1;
1300 
1302  OP_Utils::evalOpParmInst(result, thissop, "colgroup#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1303  return (result);
1304  }
1305  int64 opNumrange_colgrouptype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1306  { return opinstNumrange_colgrouptype(cookparms, &_idx); }
1307  int64 opinstNumrange_colgrouptype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1308  {
1309  SOP_Node *thissop = cookparms.getNode();
1310  if (!thissop) return (myNumrange(_idx[0]).colgrouptype);
1311  int _parmidx[2-1];
1312  _parmidx[1-1] = _idx[1-1] + 1;
1313 
1314  int64 result;
1315  OP_Utils::evalOpParmInst(result, thissop, "colgrouptype#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1316  return (result);
1317  }
1318  bool opNumrange_colallowonbnd(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1319  { return opinstNumrange_colallowonbnd(cookparms, &_idx); }
1320  bool opinstNumrange_colallowonbnd(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1321  {
1322  SOP_Node *thissop = cookparms.getNode();
1323  if (!thissop) return (myNumrange(_idx[0]).colallowonbnd);
1324  int _parmidx[2-1];
1325  _parmidx[1-1] = _idx[1-1] + 1;
1326 
1327  bool result;
1328  OP_Utils::evalOpParmInst(result, thissop, "colallowonbnd#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1329  return (result);
1330  }
1331  bool opNumrange_usepartnum(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1332  { return opinstNumrange_usepartnum(cookparms, &_idx); }
1333  bool opinstNumrange_usepartnum(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1334  {
1335  SOP_Node *thissop = cookparms.getNode();
1336  if (!thissop) return (myNumrange(_idx[0]).usepartnum);
1337  int _parmidx[2-1];
1338  _parmidx[1-1] = _idx[1-1] + 1;
1339 
1340  bool result;
1341  OP_Utils::evalOpParmInst(result, thissop, "usepartnum#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1342  return (result);
1343  }
1344  bool opNumrange_keeponlypartnum(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1345  { return opinstNumrange_keeponlypartnum(cookparms, &_idx); }
1346  bool opinstNumrange_keeponlypartnum(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1347  {
1348  SOP_Node *thissop = cookparms.getNode();
1349  if (!thissop) return (myNumrange(_idx[0]).keeponlypartnum);
1350  int _parmidx[2-1];
1351  _parmidx[1-1] = _idx[1-1] + 1;
1352 
1353  bool result;
1354  OP_Utils::evalOpParmInst(result, thissop, "keeponlypartnum#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1355  return (result);
1356  }
1357  int64 opNumrange_partnum(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
1358  { return opinstNumrange_partnum(cookparms, &_idx); }
1359  int64 opinstNumrange_partnum(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
1360  {
1361  SOP_Node *thissop = cookparms.getNode();
1362  if (!thissop) return (myNumrange(_idx[0]).partnum);
1363  int _parmidx[2-1];
1364  _parmidx[1-1] = _idx[1-1] + 1;
1365 
1366  int64 result;
1367  OP_Utils::evalOpParmInst(result, thissop, "partnum#", _parmidx, cookparms.getCookTime(), 0, 2-1);
1368  return (result);
1369  }
1370 
1371 
1372 private:
1373  UT_Array<Numrange> myNumrange;
1374 
1375 };
bool opinstNumrange_connectedgeo(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
UT_StringHolder opNumrange_attrib(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void saveData(std::ostream &os, bool v)
int64 opNumrange_partition(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool isParmColorRamp(exint idx) const override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
UT_StringHolder opinstNumrange_groupname(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opNumrange_method(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void partition(I begin, I middle, I end, const Pred &pred, I *out_eqbeg, I *out_eqend)
Definition: pugixml.cpp:7255
void
Definition: png.h:1083
GLboolean invert
Definition: glcorearb.h:549
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
int64 opNumrange_start(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_StringHolder createString(const UT_Array< Numrange > &list) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
GLuint start
Definition: glcorearb.h:475
int64 opinstNumrange_selecttotal(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool opNumrange_invert(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool operator==(const SOP_GroupRangeParms &src) const
bool opinstNumrange_colallowonbnd(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
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
SYS_FORCE_INLINE const char * buffer() const
int64 opinstNumrange_partnum(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
GLdouble s
Definition: glad.h:3009
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
UT_StringHolder opNumrange_groupname(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
An output stream object that owns its own string buffer storage.
UT_StringHolder opNumrange_colgroup(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool opNumrange_colallowonbnd(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
**But if you need a result
Definition: thread.h:613
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
int64 opinstNumrange_method(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opinstNumrange_partition(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
int64 opNumrange_selecttotal(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 opNumrange_selectamount(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void save(std::ostream &os) const
void loadFromOpSubclass(const LoadParms &loadparms) override
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
bool opinstNumrange_usepartnum(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
static void loadData(UT_IStream &is, bool &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
int64 opNumrange_end(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
const char * getNestParmName(TempIndex fieldnum) const override
int64 opNumrange_partnum(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
int64 opNumrange_selectoffset(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
UT_StringHolder opinstNumrange_colgroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
exint length() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
bool operator!=(const Numrange &src) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
SYS_FORCE_INLINE UT_StringHolder getToken(Grouptype enum_value)
bool opinstNumrange_usecolgroup(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opinstNumrange_mergeop(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
exint getNestNumParms(TempIndex idx) const override
int64 opinstNumrange_colgrouptype(const SOP_NodeVerb::CookParms &cookparms, const 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
GLuint GLuint end
Definition: glcorearb.h:475
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
bool opNumrange_connectedgeo(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
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
int64 opinstNumrange_numpartition(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void saveData(std::ostream &os, UT_Matrix2D v)
const UT_Array< Numrange > & getNumrange() const
int64 opinstNumrange_selectamount(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opNumrange_usepartnum(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 opNumrange_mergeop(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
UT_StringHolder opNumrange_group(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
SYS_FORCE_INLINE void strcat(const char *src)
static void loadData(UT_IStream &is, fpreal64 &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void loadData(UT_IStream &is, UT_StringHolder &v)
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
bool opNumrange_keeponlypartnum(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool opinstNumrange_useattrib(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void copyFrom(const OP_NodeParms *src) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool opinstNumrange_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opinstNumrange_start(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
bool opinstNumrange_invert(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
LeafData & operator=(const LeafData &)=delete
ParmType getNestParmType(TempIndex fieldnum) const override
int64 opinstNumrange_grouptype(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
int64 opinstNumrange_length(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
int64 opinstNumrange_selectoffset(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
UT_StringHolder opinstNumrange_attrib(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool opNumrange_usecolgroup(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void setNumrange(const UT_Array< Numrange > &val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
static void saveData(std::ostream &os, UT_Vector3D v)
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
int64 opinstNumrange_end(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
int64 opNumrange_colgrouptype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
int64 opNumrange_grouptype(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
bool opNumrange_useattrib(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GLboolean r
Definition: glcorearb.h:1222
bool opinstNumrange_keeponlypartnum(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool operator==(const Numrange &src) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
exint opNumrange(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opinstNumrange_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
bool opNumrange_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
type
Definition: core.h:1059
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
bool load(UT_IStream &is)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool operator!=(const SOP_GroupRangeParms &src) const
int64 opNumrange_length(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
GLenum src
Definition: glcorearb.h:1793
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
static void loadData(UT_IStream &is, UT_Vector3D &v)
int64 opNumrange_numpartition(const SOP_NodeVerb::CookParms &cookparms, int _idx) const