HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_File.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_FileEnums
24 {
25  enum class Filemode
26  {
27  AUTO = 0,
28  READ,
29  WRITE,
30  NONE
31  };
32 
34  getToken(Filemode enum_value)
35  {
36  using namespace UT::Literal;
37  switch (enum_value) {
38  case Filemode::AUTO: return "auto"_sh;
39  case Filemode::READ: return "read"_sh;
40  case Filemode::WRITE: return "write"_sh;
41  case Filemode::NONE: return "none"_sh;
42  default: UT_ASSERT(false); return ""_sh;
43  }
44  }
45 
46  enum class Missingframe
47  {
48  ERROR = 0,
49  EMPTY
50  };
51 
53  getToken(Missingframe enum_value)
54  {
55  using namespace UT::Literal;
56  switch (enum_value) {
57  case Missingframe::ERROR: return "error"_sh;
58  case Missingframe::EMPTY: return "empty"_sh;
59  default: UT_ASSERT(false); return ""_sh;
60  }
61  }
62 
63  enum class Loadtype
64  {
65  FULL = 0,
66  INFOBBOX,
67  INFO,
68  POINTS,
69  DELAYED,
70  PACKEDSEQ,
71  PACKEDGEO
72  };
73 
75  getToken(Loadtype enum_value)
76  {
77  using namespace UT::Literal;
78  switch (enum_value) {
79  case Loadtype::FULL: return "full"_sh;
80  case Loadtype::INFOBBOX: return "infobbox"_sh;
81  case Loadtype::INFO: return "info"_sh;
82  case Loadtype::POINTS: return "points"_sh;
83  case Loadtype::DELAYED: return "delayed"_sh;
84  case Loadtype::PACKEDSEQ: return "packedseq"_sh;
85  case Loadtype::PACKEDGEO: return "packedgeo"_sh;
86  default: UT_ASSERT(false); return ""_sh;
87  }
88  }
89 
90  enum class Packedviewedit
91  {
92  UNCHANGED = 0,
93  FULL,
94  POINTS,
95  BOX,
96  CENTROID,
97  HIDDEN
98  };
99 
102  {
103  using namespace UT::Literal;
104  switch (enum_value) {
105  case Packedviewedit::UNCHANGED: return "unchanged"_sh;
106  case Packedviewedit::FULL: return "full"_sh;
107  case Packedviewedit::POINTS: return "points"_sh;
108  case Packedviewedit::BOX: return "box"_sh;
109  case Packedviewedit::CENTROID: return "centroid"_sh;
110  case Packedviewedit::HIDDEN: return "hidden"_sh;
111  default: UT_ASSERT(false); return ""_sh;
112  }
113  }
114 
115  enum class Viewportlod
116  {
117  FULL = 0,
118  POINTS,
119  BOX,
120  CENTROID,
121  HIDDEN
122  };
123 
125  getToken(Viewportlod enum_value)
126  {
127  using namespace UT::Literal;
128  switch (enum_value) {
129  case Viewportlod::FULL: return "full"_sh;
130  case Viewportlod::POINTS: return "points"_sh;
131  case Viewportlod::BOX: return "box"_sh;
132  case Viewportlod::CENTROID: return "centroid"_sh;
133  case Viewportlod::HIDDEN: return "hidden"_sh;
134  default: UT_ASSERT(false); return ""_sh;
135  }
136  }
137 
138  enum class Wrap
139  {
140  CYCLE = 0,
141  CLAMP,
142  STRICK,
143  MIRROR
144  };
145 
147  getToken(Wrap enum_value)
148  {
149  using namespace UT::Literal;
150  switch (enum_value) {
151  case Wrap::CYCLE: return "cycle"_sh;
152  case Wrap::CLAMP: return "clamp"_sh;
153  case Wrap::STRICK: return "strick"_sh;
154  case Wrap::MIRROR: return "mirror"_sh;
155  default: UT_ASSERT(false); return ""_sh;
156  }
157  }
158 
159 }
160 
161 
163 {
164 public:
165  static int version() { return 1; }
166 
168  {
169  myFilemode = 1;
170  myFile = "default.bgeo"_UTsh;
171  raw_myFile = "default.bgeo"_UTsh;
172  myObjpattern = "*"_UTsh;
173  myGeodatapath = ""_UTsh;
174  myMissingframe = 0;
175  myLoadtype = 0;
176  myPackedviewedit = 0;
177  myViewportlod = 2;
178  myPackexpanded = true;
179  myDelayload = false;
180  myMkpath = true;
181  myCachesize = 0;
182  myPrefetch = false;
183  myF = UT_Vector2I(1,24);
184  myIndex = 0;
185  myWrap = 0;
186  myRetry = 0;
187 
188  }
189 
190  explicit SOP_FileParms(const SOP_FileParms &) = default;
191  SOP_FileParms &operator=(const SOP_FileParms &) = default;
192  SOP_FileParms(SOP_FileParms &&) noexcept = default;
193  SOP_FileParms &operator=(SOP_FileParms &&) noexcept = default;
194 
195  ~SOP_FileParms() override {}
196 
197  bool operator==(const SOP_FileParms &src) const
198  {
199  if (myFilemode != src.myFilemode) return false;
200  if (myFile != src.myFile) return false;
201  if (raw_myFile != src.raw_myFile) return false;
202  if (myObjpattern != src.myObjpattern) return false;
203  if (myGeodatapath != src.myGeodatapath) return false;
204  if (myMissingframe != src.myMissingframe) return false;
205  if (myLoadtype != src.myLoadtype) return false;
206  if (myPackedviewedit != src.myPackedviewedit) return false;
207  if (myViewportlod != src.myViewportlod) return false;
208  if (myPackexpanded != src.myPackexpanded) return false;
209  if (myDelayload != src.myDelayload) return false;
210  if (myMkpath != src.myMkpath) return false;
211  if (myCachesize != src.myCachesize) return false;
212  if (myPrefetch != src.myPrefetch) return false;
213  if (myF != src.myF) return false;
214  if (myIndex != src.myIndex) return false;
215  if (myWrap != src.myWrap) return false;
216  if (myRetry != src.myRetry) return false;
217 
218  return true;
219  }
220  bool operator!=(const SOP_FileParms &src) const
221  {
222  return !operator==(src);
223  }
230 
231 
232 
233  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
234  {
235  myFilemode = 1;
236  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)==0)))) ) )
237  graph->evalOpParm(myFilemode, nodeidx, "filemode", time, 0);
238  myFile = "default.bgeo"_UTsh;
239  if (true)
240  graph->evalOpParm(myFile, nodeidx, "file", time, 0);
241  raw_myFile = "default.bgeo"_UTsh;
242  if (true)
243  graph->evalOpParmRaw(raw_myFile, nodeidx, "file", time, 0);
244  myObjpattern = "*"_UTsh;
245  if (true && ( (true&&!(((!getFile().matchRegex(".*[.]sim"))))) ) )
246  graph->evalOpParm(myObjpattern, nodeidx, "objpattern", time, 0);
247  myGeodatapath = ""_UTsh;
248  if (true && ( (true&&!(((!getFile().matchRegex(".*[.]sim"))))) ) )
249  graph->evalOpParm(myGeodatapath, nodeidx, "geodatapath", time, 0);
250  myMissingframe = 0;
251  if (true && ( (true&&!(((int64(getFilemode())!=1)&&((graph->getInput(nodeidx,0)>=0)==1)))) ) )
252  graph->evalOpParm(myMissingframe, nodeidx, "missingframe", time, 0);
253  myLoadtype = 0;
254  if (true && ( (true&&!(((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
255  graph->evalOpParm(myLoadtype, nodeidx, "loadtype", time, 0);
256  myPackedviewedit = 0;
257  if (true && ( (true&&!(((int64(getLoadtype())!=0))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
258  graph->evalOpParm(myPackedviewedit, nodeidx, "packedviewedit", time, 0);
259  myViewportlod = 2;
260  if (true && ( (true&&!(((int64(getLoadtype())!=4)&&(int64(getLoadtype())!=5)&&(int64(getLoadtype())!=6))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
261  graph->evalOpParm(myViewportlod, nodeidx, "viewportlod", time, 0);
262  myPackexpanded = true;
263  if (true && ( (true&&!(((int64(getLoadtype())!=4))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
264  graph->evalOpParm(myPackexpanded, nodeidx, "packexpanded", time, 0);
265  myDelayload = false;
266  if (true && ( (true&&!(((int64(getLoadtype())!=0))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
267  graph->evalOpParm(myDelayload, nodeidx, "delayload", time, 0);
268  myMkpath = true;
269  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)==0))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=2)))) ) )
270  graph->evalOpParm(myMkpath, nodeidx, "mkpath", time, 0);
271  myCachesize = 0;
272  if (true && ( (true&&!(((int64(getFilemode())!=1))||((int64(getLoadtype())!=0))||((int64(getPackedviewedit())!=0)))) ) )
273  graph->evalOpParm(myCachesize, nodeidx, "cachesize", time, 0);
274  myPrefetch = false;
275  if (true && ( (true&&!(((int64(getFilemode())!=1))||((int64(getLoadtype())!=0))||((int64(getPackedviewedit())!=0))||((int64(getCachesize())==0)))) ) )
276  graph->evalOpParm(myPrefetch, nodeidx, "prefetch", time, 0);
277  myF = UT_Vector2I(1,24);
278  if (true && ( (true&&!(((int64(getLoadtype())!=5))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
279  graph->evalOpParm(myF, nodeidx, "f", time, 0);
280  myIndex = 0;
281  if (true && ( (true&&!(((int64(getLoadtype())!=5))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
282  graph->evalOpParm(myIndex, nodeidx, "index", time, 0);
283  myWrap = 0;
284  if (true && ( (true&&!(((int64(getLoadtype())!=5))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
285  graph->evalOpParm(myWrap, nodeidx, "wrap", time, 0);
286  myRetry = 0;
287  if (true)
288  graph->evalOpParm(myRetry, nodeidx, "retry", time, 0);
289 
290  }
291 
292 
293  void loadFromOpSubclass(const LoadParms &loadparms) override
294  {
295  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
296  }
297 
298 
299  void copyFrom(const OP_NodeParms *src) override
300  {
301  *this = *((const SOP_FileParms *)src);
302  }
303 
304  template <typename T>
305  void
306  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
307  {
308  if (idx.size() < 1)
309  return;
310  UT_ASSERT(idx.size() == instance.size()+1);
311  if (idx.size() != instance.size()+1)
312  return;
313  switch (idx[0])
314  {
315  case 0:
316  coerceValue(value, myFilemode);
317  break;
318  case 1:
319  coerceValue(value, myFile);
320  break;
321  case 2:
322  coerceValue(value, myObjpattern);
323  break;
324  case 3:
325  coerceValue(value, myGeodatapath);
326  break;
327  case 4:
328  coerceValue(value, myMissingframe);
329  break;
330  case 5:
331  coerceValue(value, myLoadtype);
332  break;
333  case 6:
334  coerceValue(value, myPackedviewedit);
335  break;
336  case 7:
337  coerceValue(value, myViewportlod);
338  break;
339  case 8:
340  coerceValue(value, myPackexpanded);
341  break;
342  case 9:
343  coerceValue(value, myDelayload);
344  break;
345  case 10:
346  coerceValue(value, myMkpath);
347  break;
348  case 11:
349  coerceValue(value, myCachesize);
350  break;
351  case 12:
352  coerceValue(value, myPrefetch);
353  break;
354  case 13:
355  coerceValue(value, myF);
356  break;
357  case 14:
358  coerceValue(value, myIndex);
359  break;
360  case 15:
361  coerceValue(value, myWrap);
362  break;
363  case 16:
364  coerceValue(value, myRetry);
365  break;
366 
367  }
368  }
369 
370  bool isParmColorRamp(exint idx) const override
371  {
372  switch (idx)
373  {
374 
375  }
376  return false;
377  }
378 
379  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
380  { doGetParmValue(idx, instance, value); }
381  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
382  { doGetParmValue(idx, instance, value); }
383  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
384  { doGetParmValue(idx, instance, value); }
385  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
386  { doGetParmValue(idx, instance, value); }
387  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
388  { doGetParmValue(idx, instance, value); }
389  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
390  { doGetParmValue(idx, instance, value); }
391  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
392  { doGetParmValue(idx, instance, value); }
393  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
394  { doGetParmValue(idx, instance, value); }
395  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
396  { doGetParmValue(idx, instance, value); }
397  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
398  { doGetParmValue(idx, instance, value); }
399  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
400  { doGetParmValue(idx, instance, value); }
401 
402  template <typename T>
403  void
404  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
405  {
406  if (idx.size() < 1)
407  return;
408  UT_ASSERT(idx.size() == instance.size()+1);
409  if (idx.size() != instance.size()+1)
410  return;
411  switch (idx[0])
412  {
413  case 0:
414  coerceValue(myFilemode, clampMinValue(0, clampMaxValue(3, value ) ));
415  break;
416  case 1:
417  coerceValue(myFile, ( ( value ) ));
418  break;
419  case 2:
420  coerceValue(myObjpattern, ( ( value ) ));
421  break;
422  case 3:
423  coerceValue(myGeodatapath, ( ( value ) ));
424  break;
425  case 4:
426  coerceValue(myMissingframe, clampMinValue(0, clampMaxValue(1, value ) ));
427  break;
428  case 5:
429  coerceValue(myLoadtype, clampMinValue(0, clampMaxValue(6, value ) ));
430  break;
431  case 6:
432  coerceValue(myPackedviewedit, clampMinValue(0, clampMaxValue(5, value ) ));
433  break;
434  case 7:
435  coerceValue(myViewportlod, clampMinValue(0, clampMaxValue(4, value ) ));
436  break;
437  case 8:
438  coerceValue(myPackexpanded, ( ( value ) ));
439  break;
440  case 9:
441  coerceValue(myDelayload, ( ( value ) ));
442  break;
443  case 10:
444  coerceValue(myMkpath, ( ( value ) ));
445  break;
446  case 11:
447  coerceValue(myCachesize, clampMinValue(0, ( value ) ));
448  break;
449  case 12:
450  coerceValue(myPrefetch, ( ( value ) ));
451  break;
452  case 13:
453  coerceValue(myF, ( ( value ) ));
454  break;
455  case 14:
456  coerceValue(myIndex, ( ( value ) ));
457  break;
458  case 15:
459  coerceValue(myWrap, clampMinValue(0, clampMaxValue(3, value ) ));
460  break;
461  case 16:
462  coerceValue(myRetry, clampMinValue(0, ( value ) ));
463  break;
464 
465  }
466  }
467 
468  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
469  { doSetParmValue(idx, instance, value); }
470  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
471  { doSetParmValue(idx, instance, value); }
472  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
473  { doSetParmValue(idx, instance, value); }
474  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
475  { doSetParmValue(idx, instance, value); }
476  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
477  { doSetParmValue(idx, instance, value); }
478  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
479  { doSetParmValue(idx, instance, value); }
480  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
481  { doSetParmValue(idx, instance, value); }
482  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
483  { doSetParmValue(idx, instance, value); }
484  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
485  { doSetParmValue(idx, instance, value); }
486  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
487  { doSetParmValue(idx, instance, value); }
488  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
489  { doSetParmValue(idx, instance, value); }
490 
491  exint getNestNumParms(TempIndex idx) const override
492  {
493  if (idx.size() == 0)
494  return 17;
495  switch (idx[0])
496  {
497 
498  }
499  // Invalid
500  return 0;
501  }
502 
503  const char *getNestParmName(TempIndex fieldnum) const override
504  {
505  if (fieldnum.size() < 1)
506  return 0;
507  switch (fieldnum[0])
508  {
509  case 0:
510  return "filemode";
511  case 1:
512  return "file";
513  case 2:
514  return "objpattern";
515  case 3:
516  return "geodatapath";
517  case 4:
518  return "missingframe";
519  case 5:
520  return "loadtype";
521  case 6:
522  return "packedviewedit";
523  case 7:
524  return "viewportlod";
525  case 8:
526  return "packexpanded";
527  case 9:
528  return "delayload";
529  case 10:
530  return "mkpath";
531  case 11:
532  return "cachesize";
533  case 12:
534  return "prefetch";
535  case 13:
536  return "f";
537  case 14:
538  return "index";
539  case 15:
540  return "wrap";
541  case 16:
542  return "retry";
543 
544  }
545  return 0;
546  }
547 
548  ParmType getNestParmType(TempIndex fieldnum) const override
549  {
550  if (fieldnum.size() < 1)
551  return PARM_UNSUPPORTED;
552  switch (fieldnum[0])
553  {
554  case 0:
555  return PARM_INTEGER;
556  case 1:
557  return PARM_STRING;
558  case 2:
559  return PARM_STRING;
560  case 3:
561  return PARM_STRING;
562  case 4:
563  return PARM_INTEGER;
564  case 5:
565  return PARM_INTEGER;
566  case 6:
567  return PARM_INTEGER;
568  case 7:
569  return PARM_INTEGER;
570  case 8:
571  return PARM_INTEGER;
572  case 9:
573  return PARM_INTEGER;
574  case 10:
575  return PARM_INTEGER;
576  case 11:
577  return PARM_INTEGER;
578  case 12:
579  return PARM_INTEGER;
580  case 13:
581  return PARM_VECTOR2;
582  case 14:
583  return PARM_FLOAT;
584  case 15:
585  return PARM_INTEGER;
586  case 16:
587  return PARM_INTEGER;
588 
589  }
590  return PARM_UNSUPPORTED;
591  }
592 
593  // Boiler plate to load individual types.
594  static void loadData(UT_IStream &is, int64 &v)
595  { is.bread(&v, 1); }
596  static void loadData(UT_IStream &is, bool &v)
597  { int64 iv; is.bread(&iv, 1); v = iv; }
598  static void loadData(UT_IStream &is, fpreal64 &v)
599  { is.bread<fpreal64>(&v, 1); }
600  static void loadData(UT_IStream &is, UT_Vector2D &v)
601  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
602  static void loadData(UT_IStream &is, UT_Vector3D &v)
603  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
604  is.bread<fpreal64>(&v.z(), 1); }
605  static void loadData(UT_IStream &is, UT_Vector4D &v)
606  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
607  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
608  static void loadData(UT_IStream &is, UT_Matrix2D &v)
609  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
610  static void loadData(UT_IStream &is, UT_Matrix3D &v)
611  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
612  static void loadData(UT_IStream &is, UT_Matrix4D &v)
613  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
614  static void loadData(UT_IStream &is, UT_Vector2I &v)
615  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
616  static void loadData(UT_IStream &is, UT_Vector3I &v)
617  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
618  is.bread<int64>(&v.z(), 1); }
619  static void loadData(UT_IStream &is, UT_Vector4I &v)
620  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
621  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
623  { is.bread(v); }
625  { UT_StringHolder rampdata;
626  loadData(is, rampdata);
627  if (rampdata.isstring())
628  {
629  v.reset(new UT_Ramp());
630  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
631  v->load(istr);
632  }
633  else v.reset();
634  }
637  loadData(is, data);
638  if (data.isstring())
639  {
640  // Find the data type.
641  const char *colon = UT_StringWrap(data).findChar(':');
642  if (colon)
643  {
644  int typelen = colon - data.buffer();
646  type.strncpy(data.buffer(), typelen);
647  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
648 
649  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
650  }
651  }
652  else v.reset();
653  }
654 
655  static void saveData(std::ostream &os, int64 v)
656  { UTwrite(os, &v); }
657  static void saveData(std::ostream &os, bool v)
658  { int64 iv = v; UTwrite(os, &iv); }
659  static void saveData(std::ostream &os, fpreal64 v)
660  { UTwrite<fpreal64>(os, &v); }
661  static void saveData(std::ostream &os, UT_Vector2D v)
662  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
663  static void saveData(std::ostream &os, UT_Vector3D v)
664  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
665  UTwrite<fpreal64>(os, &v.z()); }
666  static void saveData(std::ostream &os, UT_Vector4D v)
667  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
668  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
669  static void saveData(std::ostream &os, UT_Matrix2D v)
671  static void saveData(std::ostream &os, UT_Matrix3D v)
673  static void saveData(std::ostream &os, UT_Matrix4D v)
675  static void saveData(std::ostream &os, UT_StringHolder s)
676  { UT_StringWrap(s).saveBinary(os); }
677  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
679  UT_OStringStream ostr;
680  if (s) s->save(ostr);
681  result = ostr.str();
682  saveData(os, result);
683  }
684  static void saveData(std::ostream &os, PRM_DataItemHandle s)
686  UT_OStringStream ostr;
687  if (s)
688  {
689  ostr << s->getDataTypeToken();
690  ostr << ":";
691  s->saveBinary(ostr);
692  }
693  result = ostr.str();
694  saveData(os, result);
695  }
696 
697 
698  void save(std::ostream &os) const
699  {
700  int32 v = version();
701  UTwrite(os, &v);
702  saveData(os, myFilemode);
703  saveData(os, myFile);
704  saveData(os, raw_myFile);
705  saveData(os, myObjpattern);
706  saveData(os, myGeodatapath);
707  saveData(os, myMissingframe);
708  saveData(os, myLoadtype);
709  saveData(os, myPackedviewedit);
710  saveData(os, myViewportlod);
711  saveData(os, myPackexpanded);
712  saveData(os, myDelayload);
713  saveData(os, myMkpath);
714  saveData(os, myCachesize);
715  saveData(os, myPrefetch);
716  saveData(os, myF);
717  saveData(os, myIndex);
718  saveData(os, myWrap);
719  saveData(os, myRetry);
720 
721  }
722 
723  bool load(UT_IStream &is)
724  {
725  int32 v;
726  is.bread(&v, 1);
727  if (version() != v)
728  {
729  // Fail incompatible versions
730  return false;
731  }
732  loadData(is, myFilemode);
733  loadData(is, myFile);
734  loadData(is, raw_myFile);
735  loadData(is, myObjpattern);
736  loadData(is, myGeodatapath);
737  loadData(is, myMissingframe);
738  loadData(is, myLoadtype);
739  loadData(is, myPackedviewedit);
740  loadData(is, myViewportlod);
741  loadData(is, myPackexpanded);
742  loadData(is, myDelayload);
743  loadData(is, myMkpath);
744  loadData(is, myCachesize);
745  loadData(is, myPrefetch);
746  loadData(is, myF);
747  loadData(is, myIndex);
748  loadData(is, myWrap);
749  loadData(is, myRetry);
750 
751  return true;
752  }
753 
754  Filemode getFilemode() const { return Filemode(myFilemode); }
755  void setFilemode(Filemode val) { myFilemode = int64(val); }
757  {
758  SOP_Node *thissop = cookparms.getNode();
759  if (!thissop) return getFilemode();
760  int64 result;
761  OP_Utils::evalOpParm(result, thissop, "filemode", cookparms.getCookTime(), 0);
762  return Filemode(result);
763  }
764  const UT_StringHolder & getFile() const { return myFile; }
765  void setFile(const UT_StringHolder & val) { myFile = val; }
767  {
768  SOP_Node *thissop = cookparms.getNode();
769  if (!thissop) return getFile();
771  OP_Utils::evalOpParm(result, thissop, "file", cookparms.getCookTime(), 0);
772  return result;
773  }
774  const UT_StringHolder & raw_getFile() const { return raw_myFile; }
775  void raw_setFile(const UT_StringHolder & val) { raw_myFile = val; }
777  {
778  SOP_Node *thissop = cookparms.getNode();
779  if (!thissop) return raw_getFile();
781  OP_Utils::evalOpParmRaw(result, thissop, "file", cookparms.getCookTime(), 0);
782  return result;
783  }
784  const UT_StringHolder & getObjpattern() const { return myObjpattern; }
785  void setObjpattern(const UT_StringHolder & val) { myObjpattern = val; }
787  {
788  SOP_Node *thissop = cookparms.getNode();
789  if (!thissop) return getObjpattern();
791  OP_Utils::evalOpParm(result, thissop, "objpattern", cookparms.getCookTime(), 0);
792  return result;
793  }
794  const UT_StringHolder & getGeodatapath() const { return myGeodatapath; }
795  void setGeodatapath(const UT_StringHolder & val) { myGeodatapath = val; }
797  {
798  SOP_Node *thissop = cookparms.getNode();
799  if (!thissop) return getGeodatapath();
801  OP_Utils::evalOpParm(result, thissop, "geodatapath", cookparms.getCookTime(), 0);
802  return result;
803  }
804  Missingframe getMissingframe() const { return Missingframe(myMissingframe); }
805  void setMissingframe(Missingframe val) { myMissingframe = int64(val); }
807  {
808  SOP_Node *thissop = cookparms.getNode();
809  if (!thissop) return getMissingframe();
810  int64 result;
811  OP_Utils::evalOpParm(result, thissop, "missingframe", cookparms.getCookTime(), 0);
812  return Missingframe(result);
813  }
814  Loadtype getLoadtype() const { return Loadtype(myLoadtype); }
815  void setLoadtype(Loadtype val) { myLoadtype = int64(val); }
817  {
818  SOP_Node *thissop = cookparms.getNode();
819  if (!thissop) return getLoadtype();
820  int64 result;
821  OP_Utils::evalOpParm(result, thissop, "loadtype", cookparms.getCookTime(), 0);
822  return Loadtype(result);
823  }
824  Packedviewedit getPackedviewedit() const { return Packedviewedit(myPackedviewedit); }
825  void setPackedviewedit(Packedviewedit val) { myPackedviewedit = int64(val); }
827  {
828  SOP_Node *thissop = cookparms.getNode();
829  if (!thissop) return getPackedviewedit();
830  int64 result;
831  OP_Utils::evalOpParm(result, thissop, "packedviewedit", cookparms.getCookTime(), 0);
832  return Packedviewedit(result);
833  }
834  Viewportlod getViewportlod() const { return Viewportlod(myViewportlod); }
835  void setViewportlod(Viewportlod val) { myViewportlod = int64(val); }
837  {
838  SOP_Node *thissop = cookparms.getNode();
839  if (!thissop) return getViewportlod();
840  int64 result;
841  OP_Utils::evalOpParm(result, thissop, "viewportlod", cookparms.getCookTime(), 0);
842  return Viewportlod(result);
843  }
844  bool getPackexpanded() const { return myPackexpanded; }
845  void setPackexpanded(bool val) { myPackexpanded = val; }
846  bool opPackexpanded(const SOP_NodeVerb::CookParms &cookparms) const
847  {
848  SOP_Node *thissop = cookparms.getNode();
849  if (!thissop) return getPackexpanded();
850  bool result;
851  OP_Utils::evalOpParm(result, thissop, "packexpanded", cookparms.getCookTime(), 0);
852  return result;
853  }
854  bool getDelayload() const { return myDelayload; }
855  void setDelayload(bool val) { myDelayload = val; }
856  bool opDelayload(const SOP_NodeVerb::CookParms &cookparms) const
857  {
858  SOP_Node *thissop = cookparms.getNode();
859  if (!thissop) return getDelayload();
860  bool result;
861  OP_Utils::evalOpParm(result, thissop, "delayload", cookparms.getCookTime(), 0);
862  return result;
863  }
864  bool getMkpath() const { return myMkpath; }
865  void setMkpath(bool val) { myMkpath = val; }
866  bool opMkpath(const SOP_NodeVerb::CookParms &cookparms) const
867  {
868  SOP_Node *thissop = cookparms.getNode();
869  if (!thissop) return getMkpath();
870  bool result;
871  OP_Utils::evalOpParm(result, thissop, "mkpath", cookparms.getCookTime(), 0);
872  return result;
873  }
874  int64 getCachesize() const { return myCachesize; }
875  void setCachesize(int64 val) { myCachesize = val; }
876  int64 opCachesize(const SOP_NodeVerb::CookParms &cookparms) const
877  {
878  SOP_Node *thissop = cookparms.getNode();
879  if (!thissop) return getCachesize();
880  int64 result;
881  OP_Utils::evalOpParm(result, thissop, "cachesize", cookparms.getCookTime(), 0);
882  return result;
883  }
884  bool getPrefetch() const { return myPrefetch; }
885  void setPrefetch(bool val) { myPrefetch = val; }
886  bool opPrefetch(const SOP_NodeVerb::CookParms &cookparms) const
887  {
888  SOP_Node *thissop = cookparms.getNode();
889  if (!thissop) return getPrefetch();
890  bool result;
891  OP_Utils::evalOpParm(result, thissop, "prefetch", cookparms.getCookTime(), 0);
892  return result;
893  }
894  UT_Vector2I getF() const { return myF; }
895  void setF(UT_Vector2I val) { myF = val; }
896  UT_Vector2I opF(const SOP_NodeVerb::CookParms &cookparms) const
897  {
898  SOP_Node *thissop = cookparms.getNode();
899  if (!thissop) return getF();
901  OP_Utils::evalOpParm(result, thissop, "f", cookparms.getCookTime(), 0);
902  return result;
903  }
904  fpreal64 getIndex() const { return myIndex; }
905  void setIndex(fpreal64 val) { myIndex = val; }
906  fpreal64 opIndex(const SOP_NodeVerb::CookParms &cookparms) const
907  {
908  SOP_Node *thissop = cookparms.getNode();
909  if (!thissop) return getIndex();
911  OP_Utils::evalOpParm(result, thissop, "index", cookparms.getCookTime(), 0);
912  return result;
913  }
914  Wrap getWrap() const { return Wrap(myWrap); }
915  void setWrap(Wrap val) { myWrap = int64(val); }
916  Wrap opWrap(const SOP_NodeVerb::CookParms &cookparms) const
917  {
918  SOP_Node *thissop = cookparms.getNode();
919  if (!thissop) return getWrap();
920  int64 result;
921  OP_Utils::evalOpParm(result, thissop, "wrap", cookparms.getCookTime(), 0);
922  return Wrap(result);
923  }
924  int64 getRetry() const { return myRetry; }
925  void setRetry(int64 val) { myRetry = val; }
926  int64 opRetry(const SOP_NodeVerb::CookParms &cookparms) const
927  {
928  SOP_Node *thissop = cookparms.getNode();
929  if (!thissop) return getRetry();
930  int64 result;
931  OP_Utils::evalOpParm(result, thissop, "retry", cookparms.getCookTime(), 0);
932  return result;
933  }
934 
935 private:
936  int64 myFilemode;
937  UT_StringHolder myFile;
938  UT_StringHolder raw_myFile;
939  UT_StringHolder myObjpattern;
940  UT_StringHolder myGeodatapath;
941  int64 myMissingframe;
942  int64 myLoadtype;
943  int64 myPackedviewedit;
944  int64 myViewportlod;
945  bool myPackexpanded;
946  bool myDelayload;
947  bool myMkpath;
948  int64 myCachesize;
949  bool myPrefetch;
950  UT_Vector2I myF;
951  fpreal64 myIndex;
952  int64 myWrap;
953  int64 myRetry;
954 
955 };
UT_Vector2T< int64 > UT_Vector2I
static void loadData(UT_IStream &is, UT_Vector3I &v)
UT_StringHolder opObjpattern(const SOP_NodeVerb::CookParms &cookparms) const
bool opDelayload(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
void setRetry(int64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
bool getDelayload() const
Packedviewedit getPackedviewedit() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setPackexpanded(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
static void saveData(std::ostream &os, bool v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
int64 getCachesize() 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
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool opPrefetch(const SOP_NodeVerb::CookParms &cookparms) const
const GLdouble * v
Definition: glcorearb.h:837
fpreal getTime() const
Definition: OP_Context.h:62
void copyFrom(const OP_NodeParms *src) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
Missingframe opMissingframe(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
const OP_Context & context() const
Definition: OP_NodeParms.h:97
virtual void evalOpParmRaw(UT_StringHolder &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
SYS_FORCE_INLINE const char * buffer() const
bool operator==(const SOP_FileParms &src) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
GLdouble s
Definition: glad.h:3009
void setMkpath(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setMissingframe(Missingframe val)
An output stream object that owns its own string buffer storage.
void setF(UT_Vector2I val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
UT_StringHolder opGeodatapath(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
**But if you need a result
Definition: thread.h:613
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setObjpattern(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
exint getNestNumParms(TempIndex idx) const override
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.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
bool load(UT_IStream &is)
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setFilemode(Filemode val)
bool getMkpath() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
bool getPrefetch() const
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, int64 &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
void setViewportlod(Viewportlod val)
const UT_StringHolder & getFile() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static int version()
void setDelayload(bool val)
Wrap getWrap() const
UT_StringHolder raw_opFile(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
void setLoadtype(Loadtype val)
Wrap opWrap(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
const UT_StringHolder & raw_getFile() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void saveData(std::ostream &os, fpreal64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
bool operator!=(const SOP_FileParms &src) const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
UT_StringHolder opFile(const SOP_NodeVerb::CookParms &cookparms) const
long long int64
Definition: SYS_Types.h:116
fpreal64 opIndex(const SOP_NodeVerb::CookParms &cookparms) const
void setIndex(fpreal64 val)
int64 opCachesize(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool getPackexpanded() const
Loadtype getLoadtype() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
const UT_StringHolder & getGeodatapath() const
void setPackedviewedit(Packedviewedit val)
static void saveData(std::ostream &os, UT_Vector2D v)
Packedviewedit opPackedviewedit(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getObjpattern() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void saveData(std::ostream &os, UT_Vector4D v)
bool opPackexpanded(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
Viewportlod opViewportlod(const SOP_NodeVerb::CookParms &cookparms) const
void save(std::ostream &os) const
UT_Vector2I getF() const
void setGeodatapath(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
LeafData & operator=(const LeafData &)=delete
int64 getRetry() const
const char * getNestParmName(TempIndex fieldnum) const override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
void setWrap(Wrap val)
int64 opRetry(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
Viewportlod getViewportlod() const
GLuint GLfloat * val
Definition: glcorearb.h:1608
void setFile(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
#define SOP_API
Definition: SOP_API.h:10
Filemode getFilemode() const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_Vector2I opF(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
Definition: UT_String.h:1395
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
Missingframe getMissingframe() const
GLboolean r
Definition: glcorearb.h:1222
fpreal64 getIndex() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
Filemode opFilemode(const SOP_NodeVerb::CookParms &cookparms) const
bool opMkpath(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
SYS_FORCE_INLINE UT_StringHolder getToken(Filemode enum_value)
type
Definition: core.h:1059
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, bool &v)
void setPrefetch(bool val)
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, int64 v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void raw_setFile(const UT_StringHolder &val)
void setCachesize(int64 val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
Loadtype opLoadtype(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)