HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_PackFolder.proto.h
Go to the documentation of this file.
1 /* Automagically Generated by generate_proto.py
2  * Do not Edit
3  */
4 #pragma once
5 
6 #include <SOP/SOP_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <SOP/SOP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_PackFolderEnums
24 {
25  enum class Method
26  {
27  ADDREPLACE = 0,
28  ADDKEEP,
29  REPLACE
30  };
31  enum class Visible
32  {
33  DEFAULT = 0,
34  FOLDER
35  };
36  enum class Treatasfolder
37  {
38  DEFAULT = 0,
39  FOLDER
40  };
41 }
42 
43 
45 {
46 public:
47  static int version() { return 1; }
48  struct Names
49  {
50  bool useinput;
55 
56 
58  {
59  useinput = true;
60  name = ""_UTsh;
61  type = ""_UTsh;
62  visible = 0;
63  treatasfolder = 0;
64 
65  }
66 
67  bool operator==(const Names &src) const
68  {
69  if (useinput != src.useinput) return false;
70  if (name != src.name) return false;
71  if (type != src.type) return false;
72  if (visible != src.visible) return false;
73  if (treatasfolder != src.treatasfolder) return false;
74 
75  return true;
76  }
77  bool operator!=(const Names &src) const
78  {
79  return !operator==(src);
80  }
81 
82  };
83 
85  {
87 
88  buf.strcat("[ ");
89  for (int i = 0; i < list.entries(); i++)
90  {
91  if (i)
92  buf.strcat(", ");
93  buf.strcat("( ");
94  buf.append("");
95  buf.appendSprintf("%s", (list(i).useinput) ? "true" : "false");
96  buf.append(", ");
97  { UT_String tmp; tmp = UT_StringWrap(list(i).name).makeQuotedString('"'); buf.strcat(tmp); }
98  buf.append(", ");
99  { UT_String tmp; tmp = UT_StringWrap(list(i).type).makeQuotedString('"'); buf.strcat(tmp); }
100  buf.append(", ");
101  buf.appendSprintf("%d", (int) list(i).visible);
102  buf.append(", ");
103  buf.appendSprintf("%d", (int) list(i).treatasfolder);
104 
105  buf.strcat(" )");
106  }
107  buf.strcat(" ]");
108 
110  return result;
111  }
112 
114  {
115  myFolder = "/"_UTsh;
116  myMethod = 0;
117  myPack = true;
118  myOnlyPackUnpacked = false;
119  myIgnoreEmpty = false;
120  myNames.setSize(0);
121 
122  }
123 
124  explicit SOP_PackFolderParms(const SOP_PackFolderParms &) = default;
126  SOP_PackFolderParms(SOP_PackFolderParms &&) noexcept = default;
127  SOP_PackFolderParms &operator=(SOP_PackFolderParms &&) noexcept = default;
128 
129  ~SOP_PackFolderParms() override {}
130 
131  bool operator==(const SOP_PackFolderParms &src) const
132  {
133  if (myFolder != src.myFolder) return false;
134  if (myMethod != src.myMethod) return false;
135  if (myPack != src.myPack) return false;
136  if (myOnlyPackUnpacked != src.myOnlyPackUnpacked) return false;
137  if (myIgnoreEmpty != src.myIgnoreEmpty) return false;
138  if (myNames != src.myNames) return false;
139 
140  return true;
141  }
142  bool operator!=(const SOP_PackFolderParms &src) const
143  {
144  return !operator==(src);
145  }
149 
150 
151 
152  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
153  {
154  myFolder = "/"_UTsh;
155  if (true)
156  graph->evalOpParm(myFolder, nodeidx, "folder", time, 0);
157  myMethod = 0;
158  if (true)
159  graph->evalOpParm(myMethod, nodeidx, "method", time, 0);
160  myPack = true;
161  if (true)
162  graph->evalOpParm(myPack, nodeidx, "pack", time, 0);
163  myOnlyPackUnpacked = false;
164  if (true && ( (true&&!(((getPack()!=1)))) ) )
165  graph->evalOpParm(myOnlyPackUnpacked, nodeidx, "onlypackunpacked", time, 0);
166  myIgnoreEmpty = false;
167  if (true)
168  graph->evalOpParm(myIgnoreEmpty, nodeidx, "ignoreempty", time, 0);
169  if (true)
170  {
171  int64 length = 0;
172  graph->evalOpParm(length, nodeidx, "names", time, 0);
173  if (length < 0) length = 0;
174  myNames.setSize(length);
175  for (exint i = 0; i < length; i++)
176  {
177  int parmidx[1];
178  int offsets[1];
179  parmidx[0] = i+1;
180  offsets[0] = 1;
181  auto && _curentry = myNames(i);
182  (void) _curentry;
183  _curentry.useinput = true;
184  if (true)
185  graph->evalOpParmInst(_curentry.useinput, nodeidx, "useinput#", parmidx, offsets, time, 0, 2-1);
186  _curentry.name = ""_UTsh;
187  if (true)
188  graph->evalOpParmInst(_curentry.name, nodeidx, "name#", parmidx, offsets, time, 0, 2-1);
189  _curentry.type = ""_UTsh;
190  if (true)
191  graph->evalOpParmInst(_curentry.type, nodeidx, "type#", parmidx, offsets, time, 0, 2-1);
192  _curentry.visible = 0;
193  if (true)
194  graph->evalOpParmInst(_curentry.visible, nodeidx, "visible#", parmidx, offsets, time, 0, 2-1);
195  _curentry.treatasfolder = 0;
196  if (true && ( (true&&!(((_curentry.type=="shp"))||((_curentry.type=="skel"))||((_curentry.type=="rig"))||((_curentry.type=="ctrl"))||((_curentry.type=="char"))||((_curentry.type=="graph")))) ) )
197  graph->evalOpParmInst(_curentry.treatasfolder, nodeidx, "treatasfolder#", parmidx, offsets, time, 0, 2-1);
198 
199  }
200  }
201  else
202  myNames.clear();
203 
204  }
205 
206 
207  void loadFromOpSubclass(const LoadParms &loadparms) override
208  {
209  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
210  }
211 
212 
213  void copyFrom(const OP_NodeParms *src) override
214  {
215  *this = *((const SOP_PackFolderParms *)src);
216  }
217 
218  template <typename T>
219  void
220  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
221  {
222  if (idx.size() < 1)
223  return;
224  UT_ASSERT(idx.size() == instance.size()+1);
225  if (idx.size() != instance.size()+1)
226  return;
227  switch (idx[0])
228  {
229  case 0:
230  coerceValue(value, myFolder);
231  break;
232  case 1:
233  coerceValue(value, myMethod);
234  break;
235  case 2:
236  coerceValue(value, myPack);
237  break;
238  case 3:
239  coerceValue(value, myOnlyPackUnpacked);
240  break;
241  case 4:
242  coerceValue(value, myIgnoreEmpty);
243  break;
244  case 5:
245  if (idx.size() == 1)
246  coerceValue(value, myNames.entries());
247  else if (instance[0] < myNames.entries())
248  {
249  auto && _data = myNames(instance[0]);
250  switch (idx[1])
251  {
252  case 0:
253  coerceValue(value, _data.useinput);
254  break;
255  case 1:
256  coerceValue(value, _data.name);
257  break;
258  case 2:
259  coerceValue(value, _data.type);
260  break;
261  case 3:
262  coerceValue(value, _data.visible);
263  break;
264  case 4:
265  coerceValue(value, _data.treatasfolder);
266  break;
267 
268  }
269  }
270  break;
271 
272  }
273  }
274 
275  bool isParmColorRamp(exint idx) const override
276  {
277  switch (idx)
278  {
279 
280  }
281  return false;
282  }
283 
284  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
285  { doGetParmValue(idx, instance, value); }
286  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
287  { doGetParmValue(idx, instance, value); }
288  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
289  { doGetParmValue(idx, instance, value); }
290  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
291  { doGetParmValue(idx, instance, value); }
292  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
293  { doGetParmValue(idx, instance, value); }
294  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
299  { doGetParmValue(idx, instance, value); }
300  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
305  { doGetParmValue(idx, instance, value); }
306 
307  template <typename T>
308  void
309  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
310  {
311  if (idx.size() < 1)
312  return;
313  UT_ASSERT(idx.size() == instance.size()+1);
314  if (idx.size() != instance.size()+1)
315  return;
316  switch (idx[0])
317  {
318  case 0:
319  coerceValue(myFolder, ( ( value ) ));
320  break;
321  case 1:
322  coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
323  break;
324  case 2:
325  coerceValue(myPack, ( ( value ) ));
326  break;
327  case 3:
328  coerceValue(myOnlyPackUnpacked, ( ( value ) ));
329  break;
330  case 4:
331  coerceValue(myIgnoreEmpty, ( ( value ) ));
332  break;
333  case 5:
334  if (idx.size() == 1)
335  {
336  exint newsize;
337  coerceValue(newsize, value);
338  if (newsize < 0) newsize = 0;
339  myNames.setSize(newsize);
340  }
341  else
342  {
343  if (instance[0] < 0)
344  return;
345  myNames.setSizeIfNeeded(instance[0]+1);
346  auto && _data = myNames(instance[0]);
347  switch (idx[1])
348  {
349  case 0:
350  coerceValue(_data.useinput, value);
351  break;
352  case 1:
353  coerceValue(_data.name, value);
354  break;
355  case 2:
356  coerceValue(_data.type, value);
357  break;
358  case 3:
359  coerceValue(_data.visible, value);
360  break;
361  case 4:
362  coerceValue(_data.treatasfolder, value);
363  break;
364 
365  }
366  }
367  break;
368 
369  }
370  }
371 
372  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
373  { doSetParmValue(idx, instance, value); }
374  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
375  { doSetParmValue(idx, instance, value); }
376  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
377  { doSetParmValue(idx, instance, value); }
378  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
379  { doSetParmValue(idx, instance, value); }
380  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
381  { doSetParmValue(idx, instance, value); }
382  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
383  { doSetParmValue(idx, instance, value); }
384  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
385  { doSetParmValue(idx, instance, value); }
386  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
387  { doSetParmValue(idx, instance, value); }
388  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
389  { doSetParmValue(idx, instance, value); }
390  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
391  { doSetParmValue(idx, instance, value); }
392  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
393  { doSetParmValue(idx, instance, value); }
394 
395  exint getNestNumParms(TempIndex idx) const override
396  {
397  if (idx.size() == 0)
398  return 6;
399  switch (idx[0])
400  {
401  case 5:
402  return 5;
403 
404  }
405  // Invalid
406  return 0;
407  }
408 
409  const char *getNestParmName(TempIndex fieldnum) const override
410  {
411  if (fieldnum.size() < 1)
412  return 0;
413  switch (fieldnum[0])
414  {
415  case 0:
416  return "folder";
417  case 1:
418  return "method";
419  case 2:
420  return "pack";
421  case 3:
422  return "onlypackunpacked";
423  case 4:
424  return "ignoreempty";
425  case 5:
426  if (fieldnum.size() == 1)
427  return "names";
428  switch (fieldnum[1])
429  {
430  case 0:
431  return "useinput#";
432  case 1:
433  return "name#";
434  case 2:
435  return "type#";
436  case 3:
437  return "visible#";
438  case 4:
439  return "treatasfolder#";
440 
441  }
442  return 0;
443 
444  }
445  return 0;
446  }
447 
448  ParmType getNestParmType(TempIndex fieldnum) const override
449  {
450  if (fieldnum.size() < 1)
451  return PARM_UNSUPPORTED;
452  switch (fieldnum[0])
453  {
454  case 0:
455  return PARM_STRING;
456  case 1:
457  return PARM_INTEGER;
458  case 2:
459  return PARM_INTEGER;
460  case 3:
461  return PARM_INTEGER;
462  case 4:
463  return PARM_INTEGER;
464  case 5:
465  if (fieldnum.size() == 1)
466  return PARM_MULTIPARM;
467  switch (fieldnum[1])
468  {
469  case 0:
470  return PARM_INTEGER;
471  case 1:
472  return PARM_STRING;
473  case 2:
474  return PARM_STRING;
475  case 3:
476  return PARM_INTEGER;
477  case 4:
478  return PARM_INTEGER;
479 
480  }
481  return PARM_UNSUPPORTED;
482 
483  }
484  return PARM_UNSUPPORTED;
485  }
486 
487  // Boiler plate to load individual types.
488  static void loadData(UT_IStream &is, int64 &v)
489  { is.bread(&v, 1); }
490  static void loadData(UT_IStream &is, bool &v)
491  { int64 iv; is.bread(&iv, 1); v = iv; }
492  static void loadData(UT_IStream &is, fpreal64 &v)
493  { is.bread<fpreal64>(&v, 1); }
494  static void loadData(UT_IStream &is, UT_Vector2D &v)
495  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
496  static void loadData(UT_IStream &is, UT_Vector3D &v)
497  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
498  is.bread<fpreal64>(&v.z(), 1); }
499  static void loadData(UT_IStream &is, UT_Vector4D &v)
500  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
501  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
502  static void loadData(UT_IStream &is, UT_Matrix2D &v)
503  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
504  static void loadData(UT_IStream &is, UT_Matrix3D &v)
505  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
506  static void loadData(UT_IStream &is, UT_Matrix4D &v)
507  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
508  static void loadData(UT_IStream &is, UT_Vector2I &v)
509  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
510  static void loadData(UT_IStream &is, UT_Vector3I &v)
511  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
512  is.bread<int64>(&v.z(), 1); }
513  static void loadData(UT_IStream &is, UT_Vector4I &v)
514  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
515  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
517  { is.bread(v); }
519  { UT_StringHolder rampdata;
520  loadData(is, rampdata);
521  if (rampdata.isstring())
522  {
523  v.reset(new UT_Ramp());
524  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
525  v->load(istr);
526  }
527  else v.reset();
528  }
531  loadData(is, data);
532  if (data.isstring())
533  {
534  // Find the data type.
535  const char *colon = UT_StringWrap(data).findChar(':');
536  if (colon)
537  {
538  int typelen = colon - data.buffer();
540  type.strncpy(data.buffer(), typelen);
541  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
542 
543  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
544  }
545  }
546  else v.reset();
547  }
548 
549  static void saveData(std::ostream &os, int64 v)
550  { UTwrite(os, &v); }
551  static void saveData(std::ostream &os, bool v)
552  { int64 iv = v; UTwrite(os, &iv); }
553  static void saveData(std::ostream &os, fpreal64 v)
554  { UTwrite<fpreal64>(os, &v); }
555  static void saveData(std::ostream &os, UT_Vector2D v)
556  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
557  static void saveData(std::ostream &os, UT_Vector3D v)
558  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
559  UTwrite<fpreal64>(os, &v.z()); }
560  static void saveData(std::ostream &os, UT_Vector4D v)
561  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
562  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
563  static void saveData(std::ostream &os, UT_Matrix2D v)
565  static void saveData(std::ostream &os, UT_Matrix3D v)
567  static void saveData(std::ostream &os, UT_Matrix4D v)
569  static void saveData(std::ostream &os, UT_StringHolder s)
570  { UT_StringWrap(s).saveBinary(os); }
571  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
573  UT_OStringStream ostr;
574  if (s) s->save(ostr);
575  result = ostr.str();
576  saveData(os, result);
577  }
578  static void saveData(std::ostream &os, PRM_DataItemHandle s)
580  UT_OStringStream ostr;
581  if (s)
582  {
583  ostr << s->getDataTypeToken();
584  ostr << ":";
585  s->saveBinary(ostr);
586  }
587  result = ostr.str();
588  saveData(os, result);
589  }
590 
591 
592  void save(std::ostream &os) const
593  {
594  int32 v = version();
595  UTwrite(os, &v);
596  saveData(os, myFolder);
597  saveData(os, myMethod);
598  saveData(os, myPack);
599  saveData(os, myOnlyPackUnpacked);
600  saveData(os, myIgnoreEmpty);
601  {
602  int64 length = myNames.entries();
603  UTwrite(os, &length);
604  for (exint i = 0; i < length; i++)
605  {
606  auto && _curentry = myNames(i);
607  (void) _curentry;
608  saveData(os, _curentry.useinput);
609  saveData(os, _curentry.name);
610  saveData(os, _curentry.type);
611  saveData(os, _curentry.visible);
612  saveData(os, _curentry.treatasfolder);
613 
614  }
615  }
616 
617  }
618 
619  bool load(UT_IStream &is)
620  {
621  int32 v;
622  is.bread(&v, 1);
623  if (version() != v)
624  {
625  // Fail incompatible versions
626  return false;
627  }
628  loadData(is, myFolder);
629  loadData(is, myMethod);
630  loadData(is, myPack);
631  loadData(is, myOnlyPackUnpacked);
632  loadData(is, myIgnoreEmpty);
633  {
634  int64 length;
635  is.read(&length, 1);
636  myNames.setSize(length);
637  for (exint i = 0; i < length; i++)
638  {
639  auto && _curentry = myNames(i);
640  (void) _curentry;
641  loadData(is, _curentry.useinput);
642  loadData(is, _curentry.name);
643  loadData(is, _curentry.type);
644  loadData(is, _curentry.visible);
645  loadData(is, _curentry.treatasfolder);
646 
647  }
648  }
649 
650  return true;
651  }
652 
653  const UT_StringHolder & getFolder() const { return myFolder; }
654  void setFolder(const UT_StringHolder & val) { myFolder = val; }
656  {
657  SOP_Node *thissop = cookparms.getNode();
658  if (!thissop) return getFolder();
660  OP_Utils::evalOpParm(result, thissop, "folder", cookparms.getCookTime(), 0);
661  return result;
662  }
663  Method getMethod() const { return Method(myMethod); }
664  void setMethod(Method val) { myMethod = int64(val); }
665  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
666  {
667  SOP_Node *thissop = cookparms.getNode();
668  if (!thissop) return getMethod();
669  int64 result;
670  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
671  return Method(result);
672  }
673  bool getPack() const { return myPack; }
674  void setPack(bool val) { myPack = val; }
675  bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
676  {
677  SOP_Node *thissop = cookparms.getNode();
678  if (!thissop) return getPack();
679  bool result;
680  OP_Utils::evalOpParm(result, thissop, "pack", cookparms.getCookTime(), 0);
681  return result;
682  }
683  bool getOnlyPackUnpacked() const { return myOnlyPackUnpacked; }
684  void setOnlyPackUnpacked(bool val) { myOnlyPackUnpacked = val; }
685  bool opOnlyPackUnpacked(const SOP_NodeVerb::CookParms &cookparms) const
686  {
687  SOP_Node *thissop = cookparms.getNode();
688  if (!thissop) return getOnlyPackUnpacked();
689  bool result;
690  OP_Utils::evalOpParm(result, thissop, "onlypackunpacked", cookparms.getCookTime(), 0);
691  return result;
692  }
693  bool getIgnoreEmpty() const { return myIgnoreEmpty; }
694  void setIgnoreEmpty(bool val) { myIgnoreEmpty = val; }
695  bool opIgnoreEmpty(const SOP_NodeVerb::CookParms &cookparms) const
696  {
697  SOP_Node *thissop = cookparms.getNode();
698  if (!thissop) return getIgnoreEmpty();
699  bool result;
700  OP_Utils::evalOpParm(result, thissop, "ignoreempty", cookparms.getCookTime(), 0);
701  return result;
702  }
703  const UT_Array<Names> &getNames() const { return myNames; }
704 void setNames(const UT_Array<Names> &val) { myNames = val; }
705  exint opNames(const SOP_NodeVerb::CookParms &cookparms) const
706  {
707  SOP_Node *thissop = cookparms.getNode();
708  if (!thissop) return getNames().entries();
709  exint result;
710  OP_Utils::evalOpParm(result, thissop, "names", cookparms.getCookTime(), 0);
711  return result;
712  }
713  bool opNames_useinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
714  { return opinstNames_useinput(cookparms, &_idx); }
715  bool opinstNames_useinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
716  {
717  SOP_Node *thissop = cookparms.getNode();
718  if (!thissop) return (myNames(_idx[0]).useinput);
719  int _parmidx[2-1];
720  _parmidx[1-1] = _idx[1-1] + 1;
721 
722  bool result;
723  OP_Utils::evalOpParmInst(result, thissop, "useinput#", _parmidx, cookparms.getCookTime(), 0, 2-1);
724  return (result);
725  }
726  UT_StringHolder opNames_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
727  { return opinstNames_name(cookparms, &_idx); }
728  UT_StringHolder opinstNames_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return (myNames(_idx[0]).name);
732  int _parmidx[2-1];
733  _parmidx[1-1] = _idx[1-1] + 1;
734 
736  OP_Utils::evalOpParmInst(result, thissop, "name#", _parmidx, cookparms.getCookTime(), 0, 2-1);
737  return (result);
738  }
739  UT_StringHolder opNames_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
740  { return opinstNames_type(cookparms, &_idx); }
741  UT_StringHolder opinstNames_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
742  {
743  SOP_Node *thissop = cookparms.getNode();
744  if (!thissop) return (myNames(_idx[0]).type);
745  int _parmidx[2-1];
746  _parmidx[1-1] = _idx[1-1] + 1;
747 
749  OP_Utils::evalOpParmInst(result, thissop, "type#", _parmidx, cookparms.getCookTime(), 0, 2-1);
750  return (result);
751  }
752  int64 opNames_visible(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
753  { return opinstNames_visible(cookparms, &_idx); }
754  int64 opinstNames_visible(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
755  {
756  SOP_Node *thissop = cookparms.getNode();
757  if (!thissop) return (myNames(_idx[0]).visible);
758  int _parmidx[2-1];
759  _parmidx[1-1] = _idx[1-1] + 1;
760 
761  int64 result;
762  OP_Utils::evalOpParmInst(result, thissop, "visible#", _parmidx, cookparms.getCookTime(), 0, 2-1);
763  return (result);
764  }
765  int64 opNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
766  { return opinstNames_treatasfolder(cookparms, &_idx); }
767  int64 opinstNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
768  {
769  SOP_Node *thissop = cookparms.getNode();
770  if (!thissop) return (myNames(_idx[0]).treatasfolder);
771  int _parmidx[2-1];
772  _parmidx[1-1] = _idx[1-1] + 1;
773 
774  int64 result;
775  OP_Utils::evalOpParmInst(result, thissop, "treatasfolder#", _parmidx, cookparms.getCookTime(), 0, 2-1);
776  return (result);
777  }
778 
779 
780 private:
781  UT_StringHolder myFolder;
782  int64 myMethod;
783  bool myPack;
784  bool myOnlyPackUnpacked;
785  bool myIgnoreEmpty;
786  UT_Array<Names> myNames;
787 
788 };
int64 opNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
exint getNestNumParms(TempIndex idx) const override
void setOnlyPackUnpacked(bool val)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool opNames_useinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool opIgnoreEmpty(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
bool load(UT_IStream &is)
bool operator!=(const SOP_PackFolderParms &src) const
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, UT_Matrix4D v)
void
Definition: png.h:1083
bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
void setIgnoreEmpty(bool val)
bool opinstNames_useinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
bool getOnlyPackUnpacked() const
void setFolder(const UT_StringHolder &val)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
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_Matrix2D &value) const override
**But if you need a result
Definition: thread.h:613
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
bool opOnlyPackUnpacked(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
int64 opNames_visible(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_StringHolder opFolder(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getFolder() const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void saveData(std::ostream &os, UT_Matrix2D v)
exint length() const
static void saveData(std::ostream &os, int64 v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
UT_StringHolder opNames_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
bool operator==(const SOP_PackFolderParms &src) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void setMethod(Method 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 saveData(std::ostream &os, UT_Vector4D v)
UT_StringHolder createString(const UT_Array< Names > &list) const
bool operator!=(const Names &src) const
static void saveData(std::ostream &os, UT_Vector3D v)
GLuint const GLchar * name
Definition: glcorearb.h:786
void save(std::ostream &os) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
int64 opinstNames_visible(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
GT_API const UT_StringHolder version
void setNames(const UT_Array< Names > &val)
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define SOP_API
Definition: SOP_API.h:10
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
const char * getNestParmName(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
const char * findChar(int c) const
Definition: UT_String.h:1385
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
UT_StringHolder opinstNames_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
Definition: core.h:1131
bool operator==(const Names &src) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
GLboolean r
Definition: glcorearb.h:1222
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
int64 opinstNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
type
Definition: core.h:1059
UT_StringHolder opNames_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
exint opNames(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
const UT_Array< Names > & getNames() const
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
OP_NodeParms & operator=(const OP_NodeParms &)=default
UT_StringHolder opinstNames_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663