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