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