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