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 <OP/OP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 class DEP_MicroNode;
23 namespace SOP_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 
178  if (baseGetSignature() != src.baseGetSignature()) return false;
179 
180  return true;
181  }
182  bool operator!=(const SOP_PackFolderParms &src) const
183  {
184  return !operator==(src);
185  }
189 
190 
191 
192  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
193  {
194  myFolder = "/"_UTsh;
195  if (true)
196  graph->evalOpParm(myFolder, nodeidx, "folder", time, graph->isDirect()?nullptr:depnode);
197  myMethod = 0;
198  if (true)
199  graph->evalOpParm(myMethod, nodeidx, "method", time, graph->isDirect()?nullptr:depnode);
200  myPack = true;
201  if (true)
202  graph->evalOpParm(myPack, nodeidx, "pack", time, graph->isDirect()?nullptr:depnode);
203  myOnlyPackUnpacked = false;
204  if (true && ( (true&&!(((getPack()!=1)))) ) )
205  graph->evalOpParm(myOnlyPackUnpacked, nodeidx, "onlypackunpacked", time, graph->isDirect()?nullptr:depnode);
206  myIgnoreEmpty = false;
207  if (true)
208  graph->evalOpParm(myIgnoreEmpty, nodeidx, "ignoreempty", time, graph->isDirect()?nullptr:depnode);
209  if (true)
210  {
211  int64 length = 0;
212  graph->evalOpParm(length, nodeidx, "names", time, graph->isDirect()?nullptr:depnode);
213  if (length < 0) length = 0;
214  myNames.setSize(length);
215  for (exint i = 0; i < length; i++)
216  {
217  int parmidx[1];
218  int offsets[1];
219  parmidx[0] = i+1;
220  offsets[0] = 1;
221  auto && _curentry = myNames(i);
222  (void) _curentry;
223  _curentry.useinput = true;
224  if (true)
225  graph->evalOpParmInst(_curentry.useinput, nodeidx, "useinput#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
226  _curentry.name = ""_UTsh;
227  if (true)
228  graph->evalOpParmInst(_curentry.name, nodeidx, "name#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
229  _curentry.type = ""_UTsh;
230  if (true)
231  graph->evalOpParmInst(_curentry.type, nodeidx, "type#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
232  _curentry.visible = 0;
233  if (true)
234  graph->evalOpParmInst(_curentry.visible, nodeidx, "visible#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
235  _curentry.treatasfolder = 0;
236  if (true && ( (true&&!(((_curentry.type=="shp"))||((_curentry.type=="skel"))||((_curentry.type=="rig"))||((_curentry.type=="ctrl"))||((_curentry.type=="char"))||((_curentry.type=="graph")))) ) )
237  graph->evalOpParmInst(_curentry.treatasfolder, nodeidx, "treatasfolder#", parmidx, offsets, time, graph->isDirect()?nullptr:depnode, 2-1);
238 
239  }
240  }
241  else
242  myNames.clear();
243 
244  }
245 
246 
247  void loadFromOpSubclass(const LoadParms &loadparms) override
248  {
249  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
250  }
251 
252 
253  void copyFrom(const OP_NodeParms *src) override
254  {
255  *this = *((const SOP_PackFolderParms *)src);
256  }
257 
258  template <typename T>
259  void
260  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
261  {
262  if (idx.size() < 1)
263  return;
264  UT_ASSERT(idx.size() == instance.size()+1);
265  if (idx.size() != instance.size()+1)
266  return;
267  switch (idx[0])
268  {
269  case 0:
270  coerceValue(value, myFolder);
271  break;
272  case 1:
273  coerceValue(value, myMethod);
274  break;
275  case 2:
276  coerceValue(value, myPack);
277  break;
278  case 3:
279  coerceValue(value, myOnlyPackUnpacked);
280  break;
281  case 4:
282  coerceValue(value, myIgnoreEmpty);
283  break;
284  case 5:
285  if (idx.size() == 1)
286  coerceValue(value, myNames.entries());
287  else if (instance[0] < myNames.entries())
288  {
289  auto && _data = myNames(instance[0]);
290  switch (idx[1])
291  {
292  case 0:
293  coerceValue(value, _data.useinput);
294  break;
295  case 1:
296  coerceValue(value, _data.name);
297  break;
298  case 2:
299  coerceValue(value, _data.type);
300  break;
301  case 3:
302  coerceValue(value, _data.visible);
303  break;
304  case 4:
305  coerceValue(value, _data.treatasfolder);
306  break;
307 
308  }
309  }
310  break;
311 
312  }
313  }
314 
315  bool isParmColorRamp(exint idx) const override
316  {
317  switch (idx)
318  {
319 
320  }
321  return false;
322  }
323 
324  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
325  { doGetParmValue(idx, instance, value); }
326  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
327  { doGetParmValue(idx, instance, value); }
328  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
329  { doGetParmValue(idx, instance, value); }
330  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
331  { doGetParmValue(idx, instance, value); }
332  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
333  { doGetParmValue(idx, instance, value); }
334  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
335  { doGetParmValue(idx, instance, value); }
336  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
337  { doGetParmValue(idx, instance, value); }
338  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
339  { doGetParmValue(idx, instance, value); }
340  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
341  { doGetParmValue(idx, instance, value); }
342  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
343  { doGetParmValue(idx, instance, value); }
344  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
345  { doGetParmValue(idx, instance, value); }
346 
347  template <typename T>
348  void
349  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
350  {
351  if (idx.size() < 1)
352  return;
353  UT_ASSERT(idx.size() == instance.size()+1);
354  if (idx.size() != instance.size()+1)
355  return;
356  switch (idx[0])
357  {
358  case 0:
359  coerceValue(myFolder, ( ( value ) ));
360  break;
361  case 1:
362  coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
363  break;
364  case 2:
365  coerceValue(myPack, ( ( value ) ));
366  break;
367  case 3:
368  coerceValue(myOnlyPackUnpacked, ( ( value ) ));
369  break;
370  case 4:
371  coerceValue(myIgnoreEmpty, ( ( value ) ));
372  break;
373  case 5:
374  if (idx.size() == 1)
375  {
376  exint newsize;
377  coerceValue(newsize, value);
378  if (newsize < 0) newsize = 0;
379  myNames.setSize(newsize);
380  }
381  else
382  {
383  if (instance[0] < 0)
384  return;
385  myNames.setSizeIfNeeded(instance[0]+1);
386  auto && _data = myNames(instance[0]);
387  switch (idx[1])
388  {
389  case 0:
390  coerceValue(_data.useinput, value);
391  break;
392  case 1:
393  coerceValue(_data.name, value);
394  break;
395  case 2:
396  coerceValue(_data.type, value);
397  break;
398  case 3:
399  coerceValue(_data.visible, value);
400  break;
401  case 4:
402  coerceValue(_data.treatasfolder, value);
403  break;
404 
405  }
406  }
407  break;
408 
409  }
410  }
411 
412  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
413  { doSetParmValue(idx, instance, value); }
414  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
415  { doSetParmValue(idx, instance, value); }
416  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
417  { doSetParmValue(idx, instance, value); }
418  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
419  { doSetParmValue(idx, instance, value); }
420  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
421  { doSetParmValue(idx, instance, value); }
422  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
423  { doSetParmValue(idx, instance, value); }
424  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
425  { doSetParmValue(idx, instance, value); }
426  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
427  { doSetParmValue(idx, instance, value); }
428  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
429  { doSetParmValue(idx, instance, value); }
430  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
431  { doSetParmValue(idx, instance, value); }
432  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
433  { doSetParmValue(idx, instance, value); }
434 
435  exint getNestNumParms(TempIndex idx) const override
436  {
437  if (idx.size() == 0)
438  return 6;
439  switch (idx[0])
440  {
441  case 5:
442  return 5;
443 
444  }
445  // Invalid
446  return 0;
447  }
448 
449  const char *getNestParmName(TempIndex fieldnum) const override
450  {
451  if (fieldnum.size() < 1)
452  return 0;
453  switch (fieldnum[0])
454  {
455  case 0:
456  return "folder";
457  case 1:
458  return "method";
459  case 2:
460  return "pack";
461  case 3:
462  return "onlypackunpacked";
463  case 4:
464  return "ignoreempty";
465  case 5:
466  if (fieldnum.size() == 1)
467  return "names";
468  switch (fieldnum[1])
469  {
470  case 0:
471  return "useinput#";
472  case 1:
473  return "name#";
474  case 2:
475  return "type#";
476  case 3:
477  return "visible#";
478  case 4:
479  return "treatasfolder#";
480 
481  }
482  return 0;
483 
484  }
485  return 0;
486  }
487 
488  ParmType getNestParmType(TempIndex fieldnum) const override
489  {
490  if (fieldnum.size() < 1)
491  return PARM_UNSUPPORTED;
492  switch (fieldnum[0])
493  {
494  case 0:
495  return PARM_STRING;
496  case 1:
497  return PARM_INTEGER;
498  case 2:
499  return PARM_INTEGER;
500  case 3:
501  return PARM_INTEGER;
502  case 4:
503  return PARM_INTEGER;
504  case 5:
505  if (fieldnum.size() == 1)
506  return PARM_MULTIPARM;
507  switch (fieldnum[1])
508  {
509  case 0:
510  return PARM_INTEGER;
511  case 1:
512  return PARM_STRING;
513  case 2:
514  return PARM_STRING;
515  case 3:
516  return PARM_INTEGER;
517  case 4:
518  return PARM_INTEGER;
519 
520  }
521  return PARM_UNSUPPORTED;
522 
523  }
524  return PARM_UNSUPPORTED;
525  }
526 
527  // Boiler plate to load individual types.
528  static void loadData(UT_IStream &is, int64 &v)
529  { is.bread(&v, 1); }
530  static void loadData(UT_IStream &is, bool &v)
531  { int64 iv; is.bread(&iv, 1); v = iv; }
532  static void loadData(UT_IStream &is, fpreal64 &v)
533  { is.bread<fpreal64>(&v, 1); }
534  static void loadData(UT_IStream &is, UT_Vector2D &v)
535  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
536  static void loadData(UT_IStream &is, UT_Vector3D &v)
537  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
538  is.bread<fpreal64>(&v.z(), 1); }
539  static void loadData(UT_IStream &is, UT_Vector4D &v)
540  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
541  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
542  static void loadData(UT_IStream &is, UT_Matrix2D &v)
543  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
544  static void loadData(UT_IStream &is, UT_Matrix3D &v)
545  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
546  static void loadData(UT_IStream &is, UT_Matrix4D &v)
547  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
548  static void loadData(UT_IStream &is, UT_Vector2I &v)
549  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
550  static void loadData(UT_IStream &is, UT_Vector3I &v)
551  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
552  is.bread<int64>(&v.z(), 1); }
553  static void loadData(UT_IStream &is, UT_Vector4I &v)
554  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
555  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
557  { is.bread(v); }
559  { UT_StringHolder rampdata;
560  loadData(is, rampdata);
561  if (rampdata.isstring())
562  {
563  v.reset(new UT_Ramp());
564  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
565  v->load(istr);
566  }
567  else v.reset();
568  }
571  loadData(is, data);
572  if (data.isstring())
573  {
574  // Find the data type.
575  const char *colon = UT_StringWrap(data).findChar(':');
576  if (colon)
577  {
578  int typelen = colon - data.buffer();
580  type.strncpy(data.buffer(), typelen);
581  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
582 
583  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
584  }
585  }
586  else v.reset();
587  }
588 
589  static void saveData(std::ostream &os, int64 v)
590  { UTwrite(os, &v); }
591  static void saveData(std::ostream &os, bool v)
592  { int64 iv = v; UTwrite(os, &iv); }
593  static void saveData(std::ostream &os, fpreal64 v)
594  { UTwrite<fpreal64>(os, &v); }
595  static void saveData(std::ostream &os, UT_Vector2D v)
596  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
597  static void saveData(std::ostream &os, UT_Vector3D v)
598  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
599  UTwrite<fpreal64>(os, &v.z()); }
600  static void saveData(std::ostream &os, UT_Vector4D v)
601  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
602  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
603  static void saveData(std::ostream &os, UT_Matrix2D v)
605  static void saveData(std::ostream &os, UT_Matrix3D v)
607  static void saveData(std::ostream &os, UT_Matrix4D v)
609  static void saveData(std::ostream &os, UT_StringHolder s)
610  { UT_StringWrap(s).saveBinary(os); }
611  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
613  UT_OStringStream ostr;
614  if (s) s->save(ostr);
615  result = ostr.str();
616  saveData(os, result);
617  }
618  static void saveData(std::ostream &os, PRM_DataItemHandle s)
620  UT_OStringStream ostr;
621  if (s)
622  {
623  ostr << s->getDataTypeToken();
624  ostr << ":";
625  s->saveBinary(ostr);
626  }
627  result = ostr.str();
628  saveData(os, result);
629  }
630 
631 
632  void save(std::ostream &os) const
633  {
634  int32 v = version();
635  UTwrite(os, &v);
636  saveData(os, myFolder);
637  saveData(os, myMethod);
638  saveData(os, myPack);
639  saveData(os, myOnlyPackUnpacked);
640  saveData(os, myIgnoreEmpty);
641  {
642  int64 length = myNames.entries();
643  UTwrite(os, &length);
644  for (exint i = 0; i < length; i++)
645  {
646  auto && _curentry = myNames(i);
647  (void) _curentry;
648  saveData(os, _curentry.useinput);
649  saveData(os, _curentry.name);
650  saveData(os, _curentry.type);
651  saveData(os, _curentry.visible);
652  saveData(os, _curentry.treatasfolder);
653 
654  }
655  }
656 
657  }
658 
659  bool load(UT_IStream &is)
660  {
661  int32 v;
662  is.bread(&v, 1);
663  if (version() != v)
664  {
665  // Fail incompatible versions
666  return false;
667  }
668  loadData(is, myFolder);
669  loadData(is, myMethod);
670  loadData(is, myPack);
671  loadData(is, myOnlyPackUnpacked);
672  loadData(is, myIgnoreEmpty);
673  {
674  int64 length;
675  is.read(&length, 1);
676  myNames.setSize(length);
677  for (exint i = 0; i < length; i++)
678  {
679  auto && _curentry = myNames(i);
680  (void) _curentry;
681  loadData(is, _curentry.useinput);
682  loadData(is, _curentry.name);
683  loadData(is, _curentry.type);
684  loadData(is, _curentry.visible);
685  loadData(is, _curentry.treatasfolder);
686 
687  }
688  }
689 
690  return true;
691  }
692 
693  const UT_StringHolder & getFolder() const { return myFolder; }
694  void setFolder(const UT_StringHolder & val) { myFolder = val; }
696  {
697  SOP_Node *thissop = cookparms.getNode();
698  if (!thissop) return getFolder();
700  OP_Utils::evalOpParm(result, thissop, "folder", cookparms.getCookTime(), 0);
701  return result;
702  }
703  Method getMethod() const { return Method(myMethod); }
704  void setMethod(Method val) { myMethod = int64(val); }
705  Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
706  {
707  SOP_Node *thissop = cookparms.getNode();
708  if (!thissop) return getMethod();
709  int64 result;
710  OP_Utils::evalOpParm(result, thissop, "method", cookparms.getCookTime(), 0);
711  return Method(result);
712  }
713  bool getPack() const { return myPack; }
714  void setPack(bool val) { myPack = val; }
715  bool opPack(const SOP_NodeVerb::CookParms &cookparms) const
716  {
717  SOP_Node *thissop = cookparms.getNode();
718  if (!thissop) return getPack();
719  bool result;
720  OP_Utils::evalOpParm(result, thissop, "pack", cookparms.getCookTime(), 0);
721  return result;
722  }
723  bool getOnlyPackUnpacked() const { return myOnlyPackUnpacked; }
724  void setOnlyPackUnpacked(bool val) { myOnlyPackUnpacked = val; }
725  bool opOnlyPackUnpacked(const SOP_NodeVerb::CookParms &cookparms) const
726  {
727  SOP_Node *thissop = cookparms.getNode();
728  if (!thissop) return getOnlyPackUnpacked();
729  bool result;
730  OP_Utils::evalOpParm(result, thissop, "onlypackunpacked", cookparms.getCookTime(), 0);
731  return result;
732  }
733  bool getIgnoreEmpty() const { return myIgnoreEmpty; }
734  void setIgnoreEmpty(bool val) { myIgnoreEmpty = val; }
735  bool opIgnoreEmpty(const SOP_NodeVerb::CookParms &cookparms) const
736  {
737  SOP_Node *thissop = cookparms.getNode();
738  if (!thissop) return getIgnoreEmpty();
739  bool result;
740  OP_Utils::evalOpParm(result, thissop, "ignoreempty", cookparms.getCookTime(), 0);
741  return result;
742  }
743  const UT_Array<Names> &getNames() const { return myNames; }
744 void setNames(const UT_Array<Names> &val) { myNames = val; }
745  exint opNames(const SOP_NodeVerb::CookParms &cookparms) const
746  {
747  SOP_Node *thissop = cookparms.getNode();
748  if (!thissop) return getNames().entries();
749  exint result;
750  OP_Utils::evalOpParm(result, thissop, "names", cookparms.getCookTime(), 0);
751  return result;
752  }
753  bool opNames_useinput(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
754  { return opinstNames_useinput(cookparms, &_idx); }
755  bool opinstNames_useinput(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
756  {
757  SOP_Node *thissop = cookparms.getNode();
758  if (!thissop) return (myNames(_idx[0]).useinput);
759  int _parmidx[2-1];
760  _parmidx[1-1] = _idx[1-1] + 1;
761 
762  bool result;
763  OP_Utils::evalOpParmInst(result, thissop, "useinput#", _parmidx, cookparms.getCookTime(), 0, 2-1);
764  return (result);
765  }
766  UT_StringHolder opNames_name(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
767  { return opinstNames_name(cookparms, &_idx); }
768  UT_StringHolder opinstNames_name(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
769  {
770  SOP_Node *thissop = cookparms.getNode();
771  if (!thissop) return (myNames(_idx[0]).name);
772  int _parmidx[2-1];
773  _parmidx[1-1] = _idx[1-1] + 1;
774 
776  OP_Utils::evalOpParmInst(result, thissop, "name#", _parmidx, cookparms.getCookTime(), 0, 2-1);
777  return (result);
778  }
779  UT_StringHolder opNames_type(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
780  { return opinstNames_type(cookparms, &_idx); }
781  UT_StringHolder opinstNames_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
782  {
783  SOP_Node *thissop = cookparms.getNode();
784  if (!thissop) return (myNames(_idx[0]).type);
785  int _parmidx[2-1];
786  _parmidx[1-1] = _idx[1-1] + 1;
787 
789  OP_Utils::evalOpParmInst(result, thissop, "type#", _parmidx, cookparms.getCookTime(), 0, 2-1);
790  return (result);
791  }
792  int64 opNames_visible(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
793  { return opinstNames_visible(cookparms, &_idx); }
794  int64 opinstNames_visible(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
795  {
796  SOP_Node *thissop = cookparms.getNode();
797  if (!thissop) return (myNames(_idx[0]).visible);
798  int _parmidx[2-1];
799  _parmidx[1-1] = _idx[1-1] + 1;
800 
801  int64 result;
802  OP_Utils::evalOpParmInst(result, thissop, "visible#", _parmidx, cookparms.getCookTime(), 0, 2-1);
803  return (result);
804  }
805  int64 opNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
806  { return opinstNames_treatasfolder(cookparms, &_idx); }
807  int64 opinstNames_treatasfolder(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
808  {
809  SOP_Node *thissop = cookparms.getNode();
810  if (!thissop) return (myNames(_idx[0]).treatasfolder);
811  int _parmidx[2-1];
812  _parmidx[1-1] = _idx[1-1] + 1;
813 
814  int64 result;
815  OP_Utils::evalOpParmInst(result, thissop, "treatasfolder#", _parmidx, cookparms.getCookTime(), 0, 2-1);
816  return (result);
817  }
818 
819 
820 private:
821  UT_StringHolder myFolder;
822  int64 myMethod;
823  bool myPack;
824  bool myOnlyPackUnpacked;
825  bool myIgnoreEmpty;
826  UT_Array<Names> myNames;
827 
828 };
type
Definition: core.h:556
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:63
void setIgnoreEmpty(bool val)
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
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:303
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:655
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:278
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
#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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
UT_StringHolder opinstNames_type(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
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
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
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