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 
33  getToken(Method enum_value)
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case Method::ADDREPLACE: return "addreplace"_sh;
38  case Method::ADDKEEP: return "addkeep"_sh;
39  case Method::REPLACE: return "replace"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class Visible
45  {
46  DEFAULT = 0,
47  FOLDER
48  };
49 
51  getToken(Visible enum_value)
52  {
53  using namespace UT::Literal;
54  switch (enum_value) {
55  case Visible::DEFAULT: return "default"_sh;
56  case Visible::FOLDER: return "folder"_sh;
57  default: UT_ASSERT(false); return ""_sh;
58  }
59  }
60 
61  enum class Treatasfolder
62  {
63  DEFAULT = 0,
64  FOLDER
65  };
66 
68  getToken(Treatasfolder enum_value)
69  {
70  using namespace UT::Literal;
71  switch (enum_value) {
72  case Treatasfolder::DEFAULT: return "default"_sh;
73  case Treatasfolder::FOLDER: return "folder"_sh;
74  default: UT_ASSERT(false); return ""_sh;
75  }
76  }
77 
78 }
79 
80 
82 {
83 public:
84  static int version() { return 1; }
85  struct Names
86  {
87  bool useinput;
92 
93 
95  {
96  useinput = true;
97  name = ""_UTsh;
98  type = ""_UTsh;
99  visible = 0;
100  treatasfolder = 0;
101 
102  }
103 
104  bool operator==(const Names &src) const
105  {
106  if (useinput != src.useinput) return false;
107  if (name != src.name) return false;
108  if (type != src.type) return false;
109  if (visible != src.visible) return false;
110  if (treatasfolder != src.treatasfolder) return false;
111 
112  return true;
113  }
114  bool operator!=(const Names &src) const
115  {
116  return !operator==(src);
117  }
118 
119  };
120 
122  {
124 
125  buf.strcat("[ ");
126  for (int i = 0; i < list.entries(); i++)
127  {
128  if (i)
129  buf.strcat(", ");
130  buf.strcat("( ");
131  buf.append("");
132  buf.appendSprintf("%s", (list(i).useinput) ? "true" : "false");
133  buf.append(", ");
134  { UT_String tmp; tmp = UT_StringWrap(list(i).name).makeQuotedString('"'); buf.strcat(tmp); }
135  buf.append(", ");
136  { UT_String tmp; tmp = UT_StringWrap(list(i).type).makeQuotedString('"'); buf.strcat(tmp); }
137  buf.append(", ");
138  buf.appendSprintf("%d", (int) list(i).visible);
139  buf.append(", ");
140  buf.appendSprintf("%d", (int) list(i).treatasfolder);
141 
142  buf.strcat(" )");
143  }
144  buf.strcat(" ]");
145 
147  return result;
148  }
149 
151  {
152  myFolder = "/"_UTsh;
153  myMethod = 0;
154  myPack = true;
155  myOnlyPackUnpacked = false;
156  myIgnoreEmpty = false;
157  myNames.setSize(0);
158 
159  }
160 
161  explicit SOP_PackFolderParms(const SOP_PackFolderParms &) = default;
163  SOP_PackFolderParms(SOP_PackFolderParms &&) noexcept = default;
164  SOP_PackFolderParms &operator=(SOP_PackFolderParms &&) noexcept = default;
165 
166  ~SOP_PackFolderParms() override {}
167 
168  bool operator==(const SOP_PackFolderParms &src) const
169  {
170  if (myFolder != src.myFolder) return false;
171  if (myMethod != src.myMethod) return false;
172  if (myPack != src.myPack) return false;
173  if (myOnlyPackUnpacked != src.myOnlyPackUnpacked) return false;
174  if (myIgnoreEmpty != src.myIgnoreEmpty) return false;
175  if (myNames != src.myNames) return false;
176 
177  return true;
178  }
179  bool operator!=(const SOP_PackFolderParms &src) const
180  {
181  return !operator==(src);
182  }
186 
187 
188 
189  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
190  {
191  myFolder = "/"_UTsh;
192  if (true)
193  graph->evalOpParm(myFolder, nodeidx, "folder", time, 0);
194  myMethod = 0;
195  if (true)
196  graph->evalOpParm(myMethod, nodeidx, "method", time, 0);
197  myPack = true;
198  if (true)
199  graph->evalOpParm(myPack, nodeidx, "pack", time, 0);
200  myOnlyPackUnpacked = false;
201  if (true && ( (true&&!(((getPack()!=1)))) ) )
202  graph->evalOpParm(myOnlyPackUnpacked, nodeidx, "onlypackunpacked", time, 0);
203  myIgnoreEmpty = false;
204  if (true)
205  graph->evalOpParm(myIgnoreEmpty, nodeidx, "ignoreempty", time, 0);
206  if (true)
207  {
208  int64 length = 0;
209  graph->evalOpParm(length, nodeidx, "names", time, 0);
210  if (length < 0) length = 0;
211  myNames.setSize(length);
212  for (exint i = 0; i < length; i++)
213  {
214  int parmidx[1];
215  int offsets[1];
216  parmidx[0] = i+1;
217  offsets[0] = 1;
218  auto && _curentry = myNames(i);
219  (void) _curentry;
220  _curentry.useinput = true;
221  if (true)
222  graph->evalOpParmInst(_curentry.useinput, nodeidx, "useinput#", parmidx, offsets, time, 0, 2-1);
223  _curentry.name = ""_UTsh;
224  if (true)
225  graph->evalOpParmInst(_curentry.name, nodeidx, "name#", parmidx, offsets, time, 0, 2-1);
226  _curentry.type = ""_UTsh;
227  if (true)
228  graph->evalOpParmInst(_curentry.type, nodeidx, "type#", parmidx, offsets, time, 0, 2-1);
229  _curentry.visible = 0;
230  if (true)
231  graph->evalOpParmInst(_curentry.visible, nodeidx, "visible#", parmidx, offsets, time, 0, 2-1);
232  _curentry.treatasfolder = 0;
233  if (true && ( (true&&!(((_curentry.type=="shp"))||((_curentry.type=="skel"))||((_curentry.type=="rig"))||((_curentry.type=="ctrl"))||((_curentry.type=="char"))||((_curentry.type=="graph")))) ) )
234  graph->evalOpParmInst(_curentry.treatasfolder, nodeidx, "treatasfolder#", parmidx, offsets, time, 0, 2-1);
235 
236  }
237  }
238  else
239  myNames.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 OP_NodeParms *src) override
251  {
252  *this = *((const SOP_PackFolderParms *)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, myFolder);
268  break;
269  case 1:
270  coerceValue(value, myMethod);
271  break;
272  case 2:
273  coerceValue(value, myPack);
274  break;
275  case 3:
276  coerceValue(value, myOnlyPackUnpacked);
277  break;
278  case 4:
279  coerceValue(value, myIgnoreEmpty);
280  break;
281  case 5:
282  if (idx.size() == 1)
283  coerceValue(value, myNames.entries());
284  else if (instance[0] < myNames.entries())
285  {
286  auto && _data = myNames(instance[0]);
287  switch (idx[1])
288  {
289  case 0:
290  coerceValue(value, _data.useinput);
291  break;
292  case 1:
293  coerceValue(value, _data.name);
294  break;
295  case 2:
296  coerceValue(value, _data.type);
297  break;
298  case 3:
299  coerceValue(value, _data.visible);
300  break;
301  case 4:
302  coerceValue(value, _data.treatasfolder);
303  break;
304 
305  }
306  }
307  break;
308 
309  }
310  }
311 
312  bool isParmColorRamp(exint idx) const override
313  {
314  switch (idx)
315  {
316 
317  }
318  return false;
319  }
320 
321  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
322  { doGetParmValue(idx, instance, value); }
323  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
324  { doGetParmValue(idx, instance, value); }
325  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
326  { doGetParmValue(idx, instance, value); }
327  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
328  { doGetParmValue(idx, instance, value); }
329  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
330  { doGetParmValue(idx, instance, value); }
331  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
332  { doGetParmValue(idx, instance, value); }
333  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
334  { doGetParmValue(idx, instance, value); }
335  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
336  { doGetParmValue(idx, instance, value); }
337  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
338  { doGetParmValue(idx, instance, value); }
339  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
340  { doGetParmValue(idx, instance, value); }
341  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
342  { doGetParmValue(idx, instance, value); }
343 
344  template <typename T>
345  void
346  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
347  {
348  if (idx.size() < 1)
349  return;
350  UT_ASSERT(idx.size() == instance.size()+1);
351  if (idx.size() != instance.size()+1)
352  return;
353  switch (idx[0])
354  {
355  case 0:
356  coerceValue(myFolder, ( ( value ) ));
357  break;
358  case 1:
359  coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
360  break;
361  case 2:
362  coerceValue(myPack, ( ( value ) ));
363  break;
364  case 3:
365  coerceValue(myOnlyPackUnpacked, ( ( value ) ));
366  break;
367  case 4:
368  coerceValue(myIgnoreEmpty, ( ( value ) ));
369  break;
370  case 5:
371  if (idx.size() == 1)
372  {
373  exint newsize;
374  coerceValue(newsize, value);
375  if (newsize < 0) newsize = 0;
376  myNames.setSize(newsize);
377  }
378  else
379  {
380  if (instance[0] < 0)
381  return;
382  myNames.setSizeIfNeeded(instance[0]+1);
383  auto && _data = myNames(instance[0]);
384  switch (idx[1])
385  {
386  case 0:
387  coerceValue(_data.useinput, value);
388  break;
389  case 1:
390  coerceValue(_data.name, value);
391  break;
392  case 2:
393  coerceValue(_data.type, value);
394  break;
395  case 3:
396  coerceValue(_data.visible, value);
397  break;
398  case 4:
399  coerceValue(_data.treatasfolder, value);
400  break;
401 
402  }
403  }
404  break;
405 
406  }
407  }
408 
409  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
410  { doSetParmValue(idx, instance, value); }
411  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
412  { doSetParmValue(idx, instance, value); }
413  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
414  { doSetParmValue(idx, instance, value); }
415  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
416  { doSetParmValue(idx, instance, value); }
417  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
418  { doSetParmValue(idx, instance, value); }
419  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
420  { doSetParmValue(idx, instance, value); }
421  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
422  { doSetParmValue(idx, instance, value); }
423  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
424  { doSetParmValue(idx, instance, value); }
425  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
426  { doSetParmValue(idx, instance, value); }
427  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
428  { doSetParmValue(idx, instance, value); }
429  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
430  { doSetParmValue(idx, instance, value); }
431 
432  exint getNestNumParms(TempIndex idx) const override
433  {
434  if (idx.size() == 0)
435  return 6;
436  switch (idx[0])
437  {
438  case 5:
439  return 5;
440 
441  }
442  // Invalid
443  return 0;
444  }
445 
446  const char *getNestParmName(TempIndex fieldnum) const override
447  {
448  if (fieldnum.size() < 1)
449  return 0;
450  switch (fieldnum[0])
451  {
452  case 0:
453  return "folder";
454  case 1:
455  return "method";
456  case 2:
457  return "pack";
458  case 3:
459  return "onlypackunpacked";
460  case 4:
461  return "ignoreempty";
462  case 5:
463  if (fieldnum.size() == 1)
464  return "names";
465  switch (fieldnum[1])
466  {
467  case 0:
468  return "useinput#";
469  case 1:
470  return "name#";
471  case 2:
472  return "type#";
473  case 3:
474  return "visible#";
475  case 4:
476  return "treatasfolder#";
477 
478  }
479  return 0;
480 
481  }
482  return 0;
483  }
484 
485  ParmType getNestParmType(TempIndex fieldnum) const override
486  {
487  if (fieldnum.size() < 1)
488  return PARM_UNSUPPORTED;
489  switch (fieldnum[0])
490  {
491  case 0:
492  return PARM_STRING;
493  case 1:
494  return PARM_INTEGER;
495  case 2:
496  return PARM_INTEGER;
497  case 3:
498  return PARM_INTEGER;
499  case 4:
500  return PARM_INTEGER;
501  case 5:
502  if (fieldnum.size() == 1)
503  return PARM_MULTIPARM;
504  switch (fieldnum[1])
505  {
506  case 0:
507  return PARM_INTEGER;
508  case 1:
509  return PARM_STRING;
510  case 2:
511  return PARM_STRING;
512  case 3:
513  return PARM_INTEGER;
514  case 4:
515  return PARM_INTEGER;
516 
517  }
518  return PARM_UNSUPPORTED;
519 
520  }
521  return PARM_UNSUPPORTED;
522  }
523 
524  // Boiler plate to load individual types.
525  static void loadData(UT_IStream &is, int64 &v)
526  { is.bread(&v, 1); }
527  static void loadData(UT_IStream &is, bool &v)
528  { int64 iv; is.bread(&iv, 1); v = iv; }
529  static void loadData(UT_IStream &is, fpreal64 &v)
530  { is.bread<fpreal64>(&v, 1); }
531  static void loadData(UT_IStream &is, UT_Vector2D &v)
532  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
533  static void loadData(UT_IStream &is, UT_Vector3D &v)
534  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
535  is.bread<fpreal64>(&v.z(), 1); }
536  static void loadData(UT_IStream &is, UT_Vector4D &v)
537  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
538  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
539  static void loadData(UT_IStream &is, UT_Matrix2D &v)
540  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
541  static void loadData(UT_IStream &is, UT_Matrix3D &v)
542  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
543  static void loadData(UT_IStream &is, UT_Matrix4D &v)
544  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
545  static void loadData(UT_IStream &is, UT_Vector2I &v)
546  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
547  static void loadData(UT_IStream &is, UT_Vector3I &v)
548  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
549  is.bread<int64>(&v.z(), 1); }
550  static void loadData(UT_IStream &is, UT_Vector4I &v)
551  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
552  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
554  { is.bread(v); }
556  { UT_StringHolder rampdata;
557  loadData(is, rampdata);
558  if (rampdata.isstring())
559  {
560  v.reset(new UT_Ramp());
561  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
562  v->load(istr);
563  }
564  else v.reset();
565  }
568  loadData(is, data);
569  if (data.isstring())
570  {
571  // Find the data type.
572  const char *colon = UT_StringWrap(data).findChar(':');
573  if (colon)
574  {
575  int typelen = colon - data.buffer();
577  type.strncpy(data.buffer(), typelen);
578  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
579 
580  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
581  }
582  }
583  else v.reset();
584  }
585 
586  static void saveData(std::ostream &os, int64 v)
587  { UTwrite(os, &v); }
588  static void saveData(std::ostream &os, bool v)
589  { int64 iv = v; UTwrite(os, &iv); }
590  static void saveData(std::ostream &os, fpreal64 v)
591  { UTwrite<fpreal64>(os, &v); }
592  static void saveData(std::ostream &os, UT_Vector2D v)
593  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
594  static void saveData(std::ostream &os, UT_Vector3D v)
595  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
596  UTwrite<fpreal64>(os, &v.z()); }
597  static void saveData(std::ostream &os, UT_Vector4D v)
598  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
599  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
600  static void saveData(std::ostream &os, UT_Matrix2D v)
602  static void saveData(std::ostream &os, UT_Matrix3D v)
604  static void saveData(std::ostream &os, UT_Matrix4D v)
606  static void saveData(std::ostream &os, UT_StringHolder s)
607  { UT_StringWrap(s).saveBinary(os); }
608  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
610  UT_OStringStream ostr;
611  if (s) s->save(ostr);
612  result = ostr.str();
613  saveData(os, result);
614  }
615  static void saveData(std::ostream &os, PRM_DataItemHandle s)
617  UT_OStringStream ostr;
618  if (s)
619  {
620  ostr << s->getDataTypeToken();
621  ostr << ":";
622  s->saveBinary(ostr);
623  }
624  result = ostr.str();
625  saveData(os, result);
626  }
627 
628 
629  void save(std::ostream &os) const
630  {
631  int32 v = version();
632  UTwrite(os, &v);
633  saveData(os, myFolder);
634  saveData(os, myMethod);
635  saveData(os, myPack);
636  saveData(os, myOnlyPackUnpacked);
637  saveData(os, myIgnoreEmpty);
638  {
639  int64 length = myNames.entries();
640  UTwrite(os, &length);
641  for (exint i = 0; i < length; i++)
642  {
643  auto && _curentry = myNames(i);
644  (void) _curentry;
645  saveData(os, _curentry.useinput);
646  saveData(os, _curentry.name);
647  saveData(os, _curentry.type);
648  saveData(os, _curentry.visible);
649  saveData(os, _curentry.treatasfolder);
650 
651  }
652  }
653 
654  }
655 
656  bool load(UT_IStream &is)
657  {
658  int32 v;
659  is.bread(&v, 1);
660  if (version() != v)
661  {
662  // Fail incompatible versions
663  return false;
664  }
665  loadData(is, myFolder);
666  loadData(is, myMethod);
667  loadData(is, myPack);
668  loadData(is, myOnlyPackUnpacked);
669  loadData(is, myIgnoreEmpty);
670  {
671  int64 length;
672  is.read(&length, 1);
673  myNames.setSize(length);
674  for (exint i = 0; i < length; i++)
675  {
676  auto && _curentry = myNames(i);
677  (void) _curentry;
678  loadData(is, _curentry.useinput);
679  loadData(is, _curentry.name);
680  loadData(is, _curentry.type);
681  loadData(is, _curentry.visible);
682  loadData(is, _curentry.treatasfolder);
683 
684  }
685  }
686 
687  return true;
688  }
689 
690  const UT_StringHolder & getFolder() const { return myFolder; }
691  void setFolder(const UT_StringHolder & val) { myFolder = val; }
693  {
694  SOP_Node *thissop = cookparms.getNode();
695  if (!thissop) return getFolder();
697  OP_Utils::evalOpParm(result, thissop, "folder", cookparms.getCookTime(), 0);
698  return result;
699  }
700  Method getMethod() const { return Method(myMethod); }
701  void setMethod(Method val) { myMethod = int64(val); }
702  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
703  {
704  SOP_Node *thissop = cookparms.getNode();
705  if (!thissop) return getMethod();
706  int64 result;
707  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
708  return Method(result);
709  }
710  bool getPack() const { return myPack; }
711  void setPack(bool val) { myPack = val; }
712  bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
713  {
714  SOP_Node *thissop = cookparms.getNode();
715  if (!thissop) return getPack();
716  bool result;
717  OP_Utils::evalOpParm(result, thissop, "pack", cookparms.getCookTime(), 0);
718  return result;
719  }
720  bool getOnlyPackUnpacked() const { return myOnlyPackUnpacked; }
721  void setOnlyPackUnpacked(bool val) { myOnlyPackUnpacked = val; }
722  bool opOnlyPackUnpacked(const SOP_NodeVerb::CookParms &cookparms) const
723  {
724  SOP_Node *thissop = cookparms.getNode();
725  if (!thissop) return getOnlyPackUnpacked();
726  bool result;
727  OP_Utils::evalOpParm(result, thissop, "onlypackunpacked", cookparms.getCookTime(), 0);
728  return result;
729  }
730  bool getIgnoreEmpty() const { return myIgnoreEmpty; }
731  void setIgnoreEmpty(bool val) { myIgnoreEmpty = val; }
732  bool opIgnoreEmpty(const SOP_NodeVerb::CookParms &cookparms) const
733  {
734  SOP_Node *thissop = cookparms.getNode();
735  if (!thissop) return getIgnoreEmpty();
736  bool result;
737  OP_Utils::evalOpParm(result, thissop, "ignoreempty", cookparms.getCookTime(), 0);
738  return result;
739  }
740  const UT_Array<Names> &getNames() const { return myNames; }
741 void setNames(const UT_Array<Names> &val) { myNames = val; }
742  exint opNames(const SOP_NodeVerb::CookParms &cookparms) const
743  {
744  SOP_Node *thissop = cookparms.getNode();
745  if (!thissop) return getNames().entries();
746  exint result;
747  OP_Utils::evalOpParm(result, thissop, "names", cookparms.getCookTime(), 0);
748  return result;
749  }
750  bool opNames_useinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
751  { return opinstNames_useinput(cookparms, &_idx); }
752  bool opinstNames_useinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
753  {
754  SOP_Node *thissop = cookparms.getNode();
755  if (!thissop) return (myNames(_idx[0]).useinput);
756  int _parmidx[2-1];
757  _parmidx[1-1] = _idx[1-1] + 1;
758 
759  bool result;
760  OP_Utils::evalOpParmInst(result, thissop, "useinput#", _parmidx, cookparms.getCookTime(), 0, 2-1);
761  return (result);
762  }
763  UT_StringHolder opNames_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
764  { return opinstNames_name(cookparms, &_idx); }
765  UT_StringHolder opinstNames_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
766  {
767  SOP_Node *thissop = cookparms.getNode();
768  if (!thissop) return (myNames(_idx[0]).name);
769  int _parmidx[2-1];
770  _parmidx[1-1] = _idx[1-1] + 1;
771 
773  OP_Utils::evalOpParmInst(result, thissop, "name#", _parmidx, cookparms.getCookTime(), 0, 2-1);
774  return (result);
775  }
776  UT_StringHolder opNames_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
777  { return opinstNames_type(cookparms, &_idx); }
778  UT_StringHolder opinstNames_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
779  {
780  SOP_Node *thissop = cookparms.getNode();
781  if (!thissop) return (myNames(_idx[0]).type);
782  int _parmidx[2-1];
783  _parmidx[1-1] = _idx[1-1] + 1;
784 
786  OP_Utils::evalOpParmInst(result, thissop, "type#", _parmidx, cookparms.getCookTime(), 0, 2-1);
787  return (result);
788  }
789  int64 opNames_visible(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
790  { return opinstNames_visible(cookparms, &_idx); }
791  int64 opinstNames_visible(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
792  {
793  SOP_Node *thissop = cookparms.getNode();
794  if (!thissop) return (myNames(_idx[0]).visible);
795  int _parmidx[2-1];
796  _parmidx[1-1] = _idx[1-1] + 1;
797 
798  int64 result;
799  OP_Utils::evalOpParmInst(result, thissop, "visible#", _parmidx, cookparms.getCookTime(), 0, 2-1);
800  return (result);
801  }
802  int64 opNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
803  { return opinstNames_treatasfolder(cookparms, &_idx); }
804  int64 opinstNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
805  {
806  SOP_Node *thissop = cookparms.getNode();
807  if (!thissop) return (myNames(_idx[0]).treatasfolder);
808  int _parmidx[2-1];
809  _parmidx[1-1] = _idx[1-1] + 1;
810 
811  int64 result;
812  OP_Utils::evalOpParmInst(result, thissop, "treatasfolder#", _parmidx, cookparms.getCookTime(), 0, 2-1);
813  return (result);
814  }
815 
816 
817 private:
818  UT_StringHolder myFolder;
819  int64 myMethod;
820  bool myPack;
821  bool myOnlyPackUnpacked;
822  bool myIgnoreEmpty;
823  UT_Array<Names> myNames;
824 
825 };
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
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
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
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
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 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
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
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:1395
#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
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
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:97
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
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