HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GAS_OpenCLParms.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 <GAS/GAS_API.h>
7 #include <SIM/SIM_Query.h>
8 #include <OP/OP_Utils.h>
9 #include <PRM/PRM_Parm.h>
10 #include <UT/UT_IStream.h>
11 #include <UT/UT_NTStreamUtil.h>
12 #include <UT/UT_Ramp.h>
13 #include <UT/UT_SharedPtr.h>
14 #include <UT/UT_StringHolder.h>
15 #include <UT/UT_StringStream.h>
16 #include <UT/UT_VectorTypes.h>
17 #include <UT/UT_EnvControl.h>
18 #include <SYS/SYS_Types.h>
19 
20 class DEP_MicroNode;
21 
23 {
24 public:
25  static int version() { return 13; }
26  struct Bindings
27  {
47  bool resolution;
48  bool voxelsize;
52  bool readable;
53  bool writeable;
54  bool optional;
55  bool defval;
60 
61 
63  {
64  name = ""_UTsh;
65  type = 0;
66  intval = 0;
67  fval = 0;
68  v2val = 0;
69  v3val = 0;
70  v4val = 0;
71  timescale = 0;
72  fieldname = ""_UTsh;
73  fieldoffsets = false;
74  ramp = UT_SharedPtr<UT_Ramp>(0);
75  rampsize = 1024;
76  geometry = "Geometry"_UTsh;
77  attribute = ""_UTsh;
78  attribclass = 2;
79  attribtype = 0;
80  attribsize = 1;
81  volume = ""_UTsh;
82  vdbtype = 0;
83  resolution = false;
84  voxelsize = false;
85  xformtoworld = false;
86  xformtovoxel = false;
87  precision = 2;
88  readable = true;
89  writeable = false;
90  optional = false;
91  defval = false;
92  dataname = ""_UTsh;
93  optionname = ""_UTsh;
94  optiontype = 0;
95  optionsize = 1;
96 
97  }
98 
99  bool operator==(const Bindings &src) const
100  {
101  if (name != src.name) return false;
102  if (type != src.type) return false;
103  if (intval != src.intval) return false;
104  if (fval != src.fval) return false;
105  if (v2val != src.v2val) return false;
106  if (v3val != src.v3val) return false;
107  if (v4val != src.v4val) return false;
108  if (timescale != src.timescale) return false;
109  if (fieldname != src.fieldname) return false;
110  if (fieldoffsets != src.fieldoffsets) return false;
111  if (ramp != src.ramp)
112  { if (!ramp || !src.ramp || !(*ramp == *src.ramp)) return false; }
113  if (rampsize != src.rampsize) return false;
114  if (geometry != src.geometry) return false;
115  if (attribute != src.attribute) return false;
116  if (attribclass != src.attribclass) return false;
117  if (attribtype != src.attribtype) return false;
118  if (attribsize != src.attribsize) return false;
119  if (volume != src.volume) return false;
120  if (vdbtype != src.vdbtype) return false;
121  if (resolution != src.resolution) return false;
122  if (voxelsize != src.voxelsize) return false;
123  if (xformtoworld != src.xformtoworld) return false;
124  if (xformtovoxel != src.xformtovoxel) return false;
125  if (precision != src.precision) return false;
126  if (readable != src.readable) return false;
127  if (writeable != src.writeable) return false;
128  if (optional != src.optional) return false;
129  if (defval != src.defval) return false;
130  if (dataname != src.dataname) return false;
131  if (optionname != src.optionname) return false;
132  if (optiontype != src.optiontype) return false;
133  if (optionsize != src.optionsize) return false;
134 
135  return true;
136  }
137  bool operator!=(const Bindings &src) const
138  {
139  return !operator==(src);
140  }
141 
142  };
143 
145  {
147 
148  buf.strcat("[ ");
149  for (int i = 0; i < list.entries(); i++)
150  {
151  if (i)
152  buf.strcat(", ");
153  buf.strcat("( ");
154  buf.append("");
155  { UT_String tmp; tmp = UT_StringWrap(list(i).name).makeQuotedString('"'); buf.strcat(tmp); }
156  buf.append(", ");
157  buf.appendSprintf("%d", (int) list(i).type);
158  buf.append(", ");
159  buf.appendSprintf("%d", (int) list(i).intval);
160  buf.append(", ");
161  buf.appendSprintf("%f", (list(i).fval));
162  buf.append(", ");
163  buf.appendSprintf("(%f, %f)", list(i).v2val.x(), list(i).v2val.y());
164  buf.append(", ");
165  buf.appendSprintf("(%f, %f, %f)", list(i).v3val.x(), list(i).v3val.y(), list(i).v3val.z());
166  buf.append(", ");
167  buf.appendSprintf("(%f, %f, %f, %f)", list(i).v4val.x(), list(i).v4val.y(), list(i).v4val.z(), list(i).v4val.w());
168  buf.append(", ");
169  buf.appendSprintf("%d", (int) list(i).timescale);
170  buf.append(", ");
171  { UT_String tmp; tmp = UT_StringWrap(list(i).fieldname).makeQuotedString('"'); buf.strcat(tmp); }
172  buf.append(", ");
173  buf.appendSprintf("%s", (list(i).fieldoffsets) ? "true" : "false");
174  buf.append(", ");
175  if (list(i).ramp)
176  {
177  UT_OStringStream os;
178  UT_String tmp;
179  list(i).ramp->save(os);
180  tmp = UT_StringWrap(os.str().buffer()).makeQuotedString('"');
181  buf.strcat(tmp);
182  }
183  else buf.strcat("""");
184  buf.append(", ");
185  buf.appendSprintf("%d", (int) list(i).rampsize);
186  buf.append(", ");
187  { UT_String tmp; tmp = UT_StringWrap(list(i).geometry).makeQuotedString('"'); buf.strcat(tmp); }
188  buf.append(", ");
189  { UT_String tmp; tmp = UT_StringWrap(list(i).attribute).makeQuotedString('"'); buf.strcat(tmp); }
190  buf.append(", ");
191  buf.appendSprintf("%d", (int) list(i).attribclass);
192  buf.append(", ");
193  buf.appendSprintf("%d", (int) list(i).attribtype);
194  buf.append(", ");
195  buf.appendSprintf("%d", (int) list(i).attribsize);
196  buf.append(", ");
197  { UT_String tmp; tmp = UT_StringWrap(list(i).volume).makeQuotedString('"'); buf.strcat(tmp); }
198  buf.append(", ");
199  buf.appendSprintf("%d", (int) list(i).vdbtype);
200  buf.append(", ");
201  buf.appendSprintf("%s", (list(i).resolution) ? "true" : "false");
202  buf.append(", ");
203  buf.appendSprintf("%s", (list(i).voxelsize) ? "true" : "false");
204  buf.append(", ");
205  buf.appendSprintf("%s", (list(i).xformtoworld) ? "true" : "false");
206  buf.append(", ");
207  buf.appendSprintf("%s", (list(i).xformtovoxel) ? "true" : "false");
208  buf.append(", ");
209  buf.appendSprintf("%d", (int) list(i).precision);
210  buf.append(", ");
211  buf.appendSprintf("%s", (list(i).readable) ? "true" : "false");
212  buf.append(", ");
213  buf.appendSprintf("%s", (list(i).writeable) ? "true" : "false");
214  buf.append(", ");
215  buf.appendSprintf("%s", (list(i).optional) ? "true" : "false");
216  buf.append(", ");
217  buf.appendSprintf("%s", (list(i).defval) ? "true" : "false");
218  buf.append(", ");
219  { UT_String tmp; tmp = UT_StringWrap(list(i).dataname).makeQuotedString('"'); buf.strcat(tmp); }
220  buf.append(", ");
221  { UT_String tmp; tmp = UT_StringWrap(list(i).optionname).makeQuotedString('"'); buf.strcat(tmp); }
222  buf.append(", ");
223  buf.appendSprintf("%d", (int) list(i).optiontype);
224  buf.append(", ");
225  buf.appendSprintf("%d", (int) list(i).optionsize);
226 
227  buf.strcat(" )");
228  }
229  buf.strcat(" ]");
230 
232  return result;
233  }
234 
236  {
237  myRunOver = 0;
238  myAlign = true;
239  myUseCode = false;
240  myKernelName = "kernelName"_UTsh;
241  myKernelFile = ""_UTsh;
242  myKernelCode = ""_UTsh;
243  myAtBinding = false;
244  myKernelOptions = ""_UTsh;
245  myOptionAttribute = ""_UTsh;
246  myRecompile = false;
247  myOrigin = false;
248  mySize = false;
249  myVoxelSize = false;
250  myTime = false;
251  myFrame = false;
252  myTimeInc = false;
253  myFlushAttributes = false;
254  myFinish = 1;
255  myTimeScale = 1;
256  myTimeMethod = 0;
257  myXNoise = false;
258  myWorksetsGeometry = ""_UTsh;
259  myWorksetsBeginAttr = ""_UTsh;
260  myWorksetsLengthAttr = ""_UTsh;
261  myWarnMissing = 1;
262  myErrorMismatchedPoint = false;
263  myErrorMismatchedPrim = false;
264  mySingleWorkgroup = 0;
265  myPrecision = 2;
266  myImportPrequel = true;
267 
268  }
269 
270  explicit GAS_OpenCLParms(const GAS_OpenCLParms &) = default;
271  GAS_OpenCLParms &operator=(const GAS_OpenCLParms &) = default;
272  GAS_OpenCLParms(GAS_OpenCLParms &&) noexcept = default;
273  GAS_OpenCLParms &operator=(GAS_OpenCLParms &&) noexcept = default;
274 
276 
277  bool operator==(const GAS_OpenCLParms &src) const
278  {
279  if (myRunOver != src.myRunOver) return false;
280  if (myAlign != src.myAlign) return false;
281  if (myUseCode != src.myUseCode) return false;
282  if (myKernelName != src.myKernelName) return false;
283  if (myKernelFile != src.myKernelFile) return false;
284  if (myKernelCode != src.myKernelCode) return false;
285  if (myAtBinding != src.myAtBinding) return false;
286  if (myKernelOptions != src.myKernelOptions) return false;
287  if (myOptionAttribute != src.myOptionAttribute) return false;
288  if (myRecompile != src.myRecompile) return false;
289  if (myOrigin != src.myOrigin) return false;
290  if (mySize != src.mySize) return false;
291  if (myVoxelSize != src.myVoxelSize) return false;
292  if (myTime != src.myTime) return false;
293  if (myFrame != src.myFrame) return false;
294  if (myTimeInc != src.myTimeInc) return false;
295  if (myFlushAttributes != src.myFlushAttributes) return false;
296  if (myFinish != src.myFinish) return false;
297  if (myTimeScale != src.myTimeScale) return false;
298  if (myTimeMethod != src.myTimeMethod) return false;
299  if (myXNoise != src.myXNoise) return false;
300  if (myWorksetsGeometry != src.myWorksetsGeometry) return false;
301  if (myWorksetsBeginAttr != src.myWorksetsBeginAttr) return false;
302  if (myWorksetsLengthAttr != src.myWorksetsLengthAttr) return false;
303  if (myWarnMissing != src.myWarnMissing) return false;
304  if (myErrorMismatchedPoint != src.myErrorMismatchedPoint) return false;
305  if (myErrorMismatchedPrim != src.myErrorMismatchedPrim) return false;
306  if (mySingleWorkgroup != src.mySingleWorkgroup) return false;
307  if (myPrecision != src.myPrecision) return false;
308  if (myImportPrequel != src.myImportPrequel) return false;
309  if (myBindings != src.myBindings) return false;
310 
311  return true;
312  }
313  bool operator!=(const GAS_OpenCLParms &src) const
314  {
315  return !operator==(src);
316  }
317 
318 
319  class Query : public SIM_Query
320  {
321  public:
322  explicit Query(const SIM_Data *owner, const GAS_OpenCLParms &parms)
323  : SIM_Query(owner)
324  , myParms(parms)
325  { }
326  ~Query() override {}
327 
328  protected:
329  bool isMyRecord(const char *recordtype) const
330  { return !strcmp(recordtype, "Params"); }
331 
332  int getNumRecordTypesSubclass() const override { return 1; }
333  const char *getRecordTypeNameSubclass(int recordtypenum) const override
334  {
335  if (recordtypenum == 0) return "Params";
336  return 0;
337  }
338  int getNumRecordsSubclass(const char *recordtype) const override
339  {
340  if (isMyRecord(recordtype)) return 1;
341  return 0;
342  }
343  int getNumFieldsSubclass(const char *recordtype) const override
344  {
345  if (isMyRecord(recordtype))
346  return 31;
347  return 0;
348  }
349 
350  const char *getFieldNameSubclass(const char *recordtype,
351  int fieldnum) const override
352  {
353  if (!isMyRecord(recordtype))
354  return 0;
355 
356  switch (fieldnum)
357  {
358  case 0:
359  return "runover";
360  case 1:
361  return "align";
362  case 2:
363  return "usecode";
364  case 3:
365  return "kernelname";
366  case 4:
367  return "kernelfile";
368  case 5:
369  return "kernelcode";
370  case 6:
371  return "atbinding";
372  case 7:
373  return "kerneloptions";
374  case 8:
375  return "kerneloptionattrib";
376  case 9:
377  return "recompile";
378  case 10:
379  return "origin";
380  case 11:
381  return "size";
382  case 12:
383  return "voxelsize";
384  case 13:
385  return "time";
386  case 14:
387  return "frame";
388  case 15:
389  return "timeinc";
390  case 16:
391  return "flushattrib";
392  case 17:
393  return "finish";
394  case 18:
395  return "timescale";
396  case 19:
397  return "timemethod";
398  case 20:
399  return "xnoise";
400  case 21:
401  return "worksets_geo";
402  case 22:
403  return "worksets_begin";
404  case 23:
405  return "worksets_length";
406  case 24:
407  return "warnmissing";
408  case 25:
409  return "errormismatchedpoint";
410  case 26:
411  return "errormismatchedprim";
412  case 27:
413  return "singleworkgroup";
414  case 28:
415  return "precision";
416  case 29:
417  return "importprequel";
418  case 30:
419  return "bindings";
420 
421  }
422  return 0;
423  }
424  UT_OptionType getFieldTypeSubclass(const char *recordtype,
425  int fieldnum) const override
426  {
427  if (!isMyRecord(recordtype))
428  return UT_OPTION_INVALID;
429 
430  switch (fieldnum)
431  {
432  case 0:
433  return UT_OPTION_INT;
434  case 1:
435  return UT_OPTION_BOOL;
436  case 2:
437  return UT_OPTION_BOOL;
438  case 3:
439  return UT_OPTION_STRING;
440  case 4:
441  return UT_OPTION_STRING;
442  case 5:
443  return UT_OPTION_STRING;
444  case 6:
445  return UT_OPTION_BOOL;
446  case 7:
447  return UT_OPTION_STRING;
448  case 8:
449  return UT_OPTION_STRING;
450  case 9:
451  return UT_OPTION_BOOL;
452  case 10:
453  return UT_OPTION_BOOL;
454  case 11:
455  return UT_OPTION_BOOL;
456  case 12:
457  return UT_OPTION_BOOL;
458  case 13:
459  return UT_OPTION_BOOL;
460  case 14:
461  return UT_OPTION_BOOL;
462  case 15:
463  return UT_OPTION_BOOL;
464  case 16:
465  return UT_OPTION_BOOL;
466  case 17:
467  return UT_OPTION_BOOL;
468  case 18:
469  return UT_OPTION_FPREAL;
470  case 19:
471  return UT_OPTION_INT;
472  case 20:
473  return UT_OPTION_BOOL;
474  case 21:
475  return UT_OPTION_STRING;
476  case 22:
477  return UT_OPTION_STRING;
478  case 23:
479  return UT_OPTION_STRING;
480  case 24:
481  return UT_OPTION_BOOL;
482  case 25:
483  return UT_OPTION_BOOL;
484  case 26:
485  return UT_OPTION_BOOL;
486  case 27:
487  return UT_OPTION_INT;
488  case 28:
489  return UT_OPTION_INT;
490  case 29:
491  return UT_OPTION_BOOL;
492  case 30:
493  return UT_OPTION_STRING;
494 
495  }
496  return UT_OPTION_INVALID;
497  }
498 
499  bool getFieldRawSubclass(const char *recordtype,
500  int recordnum,
501  const char *fieldname,
502  UT_OptionEntryPtr &result) const override
503  {
504  if (!isMyRecord(recordtype))
505  return false;
506  if (recordnum != 0)
507  return false;
508  // This is less optimal, but if we are in SIM_Query
509  // land we have already given up on performance.
510  if (!strcmp(fieldname, "runover"))
511  {
512  result = UTmakeUnique<UT_OptionInt>(myParms.myRunOver);
513  return true;
514  }
515  if (!strcmp(fieldname, "align"))
516  {
517  result = UTmakeUnique<UT_OptionBool>(myParms.myAlign);
518  return true;
519  }
520  if (!strcmp(fieldname, "usecode"))
521  {
522  result = UTmakeUnique<UT_OptionBool>(myParms.myUseCode);
523  return true;
524  }
525  if (!strcmp(fieldname, "kernelname"))
526  {
527  result = UTmakeUnique<UT_OptionString>(myParms.myKernelName);
528  return true;
529  }
530  if (!strcmp(fieldname, "kernelfile"))
531  {
532  result = UTmakeUnique<UT_OptionString>(myParms.myKernelFile);
533  return true;
534  }
535  if (!strcmp(fieldname, "kernelcode"))
536  {
537  result = UTmakeUnique<UT_OptionString>(myParms.myKernelCode);
538  return true;
539  }
540  if (!strcmp(fieldname, "atbinding"))
541  {
542  result = UTmakeUnique<UT_OptionBool>(myParms.myAtBinding);
543  return true;
544  }
545  if (!strcmp(fieldname, "kerneloptions"))
546  {
547  result = UTmakeUnique<UT_OptionString>(myParms.myKernelOptions);
548  return true;
549  }
550  if (!strcmp(fieldname, "kerneloptionattrib"))
551  {
552  result = UTmakeUnique<UT_OptionString>(myParms.myOptionAttribute);
553  return true;
554  }
555  if (!strcmp(fieldname, "recompile"))
556  {
557  result = UTmakeUnique<UT_OptionBool>(myParms.myRecompile);
558  return true;
559  }
560  if (!strcmp(fieldname, "origin"))
561  {
562  result = UTmakeUnique<UT_OptionBool>(myParms.myOrigin);
563  return true;
564  }
565  if (!strcmp(fieldname, "size"))
566  {
567  result = UTmakeUnique<UT_OptionBool>(myParms.mySize);
568  return true;
569  }
570  if (!strcmp(fieldname, "voxelsize"))
571  {
572  result = UTmakeUnique<UT_OptionBool>(myParms.myVoxelSize);
573  return true;
574  }
575  if (!strcmp(fieldname, "time"))
576  {
577  result = UTmakeUnique<UT_OptionBool>(myParms.myTime);
578  return true;
579  }
580  if (!strcmp(fieldname, "frame"))
581  {
582  result = UTmakeUnique<UT_OptionBool>(myParms.myFrame);
583  return true;
584  }
585  if (!strcmp(fieldname, "timeinc"))
586  {
587  result = UTmakeUnique<UT_OptionBool>(myParms.myTimeInc);
588  return true;
589  }
590  if (!strcmp(fieldname, "flushattrib"))
591  {
592  result = UTmakeUnique<UT_OptionBool>(myParms.myFlushAttributes);
593  return true;
594  }
595  if (!strcmp(fieldname, "finish"))
596  {
597  result = UTmakeUnique<UT_OptionBool>(myParms.myFinish);
598  return true;
599  }
600  if (!strcmp(fieldname, "timescale"))
601  {
602  result = UTmakeUnique<UT_OptionFpreal>(myParms.myTimeScale);
603  return true;
604  }
605  if (!strcmp(fieldname, "timemethod"))
606  {
607  result = UTmakeUnique<UT_OptionInt>(myParms.myTimeMethod);
608  return true;
609  }
610  if (!strcmp(fieldname, "xnoise"))
611  {
612  result = UTmakeUnique<UT_OptionBool>(myParms.myXNoise);
613  return true;
614  }
615  if (!strcmp(fieldname, "worksets_geo"))
616  {
617  result = UTmakeUnique<UT_OptionString>(myParms.myWorksetsGeometry);
618  return true;
619  }
620  if (!strcmp(fieldname, "worksets_begin"))
621  {
622  result = UTmakeUnique<UT_OptionString>(myParms.myWorksetsBeginAttr);
623  return true;
624  }
625  if (!strcmp(fieldname, "worksets_length"))
626  {
627  result = UTmakeUnique<UT_OptionString>(myParms.myWorksetsLengthAttr);
628  return true;
629  }
630  if (!strcmp(fieldname, "warnmissing"))
631  {
632  result = UTmakeUnique<UT_OptionBool>(myParms.myWarnMissing);
633  return true;
634  }
635  if (!strcmp(fieldname, "errormismatchedpoint"))
636  {
637  result = UTmakeUnique<UT_OptionBool>(myParms.myErrorMismatchedPoint);
638  return true;
639  }
640  if (!strcmp(fieldname, "errormismatchedprim"))
641  {
642  result = UTmakeUnique<UT_OptionBool>(myParms.myErrorMismatchedPrim);
643  return true;
644  }
645  if (!strcmp(fieldname, "singleworkgroup"))
646  {
647  result = UTmakeUnique<UT_OptionInt>(myParms.mySingleWorkgroup);
648  return true;
649  }
650  if (!strcmp(fieldname, "precision"))
651  {
652  result = UTmakeUnique<UT_OptionInt>(myParms.myPrecision);
653  return true;
654  }
655  if (!strcmp(fieldname, "importprequel"))
656  {
657  result = UTmakeUnique<UT_OptionBool>(myParms.myImportPrequel);
658  return true;
659  }
660  if (!strcmp(fieldname, "bindings"))
661  {
662  result = UTmakeUnique<UT_OptionString>(myParms.createString(myParms.myBindings));
663  return true;
664  }
665 
666  // Failed to find
667  return false;
668  }
669 
671  };
672 
673  SIM_Query *createQueryObject(const SIM_Data *owner) const
674  { return new Query(owner, *this); }
675 
676 
677 
678 
679  // Boiler plate to load individual types.
680  static void loadData(UT_IStream &is, int64 &v)
681  { is.bread(&v, 1); }
682  static void loadData(UT_IStream &is, bool &v)
683  { int64 iv; is.bread(&iv, 1); v = iv; }
684  static void loadData(UT_IStream &is, fpreal64 &v)
685  { is.bread<fpreal64>(&v, 1); }
686  static void loadData(UT_IStream &is, UT_Vector2D &v)
687  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
688  static void loadData(UT_IStream &is, UT_Vector3D &v)
689  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
690  is.bread<fpreal64>(&v.z(), 1); }
691  static void loadData(UT_IStream &is, UT_Vector4D &v)
692  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
693  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
694  static void loadData(UT_IStream &is, UT_Matrix2D &v)
695  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
696  static void loadData(UT_IStream &is, UT_Matrix3D &v)
697  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
698  static void loadData(UT_IStream &is, UT_Matrix4D &v)
699  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
700  static void loadData(UT_IStream &is, UT_Vector2I &v)
701  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
702  static void loadData(UT_IStream &is, UT_Vector3I &v)
703  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
704  is.bread<int64>(&v.z(), 1); }
705  static void loadData(UT_IStream &is, UT_Vector4I &v)
706  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
707  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
709  { is.bread(v); }
711  { UT_StringHolder rampdata;
712  loadData(is, rampdata);
713  if (rampdata.isstring())
714  {
715  v.reset(new UT_Ramp());
716  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
717  v->load(istr);
718  }
719  else v.reset();
720  }
723  loadData(is, data);
724  if (data.isstring())
725  {
726  // Find the data type.
727  const char *colon = UT_StringWrap(data).findChar(':');
728  if (colon)
729  {
730  int typelen = colon - data.buffer();
732  type.strncpy(data.buffer(), typelen);
733  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
734 
735  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
736  }
737  }
738  else v.reset();
739  }
740 
741  static void saveData(std::ostream &os, int64 v)
742  { UTwrite(os, &v); }
743  static void saveData(std::ostream &os, bool v)
744  { int64 iv = v; UTwrite(os, &iv); }
745  static void saveData(std::ostream &os, fpreal64 v)
746  { UTwrite<fpreal64>(os, &v); }
747  static void saveData(std::ostream &os, UT_Vector2D v)
748  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
749  static void saveData(std::ostream &os, UT_Vector3D v)
750  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
751  UTwrite<fpreal64>(os, &v.z()); }
752  static void saveData(std::ostream &os, UT_Vector4D v)
753  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
754  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
755  static void saveData(std::ostream &os, UT_Matrix2D v)
757  static void saveData(std::ostream &os, UT_Matrix3D v)
759  static void saveData(std::ostream &os, UT_Matrix4D v)
761  static void saveData(std::ostream &os, UT_StringHolder s)
762  { UT_StringWrap(s).saveBinary(os); }
763  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
765  UT_OStringStream ostr;
766  if (s) s->save(ostr);
767  result = ostr.str();
768  saveData(os, result);
769  }
770  static void saveData(std::ostream &os, PRM_DataItemHandle s)
772  UT_OStringStream ostr;
773  if (s)
774  {
775  ostr << s->getDataTypeToken();
776  ostr << ":";
777  s->saveBinary(ostr);
778  }
779  result = ostr.str();
780  saveData(os, result);
781  }
782 
783 
784  void save(std::ostream &os) const
785  {
786  int32 v = version();
787  UTwrite(os, &v);
788  saveData(os, myRunOver);
789  saveData(os, myAlign);
790  saveData(os, myUseCode);
791  saveData(os, myKernelName);
792  saveData(os, myKernelFile);
793  saveData(os, myKernelCode);
794  saveData(os, myAtBinding);
795  saveData(os, myKernelOptions);
796  saveData(os, myOptionAttribute);
797  saveData(os, myRecompile);
798  saveData(os, myOrigin);
799  saveData(os, mySize);
800  saveData(os, myVoxelSize);
801  saveData(os, myTime);
802  saveData(os, myFrame);
803  saveData(os, myTimeInc);
804  saveData(os, myFlushAttributes);
805  saveData(os, myFinish);
806  saveData(os, myTimeScale);
807  saveData(os, myTimeMethod);
808  saveData(os, myXNoise);
809  saveData(os, myWorksetsGeometry);
810  saveData(os, myWorksetsBeginAttr);
811  saveData(os, myWorksetsLengthAttr);
812  saveData(os, myWarnMissing);
813  saveData(os, myErrorMismatchedPoint);
814  saveData(os, myErrorMismatchedPrim);
815  saveData(os, mySingleWorkgroup);
816  saveData(os, myPrecision);
817  saveData(os, myImportPrequel);
818  {
819  int64 length = myBindings.entries();
820  UTwrite(os, &length);
821  for (exint i = 0; i < length; i++)
822  {
823  auto && _curentry = myBindings(i);
824  (void) _curentry;
825  saveData(os, _curentry.name);
826  saveData(os, _curentry.type);
827  saveData(os, _curentry.intval);
828  saveData(os, _curentry.fval);
829  saveData(os, _curentry.v2val);
830  saveData(os, _curentry.v3val);
831  saveData(os, _curentry.v4val);
832  saveData(os, _curentry.timescale);
833  saveData(os, _curentry.fieldname);
834  saveData(os, _curentry.fieldoffsets);
835  saveData(os, _curentry.ramp);
836  saveData(os, _curentry.rampsize);
837  saveData(os, _curentry.geometry);
838  saveData(os, _curentry.attribute);
839  saveData(os, _curentry.attribclass);
840  saveData(os, _curentry.attribtype);
841  saveData(os, _curentry.attribsize);
842  saveData(os, _curentry.volume);
843  saveData(os, _curentry.vdbtype);
844  saveData(os, _curentry.resolution);
845  saveData(os, _curentry.voxelsize);
846  saveData(os, _curentry.xformtoworld);
847  saveData(os, _curentry.xformtovoxel);
848  saveData(os, _curentry.precision);
849  saveData(os, _curentry.readable);
850  saveData(os, _curentry.writeable);
851  saveData(os, _curentry.optional);
852  saveData(os, _curentry.defval);
853  saveData(os, _curentry.dataname);
854  saveData(os, _curentry.optionname);
855  saveData(os, _curentry.optiontype);
856  saveData(os, _curentry.optionsize);
857 
858  }
859  }
860 
861  }
862 
863  bool load(UT_IStream &is)
864  {
865  int32 v;
866  is.bread(&v, 1);
867  if (version() != v)
868  {
869  // Fail incompatible versions
870  return false;
871  }
872  loadData(is, myRunOver);
873  loadData(is, myAlign);
874  loadData(is, myUseCode);
875  loadData(is, myKernelName);
876  loadData(is, myKernelFile);
877  loadData(is, myKernelCode);
878  loadData(is, myAtBinding);
879  loadData(is, myKernelOptions);
880  loadData(is, myOptionAttribute);
881  loadData(is, myRecompile);
882  loadData(is, myOrigin);
883  loadData(is, mySize);
884  loadData(is, myVoxelSize);
885  loadData(is, myTime);
886  loadData(is, myFrame);
887  loadData(is, myTimeInc);
888  loadData(is, myFlushAttributes);
889  loadData(is, myFinish);
890  loadData(is, myTimeScale);
891  loadData(is, myTimeMethod);
892  loadData(is, myXNoise);
893  loadData(is, myWorksetsGeometry);
894  loadData(is, myWorksetsBeginAttr);
895  loadData(is, myWorksetsLengthAttr);
896  loadData(is, myWarnMissing);
897  loadData(is, myErrorMismatchedPoint);
898  loadData(is, myErrorMismatchedPrim);
899  loadData(is, mySingleWorkgroup);
900  loadData(is, myPrecision);
901  loadData(is, myImportPrequel);
902  {
903  int64 length;
904  is.read(&length, 1);
905  myBindings.setSize(length);
906  for (exint i = 0; i < length; i++)
907  {
908  auto && _curentry = myBindings(i);
909  (void) _curentry;
910  loadData(is, _curentry.name);
911  loadData(is, _curentry.type);
912  loadData(is, _curentry.intval);
913  loadData(is, _curentry.fval);
914  loadData(is, _curentry.v2val);
915  loadData(is, _curentry.v3val);
916  loadData(is, _curentry.v4val);
917  loadData(is, _curentry.timescale);
918  loadData(is, _curentry.fieldname);
919  loadData(is, _curentry.fieldoffsets);
920  loadData(is, _curentry.ramp);
921  loadData(is, _curentry.rampsize);
922  loadData(is, _curentry.geometry);
923  loadData(is, _curentry.attribute);
924  loadData(is, _curentry.attribclass);
925  loadData(is, _curentry.attribtype);
926  loadData(is, _curentry.attribsize);
927  loadData(is, _curentry.volume);
928  loadData(is, _curentry.vdbtype);
929  loadData(is, _curentry.resolution);
930  loadData(is, _curentry.voxelsize);
931  loadData(is, _curentry.xformtoworld);
932  loadData(is, _curentry.xformtovoxel);
933  loadData(is, _curentry.precision);
934  loadData(is, _curentry.readable);
935  loadData(is, _curentry.writeable);
936  loadData(is, _curentry.optional);
937  loadData(is, _curentry.defval);
938  loadData(is, _curentry.dataname);
939  loadData(is, _curentry.optionname);
940  loadData(is, _curentry.optiontype);
941  loadData(is, _curentry.optionsize);
942 
943  }
944  }
945 
946  return true;
947  }
948 
949  int64 getRunOver() const { return myRunOver; }
950  void setRunOver(int64 val) { myRunOver = val; }
951  bool getAlign() const { return myAlign; }
952  void setAlign(bool val) { myAlign = val; }
953  bool getUseCode() const { return myUseCode; }
954  void setUseCode(bool val) { myUseCode = val; }
955  const UT_StringHolder & getKernelName() const { return myKernelName; }
956  void setKernelName(const UT_StringHolder & val) { myKernelName = val; }
957  const UT_StringHolder & getKernelFile() const { return myKernelFile; }
958  void setKernelFile(const UT_StringHolder & val) { myKernelFile = val; }
959  const UT_StringHolder & getKernelCode() const { return myKernelCode; }
960  void setKernelCode(const UT_StringHolder & val) { myKernelCode = val; }
961  bool getAtBinding() const { return myAtBinding; }
962  void setAtBinding(bool val) { myAtBinding = val; }
963  const UT_StringHolder & getKernelOptions() const { return myKernelOptions; }
964  void setKernelOptions(const UT_StringHolder & val) { myKernelOptions = val; }
965  const UT_StringHolder & getOptionAttribute() const { return myOptionAttribute; }
966  void setOptionAttribute(const UT_StringHolder & val) { myOptionAttribute = val; }
967  bool getRecompile() const { return myRecompile; }
968  void setRecompile(bool val) { myRecompile = val; }
969  bool getOrigin() const { return myOrigin; }
970  void setOrigin(bool val) { myOrigin = val; }
971  bool getSize() const { return mySize; }
972  void setSize(bool val) { mySize = val; }
973  bool getVoxelSize() const { return myVoxelSize; }
974  void setVoxelSize(bool val) { myVoxelSize = val; }
975  bool getTime() const { return myTime; }
976  void setTime(bool val) { myTime = val; }
977  bool getFrame() const { return myFrame; }
978  void setFrame(bool val) { myFrame = val; }
979  bool getTimeInc() const { return myTimeInc; }
980  void setTimeInc(bool val) { myTimeInc = val; }
981  bool getFlushAttributes() const { return myFlushAttributes; }
982  void setFlushAttributes(bool val) { myFlushAttributes = val; }
983  bool getFinish() const { return myFinish; }
984  void setFinish(bool val) { myFinish = val; }
985  fpreal64 getTimeScale() const { return myTimeScale; }
986  void setTimeScale(fpreal64 val) { myTimeScale = val; }
987  int64 getTimeMethod() const { return myTimeMethod; }
988  void setTimeMethod(int64 val) { myTimeMethod = val; }
989  bool getXNoise() const { return myXNoise; }
990  void setXNoise(bool val) { myXNoise = val; }
991  const UT_StringHolder & getWorksetsGeometry() const { return myWorksetsGeometry; }
992  void setWorksetsGeometry(const UT_StringHolder & val) { myWorksetsGeometry = val; }
993  const UT_StringHolder & getWorksetsBeginAttr() const { return myWorksetsBeginAttr; }
994  void setWorksetsBeginAttr(const UT_StringHolder & val) { myWorksetsBeginAttr = val; }
995  const UT_StringHolder & getWorksetsLengthAttr() const { return myWorksetsLengthAttr; }
996  void setWorksetsLengthAttr(const UT_StringHolder & val) { myWorksetsLengthAttr = val; }
997  bool getWarnMissing() const { return myWarnMissing; }
998  void setWarnMissing(bool val) { myWarnMissing = val; }
999  bool getErrorMismatchedPoint() const { return myErrorMismatchedPoint; }
1000  void setErrorMismatchedPoint(bool val) { myErrorMismatchedPoint = val; }
1001  bool getErrorMismatchedPrim() const { return myErrorMismatchedPrim; }
1002  void setErrorMismatchedPrim(bool val) { myErrorMismatchedPrim = val; }
1003  int64 getSingleWorkgroup() const { return mySingleWorkgroup; }
1004  void setSingleWorkgroup(int64 val) { mySingleWorkgroup = val; }
1005  int64 getPrecision() const { return myPrecision; }
1006  void setPrecision(int64 val) { myPrecision = val; }
1007  bool getImportPrequel() const { return myImportPrequel; }
1008  void setImportPrequel(bool val) { myImportPrequel = val; }
1009  const UT_Array<Bindings> &getBindings() const { return myBindings; }
1010 void setBindings(const UT_Array<Bindings> &val) { myBindings = val; }
1011 
1012 private:
1013  int64 myRunOver;
1014  bool myAlign;
1015  bool myUseCode;
1016  UT_StringHolder myKernelName;
1017  UT_StringHolder myKernelFile;
1018  UT_StringHolder myKernelCode;
1019  bool myAtBinding;
1020  UT_StringHolder myKernelOptions;
1021  UT_StringHolder myOptionAttribute;
1022  bool myRecompile;
1023  bool myOrigin;
1024  bool mySize;
1025  bool myVoxelSize;
1026  bool myTime;
1027  bool myFrame;
1028  bool myTimeInc;
1029  bool myFlushAttributes;
1030  bool myFinish;
1031  fpreal64 myTimeScale;
1032  int64 myTimeMethod;
1033  bool myXNoise;
1034  UT_StringHolder myWorksetsGeometry;
1035  UT_StringHolder myWorksetsBeginAttr;
1036  UT_StringHolder myWorksetsLengthAttr;
1037  bool myWarnMissing;
1038  bool myErrorMismatchedPoint;
1039  bool myErrorMismatchedPrim;
1040  int64 mySingleWorkgroup;
1041  int64 myPrecision;
1042  bool myImportPrequel;
1043  UT_Array<Bindings> myBindings;
1044 
1045 };
bool getImportPrequel() const
bool operator!=(const Bindings &src) const
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
static void saveData(std::ostream &os, UT_Vector3D v)
const UT_StringHolder & getKernelName() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
bool operator==(const GAS_OpenCLParms &src) const
void setOptionAttribute(const UT_StringHolder &val)
static void loadData(UT_IStream &is, fpreal64 &v)
int int32
Definition: SYS_Types.h:39
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void setTimeMethod(int64 val)
void setRunOver(int64 val)
bool getFlushAttributes() const
void setSize(bool val)
bool getErrorMismatchedPrim() const
const char * getFieldNameSubclass(const char *recordtype, int fieldnum) const override
void
Definition: png.h:1083
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector4.h:493
const GLdouble * v
Definition: glcorearb.h:837
#define GAS_API
Definition: GAS_API.h:10
bool getErrorMismatchedPoint() const
void setFrame(bool val)
UT_StringHolder createString(const UT_Array< Bindings > &list) const
void setFinish(bool val)
bool isMyRecord(const char *recordtype) const
bool getWarnMissing() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
UT_OptionType
Definition: UT_Options.h:44
void setWorksetsGeometry(const UT_StringHolder &val)
UT_OptionType getFieldTypeSubclass(const char *recordtype, int fieldnum) const override
void setOrigin(bool val)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
const UT_StringHolder & getWorksetsGeometry() const
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE const char * buffer() const
GLdouble s
Definition: glad.h:3009
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
An output stream object that owns its own string buffer storage.
Query(const SIM_Data *owner, const GAS_OpenCLParms &parms)
const GAS_OpenCLParms & myParms
void setXNoise(bool val)
**But if you need a result
Definition: thread.h:613
bool getRecompile() const
void setAtBinding(bool val)
static void saveData(std::ostream &os, UT_Vector4D v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setUseCode(bool val)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setTimeInc(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
bool getUseCode() const
void setImportPrequel(bool val)
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool getFieldRawSubclass(const char *recordtype, int recordnum, const char *fieldname, UT_OptionEntryPtr &result) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void saveData(std::ostream &os, int64 v)
void setBindings(const UT_Array< Bindings > &val)
exint length() const
bool load(UT_IStream &is)
SIM_Query * createQueryObject(const SIM_Data *owner) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void save(std::ostream &os) const
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
int64 getTimeMethod() const
UT_SharedPtr< UT_Ramp > ramp
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
int64 getPrecision() const
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setErrorMismatchedPoint(bool val)
void setVoxelSize(bool val)
static void loadData(UT_IStream &is, UT_Vector4D &v)
long long int64
Definition: SYS_Types.h:116
bool getAtBinding() const
HUSD_API const char * resolution()
static void saveData(std::ostream &os, UT_Vector2D v)
GLuint const GLchar * name
Definition: glcorearb.h:786
void setErrorMismatchedPrim(bool val)
const UT_Array< Bindings > & getBindings() const
static void saveData(std::ostream &os, UT_Matrix2D v)
const char * getRecordTypeNameSubclass(int recordtypenum) const override
int getNumRecordsSubclass(const char *recordtype) const override
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
void setRecompile(bool val)
const UT_StringHolder & getOptionAttribute() const
GT_API const UT_StringHolder version
GLenum GLint GLint * precision
Definition: glcorearb.h:1925
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
const UT_StringHolder & getKernelFile() const
void setPrecision(int64 val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setWorksetsLengthAttr(const UT_StringHolder &val)
bool getTimeInc() const
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setTimeScale(fpreal64 val)
const UT_StringHolder & getKernelCode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
void setWorksetsBeginAttr(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
SYS_FORCE_INLINE void append(char character)
void setAlign(bool val)
GLuint GLfloat * val
Definition: glcorearb.h:1608
static void loadData(UT_IStream &is, UT_Vector3D &v)
int getNumFieldsSubclass(const char *recordtype) const override
static void saveData(std::ostream &os, UT_StringHolder s)
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
bool operator!=(const GAS_OpenCLParms &src) const
bool operator==(const Bindings &src) const
void setWarnMissing(bool val)
const UT_StringHolder & getKernelOptions() const
void setSingleWorkgroup(int64 val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
const char * findChar(int c) const
Definition: UT_String.h:1395
void setKernelName(const UT_StringHolder &val)
void setKernelCode(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
GLboolean r
Definition: glcorearb.h:1222
fpreal64 getTimeScale() const
int64 getRunOver() const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
bool getVoxelSize() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
void setKernelOptions(const UT_StringHolder &val)
type
Definition: core.h:1059
int64 getSingleWorkgroup() const
const UT_StringHolder & getWorksetsLengthAttr() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setKernelFile(const UT_StringHolder &val)
void setFlushAttributes(bool val)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
UT_UniquePtr< UT_OptionEntry > UT_OptionEntryPtr
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, bool v)
int getNumRecordTypesSubclass() const override
void setTime(bool val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
const UT_StringHolder & getWorksetsBeginAttr() const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663