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 <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_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 
219  if (baseGetSignature() != src.baseGetSignature()) return false;
220 
221  return true;
222  }
223  bool operator!=(const SOP_FileParms &src) const
224  {
225  return !operator==(src);
226  }
233 
234 
235 
236  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
237  {
238  myFilemode = 1;
239  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)==0)))) ) )
240  graph->evalOpParm(myFilemode, nodeidx, "filemode", time, graph->isDirect()?nullptr:depnode);
241  myFile = "default.bgeo"_UTsh;
242  if (true)
243  graph->evalOpParm(myFile, nodeidx, "file", time, graph->isDirect()?nullptr:depnode);
244  raw_myFile = "default.bgeo"_UTsh;
245  if (true)
246  graph->evalOpParmRaw(raw_myFile, nodeidx, "file", time, graph->isDirect()?nullptr:depnode);
247  myObjpattern = "*"_UTsh;
248  if (true && ( (true&&!(((!getFile().matchRegex(".*[.]sim"))))) ) )
249  graph->evalOpParm(myObjpattern, nodeidx, "objpattern", time, graph->isDirect()?nullptr:depnode);
250  myGeodatapath = ""_UTsh;
251  if (true && ( (true&&!(((!getFile().matchRegex(".*[.]sim"))))) ) )
252  graph->evalOpParm(myGeodatapath, nodeidx, "geodatapath", time, graph->isDirect()?nullptr:depnode);
253  myMissingframe = 0;
254  if (true && ( (true&&!(((int64(getFilemode())!=1)&&((graph->getInput(nodeidx,0)>=0)==1)))) ) )
255  graph->evalOpParm(myMissingframe, nodeidx, "missingframe", time, graph->isDirect()?nullptr:depnode);
256  myLoadtype = 0;
257  if (true && ( (true&&!(((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
258  graph->evalOpParm(myLoadtype, nodeidx, "loadtype", time, graph->isDirect()?nullptr:depnode);
259  myPackedviewedit = 0;
260  if (true && ( (true&&!(((int64(getLoadtype())!=0))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
261  graph->evalOpParm(myPackedviewedit, nodeidx, "packedviewedit", time, graph->isDirect()?nullptr:depnode);
262  myViewportlod = 2;
263  if (true && ( (true&&!(((int64(getLoadtype())!=4)&&(int64(getLoadtype())!=5)&&(int64(getLoadtype())!=6))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
264  graph->evalOpParm(myViewportlod, nodeidx, "viewportlod", time, graph->isDirect()?nullptr:depnode);
265  myPackexpanded = true;
266  if (true && ( (true&&!(((int64(getLoadtype())!=4))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
267  graph->evalOpParm(myPackexpanded, nodeidx, "packexpanded", time, graph->isDirect()?nullptr:depnode);
268  myDelayload = false;
269  if (true && ( (true&&!(((int64(getLoadtype())!=0))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
270  graph->evalOpParm(myDelayload, nodeidx, "delayload", time, graph->isDirect()?nullptr:depnode);
271  myMkpath = true;
272  if (true && ( (true&&!((((graph->getInput(nodeidx,0)>=0)==0))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=2)))) ) )
273  graph->evalOpParm(myMkpath, nodeidx, "mkpath", time, graph->isDirect()?nullptr:depnode);
274  myCachesize = 0;
275  if (true && ( (true&&!(((int64(getFilemode())!=1))||((int64(getLoadtype())!=0))||((int64(getPackedviewedit())!=0)))) ) )
276  graph->evalOpParm(myCachesize, nodeidx, "cachesize", time, graph->isDirect()?nullptr:depnode);
277  myPrefetch = false;
278  if (true && ( (true&&!(((int64(getFilemode())!=1))||((int64(getLoadtype())!=0))||((int64(getPackedviewedit())!=0))||((int64(getCachesize())==0)))) ) )
279  graph->evalOpParm(myPrefetch, nodeidx, "prefetch", time, graph->isDirect()?nullptr:depnode);
280  myF = UT_Vector2I(1,24);
281  if (true && ( (true&&!(((int64(getLoadtype())!=5))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
282  graph->evalOpParm(myF, nodeidx, "f", time, graph->isDirect()?nullptr:depnode);
283  myIndex = 0;
284  if (true && ( (true&&!(((int64(getLoadtype())!=5))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
285  graph->evalOpParm(myIndex, nodeidx, "index", time, graph->isDirect()?nullptr:depnode);
286  myWrap = 0;
287  if (true && ( (true&&!(((int64(getLoadtype())!=5))||((int64(getFilemode())!=0)&&(int64(getFilemode())!=1)))) ) )
288  graph->evalOpParm(myWrap, nodeidx, "wrap", time, graph->isDirect()?nullptr:depnode);
289  myRetry = 0;
290  if (true)
291  graph->evalOpParm(myRetry, nodeidx, "retry", time, graph->isDirect()?nullptr:depnode);
292 
293  }
294 
295 
296  void loadFromOpSubclass(const LoadParms &loadparms) override
297  {
298  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
299  }
300 
301 
302  void copyFrom(const OP_NodeParms *src) override
303  {
304  *this = *((const SOP_FileParms *)src);
305  }
306 
307  template <typename T>
308  void
309  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
310  {
311  if (idx.size() < 1)
312  return;
313  UT_ASSERT(idx.size() == instance.size()+1);
314  if (idx.size() != instance.size()+1)
315  return;
316  switch (idx[0])
317  {
318  case 0:
319  coerceValue(value, myFilemode);
320  break;
321  case 1:
322  coerceValue(value, myFile);
323  break;
324  case 2:
325  coerceValue(value, myObjpattern);
326  break;
327  case 3:
328  coerceValue(value, myGeodatapath);
329  break;
330  case 4:
331  coerceValue(value, myMissingframe);
332  break;
333  case 5:
334  coerceValue(value, myLoadtype);
335  break;
336  case 6:
337  coerceValue(value, myPackedviewedit);
338  break;
339  case 7:
340  coerceValue(value, myViewportlod);
341  break;
342  case 8:
343  coerceValue(value, myPackexpanded);
344  break;
345  case 9:
346  coerceValue(value, myDelayload);
347  break;
348  case 10:
349  coerceValue(value, myMkpath);
350  break;
351  case 11:
352  coerceValue(value, myCachesize);
353  break;
354  case 12:
355  coerceValue(value, myPrefetch);
356  break;
357  case 13:
358  coerceValue(value, myF);
359  break;
360  case 14:
361  coerceValue(value, myIndex);
362  break;
363  case 15:
364  coerceValue(value, myWrap);
365  break;
366  case 16:
367  coerceValue(value, myRetry);
368  break;
369 
370  }
371  }
372 
373  bool isParmColorRamp(exint idx) const override
374  {
375  switch (idx)
376  {
377 
378  }
379  return false;
380  }
381 
382  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
383  { doGetParmValue(idx, instance, value); }
384  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
385  { doGetParmValue(idx, instance, value); }
386  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
387  { doGetParmValue(idx, instance, value); }
388  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
389  { doGetParmValue(idx, instance, value); }
390  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
391  { doGetParmValue(idx, instance, value); }
392  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
393  { doGetParmValue(idx, instance, value); }
394  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
395  { doGetParmValue(idx, instance, value); }
396  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
397  { doGetParmValue(idx, instance, value); }
398  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
399  { doGetParmValue(idx, instance, value); }
400  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
401  { doGetParmValue(idx, instance, value); }
402  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
403  { doGetParmValue(idx, instance, value); }
404 
405  template <typename T>
406  void
407  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
408  {
409  if (idx.size() < 1)
410  return;
411  UT_ASSERT(idx.size() == instance.size()+1);
412  if (idx.size() != instance.size()+1)
413  return;
414  switch (idx[0])
415  {
416  case 0:
417  coerceValue(myFilemode, clampMinValue(0, clampMaxValue(3, value ) ));
418  break;
419  case 1:
420  coerceValue(myFile, ( ( value ) ));
421  break;
422  case 2:
423  coerceValue(myObjpattern, ( ( value ) ));
424  break;
425  case 3:
426  coerceValue(myGeodatapath, ( ( value ) ));
427  break;
428  case 4:
429  coerceValue(myMissingframe, clampMinValue(0, clampMaxValue(1, value ) ));
430  break;
431  case 5:
432  coerceValue(myLoadtype, clampMinValue(0, clampMaxValue(6, value ) ));
433  break;
434  case 6:
435  coerceValue(myPackedviewedit, clampMinValue(0, clampMaxValue(5, value ) ));
436  break;
437  case 7:
438  coerceValue(myViewportlod, clampMinValue(0, clampMaxValue(4, value ) ));
439  break;
440  case 8:
441  coerceValue(myPackexpanded, ( ( value ) ));
442  break;
443  case 9:
444  coerceValue(myDelayload, ( ( value ) ));
445  break;
446  case 10:
447  coerceValue(myMkpath, ( ( value ) ));
448  break;
449  case 11:
450  coerceValue(myCachesize, clampMinValue(0, ( value ) ));
451  break;
452  case 12:
453  coerceValue(myPrefetch, ( ( value ) ));
454  break;
455  case 13:
456  coerceValue(myF, ( ( value ) ));
457  break;
458  case 14:
459  coerceValue(myIndex, ( ( value ) ));
460  break;
461  case 15:
462  coerceValue(myWrap, clampMinValue(0, clampMaxValue(3, value ) ));
463  break;
464  case 16:
465  coerceValue(myRetry, clampMinValue(0, ( value ) ));
466  break;
467 
468  }
469  }
470 
471  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
472  { doSetParmValue(idx, instance, value); }
473  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
474  { doSetParmValue(idx, instance, value); }
475  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
476  { doSetParmValue(idx, instance, value); }
477  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
478  { doSetParmValue(idx, instance, value); }
479  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
480  { doSetParmValue(idx, instance, value); }
481  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
482  { doSetParmValue(idx, instance, value); }
483  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
484  { doSetParmValue(idx, instance, value); }
485  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
486  { doSetParmValue(idx, instance, value); }
487  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
488  { doSetParmValue(idx, instance, value); }
489  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
490  { doSetParmValue(idx, instance, value); }
491  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
492  { doSetParmValue(idx, instance, value); }
493 
494  exint getNestNumParms(TempIndex idx) const override
495  {
496  if (idx.size() == 0)
497  return 17;
498  switch (idx[0])
499  {
500 
501  }
502  // Invalid
503  return 0;
504  }
505 
506  const char *getNestParmName(TempIndex fieldnum) const override
507  {
508  if (fieldnum.size() < 1)
509  return 0;
510  switch (fieldnum[0])
511  {
512  case 0:
513  return "filemode";
514  case 1:
515  return "file";
516  case 2:
517  return "objpattern";
518  case 3:
519  return "geodatapath";
520  case 4:
521  return "missingframe";
522  case 5:
523  return "loadtype";
524  case 6:
525  return "packedviewedit";
526  case 7:
527  return "viewportlod";
528  case 8:
529  return "packexpanded";
530  case 9:
531  return "delayload";
532  case 10:
533  return "mkpath";
534  case 11:
535  return "cachesize";
536  case 12:
537  return "prefetch";
538  case 13:
539  return "f";
540  case 14:
541  return "index";
542  case 15:
543  return "wrap";
544  case 16:
545  return "retry";
546 
547  }
548  return 0;
549  }
550 
551  ParmType getNestParmType(TempIndex fieldnum) const override
552  {
553  if (fieldnum.size() < 1)
554  return PARM_UNSUPPORTED;
555  switch (fieldnum[0])
556  {
557  case 0:
558  return PARM_INTEGER;
559  case 1:
560  return PARM_STRING;
561  case 2:
562  return PARM_STRING;
563  case 3:
564  return PARM_STRING;
565  case 4:
566  return PARM_INTEGER;
567  case 5:
568  return PARM_INTEGER;
569  case 6:
570  return PARM_INTEGER;
571  case 7:
572  return PARM_INTEGER;
573  case 8:
574  return PARM_INTEGER;
575  case 9:
576  return PARM_INTEGER;
577  case 10:
578  return PARM_INTEGER;
579  case 11:
580  return PARM_INTEGER;
581  case 12:
582  return PARM_INTEGER;
583  case 13:
584  return PARM_VECTOR2;
585  case 14:
586  return PARM_FLOAT;
587  case 15:
588  return PARM_INTEGER;
589  case 16:
590  return PARM_INTEGER;
591 
592  }
593  return PARM_UNSUPPORTED;
594  }
595 
596  // Boiler plate to load individual types.
597  static void loadData(UT_IStream &is, int64 &v)
598  { is.bread(&v, 1); }
599  static void loadData(UT_IStream &is, bool &v)
600  { int64 iv; is.bread(&iv, 1); v = iv; }
601  static void loadData(UT_IStream &is, fpreal64 &v)
602  { is.bread<fpreal64>(&v, 1); }
603  static void loadData(UT_IStream &is, UT_Vector2D &v)
604  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
605  static void loadData(UT_IStream &is, UT_Vector3D &v)
606  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
607  is.bread<fpreal64>(&v.z(), 1); }
608  static void loadData(UT_IStream &is, UT_Vector4D &v)
609  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
610  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
611  static void loadData(UT_IStream &is, UT_Matrix2D &v)
612  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
613  static void loadData(UT_IStream &is, UT_Matrix3D &v)
614  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
615  static void loadData(UT_IStream &is, UT_Matrix4D &v)
616  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
617  static void loadData(UT_IStream &is, UT_Vector2I &v)
618  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
619  static void loadData(UT_IStream &is, UT_Vector3I &v)
620  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
621  is.bread<int64>(&v.z(), 1); }
622  static void loadData(UT_IStream &is, UT_Vector4I &v)
623  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
624  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
626  { is.bread(v); }
628  { UT_StringHolder rampdata;
629  loadData(is, rampdata);
630  if (rampdata.isstring())
631  {
632  v.reset(new UT_Ramp());
633  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
634  v->load(istr);
635  }
636  else v.reset();
637  }
640  loadData(is, data);
641  if (data.isstring())
642  {
643  // Find the data type.
644  const char *colon = UT_StringWrap(data).findChar(':');
645  if (colon)
646  {
647  int typelen = colon - data.buffer();
649  type.strncpy(data.buffer(), typelen);
650  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
651 
652  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
653  }
654  }
655  else v.reset();
656  }
657 
658  static void saveData(std::ostream &os, int64 v)
659  { UTwrite(os, &v); }
660  static void saveData(std::ostream &os, bool v)
661  { int64 iv = v; UTwrite(os, &iv); }
662  static void saveData(std::ostream &os, fpreal64 v)
663  { UTwrite<fpreal64>(os, &v); }
664  static void saveData(std::ostream &os, UT_Vector2D v)
665  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
666  static void saveData(std::ostream &os, UT_Vector3D v)
667  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
668  UTwrite<fpreal64>(os, &v.z()); }
669  static void saveData(std::ostream &os, UT_Vector4D v)
670  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
671  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
672  static void saveData(std::ostream &os, UT_Matrix2D v)
674  static void saveData(std::ostream &os, UT_Matrix3D v)
676  static void saveData(std::ostream &os, UT_Matrix4D v)
678  static void saveData(std::ostream &os, UT_StringHolder s)
679  { UT_StringWrap(s).saveBinary(os); }
680  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
682  UT_OStringStream ostr;
683  if (s) s->save(ostr);
684  result = ostr.str();
685  saveData(os, result);
686  }
687  static void saveData(std::ostream &os, PRM_DataItemHandle s)
689  UT_OStringStream ostr;
690  if (s)
691  {
692  ostr << s->getDataTypeToken();
693  ostr << ":";
694  s->saveBinary(ostr);
695  }
696  result = ostr.str();
697  saveData(os, result);
698  }
699 
700 
701  void save(std::ostream &os) const
702  {
703  int32 v = version();
704  UTwrite(os, &v);
705  saveData(os, myFilemode);
706  saveData(os, myFile);
707  saveData(os, raw_myFile);
708  saveData(os, myObjpattern);
709  saveData(os, myGeodatapath);
710  saveData(os, myMissingframe);
711  saveData(os, myLoadtype);
712  saveData(os, myPackedviewedit);
713  saveData(os, myViewportlod);
714  saveData(os, myPackexpanded);
715  saveData(os, myDelayload);
716  saveData(os, myMkpath);
717  saveData(os, myCachesize);
718  saveData(os, myPrefetch);
719  saveData(os, myF);
720  saveData(os, myIndex);
721  saveData(os, myWrap);
722  saveData(os, myRetry);
723 
724  }
725 
726  bool load(UT_IStream &is)
727  {
728  int32 v;
729  is.bread(&v, 1);
730  if (version() != v)
731  {
732  // Fail incompatible versions
733  return false;
734  }
735  loadData(is, myFilemode);
736  loadData(is, myFile);
737  loadData(is, raw_myFile);
738  loadData(is, myObjpattern);
739  loadData(is, myGeodatapath);
740  loadData(is, myMissingframe);
741  loadData(is, myLoadtype);
742  loadData(is, myPackedviewedit);
743  loadData(is, myViewportlod);
744  loadData(is, myPackexpanded);
745  loadData(is, myDelayload);
746  loadData(is, myMkpath);
747  loadData(is, myCachesize);
748  loadData(is, myPrefetch);
749  loadData(is, myF);
750  loadData(is, myIndex);
751  loadData(is, myWrap);
752  loadData(is, myRetry);
753 
754  return true;
755  }
756 
757  Filemode getFilemode() const { return Filemode(myFilemode); }
758  void setFilemode(Filemode val) { myFilemode = int64(val); }
760  {
761  SOP_Node *thissop = cookparms.getNode();
762  if (!thissop) return getFilemode();
763  int64 result;
764  OP_Utils::evalOpParm(result, thissop, "filemode", cookparms.getCookTime(), 0);
765  return Filemode(result);
766  }
767  const UT_StringHolder & getFile() const { return myFile; }
768  void setFile(const UT_StringHolder & val) { myFile = val; }
770  {
771  SOP_Node *thissop = cookparms.getNode();
772  if (!thissop) return getFile();
774  OP_Utils::evalOpParm(result, thissop, "file", cookparms.getCookTime(), 0);
775  return result;
776  }
777  const UT_StringHolder & raw_getFile() const { return raw_myFile; }
778  void raw_setFile(const UT_StringHolder & val) { raw_myFile = val; }
780  {
781  SOP_Node *thissop = cookparms.getNode();
782  if (!thissop) return raw_getFile();
784  OP_Utils::evalOpParmRaw(result, thissop, "file", cookparms.getCookTime(), 0);
785  return result;
786  }
787  const UT_StringHolder & getObjpattern() const { return myObjpattern; }
788  void setObjpattern(const UT_StringHolder & val) { myObjpattern = val; }
790  {
791  SOP_Node *thissop = cookparms.getNode();
792  if (!thissop) return getObjpattern();
794  OP_Utils::evalOpParm(result, thissop, "objpattern", cookparms.getCookTime(), 0);
795  return result;
796  }
797  const UT_StringHolder & getGeodatapath() const { return myGeodatapath; }
798  void setGeodatapath(const UT_StringHolder & val) { myGeodatapath = val; }
800  {
801  SOP_Node *thissop = cookparms.getNode();
802  if (!thissop) return getGeodatapath();
804  OP_Utils::evalOpParm(result, thissop, "geodatapath", cookparms.getCookTime(), 0);
805  return result;
806  }
807  Missingframe getMissingframe() const { return Missingframe(myMissingframe); }
808  void setMissingframe(Missingframe val) { myMissingframe = int64(val); }
810  {
811  SOP_Node *thissop = cookparms.getNode();
812  if (!thissop) return getMissingframe();
813  int64 result;
814  OP_Utils::evalOpParm(result, thissop, "missingframe", cookparms.getCookTime(), 0);
815  return Missingframe(result);
816  }
817  Loadtype getLoadtype() const { return Loadtype(myLoadtype); }
818  void setLoadtype(Loadtype val) { myLoadtype = int64(val); }
820  {
821  SOP_Node *thissop = cookparms.getNode();
822  if (!thissop) return getLoadtype();
823  int64 result;
824  OP_Utils::evalOpParm(result, thissop, "loadtype", cookparms.getCookTime(), 0);
825  return Loadtype(result);
826  }
827  Packedviewedit getPackedviewedit() const { return Packedviewedit(myPackedviewedit); }
828  void setPackedviewedit(Packedviewedit val) { myPackedviewedit = int64(val); }
830  {
831  SOP_Node *thissop = cookparms.getNode();
832  if (!thissop) return getPackedviewedit();
833  int64 result;
834  OP_Utils::evalOpParm(result, thissop, "packedviewedit", cookparms.getCookTime(), 0);
835  return Packedviewedit(result);
836  }
837  Viewportlod getViewportlod() const { return Viewportlod(myViewportlod); }
838  void setViewportlod(Viewportlod val) { myViewportlod = int64(val); }
840  {
841  SOP_Node *thissop = cookparms.getNode();
842  if (!thissop) return getViewportlod();
843  int64 result;
844  OP_Utils::evalOpParm(result, thissop, "viewportlod", cookparms.getCookTime(), 0);
845  return Viewportlod(result);
846  }
847  bool getPackexpanded() const { return myPackexpanded; }
848  void setPackexpanded(bool val) { myPackexpanded = val; }
849  bool opPackexpanded(const SOP_NodeVerb::CookParms &cookparms) const
850  {
851  SOP_Node *thissop = cookparms.getNode();
852  if (!thissop) return getPackexpanded();
853  bool result;
854  OP_Utils::evalOpParm(result, thissop, "packexpanded", cookparms.getCookTime(), 0);
855  return result;
856  }
857  bool getDelayload() const { return myDelayload; }
858  void setDelayload(bool val) { myDelayload = val; }
859  bool opDelayload(const SOP_NodeVerb::CookParms &cookparms) const
860  {
861  SOP_Node *thissop = cookparms.getNode();
862  if (!thissop) return getDelayload();
863  bool result;
864  OP_Utils::evalOpParm(result, thissop, "delayload", cookparms.getCookTime(), 0);
865  return result;
866  }
867  bool getMkpath() const { return myMkpath; }
868  void setMkpath(bool val) { myMkpath = val; }
869  bool opMkpath(const SOP_NodeVerb::CookParms &cookparms) const
870  {
871  SOP_Node *thissop = cookparms.getNode();
872  if (!thissop) return getMkpath();
873  bool result;
874  OP_Utils::evalOpParm(result, thissop, "mkpath", cookparms.getCookTime(), 0);
875  return result;
876  }
877  int64 getCachesize() const { return myCachesize; }
878  void setCachesize(int64 val) { myCachesize = val; }
879  int64 opCachesize(const SOP_NodeVerb::CookParms &cookparms) const
880  {
881  SOP_Node *thissop = cookparms.getNode();
882  if (!thissop) return getCachesize();
883  int64 result;
884  OP_Utils::evalOpParm(result, thissop, "cachesize", cookparms.getCookTime(), 0);
885  return result;
886  }
887  bool getPrefetch() const { return myPrefetch; }
888  void setPrefetch(bool val) { myPrefetch = val; }
889  bool opPrefetch(const SOP_NodeVerb::CookParms &cookparms) const
890  {
891  SOP_Node *thissop = cookparms.getNode();
892  if (!thissop) return getPrefetch();
893  bool result;
894  OP_Utils::evalOpParm(result, thissop, "prefetch", cookparms.getCookTime(), 0);
895  return result;
896  }
897  UT_Vector2I getF() const { return myF; }
898  void setF(UT_Vector2I val) { myF = val; }
899  UT_Vector2I opF(const SOP_NodeVerb::CookParms &cookparms) const
900  {
901  SOP_Node *thissop = cookparms.getNode();
902  if (!thissop) return getF();
904  OP_Utils::evalOpParm(result, thissop, "f", cookparms.getCookTime(), 0);
905  return result;
906  }
907  fpreal64 getIndex() const { return myIndex; }
908  void setIndex(fpreal64 val) { myIndex = val; }
909  fpreal64 opIndex(const SOP_NodeVerb::CookParms &cookparms) const
910  {
911  SOP_Node *thissop = cookparms.getNode();
912  if (!thissop) return getIndex();
914  OP_Utils::evalOpParm(result, thissop, "index", cookparms.getCookTime(), 0);
915  return result;
916  }
917  Wrap getWrap() const { return Wrap(myWrap); }
918  void setWrap(Wrap val) { myWrap = int64(val); }
919  Wrap opWrap(const SOP_NodeVerb::CookParms &cookparms) const
920  {
921  SOP_Node *thissop = cookparms.getNode();
922  if (!thissop) return getWrap();
923  int64 result;
924  OP_Utils::evalOpParm(result, thissop, "wrap", cookparms.getCookTime(), 0);
925  return Wrap(result);
926  }
927  int64 getRetry() const { return myRetry; }
928  void setRetry(int64 val) { myRetry = val; }
929  int64 opRetry(const SOP_NodeVerb::CookParms &cookparms) const
930  {
931  SOP_Node *thissop = cookparms.getNode();
932  if (!thissop) return getRetry();
933  int64 result;
934  OP_Utils::evalOpParm(result, thissop, "retry", cookparms.getCookTime(), 0);
935  return result;
936  }
937 
938 private:
939  int64 myFilemode;
940  UT_StringHolder myFile;
941  UT_StringHolder raw_myFile;
942  UT_StringHolder myObjpattern;
943  UT_StringHolder myGeodatapath;
944  int64 myMissingframe;
945  int64 myLoadtype;
946  int64 myPackedviewedit;
947  int64 myViewportlod;
948  bool myPackexpanded;
949  bool myDelayload;
950  bool myMkpath;
951  int64 myCachesize;
952  bool myPrefetch;
953  UT_Vector2I myF;
954  fpreal64 myIndex;
955  int64 myWrap;
956  int64 myRetry;
957 
958 };
virtual NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused=false) const =0
type
Definition: core.h:556
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:63
GLsizei const GLfloat * value
Definition: glcorearb.h:824
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:622
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)
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: APEX_Include.h:55
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:303
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:278
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:96
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
virtual UT_StringHolder baseGetSignature() const
Definition: OP_NodeParms.h:294
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:372
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:1401
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
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)
void loadFromOpSubclass(const LoadParms &loadparms) override
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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)
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)