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