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