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 
7 #include <OP/OP_Utils.h>
8 #include <PRM/PRM_Parm.h>
9 #include <UT/UT_IStream.h>
10 #include <UT/UT_NTStreamUtil.h>
11 #include <UT/UT_Ramp.h>
12 #include <UT/UT_SharedPtr.h>
13 #include <UT/UT_StringHolder.h>
14 #include <UT/UT_StringStream.h>
15 #include <UT/UT_VectorTypes.h>
16 #include <SYS/SYS_Types.h>
17 
18 using namespace UT::Literal;
19 
20 class DEP_MicroNode;
21 
23 {
24 public:
25  static int version() { return 4; }
26  struct Bindings
27  {
45  bool readable;
46  bool writeable;
47  bool optional;
48 
49 
51  {
52  name = ""_sh;
53  type = 0;
54  intval = 0;
55  fval = 0;
56  v3val = 0;
57  v4val = 0;
58  timescale = 0;
59  fieldname = ""_sh;
60  fieldoffsets = false;
61  ramp = UT_SharedPtr<UT_Ramp>(0);
62  rampsize = 0;
63  geometry = ""_sh;
64  attribute = ""_sh;
65  attribclass = 0;
66  attribtype = 0;
67  attribsize = 0;
68  precision = 0;
69  readable = false;
70  writeable = false;
71  optional = false;
72 
73  }
74 
75  bool operator==(const Bindings &src) const
76  {
77  if (name != src.name) return false;
78  if (type != src.type) return false;
79  if (intval != src.intval) return false;
80  if (fval != src.fval) return false;
81  if (v3val != src.v3val) return false;
82  if (v4val != src.v4val) return false;
83  if (timescale != src.timescale) return false;
84  if (fieldname != src.fieldname) return false;
85  if (fieldoffsets != src.fieldoffsets) return false;
86  if (ramp != src.ramp)
87  { if (!ramp || !src.ramp || !(*ramp == *src.ramp)) return false; }
88  if (rampsize != src.rampsize) return false;
89  if (geometry != src.geometry) return false;
90  if (attribute != src.attribute) return false;
91  if (attribclass != src.attribclass) return false;
92  if (attribtype != src.attribtype) return false;
93  if (attribsize != src.attribsize) return false;
94  if (precision != src.precision) return false;
95  if (readable != src.readable) return false;
96  if (writeable != src.writeable) return false;
97  if (optional != src.optional) return false;
98 
99  return true;
100  }
101  bool operator!=(const Bindings &src) const
102  {
103  return !operator==(src);
104  }
105 
106  };
107 
109  {
111 
112  buf.strcat("[ ");
113  for (int i = 0; i < list.entries(); i++)
114  {
115  if (i)
116  buf.strcat(", ");
117  buf.strcat("( ");
118  buf.append("");
119  { UT_String tmp; tmp = UT_StringWrap(list(i).name).makeQuotedString('"'); buf.strcat(tmp); }
120  buf.append(", ");
121  buf.appendSprintf("%d", (int) list(i).type);
122  buf.append(", ");
123  buf.appendSprintf("%d", (int) list(i).intval);
124  buf.append(", ");
125  buf.appendSprintf("%f", (list(i).fval));
126  buf.append(", ");
127  buf.appendSprintf("(%f, %f, %f)", list(i).v3val.x(), list(i).v3val.y(), list(i).v3val.z());
128  buf.append(", ");
129  buf.appendSprintf("(%f, %f, %f, %f)", list(i).v4val.x(), list(i).v4val.y(), list(i).v4val.z(), list(i).v4val.w());
130  buf.append(", ");
131  buf.appendSprintf("%d", (int) list(i).timescale);
132  buf.append(", ");
133  { UT_String tmp; tmp = UT_StringWrap(list(i).fieldname).makeQuotedString('"'); buf.strcat(tmp); }
134  buf.append(", ");
135  buf.appendSprintf("%s", (list(i).fieldoffsets) ? "true" : "false");
136  buf.append(", ");
137  if (list(i).ramp)
138  {
139  UT_OStringStream os;
140  UT_String tmp;
141  list(i).ramp->save(os);
142  tmp = UT_StringWrap(os.str().buffer()).makeQuotedString('"');
143  buf.strcat(tmp);
144  }
145  else buf.strcat("""");
146  buf.append(", ");
147  buf.appendSprintf("%d", (int) list(i).rampsize);
148  buf.append(", ");
149  { UT_String tmp; tmp = UT_StringWrap(list(i).geometry).makeQuotedString('"'); buf.strcat(tmp); }
150  buf.append(", ");
151  { UT_String tmp; tmp = UT_StringWrap(list(i).attribute).makeQuotedString('"'); buf.strcat(tmp); }
152  buf.append(", ");
153  buf.appendSprintf("%d", (int) list(i).attribclass);
154  buf.append(", ");
155  buf.appendSprintf("%d", (int) list(i).attribtype);
156  buf.append(", ");
157  buf.appendSprintf("%d", (int) list(i).attribsize);
158  buf.append(", ");
159  buf.appendSprintf("%d", (int) list(i).precision);
160  buf.append(", ");
161  buf.appendSprintf("%s", (list(i).readable) ? "true" : "false");
162  buf.append(", ");
163  buf.appendSprintf("%s", (list(i).writeable) ? "true" : "false");
164  buf.append(", ");
165  buf.appendSprintf("%s", (list(i).optional) ? "true" : "false");
166 
167  buf.strcat(" )");
168  }
169  buf.strcat(" ]");
170 
172  return result;
173  }
174 
176  {
177  myRunOver = 0;
178  myAlign = false;
179  myUseCode = false;
180  myKernelName = ""_sh;
181  myKernelFile = ""_sh;
182  myKernelCode = ""_sh;
183  myKernelOptions = ""_sh;
184  myRecompile = false;
185  myOrigin = false;
186  mySize = false;
187  myVoxelSize = false;
188  myTime = false;
189  myFrame = false;
190  myTimeInc = false;
191  myFlushAttributes = false;
192  myFinish = false;
193  myTimeScale = 0;
194  myTimeMethod = 0;
195  myXNoise = false;
196  myWorksetsGeometry = ""_sh;
197  myWorksetsBeginAttr = ""_sh;
198  myWorksetsLengthAttr = ""_sh;
199  myWarnMissing = false;
200  mySingleWorkgroup = false;
201  myPrecision = 0;
202 
203  }
204 
205  explicit GAS_OpenCLParms(const GAS_OpenCLParms &) = default;
206 
208 
209  bool operator==(const GAS_OpenCLParms &src) const
210  {
211  if (myRunOver != src.myRunOver) return false;
212  if (myAlign != src.myAlign) return false;
213  if (myUseCode != src.myUseCode) return false;
214  if (myKernelName != src.myKernelName) return false;
215  if (myKernelFile != src.myKernelFile) return false;
216  if (myKernelCode != src.myKernelCode) return false;
217  if (myKernelOptions != src.myKernelOptions) return false;
218  if (myRecompile != src.myRecompile) return false;
219  if (myOrigin != src.myOrigin) return false;
220  if (mySize != src.mySize) return false;
221  if (myVoxelSize != src.myVoxelSize) return false;
222  if (myTime != src.myTime) return false;
223  if (myFrame != src.myFrame) return false;
224  if (myTimeInc != src.myTimeInc) return false;
225  if (myFlushAttributes != src.myFlushAttributes) return false;
226  if (myFinish != src.myFinish) return false;
227  if (myTimeScale != src.myTimeScale) return false;
228  if (myTimeMethod != src.myTimeMethod) return false;
229  if (myXNoise != src.myXNoise) return false;
230  if (myWorksetsGeometry != src.myWorksetsGeometry) return false;
231  if (myWorksetsBeginAttr != src.myWorksetsBeginAttr) return false;
232  if (myWorksetsLengthAttr != src.myWorksetsLengthAttr) return false;
233  if (myWarnMissing != src.myWarnMissing) return false;
234  if (mySingleWorkgroup != src.mySingleWorkgroup) return false;
235  if (myPrecision != src.myPrecision) return false;
236  if (myBindings != src.myBindings) return false;
237 
238  return true;
239  }
240  bool operator!=(const GAS_OpenCLParms &src) const
241  {
242  return !operator==(src);
243  }
244 
245 
246  class Query : public SIM_Query
247  {
248  public:
249  explicit Query(const SIM_Data *owner, const GAS_OpenCLParms &parms)
250  : SIM_Query(owner)
251  , myParms(parms)
252  { }
253  virtual ~Query() {}
254 
255  protected:
256  bool isMyRecord(const char *recordtype) const
257  { return !strcmp(recordtype, "Params"); }
258 
259  virtual int getNumRecordTypesSubclass() const { return 1; }
260  virtual const char *getRecordTypeNameSubclass(int recordtypenum) const
261  {
262  if (recordtypenum == 0) return "Params";
263  return 0;
264  }
265  virtual int getNumRecordsSubclass(const char *recordtype) const
266  {
267  if (isMyRecord(recordtype)) return 1;
268  return 0;
269  }
270  virtual int getNumFieldsSubclass(const char *recordtype) const
271  {
272  if (isMyRecord(recordtype))
273  return 26;
274  return 0;
275  }
276 
277  virtual const char *getFieldNameSubclass(const char *recordtype,
278  int fieldnum) const
279  {
280  if (!isMyRecord(recordtype))
281  return 0;
282 
283  switch (fieldnum)
284  {
285  case 0:
286  return "runover";
287  case 1:
288  return "align";
289  case 2:
290  return "usecode";
291  case 3:
292  return "kernelname";
293  case 4:
294  return "kernelfile";
295  case 5:
296  return "kernelcode";
297  case 6:
298  return "kerneloptions";
299  case 7:
300  return "recompile";
301  case 8:
302  return "origin";
303  case 9:
304  return "size";
305  case 10:
306  return "voxelsize";
307  case 11:
308  return "time";
309  case 12:
310  return "frame";
311  case 13:
312  return "timeinc";
313  case 14:
314  return "flushattrib";
315  case 15:
316  return "finish";
317  case 16:
318  return "timescale";
319  case 17:
320  return "timemethod";
321  case 18:
322  return "xnoise";
323  case 19:
324  return "worksets_geo";
325  case 20:
326  return "worksets_begin";
327  case 21:
328  return "worksets_length";
329  case 22:
330  return "warnmissing";
331  case 23:
332  return "singleworkgroup";
333  case 24:
334  return "precision";
335  case 25:
336  return "bindings";
337 
338  }
339  return 0;
340  }
341  virtual UT_OptionType getFieldTypeSubclass(const char *recordtype,
342  int fieldnum) const
343  {
344  if (!isMyRecord(recordtype))
345  return UT_OPTION_INVALID;
346 
347  switch (fieldnum)
348  {
349  case 0:
350  return UT_OPTION_INT;
351  case 1:
352  return UT_OPTION_BOOL;
353  case 2:
354  return UT_OPTION_BOOL;
355  case 3:
356  return UT_OPTION_STRING;
357  case 4:
358  return UT_OPTION_STRING;
359  case 5:
360  return UT_OPTION_STRING;
361  case 6:
362  return UT_OPTION_STRING;
363  case 7:
364  return UT_OPTION_BOOL;
365  case 8:
366  return UT_OPTION_BOOL;
367  case 9:
368  return UT_OPTION_BOOL;
369  case 10:
370  return UT_OPTION_BOOL;
371  case 11:
372  return UT_OPTION_BOOL;
373  case 12:
374  return UT_OPTION_BOOL;
375  case 13:
376  return UT_OPTION_BOOL;
377  case 14:
378  return UT_OPTION_BOOL;
379  case 15:
380  return UT_OPTION_BOOL;
381  case 16:
382  return UT_OPTION_FPREAL;
383  case 17:
384  return UT_OPTION_INT;
385  case 18:
386  return UT_OPTION_BOOL;
387  case 19:
388  return UT_OPTION_STRING;
389  case 20:
390  return UT_OPTION_STRING;
391  case 21:
392  return UT_OPTION_STRING;
393  case 22:
394  return UT_OPTION_BOOL;
395  case 23:
396  return UT_OPTION_BOOL;
397  case 24:
398  return UT_OPTION_INT;
399  case 25:
400  return UT_OPTION_STRING;
401 
402  }
403  return UT_OPTION_INVALID;
404  }
405 
406  virtual bool getFieldRawSubclass(const char *recordtype,
407  int recordnum,
408  const char *fieldname,
409  UT_OptionEntryPtr &result) const
410  {
411  if (!isMyRecord(recordtype))
412  return false;
413  if (recordnum != 0)
414  return false;
415  // This is less optimal, but if we are in SIM_Query
416  // land we have already given up on performance.
417  if (!strcmp(fieldname, "runover"))
418  {
419  result = UTmakeUnique<UT_OptionInt>(myParms.myRunOver);
420  return true;
421  }
422  if (!strcmp(fieldname, "align"))
423  {
424  result = UTmakeUnique<UT_OptionBool>(myParms.myAlign);
425  return true;
426  }
427  if (!strcmp(fieldname, "usecode"))
428  {
429  result = UTmakeUnique<UT_OptionBool>(myParms.myUseCode);
430  return true;
431  }
432  if (!strcmp(fieldname, "kernelname"))
433  {
434  result = UTmakeUnique<UT_OptionString>(myParms.myKernelName);
435  return true;
436  }
437  if (!strcmp(fieldname, "kernelfile"))
438  {
439  result = UTmakeUnique<UT_OptionString>(myParms.myKernelFile);
440  return true;
441  }
442  if (!strcmp(fieldname, "kernelcode"))
443  {
444  result = UTmakeUnique<UT_OptionString>(myParms.myKernelCode);
445  return true;
446  }
447  if (!strcmp(fieldname, "kerneloptions"))
448  {
449  result = UTmakeUnique<UT_OptionString>(myParms.myKernelOptions);
450  return true;
451  }
452  if (!strcmp(fieldname, "recompile"))
453  {
454  result = UTmakeUnique<UT_OptionBool>(myParms.myRecompile);
455  return true;
456  }
457  if (!strcmp(fieldname, "origin"))
458  {
459  result = UTmakeUnique<UT_OptionBool>(myParms.myOrigin);
460  return true;
461  }
462  if (!strcmp(fieldname, "size"))
463  {
464  result = UTmakeUnique<UT_OptionBool>(myParms.mySize);
465  return true;
466  }
467  if (!strcmp(fieldname, "voxelsize"))
468  {
469  result = UTmakeUnique<UT_OptionBool>(myParms.myVoxelSize);
470  return true;
471  }
472  if (!strcmp(fieldname, "time"))
473  {
474  result = UTmakeUnique<UT_OptionBool>(myParms.myTime);
475  return true;
476  }
477  if (!strcmp(fieldname, "frame"))
478  {
479  result = UTmakeUnique<UT_OptionBool>(myParms.myFrame);
480  return true;
481  }
482  if (!strcmp(fieldname, "timeinc"))
483  {
484  result = UTmakeUnique<UT_OptionBool>(myParms.myTimeInc);
485  return true;
486  }
487  if (!strcmp(fieldname, "flushattrib"))
488  {
489  result = UTmakeUnique<UT_OptionBool>(myParms.myFlushAttributes);
490  return true;
491  }
492  if (!strcmp(fieldname, "finish"))
493  {
494  result = UTmakeUnique<UT_OptionBool>(myParms.myFinish);
495  return true;
496  }
497  if (!strcmp(fieldname, "timescale"))
498  {
499  result = UTmakeUnique<UT_OptionFpreal>(myParms.myTimeScale);
500  return true;
501  }
502  if (!strcmp(fieldname, "timemethod"))
503  {
504  result = UTmakeUnique<UT_OptionInt>(myParms.myTimeMethod);
505  return true;
506  }
507  if (!strcmp(fieldname, "xnoise"))
508  {
509  result = UTmakeUnique<UT_OptionBool>(myParms.myXNoise);
510  return true;
511  }
512  if (!strcmp(fieldname, "worksets_geo"))
513  {
514  result = UTmakeUnique<UT_OptionString>(myParms.myWorksetsGeometry);
515  return true;
516  }
517  if (!strcmp(fieldname, "worksets_begin"))
518  {
519  result = UTmakeUnique<UT_OptionString>(myParms.myWorksetsBeginAttr);
520  return true;
521  }
522  if (!strcmp(fieldname, "worksets_length"))
523  {
524  result = UTmakeUnique<UT_OptionString>(myParms.myWorksetsLengthAttr);
525  return true;
526  }
527  if (!strcmp(fieldname, "warnmissing"))
528  {
529  result = UTmakeUnique<UT_OptionBool>(myParms.myWarnMissing);
530  return true;
531  }
532  if (!strcmp(fieldname, "singleworkgroup"))
533  {
534  result = UTmakeUnique<UT_OptionBool>(myParms.mySingleWorkgroup);
535  return true;
536  }
537  if (!strcmp(fieldname, "precision"))
538  {
539  result = UTmakeUnique<UT_OptionInt>(myParms.myPrecision);
540  return true;
541  }
542  if (!strcmp(fieldname, "bindings"))
543  {
544  result = UTmakeUnique<UT_OptionString>(myParms.createString(myParms.myBindings));
545  return true;
546  }
547 
548  // Failed to find
549  return false;
550  }
551 
553  };
554 
555  SIM_Query *createQueryObject(const SIM_Data *owner) const
556  { return new Query(owner, *this); }
557 
558 
559 
560 
561  // Boiler plate to load individual types.
562  static void loadData(UT_IStream &is, int64 &v)
563  { is.bread(&v, 1); }
564  static void loadData(UT_IStream &is, bool &v)
565  { int64 iv; is.bread(&iv, 1); v = iv; }
566  static void loadData(UT_IStream &is, fpreal64 &v)
567  { is.bread<fpreal64>(&v, 1); }
568  static void loadData(UT_IStream &is, UT_Vector2D &v)
569  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
570  static void loadData(UT_IStream &is, UT_Vector3D &v)
571  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
572  is.bread<fpreal64>(&v.z(), 1); }
573  static void loadData(UT_IStream &is, UT_Vector4D &v)
574  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
575  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
576  static void loadData(UT_IStream &is, UT_Matrix2D &v)
577  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
578  static void loadData(UT_IStream &is, UT_Matrix3D &v)
579  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
580  static void loadData(UT_IStream &is, UT_Matrix4D &v)
581  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
582  static void loadData(UT_IStream &is, UT_Vector2I &v)
583  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
584  static void loadData(UT_IStream &is, UT_Vector3I &v)
585  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
586  is.bread<int64>(&v.z(), 1); }
587  static void loadData(UT_IStream &is, UT_Vector4I &v)
588  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
589  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
591  { is.bread(v); }
593  { UT_StringHolder rampdata;
594  loadData(is, rampdata);
595  if (rampdata.isstring())
596  {
597  v.reset(new UT_Ramp());
598  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
599  v->load(istr);
600  }
601  else v.reset();
602  }
605  loadData(is, data);
606  if (data.isstring())
607  {
608  // Find the data type.
609  const char *colon = UT_StringWrap(data).findChar(':');
610  if (colon)
611  {
612  int typelen = colon - data.buffer();
614  type.strncpy(data.buffer(), typelen);
615  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
616 
617  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
618  }
619  }
620  else v.reset();
621  }
622 
623  static void saveData(std::ostream &os, int64 v)
624  { UTwrite(os, &v); }
625  static void saveData(std::ostream &os, bool v)
626  { int64 iv = v; UTwrite(os, &iv); }
627  static void saveData(std::ostream &os, fpreal64 v)
628  { UTwrite<fpreal64>(os, &v); }
629  static void saveData(std::ostream &os, UT_Vector2D v)
630  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
631  static void saveData(std::ostream &os, UT_Vector3D v)
632  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
633  UTwrite<fpreal64>(os, &v.z()); }
634  static void saveData(std::ostream &os, UT_Vector4D v)
635  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
636  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
637  static void saveData(std::ostream &os, UT_Matrix2D v)
639  static void saveData(std::ostream &os, UT_Matrix3D v)
641  static void saveData(std::ostream &os, UT_Matrix4D v)
643  static void saveData(std::ostream &os, UT_StringHolder s)
644  { UT_StringWrap(s).saveBinary(os); }
645  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
647  UT_OStringStream ostr;
648  if (s) s->save(ostr);
649  result = ostr.str();
650  saveData(os, result);
651  }
652  static void saveData(std::ostream &os, PRM_DataItemHandle s)
654  UT_OStringStream ostr;
655  if (s)
656  {
657  ostr << s->getDataTypeToken();
658  ostr << ":";
659  s->saveBinary(ostr);
660  }
661  result = ostr.str();
662  saveData(os, result);
663  }
664 
665 
666  void save(std::ostream &os) const
667  {
668  int32 v = version();
669  UTwrite(os, &v);
670  saveData(os, myRunOver);
671  saveData(os, myAlign);
672  saveData(os, myUseCode);
673  saveData(os, myKernelName);
674  saveData(os, myKernelFile);
675  saveData(os, myKernelCode);
676  saveData(os, myKernelOptions);
677  saveData(os, myRecompile);
678  saveData(os, myOrigin);
679  saveData(os, mySize);
680  saveData(os, myVoxelSize);
681  saveData(os, myTime);
682  saveData(os, myFrame);
683  saveData(os, myTimeInc);
684  saveData(os, myFlushAttributes);
685  saveData(os, myFinish);
686  saveData(os, myTimeScale);
687  saveData(os, myTimeMethod);
688  saveData(os, myXNoise);
689  saveData(os, myWorksetsGeometry);
690  saveData(os, myWorksetsBeginAttr);
691  saveData(os, myWorksetsLengthAttr);
692  saveData(os, myWarnMissing);
693  saveData(os, mySingleWorkgroup);
694  saveData(os, myPrecision);
695  {
696  int64 length = myBindings.entries();
697  UTwrite(os, &length);
698  for (exint i = 0; i < length; i++)
699  {
700  saveData(os, myBindings(i).name);
701  saveData(os, myBindings(i).type);
702  saveData(os, myBindings(i).intval);
703  saveData(os, myBindings(i).fval);
704  saveData(os, myBindings(i).v3val);
705  saveData(os, myBindings(i).v4val);
706  saveData(os, myBindings(i).timescale);
707  saveData(os, myBindings(i).fieldname);
708  saveData(os, myBindings(i).fieldoffsets);
709  saveData(os, myBindings(i).ramp);
710  saveData(os, myBindings(i).rampsize);
711  saveData(os, myBindings(i).geometry);
712  saveData(os, myBindings(i).attribute);
713  saveData(os, myBindings(i).attribclass);
714  saveData(os, myBindings(i).attribtype);
715  saveData(os, myBindings(i).attribsize);
716  saveData(os, myBindings(i).precision);
717  saveData(os, myBindings(i).readable);
718  saveData(os, myBindings(i).writeable);
719  saveData(os, myBindings(i).optional);
720 
721  }
722  }
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, myRunOver);
736  loadData(is, myAlign);
737  loadData(is, myUseCode);
738  loadData(is, myKernelName);
739  loadData(is, myKernelFile);
740  loadData(is, myKernelCode);
741  loadData(is, myKernelOptions);
742  loadData(is, myRecompile);
743  loadData(is, myOrigin);
744  loadData(is, mySize);
745  loadData(is, myVoxelSize);
746  loadData(is, myTime);
747  loadData(is, myFrame);
748  loadData(is, myTimeInc);
749  loadData(is, myFlushAttributes);
750  loadData(is, myFinish);
751  loadData(is, myTimeScale);
752  loadData(is, myTimeMethod);
753  loadData(is, myXNoise);
754  loadData(is, myWorksetsGeometry);
755  loadData(is, myWorksetsBeginAttr);
756  loadData(is, myWorksetsLengthAttr);
757  loadData(is, myWarnMissing);
758  loadData(is, mySingleWorkgroup);
759  loadData(is, myPrecision);
760  {
761  int64 length;
762  is.read(&length, 1);
763  myBindings.entries(length);
764  for (exint i = 0; i < length; i++)
765  {
766  loadData(is, myBindings(i).name);
767  loadData(is, myBindings(i).type);
768  loadData(is, myBindings(i).intval);
769  loadData(is, myBindings(i).fval);
770  loadData(is, myBindings(i).v3val);
771  loadData(is, myBindings(i).v4val);
772  loadData(is, myBindings(i).timescale);
773  loadData(is, myBindings(i).fieldname);
774  loadData(is, myBindings(i).fieldoffsets);
775  loadData(is, myBindings(i).ramp);
776  loadData(is, myBindings(i).rampsize);
777  loadData(is, myBindings(i).geometry);
778  loadData(is, myBindings(i).attribute);
779  loadData(is, myBindings(i).attribclass);
780  loadData(is, myBindings(i).attribtype);
781  loadData(is, myBindings(i).attribsize);
782  loadData(is, myBindings(i).precision);
783  loadData(is, myBindings(i).readable);
784  loadData(is, myBindings(i).writeable);
785  loadData(is, myBindings(i).optional);
786 
787  }
788  }
789 
790  return true;
791  }
792 
793  int64 getRunOver() const { return myRunOver; }
794  void setRunOver(int64 val) { myRunOver = val; }
795  bool getAlign() const { return myAlign; }
796  void setAlign(bool val) { myAlign = val; }
797  bool getUseCode() const { return myUseCode; }
798  void setUseCode(bool val) { myUseCode = val; }
799  const UT_StringHolder & getKernelName() const { return myKernelName; }
800  void setKernelName(const UT_StringHolder & val) { myKernelName = val; }
801  const UT_StringHolder & getKernelFile() const { return myKernelFile; }
802  void setKernelFile(const UT_StringHolder & val) { myKernelFile = val; }
803  const UT_StringHolder & getKernelCode() const { return myKernelCode; }
804  void setKernelCode(const UT_StringHolder & val) { myKernelCode = val; }
805  const UT_StringHolder & getKernelOptions() const { return myKernelOptions; }
806  void setKernelOptions(const UT_StringHolder & val) { myKernelOptions = val; }
807  bool getRecompile() const { return myRecompile; }
808  void setRecompile(bool val) { myRecompile = val; }
809  bool getOrigin() const { return myOrigin; }
810  void setOrigin(bool val) { myOrigin = val; }
811  bool getSize() const { return mySize; }
812  void setSize(bool val) { mySize = val; }
813  bool getVoxelSize() const { return myVoxelSize; }
814  void setVoxelSize(bool val) { myVoxelSize = val; }
815  bool getTime() const { return myTime; }
816  void setTime(bool val) { myTime = val; }
817  bool getFrame() const { return myFrame; }
818  void setFrame(bool val) { myFrame = val; }
819  bool getTimeInc() const { return myTimeInc; }
820  void setTimeInc(bool val) { myTimeInc = val; }
821  bool getFlushAttributes() const { return myFlushAttributes; }
822  void setFlushAttributes(bool val) { myFlushAttributes = val; }
823  bool getFinish() const { return myFinish; }
824  void setFinish(bool val) { myFinish = val; }
825  fpreal64 getTimeScale() const { return myTimeScale; }
826  void setTimeScale(fpreal64 val) { myTimeScale = val; }
827  int64 getTimeMethod() const { return myTimeMethod; }
828  void setTimeMethod(int64 val) { myTimeMethod = val; }
829  bool getXNoise() const { return myXNoise; }
830  void setXNoise(bool val) { myXNoise = val; }
831  const UT_StringHolder & getWorksetsGeometry() const { return myWorksetsGeometry; }
832  void setWorksetsGeometry(const UT_StringHolder & val) { myWorksetsGeometry = val; }
833  const UT_StringHolder & getWorksetsBeginAttr() const { return myWorksetsBeginAttr; }
834  void setWorksetsBeginAttr(const UT_StringHolder & val) { myWorksetsBeginAttr = val; }
835  const UT_StringHolder & getWorksetsLengthAttr() const { return myWorksetsLengthAttr; }
836  void setWorksetsLengthAttr(const UT_StringHolder & val) { myWorksetsLengthAttr = val; }
837  bool getWarnMissing() const { return myWarnMissing; }
838  void setWarnMissing(bool val) { myWarnMissing = val; }
839  bool getSingleWorkgroup() const { return mySingleWorkgroup; }
840  void setSingleWorkgroup(bool val) { mySingleWorkgroup = val; }
841  int64 getPrecision() const { return myPrecision; }
842  void setPrecision(int64 val) { myPrecision = val; }
843  const UT_Array<Bindings> &getBindings() const { return myBindings; }
844  void setBindings(const UT_Array<Bindings> &val) { myBindings = val; }
845 
846 private:
847  int64 myRunOver;
848  bool myAlign;
849  bool myUseCode;
850  UT_StringHolder myKernelName;
851  UT_StringHolder myKernelFile;
852  UT_StringHolder myKernelCode;
853  UT_StringHolder myKernelOptions;
854  bool myRecompile;
855  bool myOrigin;
856  bool mySize;
857  bool myVoxelSize;
858  bool myTime;
859  bool myFrame;
860  bool myTimeInc;
861  bool myFlushAttributes;
862  bool myFinish;
863  fpreal64 myTimeScale;
864  int64 myTimeMethod;
865  bool myXNoise;
866  UT_StringHolder myWorksetsGeometry;
867  UT_StringHolder myWorksetsBeginAttr;
868  UT_StringHolder myWorksetsLengthAttr;
869  bool myWarnMissing;
870  bool mySingleWorkgroup;
871  int64 myPrecision;
872  UT_Array<Bindings> myBindings;
873 
874 };
GLdouble s
Definition: glew.h:1390
bool operator!=(const Bindings &src) const
virtual const char * getRecordTypeNameSubclass(int recordtypenum) const
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
GLenum src
Definition: glew.h:2410
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
T & z(void)
Definition: UT_Vector4.h:387
GLuint const GLchar * name
Definition: glew.h:1814
void setTimeMethod(int64 val)
void setRunOver(int64 val)
bool getFlushAttributes() const
void setSize(bool val)
exint bread(int32 *buffer, exint asize=1)
#define GAS_API
Definition: GAS_API.h:10
void setFrame(bool val)
GLuint const GLfloat * val
Definition: glew.h:2794
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)
void setWorksetsGeometry(const UT_StringHolder &val)
void setOrigin(bool val)
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
virtual int getNumRecordsSubclass(const char *recordtype) const
const UT_StringHolder & getWorksetsGeometry() const
static void saveData(std::ostream &os, fpreal64 v)
SYS_FORCE_INLINE const char * buffer() const
T & x(void)
Definition: UT_Vector2.h:292
UT_OptionType
An output stream object that owns its own string buffer storage.
virtual int getNumRecordTypesSubclass() const
Query(const SIM_Data *owner, const GAS_OpenCLParms &parms)
const GAS_OpenCLParms & myParms
const UT_WorkBuffer & str() const
Returns a read-only reference to the underlying UT_WorkBuffer.
const GLdouble * v
Definition: glew.h:1391
void setXNoise(bool val)
bool getRecompile() const
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:507
static void saveData(std::ostream &os, UT_Vector4D v)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setUseCode(bool val)
void setTimeInc(bool val)
bool getUseCode() const
virtual bool getFieldRawSubclass(const char *recordtype, int recordnum, const char *fieldname, UT_OptionEntryPtr &result) const
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:511
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
long long int64
Definition: SYS_Types.h:111
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
bool getSingleWorkgroup() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
void save(std::ostream &os) const
int64 exint
Definition: SYS_Types.h:120
int64 getTimeMethod() const
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
double fpreal64
Definition: SYS_Types.h:196
UT_SharedPtr< UT_Ramp > ramp
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:284
int64 getPrecision() const
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const GLfloat * c
Definition: glew.h:16296
GLuint GLsizei GLsizei * length
Definition: glew.h:1825
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setVoxelSize(bool val)
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
int int32
Definition: SYS_Types.h:39
T & y(void)
Definition: UT_Vector4.h:385
const UT_Array< Bindings > & getBindings() const
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
static void saveData(std::ostream &os, UT_Matrix2D v)
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
void setRecompile(bool val)
GT_API const UT_StringHolder version
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:453
const UT_StringHolder & getKernelFile() const
void setPrecision(int64 val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setWorksetsLengthAttr(const UT_StringHolder &val)
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:509
void setSingleWorkgroup(bool val)
bool getTimeInc() const
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
void setTimeScale(fpreal64 val)
const UT_StringHolder & getKernelCode() const
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:47
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
void setWorksetsBeginAttr(const UT_StringHolder &val)
SYS_FORCE_INLINE void append(char character)
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
virtual UT_OptionType getFieldTypeSubclass(const char *recordtype, int fieldnum) const
void setAlign(bool val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
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
T & x(void)
Definition: UT_Vector4.h:383
bool operator==(const Bindings &src) const
void setWarnMissing(bool val)
GLuint64EXT * result
Definition: glew.h:14007
const UT_StringHolder & getKernelOptions() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
T & y(void)
Definition: UT_Vector2.h:294
const char * findChar(int c) const
Definition: UT_String.h:1350
void setKernelName(const UT_StringHolder &val)
void setKernelCode(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
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)
T & w(void)
Definition: UT_Vector4.h:389
bool getVoxelSize() const
void setKernelOptions(const UT_StringHolder &val)
GLenum GLuint GLsizei const GLchar * buf
Definition: glew.h:2580
GLenum GLint GLint * precision
Definition: glew.h:3500
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:88
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setKernelFile(const UT_StringHolder &val)
void setFlushAttributes(bool val)
SYS_FORCE_INLINE bool isstring() const
virtual const char * getFieldNameSubclass(const char *recordtype, int fieldnum) const
static void saveData(std::ostream &os, bool v)
void setTime(bool val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
type
Definition: core.h:528
const UT_StringHolder & getWorksetsBeginAttr() const
virtual int getNumFieldsSubclass(const char *recordtype) const