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 <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_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 
188  if (baseGetSignature() != src.baseGetSignature()) return false;
189 
190  return true;
191  }
192  bool operator!=(const SOP_NameParms &src) const
193  {
194  return !operator==(src);
195  }
197 
198 
199 
200  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
201  {
202  myAttribname = "name"_UTsh;
203  if (true)
204  graph->evalOpParm(myAttribname, nodeidx, "attribname", time, graph->isDirect()?nullptr:depnode);
205  myClass = 0;
206  if (true)
207  graph->evalOpParm(myClass, nodeidx, "class", time, graph->isDirect()?nullptr:depnode);
208  myDonamefromgroup = false;
209  if (true)
210  graph->evalOpParm(myDonamefromgroup, nodeidx, "donamefromgroup", time, graph->isDirect()?nullptr:depnode);
211  myNamefromgroupmask = "piece*"_UTsh;
212  if (true && ( (true&&!(((getDonamefromgroup()==0)))) ) )
213  graph->evalOpParm(myNamefromgroupmask, nodeidx, "namefromgroupmask", time, graph->isDirect()?nullptr:depnode);
214  if (true)
215  {
216  int64 length = 0;
217  graph->evalOpParm(length, nodeidx, "numnames", time, graph->isDirect()?nullptr:depnode);
218  if (length < 0) length = 0;
219  myNumnames.setSize(length);
220  for (exint i = 0; i < length; i++)
221  {
222  int parmidx[1];
223  int offsets[1];
224  parmidx[0] = i+1;
225  offsets[0] = 1;
226  auto && _curentry = myNumnames(i);
227  (void) _curentry;
228  _curentry.group = ""_UTsh;
229  if (true)
230  graph->evalOpParmInst(_curentry.group, nodeidx, "group#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
231  _curentry.name = ""_UTsh;
232  if (true)
233  graph->evalOpParmInst(_curentry.name, nodeidx, "name#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
234 
235  }
236  }
237  else
238  myNumnames.clear();
239  if (true)
240  {
241  int64 length = 0;
242  graph->evalOpParm(length, nodeidx, "numrenames", time, graph->isDirect()?nullptr:depnode);
243  if (length < 0) length = 0;
244  myNumrenames.setSize(length);
245  for (exint i = 0; i < length; i++)
246  {
247  int parmidx[1];
248  int offsets[1];
249  parmidx[0] = i+1;
250  offsets[0] = 1;
251  auto && _curentry = myNumrenames(i);
252  (void) _curentry;
253  _curentry.enable = true;
254  if (true)
255  graph->evalOpParmInst(_curentry.enable, nodeidx, "enable#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
256  _curentry.global = false;
257  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
258  graph->evalOpParmInst(_curentry.global, nodeidx, "global#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
259  _curentry.from = ""_UTsh;
260  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
261  graph->evalOpParmInst(_curentry.from, nodeidx, "from#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
262  _curentry.to = ""_UTsh;
263  if (true && ( (true&&!(((_curentry.enable==0)))) ) )
264  graph->evalOpParmInst(_curentry.to, nodeidx, "to#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
265 
266  }
267  }
268  else
269  myNumrenames.clear();
270 
271  }
272 
273 
274  void loadFromOpSubclass(const LoadParms &loadparms) override
275  {
276  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
277  }
278 
279 
280  void copyFrom(const OP_NodeParms *src) override
281  {
282  *this = *((const SOP_NameParms *)src);
283  }
284 
285  template <typename T>
286  void
287  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
288  {
289  if (idx.size() < 1)
290  return;
291  UT_ASSERT(idx.size() == instance.size()+1);
292  if (idx.size() != instance.size()+1)
293  return;
294  switch (idx[0])
295  {
296  case 0:
297  coerceValue(value, myAttribname);
298  break;
299  case 1:
300  coerceValue(value, myClass);
301  break;
302  case 2:
303  coerceValue(value, myDonamefromgroup);
304  break;
305  case 3:
306  coerceValue(value, myNamefromgroupmask);
307  break;
308  case 4:
309  if (idx.size() == 1)
310  coerceValue(value, myNumnames.entries());
311  else if (instance[0] < myNumnames.entries())
312  {
313  auto && _data = myNumnames(instance[0]);
314  switch (idx[1])
315  {
316  case 0:
317  coerceValue(value, _data.group);
318  break;
319  case 1:
320  coerceValue(value, _data.name);
321  break;
322 
323  }
324  }
325  break;
326  case 5:
327  if (idx.size() == 1)
328  coerceValue(value, myNumrenames.entries());
329  else if (instance[0] < myNumrenames.entries())
330  {
331  auto && _data = myNumrenames(instance[0]);
332  switch (idx[1])
333  {
334  case 0:
335  coerceValue(value, _data.enable);
336  break;
337  case 1:
338  coerceValue(value, _data.global);
339  break;
340  case 2:
341  coerceValue(value, _data.from);
342  break;
343  case 3:
344  coerceValue(value, _data.to);
345  break;
346 
347  }
348  }
349  break;
350 
351  }
352  }
353 
354  bool isParmColorRamp(exint idx) const override
355  {
356  switch (idx)
357  {
358 
359  }
360  return false;
361  }
362 
363  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
364  { doGetParmValue(idx, instance, value); }
365  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
366  { doGetParmValue(idx, instance, value); }
367  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
368  { doGetParmValue(idx, instance, value); }
369  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
370  { doGetParmValue(idx, instance, value); }
371  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
372  { doGetParmValue(idx, instance, value); }
373  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
374  { doGetParmValue(idx, instance, value); }
375  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
376  { doGetParmValue(idx, instance, value); }
377  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
378  { doGetParmValue(idx, instance, value); }
379  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
380  { doGetParmValue(idx, instance, value); }
381  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
382  { doGetParmValue(idx, instance, value); }
383  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
384  { doGetParmValue(idx, instance, value); }
385 
386  template <typename T>
387  void
388  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
389  {
390  if (idx.size() < 1)
391  return;
392  UT_ASSERT(idx.size() == instance.size()+1);
393  if (idx.size() != instance.size()+1)
394  return;
395  switch (idx[0])
396  {
397  case 0:
398  coerceValue(myAttribname, ( ( value ) ));
399  break;
400  case 1:
401  coerceValue(myClass, clampMinValue(0, clampMaxValue(2, value ) ));
402  break;
403  case 2:
404  coerceValue(myDonamefromgroup, ( ( value ) ));
405  break;
406  case 3:
407  coerceValue(myNamefromgroupmask, ( ( value ) ));
408  break;
409  case 4:
410  if (idx.size() == 1)
411  {
412  exint newsize;
413  coerceValue(newsize, value);
414  if (newsize < 0) newsize = 0;
415  myNumnames.setSize(newsize);
416  }
417  else
418  {
419  if (instance[0] < 0)
420  return;
421  myNumnames.setSizeIfNeeded(instance[0]+1);
422  auto && _data = myNumnames(instance[0]);
423  switch (idx[1])
424  {
425  case 0:
426  coerceValue(_data.group, value);
427  break;
428  case 1:
429  coerceValue(_data.name, value);
430  break;
431 
432  }
433  }
434  break;
435  case 5:
436  if (idx.size() == 1)
437  {
438  exint newsize;
439  coerceValue(newsize, value);
440  if (newsize < 0) newsize = 0;
441  myNumrenames.setSize(newsize);
442  }
443  else
444  {
445  if (instance[0] < 0)
446  return;
447  myNumrenames.setSizeIfNeeded(instance[0]+1);
448  auto && _data = myNumrenames(instance[0]);
449  switch (idx[1])
450  {
451  case 0:
452  coerceValue(_data.enable, value);
453  break;
454  case 1:
455  coerceValue(_data.global, value);
456  break;
457  case 2:
458  coerceValue(_data.from, value);
459  break;
460  case 3:
461  coerceValue(_data.to, value);
462  break;
463 
464  }
465  }
466  break;
467 
468  }
469  }
470 
471  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
472  { doSetParmValue(idx, instance, value); }
473  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
474  { doSetParmValue(idx, instance, value); }
475  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
476  { doSetParmValue(idx, instance, value); }
477  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
478  { doSetParmValue(idx, instance, value); }
479  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
480  { doSetParmValue(idx, instance, value); }
481  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
482  { doSetParmValue(idx, instance, value); }
483  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
484  { doSetParmValue(idx, instance, value); }
485  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
486  { doSetParmValue(idx, instance, value); }
487  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
488  { doSetParmValue(idx, instance, value); }
489  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
490  { doSetParmValue(idx, instance, value); }
491  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
492  { doSetParmValue(idx, instance, value); }
493 
494  exint getNestNumParms(TempIndex idx) const override
495  {
496  if (idx.size() == 0)
497  return 6;
498  switch (idx[0])
499  {
500  case 4:
501  return 2;
502  case 5:
503  return 4;
504 
505  }
506  // Invalid
507  return 0;
508  }
509 
510  const char *getNestParmName(TempIndex fieldnum) const override
511  {
512  if (fieldnum.size() < 1)
513  return 0;
514  switch (fieldnum[0])
515  {
516  case 0:
517  return "attribname";
518  case 1:
519  return "class";
520  case 2:
521  return "donamefromgroup";
522  case 3:
523  return "namefromgroupmask";
524  case 4:
525  if (fieldnum.size() == 1)
526  return "numnames";
527  switch (fieldnum[1])
528  {
529  case 0:
530  return "group#";
531  case 1:
532  return "name#";
533 
534  }
535  return 0;
536  case 5:
537  if (fieldnum.size() == 1)
538  return "numrenames";
539  switch (fieldnum[1])
540  {
541  case 0:
542  return "enable#";
543  case 1:
544  return "global#";
545  case 2:
546  return "from#";
547  case 3:
548  return "to#";
549 
550  }
551  return 0;
552 
553  }
554  return 0;
555  }
556 
557  ParmType getNestParmType(TempIndex fieldnum) const override
558  {
559  if (fieldnum.size() < 1)
560  return PARM_UNSUPPORTED;
561  switch (fieldnum[0])
562  {
563  case 0:
564  return PARM_STRING;
565  case 1:
566  return PARM_INTEGER;
567  case 2:
568  return PARM_INTEGER;
569  case 3:
570  return PARM_STRING;
571  case 4:
572  if (fieldnum.size() == 1)
573  return PARM_MULTIPARM;
574  switch (fieldnum[1])
575  {
576  case 0:
577  return PARM_STRING;
578  case 1:
579  return PARM_STRING;
580 
581  }
582  return PARM_UNSUPPORTED;
583  case 5:
584  if (fieldnum.size() == 1)
585  return PARM_MULTIPARM;
586  switch (fieldnum[1])
587  {
588  case 0:
589  return PARM_INTEGER;
590  case 1:
591  return PARM_INTEGER;
592  case 2:
593  return PARM_STRING;
594  case 3:
595  return PARM_STRING;
596 
597  }
598  return PARM_UNSUPPORTED;
599 
600  }
601  return PARM_UNSUPPORTED;
602  }
603 
604  // Boiler plate to load individual types.
605  static void loadData(UT_IStream &is, int64 &v)
606  { is.bread(&v, 1); }
607  static void loadData(UT_IStream &is, bool &v)
608  { int64 iv; is.bread(&iv, 1); v = iv; }
609  static void loadData(UT_IStream &is, fpreal64 &v)
610  { is.bread<fpreal64>(&v, 1); }
611  static void loadData(UT_IStream &is, UT_Vector2D &v)
612  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
613  static void loadData(UT_IStream &is, UT_Vector3D &v)
614  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
615  is.bread<fpreal64>(&v.z(), 1); }
616  static void loadData(UT_IStream &is, UT_Vector4D &v)
617  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
618  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
619  static void loadData(UT_IStream &is, UT_Matrix2D &v)
620  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
621  static void loadData(UT_IStream &is, UT_Matrix3D &v)
622  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
623  static void loadData(UT_IStream &is, UT_Matrix4D &v)
624  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
625  static void loadData(UT_IStream &is, UT_Vector2I &v)
626  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
627  static void loadData(UT_IStream &is, UT_Vector3I &v)
628  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
629  is.bread<int64>(&v.z(), 1); }
630  static void loadData(UT_IStream &is, UT_Vector4I &v)
631  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
632  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
634  { is.bread(v); }
636  { UT_StringHolder rampdata;
637  loadData(is, rampdata);
638  if (rampdata.isstring())
639  {
640  v.reset(new UT_Ramp());
641  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
642  v->load(istr);
643  }
644  else v.reset();
645  }
648  loadData(is, data);
649  if (data.isstring())
650  {
651  // Find the data type.
652  const char *colon = UT_StringWrap(data).findChar(':');
653  if (colon)
654  {
655  int typelen = colon - data.buffer();
657  type.strncpy(data.buffer(), typelen);
658  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
659 
660  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
661  }
662  }
663  else v.reset();
664  }
665 
666  static void saveData(std::ostream &os, int64 v)
667  { UTwrite(os, &v); }
668  static void saveData(std::ostream &os, bool v)
669  { int64 iv = v; UTwrite(os, &iv); }
670  static void saveData(std::ostream &os, fpreal64 v)
671  { UTwrite<fpreal64>(os, &v); }
672  static void saveData(std::ostream &os, UT_Vector2D v)
673  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
674  static void saveData(std::ostream &os, UT_Vector3D v)
675  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
676  UTwrite<fpreal64>(os, &v.z()); }
677  static void saveData(std::ostream &os, UT_Vector4D v)
678  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
679  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
680  static void saveData(std::ostream &os, UT_Matrix2D v)
682  static void saveData(std::ostream &os, UT_Matrix3D v)
684  static void saveData(std::ostream &os, UT_Matrix4D v)
686  static void saveData(std::ostream &os, UT_StringHolder s)
687  { UT_StringWrap(s).saveBinary(os); }
688  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
690  UT_OStringStream ostr;
691  if (s) s->save(ostr);
692  result = ostr.str();
693  saveData(os, result);
694  }
695  static void saveData(std::ostream &os, PRM_DataItemHandle s)
697  UT_OStringStream ostr;
698  if (s)
699  {
700  ostr << s->getDataTypeToken();
701  ostr << ":";
702  s->saveBinary(ostr);
703  }
704  result = ostr.str();
705  saveData(os, result);
706  }
707 
708 
709  void save(std::ostream &os) const
710  {
711  int32 v = version();
712  UTwrite(os, &v);
713  saveData(os, myAttribname);
714  saveData(os, myClass);
715  saveData(os, myDonamefromgroup);
716  saveData(os, myNamefromgroupmask);
717  {
718  int64 length = myNumnames.entries();
719  UTwrite(os, &length);
720  for (exint i = 0; i < length; i++)
721  {
722  auto && _curentry = myNumnames(i);
723  (void) _curentry;
724  saveData(os, _curentry.group);
725  saveData(os, _curentry.name);
726 
727  }
728  }
729  {
730  int64 length = myNumrenames.entries();
731  UTwrite(os, &length);
732  for (exint i = 0; i < length; i++)
733  {
734  auto && _curentry = myNumrenames(i);
735  (void) _curentry;
736  saveData(os, _curentry.enable);
737  saveData(os, _curentry.global);
738  saveData(os, _curentry.from);
739  saveData(os, _curentry.to);
740 
741  }
742  }
743 
744  }
745 
746  bool load(UT_IStream &is)
747  {
748  int32 v;
749  is.bread(&v, 1);
750  if (version() != v)
751  {
752  // Fail incompatible versions
753  return false;
754  }
755  loadData(is, myAttribname);
756  loadData(is, myClass);
757  loadData(is, myDonamefromgroup);
758  loadData(is, myNamefromgroupmask);
759  {
760  int64 length;
761  is.read(&length, 1);
762  myNumnames.setSize(length);
763  for (exint i = 0; i < length; i++)
764  {
765  auto && _curentry = myNumnames(i);
766  (void) _curentry;
767  loadData(is, _curentry.group);
768  loadData(is, _curentry.name);
769 
770  }
771  }
772  {
773  int64 length;
774  is.read(&length, 1);
775  myNumrenames.setSize(length);
776  for (exint i = 0; i < length; i++)
777  {
778  auto && _curentry = myNumrenames(i);
779  (void) _curentry;
780  loadData(is, _curentry.enable);
781  loadData(is, _curentry.global);
782  loadData(is, _curentry.from);
783  loadData(is, _curentry.to);
784 
785  }
786  }
787 
788  return true;
789  }
790 
791  const UT_StringHolder & getAttribname() const { return myAttribname; }
792  void setAttribname(const UT_StringHolder & val) { myAttribname = val; }
794  {
795  SOP_Node *thissop = cookparms.getNode();
796  if (!thissop) return getAttribname();
798  OP_Utils::evalOpParm(result, thissop, "attribname", cookparms.getCookTime(), 0);
799  return result;
800  }
801  Class getClass() const { return Class(myClass); }
802  void setClass(Class val) { myClass = int64(val); }
803  Class opClass(const SOP_NodeVerb::CookParms &cookparms) const
804  {
805  SOP_Node *thissop = cookparms.getNode();
806  if (!thissop) return getClass();
807  int64 result;
808  OP_Utils::evalOpParm(result, thissop, "class", cookparms.getCookTime(), 0);
809  return Class(result);
810  }
811  bool getDonamefromgroup() const { return myDonamefromgroup; }
812  void setDonamefromgroup(bool val) { myDonamefromgroup = val; }
813  bool opDonamefromgroup(const SOP_NodeVerb::CookParms &cookparms) const
814  {
815  SOP_Node *thissop = cookparms.getNode();
816  if (!thissop) return getDonamefromgroup();
817  bool result;
818  OP_Utils::evalOpParm(result, thissop, "donamefromgroup", cookparms.getCookTime(), 0);
819  return result;
820  }
821  const UT_StringHolder & getNamefromgroupmask() const { return myNamefromgroupmask; }
822  void setNamefromgroupmask(const UT_StringHolder & val) { myNamefromgroupmask = val; }
824  {
825  SOP_Node *thissop = cookparms.getNode();
826  if (!thissop) return getNamefromgroupmask();
828  OP_Utils::evalOpParm(result, thissop, "namefromgroupmask", cookparms.getCookTime(), 0);
829  return result;
830  }
831  const UT_Array<Numnames> &getNumnames() const { return myNumnames; }
832 void setNumnames(const UT_Array<Numnames> &val) { myNumnames = val; }
833  exint opNumnames(const SOP_NodeVerb::CookParms &cookparms) const
834  {
835  SOP_Node *thissop = cookparms.getNode();
836  if (!thissop) return getNumnames().entries();
837  exint result;
838  OP_Utils::evalOpParm(result, thissop, "numnames", cookparms.getCookTime(), 0);
839  return result;
840  }
841  UT_StringHolder opNumnames_group(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
842  { return opinstNumnames_group(cookparms, &_idx); }
843  UT_StringHolder opinstNumnames_group(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
844  {
845  SOP_Node *thissop = cookparms.getNode();
846  if (!thissop) return (myNumnames(_idx[0]).group);
847  int _parmidx[2-1];
848  _parmidx[1-1] = _idx[1-1] + 1;
849 
851  OP_Utils::evalOpParmInst(result, thissop, "group#", _parmidx, cookparms.getCookTime(), 0, 2-1);
852  return (result);
853  }
854  UT_StringHolder opNumnames_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
855  { return opinstNumnames_name(cookparms, &_idx); }
856  UT_StringHolder opinstNumnames_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
857  {
858  SOP_Node *thissop = cookparms.getNode();
859  if (!thissop) return (myNumnames(_idx[0]).name);
860  int _parmidx[2-1];
861  _parmidx[1-1] = _idx[1-1] + 1;
862 
864  OP_Utils::evalOpParmInst(result, thissop, "name#", _parmidx, cookparms.getCookTime(), 0, 2-1);
865  return (result);
866  }
867 
868  const UT_Array<Numrenames> &getNumrenames() const { return myNumrenames; }
869 void setNumrenames(const UT_Array<Numrenames> &val) { myNumrenames = val; }
871  {
872  SOP_Node *thissop = cookparms.getNode();
873  if (!thissop) return getNumrenames().entries();
874  exint result;
875  OP_Utils::evalOpParm(result, thissop, "numrenames", cookparms.getCookTime(), 0);
876  return result;
877  }
878  bool opNumrenames_enable(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
879  { return opinstNumrenames_enable(cookparms, &_idx); }
880  bool opinstNumrenames_enable(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
881  {
882  SOP_Node *thissop = cookparms.getNode();
883  if (!thissop) return (myNumrenames(_idx[0]).enable);
884  int _parmidx[2-1];
885  _parmidx[1-1] = _idx[1-1] + 1;
886 
887  bool result;
888  OP_Utils::evalOpParmInst(result, thissop, "enable#", _parmidx, cookparms.getCookTime(), 0, 2-1);
889  return (result);
890  }
891  bool opNumrenames_global(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
892  { return opinstNumrenames_global(cookparms, &_idx); }
893  bool opinstNumrenames_global(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
894  {
895  SOP_Node *thissop = cookparms.getNode();
896  if (!thissop) return (myNumrenames(_idx[0]).global);
897  int _parmidx[2-1];
898  _parmidx[1-1] = _idx[1-1] + 1;
899 
900  bool result;
901  OP_Utils::evalOpParmInst(result, thissop, "global#", _parmidx, cookparms.getCookTime(), 0, 2-1);
902  return (result);
903  }
905  { return opinstNumrenames_from(cookparms, &_idx); }
906  UT_StringHolder opinstNumrenames_from(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
907  {
908  SOP_Node *thissop = cookparms.getNode();
909  if (!thissop) return (myNumrenames(_idx[0]).from);
910  int _parmidx[2-1];
911  _parmidx[1-1] = _idx[1-1] + 1;
912 
914  OP_Utils::evalOpParmInst(result, thissop, "from#", _parmidx, cookparms.getCookTime(), 0, 2-1);
915  return (result);
916  }
917  UT_StringHolder opNumrenames_to(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
918  { return opinstNumrenames_to(cookparms, &_idx); }
919  UT_StringHolder opinstNumrenames_to(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
920  {
921  SOP_Node *thissop = cookparms.getNode();
922  if (!thissop) return (myNumrenames(_idx[0]).to);
923  int _parmidx[2-1];
924  _parmidx[1-1] = _idx[1-1] + 1;
925 
927  OP_Utils::evalOpParmInst(result, thissop, "to#", _parmidx, cookparms.getCookTime(), 0, 2-1);
928  return (result);
929  }
930 
931 
932 private:
933  UT_StringHolder myAttribname;
934  int64 myClass;
935  bool myDonamefromgroup;
936  UT_StringHolder myNamefromgroupmask;
937  UT_Array<Numnames> myNumnames;
938  UT_Array<Numrenames> myNumrenames;
939 
940 };
type
Definition: core.h:556
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:63
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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:303
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:655
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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
UT_StringHolder group
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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