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