HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_OpenCL.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_NodeVerb.h>
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 namespace SOP_OpenCLEnums
22 {
23  enum class RunOver
24  {
25  ATTRIBUTE = 0,
26  VOLUME,
27  WORKSETS
28  };
29  enum class Timemethod
30  {
31  INVERT = 0,
32  POW
33  };
34  enum class Bindings_type
35  {
36  INT = 0,
37  FLOAT,
38  FLOAT3,
39  FLOAT4,
40  RAMP,
41  ATTRIBUTE,
42  VOLUME
43  };
44  enum class Bindings_timescale
45  {
46  NONE = 0,
47  MULT,
48  INVERT,
49  POW
50  };
52  {
53  DETAIL = 0,
54  PRIMITIVE,
55  POINT,
56  VERTEX
57  };
59  {
60  FLOAT = 0,
61  INT,
62  FLOATARRAY,
63  INTARRAY
64  };
65 }
66 
67 
69 {
70 public:
71  static int version() { return 1; }
72  struct Bindings
73  {
96 
97 
99  {
100  bindings_name = ""_sh;
101  bindings_type = 0;
102  bindings_intval = 0;
103  bindings_fval = 0;
104  bindings_v3val = UT_Vector3D(0,0,0);
105  bindings_v4val = UT_Vector4D(0,0,0,0);
106  bindings_timescale = 0;
107  bindings_ramp = UT_SharedPtr<UT_Ramp>(0);
108  bindings_rampsize = 1024;
109  bindings_volume = ""_sh;
110  bindings_forcealign = false;
111  bindings_resolution = false;
112  bindings_voxelsize = false;
113  bindings_xformtoworld = false;
114  bindings_xformtovoxel = false;
115  bindings_attribute = ""_sh;
116  bindings_attribclass = 2;
117  bindings_attribtype = 0;
118  bindings_attribsize = 1;
119  bindings_readable = false;
120  bindings_writeable = false;
121  bindings_optional = false;
122 
123  }
124 
125  bool operator==(const Bindings &src) const
126  {
127  if (bindings_name != src.bindings_name) return false;
128  if (bindings_type != src.bindings_type) return false;
129  if (bindings_intval != src.bindings_intval) return false;
130  if (bindings_fval != src.bindings_fval) return false;
131  if (bindings_v3val != src.bindings_v3val) return false;
132  if (bindings_v4val != src.bindings_v4val) return false;
133  if (bindings_timescale != src.bindings_timescale) return false;
134  if (bindings_ramp != src.bindings_ramp)
135  { if (!bindings_ramp || !src.bindings_ramp || !(*bindings_ramp == *src.bindings_ramp)) return false; }
136  if (bindings_rampsize != src.bindings_rampsize) return false;
137  if (bindings_volume != src.bindings_volume) return false;
138  if (bindings_forcealign != src.bindings_forcealign) return false;
139  if (bindings_resolution != src.bindings_resolution) return false;
140  if (bindings_voxelsize != src.bindings_voxelsize) return false;
141  if (bindings_xformtoworld != src.bindings_xformtoworld) return false;
142  if (bindings_xformtovoxel != src.bindings_xformtovoxel) return false;
143  if (bindings_attribute != src.bindings_attribute) return false;
144  if (bindings_attribclass != src.bindings_attribclass) return false;
145  if (bindings_attribtype != src.bindings_attribtype) return false;
146  if (bindings_attribsize != src.bindings_attribsize) return false;
147  if (bindings_readable != src.bindings_readable) return false;
148  if (bindings_writeable != src.bindings_writeable) return false;
149  if (bindings_optional != src.bindings_optional) return false;
150 
151  return true;
152  }
153  bool operator!=(const Bindings &src) const
154  {
155  return !operator==(src);
156  }
157 
158  };
159 
161  {
163 
164  buf.strcat("[ ");
165  for (int i = 0; i < list.entries(); i++)
166  {
167  if (i)
168  buf.strcat(", ");
169  buf.strcat("( ");
170  buf.append("");
171  { UT_String tmp; tmp = UT_StringWrap(list(i).bindings_name).makeQuotedString('"'); buf.strcat(tmp); }
172  buf.append(", ");
173  buf.appendSprintf("%d", (int) list(i).bindings_type);
174  buf.append(", ");
175  buf.appendSprintf("%d", (int) list(i).bindings_intval);
176  buf.append(", ");
177  buf.appendSprintf("%f", (list(i).bindings_fval));
178  buf.append(", ");
179  buf.appendSprintf("(%f, %f, %f)", list(i).bindings_v3val.x(), list(i).bindings_v3val.y(), list(i).bindings_v3val.z());
180  buf.append(", ");
181  buf.appendSprintf("(%f, %f, %f, %f)", list(i).bindings_v4val.x(), list(i).bindings_v4val.y(), list(i).bindings_v4val.z(), list(i).bindings_v4val.w());
182  buf.append(", ");
183  buf.appendSprintf("%d", (int) list(i).bindings_timescale);
184  buf.append(", ");
185  if (list(i).bindings_ramp)
186  {
187  UT_OStringStream os;
188  UT_String tmp;
189  list(i).bindings_ramp->save(os);
190  tmp = UT_StringWrap(os.str().buffer()).makeQuotedString('"');
191  buf.strcat(tmp);
192  }
193  else buf.strcat("""");
194  buf.append(", ");
195  buf.appendSprintf("%d", (int) list(i).bindings_rampsize);
196  buf.append(", ");
197  { UT_String tmp; tmp = UT_StringWrap(list(i).bindings_volume).makeQuotedString('"'); buf.strcat(tmp); }
198  buf.append(", ");
199  buf.appendSprintf("%s", (list(i).bindings_forcealign) ? "true" : "false");
200  buf.append(", ");
201  buf.appendSprintf("%s", (list(i).bindings_resolution) ? "true" : "false");
202  buf.append(", ");
203  buf.appendSprintf("%s", (list(i).bindings_voxelsize) ? "true" : "false");
204  buf.append(", ");
205  buf.appendSprintf("%s", (list(i).bindings_xformtoworld) ? "true" : "false");
206  buf.append(", ");
207  buf.appendSprintf("%s", (list(i).bindings_xformtovoxel) ? "true" : "false");
208  buf.append(", ");
209  { UT_String tmp; tmp = UT_StringWrap(list(i).bindings_attribute).makeQuotedString('"'); buf.strcat(tmp); }
210  buf.append(", ");
211  buf.appendSprintf("%d", (int) list(i).bindings_attribclass);
212  buf.append(", ");
213  buf.appendSprintf("%d", (int) list(i).bindings_attribtype);
214  buf.append(", ");
215  buf.appendSprintf("%d", (int) list(i).bindings_attribsize);
216  buf.append(", ");
217  buf.appendSprintf("%s", (list(i).bindings_readable) ? "true" : "false");
218  buf.append(", ");
219  buf.appendSprintf("%s", (list(i).bindings_writeable) ? "true" : "false");
220  buf.append(", ");
221  buf.appendSprintf("%s", (list(i).bindings_optional) ? "true" : "false");
222 
223  buf.strcat(" )");
224  }
225  buf.strcat(" ]");
226 
227  UT_StringHolder result = buf;
228  return result;
229  }
230 
232  {
233  myKernelname = "kernelName"_sh;
234  myUsecode = false;
235  myKernelfile = ""_sh;
236  myKernelcode = ""_sh;
237  myKerneloptions = ""_sh;
238  myUsewritebackkernel = false;
239  myWritebackkernelname = "writeBack"_sh;
240  myRecompile = false;
241  myRunOver = 0;
242  myIterations = 1;
243  myWorksets_begin = ""_sh;
244  myWorksets_length = ""_sh;
245  myFinish = true;
246  myTime = false;
247  myTimeinc = false;
248  myTimescale = 1;
249  myTimemethod = 0;
250  myXnoise = false;
251 
252  }
253 
254  explicit SOP_OpenCLParms(const SOP_OpenCLParms &) = default;
255 
256  virtual ~SOP_OpenCLParms() {}
257 
258  bool operator==(const SOP_OpenCLParms &src) const
259  {
260  if (myKernelname != src.myKernelname) return false;
261  if (myUsecode != src.myUsecode) return false;
262  if (myKernelfile != src.myKernelfile) return false;
263  if (myKernelcode != src.myKernelcode) return false;
264  if (myKerneloptions != src.myKerneloptions) return false;
265  if (myUsewritebackkernel != src.myUsewritebackkernel) return false;
266  if (myWritebackkernelname != src.myWritebackkernelname) return false;
267  if (myRecompile != src.myRecompile) return false;
268  if (myRunOver != src.myRunOver) return false;
269  if (myIterations != src.myIterations) return false;
270  if (myWorksets_begin != src.myWorksets_begin) return false;
271  if (myWorksets_length != src.myWorksets_length) return false;
272  if (myFinish != src.myFinish) return false;
273  if (myTime != src.myTime) return false;
274  if (myTimeinc != src.myTimeinc) return false;
275  if (myTimescale != src.myTimescale) return false;
276  if (myTimemethod != src.myTimemethod) return false;
277  if (myXnoise != src.myXnoise) return false;
278  if (myBindings != src.myBindings) return false;
279 
280  return true;
281  }
282  bool operator!=(const SOP_OpenCLParms &src) const
283  {
284  return !operator==(src);
285  }
292 
293 
294 
295  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
296  {
297  if (true)
298  OP_Utils::evalOpParm(myKernelname, node, "kernelname", time, 0);
299  else myKernelname = "kernelName"_sh;
300  if (true)
301  OP_Utils::evalOpParm(myUsecode, node, "usecode", time, 0);
302  else myUsecode = false;
303  if (true && ( (!(((getUsecode()!=0)))) ) )
304  OP_Utils::evalOpParm(myKernelfile, node, "kernelfile", time, 0);
305  else myKernelfile = ""_sh;
306  if (true && ( (!(((getUsecode()==0)))) ) )
307  OP_Utils::evalOpParm(myKernelcode, node, "kernelcode", time, 0);
308  else myKernelcode = ""_sh;
309  if (true)
310  OP_Utils::evalOpParm(myKerneloptions, node, "kerneloptions", time, 0);
311  else myKerneloptions = ""_sh;
312  if (true)
313  OP_Utils::evalOpParm(myUsewritebackkernel, node, "usewritebackkernel", time, 0);
314  else myUsewritebackkernel = false;
315  if (true && ( (!(((getUsewritebackkernel()==0)))) ) )
316  OP_Utils::evalOpParm(myWritebackkernelname, node, "writebackkernelname", time, 0);
317  else myWritebackkernelname = "writeBack"_sh;
318  if (true)
319  OP_Utils::evalOpParm(myRecompile, node, "recompile", time, 0);
320  else myRecompile = false;
321  if (true)
322  OP_Utils::evalOpParm(myRunOver, node, "runover", time, 0);
323  else myRunOver = 0;
324  if (true)
325  OP_Utils::evalOpParm(myIterations, node, "iterations", time, 0);
326  else myIterations = 1;
327  if (true && ( (!(((int64(getRunOver())!=2)))) ) )
328  OP_Utils::evalOpParm(myWorksets_begin, node, "worksets_begin", time, 0);
329  else myWorksets_begin = ""_sh;
330  if (true && ( (!(((int64(getRunOver())!=2)))) ) )
331  OP_Utils::evalOpParm(myWorksets_length, node, "worksets_length", time, 0);
332  else myWorksets_length = ""_sh;
333  if (true)
334  OP_Utils::evalOpParm(myFinish, node, "finish", time, 0);
335  else myFinish = true;
336  if (true)
337  OP_Utils::evalOpParm(myTime, node, "time", time, 0);
338  else myTime = false;
339  if (true)
340  OP_Utils::evalOpParm(myTimeinc, node, "timeinc", time, 0);
341  else myTimeinc = false;
342  if (true && ( (!(((getTimeinc()==0)))) ) )
343  OP_Utils::evalOpParm(myTimescale, node, "timescale", time, 0);
344  else myTimescale = 1;
345  if (true && ( (!(((getTimeinc()==0)))) ) )
346  OP_Utils::evalOpParm(myTimemethod, node, "timemethod", time, 0);
347  else myTimemethod = 0;
348  if (true)
349  OP_Utils::evalOpParm(myXnoise, node, "xnoise", time, 0);
350  else myXnoise = false;
351  if (true)
352  {
353  int64 length;
354  OP_Utils::evalOpParm(length, node, "bindings", time, 0);
355  myBindings.entries(length);
356  for (exint i = 0; i < length; i++)
357  {
358  int parmidx = i+1;
359  auto && _curentry = myBindings(i);
360  (void) _curentry;
361  if (true)
362  OP_Utils::evalOpParmInst(myBindings(i).bindings_name, node, "bindings#_name", &parmidx, time, 0);
363  else myBindings(i).bindings_name = ""_sh;
364  if (true)
365  OP_Utils::evalOpParmInst(myBindings(i).bindings_type, node, "bindings#_type", &parmidx, time, 0);
366  else myBindings(i).bindings_type = 0;
367  if (true && ( (!(((_curentry.bindings_type!=0)))) ) )
368  OP_Utils::evalOpParmInst(myBindings(i).bindings_intval, node, "bindings#_intval", &parmidx, time, 0);
369  else myBindings(i).bindings_intval = 0;
370  if (true && ( (!(((_curentry.bindings_type!=1)))) ) )
371  OP_Utils::evalOpParmInst(myBindings(i).bindings_fval, node, "bindings#_fval", &parmidx, time, 0);
372  else myBindings(i).bindings_fval = 0;
373  if (true && ( (!(((_curentry.bindings_type!=2)))) ) )
374  OP_Utils::evalOpParmInst(myBindings(i).bindings_v3val, node, "bindings#_v3val", &parmidx, time, 0);
375  else myBindings(i).bindings_v3val = UT_Vector3D(0,0,0);
376  if (true && ( (!(((_curentry.bindings_type!=3)))) ) )
377  OP_Utils::evalOpParmInst(myBindings(i).bindings_v4val, node, "bindings#_v4val", &parmidx, time, 0);
378  else myBindings(i).bindings_v4val = UT_Vector4D(0,0,0,0);
379  if (true && ( (!(((_curentry.bindings_type!=1)))) ) )
380  OP_Utils::evalOpParmInst(myBindings(i).bindings_timescale, node, "bindings#_timescale", &parmidx, time, 0);
381  else myBindings(i).bindings_timescale = 0;
382  if (true && ( (!(((_curentry.bindings_type!=4)))) ) )
383  OP_Utils::evalOpParmInst(myBindings(i).bindings_ramp, node, "bindings#_ramp", &parmidx, time, 0);
384  else myBindings(i).bindings_ramp = UT_SharedPtr<UT_Ramp>(0);
385  if (true && ( (!(((_curentry.bindings_type!=4)))) ) )
386  OP_Utils::evalOpParmInst(myBindings(i).bindings_rampsize, node, "bindings#_rampsize", &parmidx, time, 0);
387  else myBindings(i).bindings_rampsize = 1024;
388  if (true && ( (!(((_curentry.bindings_type!=6)))) ) )
389  OP_Utils::evalOpParmInst(myBindings(i).bindings_volume, node, "bindings#_volume", &parmidx, time, 0);
390  else myBindings(i).bindings_volume = ""_sh;
391  if (true && ( (!(((_curentry.bindings_type!=6)))) ) )
392  OP_Utils::evalOpParmInst(myBindings(i).bindings_forcealign, node, "bindings#_forcealign", &parmidx, time, 0);
393  else myBindings(i).bindings_forcealign = false;
394  if (true && ( (!(((_curentry.bindings_type!=6))||((_curentry.bindings_forcealign==1)))) ) )
395  OP_Utils::evalOpParmInst(myBindings(i).bindings_resolution, node, "bindings#_resolution", &parmidx, time, 0);
396  else myBindings(i).bindings_resolution = false;
397  if (true && ( (!(((_curentry.bindings_type!=6))||((_curentry.bindings_forcealign==1)))) ) )
398  OP_Utils::evalOpParmInst(myBindings(i).bindings_voxelsize, node, "bindings#_voxelsize", &parmidx, time, 0);
399  else myBindings(i).bindings_voxelsize = false;
400  if (true && ( (!(((_curentry.bindings_type!=6))||((_curentry.bindings_forcealign==1)))) ) )
401  OP_Utils::evalOpParmInst(myBindings(i).bindings_xformtoworld, node, "bindings#_xformtoworld", &parmidx, time, 0);
402  else myBindings(i).bindings_xformtoworld = false;
403  if (true && ( (!(((_curentry.bindings_type!=6))||((_curentry.bindings_forcealign==1)))) ) )
404  OP_Utils::evalOpParmInst(myBindings(i).bindings_xformtovoxel, node, "bindings#_xformtovoxel", &parmidx, time, 0);
405  else myBindings(i).bindings_xformtovoxel = false;
406  if (true && ( (!(((_curentry.bindings_type!=5)))) ) )
407  OP_Utils::evalOpParmInst(myBindings(i).bindings_attribute, node, "bindings#_attribute", &parmidx, time, 0);
408  else myBindings(i).bindings_attribute = ""_sh;
409  if (true && ( (!(((_curentry.bindings_type!=5)))) ) )
410  OP_Utils::evalOpParmInst(myBindings(i).bindings_attribclass, node, "bindings#_attribclass", &parmidx, time, 0);
411  else myBindings(i).bindings_attribclass = 2;
412  if (true && ( (!(((_curentry.bindings_type!=5)))) ) )
413  OP_Utils::evalOpParmInst(myBindings(i).bindings_attribtype, node, "bindings#_attribtype", &parmidx, time, 0);
414  else myBindings(i).bindings_attribtype = 0;
415  if (true && ( (!(((_curentry.bindings_type!=5)))) ) )
416  OP_Utils::evalOpParmInst(myBindings(i).bindings_attribsize, node, "bindings#_attribsize", &parmidx, time, 0);
417  else myBindings(i).bindings_attribsize = 1;
418  if (true && ( (!(((_curentry.bindings_type!=5)&&(_curentry.bindings_type!=6)))) ) )
419  OP_Utils::evalOpParmInst(myBindings(i).bindings_readable, node, "bindings#_readable", &parmidx, time, 0);
420  else myBindings(i).bindings_readable = false;
421  if (true && ( (!(((_curentry.bindings_type!=5)&&(_curentry.bindings_type!=6)))) ) )
422  OP_Utils::evalOpParmInst(myBindings(i).bindings_writeable, node, "bindings#_writeable", &parmidx, time, 0);
423  else myBindings(i).bindings_writeable = false;
424  if (true && ( (!(((_curentry.bindings_type!=5)&&(_curentry.bindings_type!=6)))) ) )
425  OP_Utils::evalOpParmInst(myBindings(i).bindings_optional, node, "bindings#_optional", &parmidx, time, 0);
426  else myBindings(i).bindings_optional = false;
427 
428  }
429  }
430  else
431  myBindings.clear();
432 
433  }
434 
435 
436  virtual void loadFromOpSubclass(const LoadParms &loadparms)
437  {
438  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
439  }
440 
441 
442  virtual void copyFrom(const SOP_NodeParms *src)
443  {
444  *this = *((const SOP_OpenCLParms *)src);
445  }
446 
447  template <typename T>
448  void
449  doGetParmValue(exint idx, T &value) const
450  {
451  switch (idx)
452  {
453  case 0:
454  coerceValue(value, myKernelname);
455  break;
456  case 1:
457  coerceValue(value, myUsecode);
458  break;
459  case 2:
460  coerceValue(value, myKernelfile);
461  break;
462  case 3:
463  coerceValue(value, myKernelcode);
464  break;
465  case 4:
466  coerceValue(value, myKerneloptions);
467  break;
468  case 5:
469  coerceValue(value, myUsewritebackkernel);
470  break;
471  case 6:
472  coerceValue(value, myWritebackkernelname);
473  break;
474  case 7:
475  coerceValue(value, myRecompile);
476  break;
477  case 8:
478  coerceValue(value, myRunOver);
479  break;
480  case 9:
481  coerceValue(value, myIterations);
482  break;
483  case 10:
484  coerceValue(value, myWorksets_begin);
485  break;
486  case 11:
487  coerceValue(value, myWorksets_length);
488  break;
489  case 12:
490  coerceValue(value, myFinish);
491  break;
492  case 13:
493  coerceValue(value, myTime);
494  break;
495  case 14:
496  coerceValue(value, myTimeinc);
497  break;
498  case 15:
499  coerceValue(value, myTimescale);
500  break;
501  case 16:
502  coerceValue(value, myTimemethod);
503  break;
504  case 17:
505  coerceValue(value, myXnoise);
506  break;
507 
508  }
509  }
510 
511  void getParmValue(exint idx, exint &value) const
512  { doGetParmValue(idx, value); }
513  void getParmValue(exint idx, fpreal &value) const
514  { doGetParmValue(idx, value); }
516  { doGetParmValue(idx, value); }
518  { doGetParmValue(idx, value); }
520  { doGetParmValue(idx, value); }
522  { doGetParmValue(idx, value); }
524  { doGetParmValue(idx, value); }
526  { doGetParmValue(idx, value); }
528  { doGetParmValue(idx, value); }
530  { doGetParmValue(idx, value); }
532  { doGetParmValue(idx, value); }
533 
534  template <typename T>
535  void
536  doSetParmValue(exint idx, const T &value)
537  {
538  switch (idx)
539  {
540  case 0:
541  coerceValue(myKernelname, value);
542  break;
543  case 1:
544  coerceValue(myUsecode, value);
545  break;
546  case 2:
547  coerceValue(myKernelfile, value);
548  break;
549  case 3:
550  coerceValue(myKernelcode, value);
551  break;
552  case 4:
553  coerceValue(myKerneloptions, value);
554  break;
555  case 5:
556  coerceValue(myUsewritebackkernel, value);
557  break;
558  case 6:
559  coerceValue(myWritebackkernelname, value);
560  break;
561  case 7:
562  coerceValue(myRecompile, value);
563  break;
564  case 8:
565  coerceValue(myRunOver, value);
566  break;
567  case 9:
568  coerceValue(myIterations, value);
569  break;
570  case 10:
571  coerceValue(myWorksets_begin, value);
572  break;
573  case 11:
574  coerceValue(myWorksets_length, value);
575  break;
576  case 12:
577  coerceValue(myFinish, value);
578  break;
579  case 13:
580  coerceValue(myTime, value);
581  break;
582  case 14:
583  coerceValue(myTimeinc, value);
584  break;
585  case 15:
586  coerceValue(myTimescale, value);
587  break;
588  case 16:
589  coerceValue(myTimemethod, value);
590  break;
591  case 17:
592  coerceValue(myXnoise, value);
593  break;
594 
595  }
596  }
597 
598  void setParmValue(exint idx, const exint &value)
599  { doSetParmValue(idx, value); }
600  void setParmValue(exint idx, const fpreal &value)
601  { doSetParmValue(idx, value); }
602  void setParmValue(exint idx, const UT_Vector2D &value)
603  { doSetParmValue(idx, value); }
604  void setParmValue(exint idx, const UT_Vector3D &value)
605  { doSetParmValue(idx, value); }
606  void setParmValue(exint idx, const UT_Vector4D &value)
607  { doSetParmValue(idx, value); }
608  void setParmValue(exint idx, const UT_Matrix2D &value)
609  { doSetParmValue(idx, value); }
610  void setParmValue(exint idx, const UT_Matrix3D &value)
611  { doSetParmValue(idx, value); }
612  void setParmValue(exint idx, const UT_Matrix4D &value)
613  { doSetParmValue(idx, value); }
615  { doSetParmValue(idx, value); }
617  { doSetParmValue(idx, value); }
619  { doSetParmValue(idx, value); }
620 
621  virtual exint getNumParms() const
622  {
623  return 19;
624  }
625 
626  virtual const char *getParmName(exint fieldnum) const
627  {
628  switch (fieldnum)
629  {
630  case 0:
631  return "kernelname";
632  case 1:
633  return "usecode";
634  case 2:
635  return "kernelfile";
636  case 3:
637  return "kernelcode";
638  case 4:
639  return "kerneloptions";
640  case 5:
641  return "usewritebackkernel";
642  case 6:
643  return "writebackkernelname";
644  case 7:
645  return "recompile";
646  case 8:
647  return "runover";
648  case 9:
649  return "iterations";
650  case 10:
651  return "worksets_begin";
652  case 11:
653  return "worksets_length";
654  case 12:
655  return "finish";
656  case 13:
657  return "time";
658  case 14:
659  return "timeinc";
660  case 15:
661  return "timescale";
662  case 16:
663  return "timemethod";
664  case 17:
665  return "xnoise";
666  case 18:
667  return "bindings";
668 
669  }
670  return 0;
671  }
672 
673  virtual ParmType getParmType(exint fieldnum) const
674  {
675  switch (fieldnum)
676  {
677  case 0:
678  return PARM_STRING;
679  case 1:
680  return PARM_INTEGER;
681  case 2:
682  return PARM_STRING;
683  case 3:
684  return PARM_STRING;
685  case 4:
686  return PARM_STRING;
687  case 5:
688  return PARM_INTEGER;
689  case 6:
690  return PARM_STRING;
691  case 7:
692  return PARM_INTEGER;
693  case 8:
694  return PARM_INTEGER;
695  case 9:
696  return PARM_INTEGER;
697  case 10:
698  return PARM_STRING;
699  case 11:
700  return PARM_STRING;
701  case 12:
702  return PARM_INTEGER;
703  case 13:
704  return PARM_INTEGER;
705  case 14:
706  return PARM_INTEGER;
707  case 15:
708  return PARM_FLOAT;
709  case 16:
710  return PARM_INTEGER;
711  case 17:
712  return PARM_INTEGER;
713 
714  }
715  return PARM_UNSUPPORTED;
716  }
717 
718  // Boiler plate to load individual types.
719  static void loadData(UT_IStream &is, int64 &v)
720  { is.bread(&v, 1); }
721  static void loadData(UT_IStream &is, bool &v)
722  { int64 iv; is.bread(&iv, 1); v = iv; }
723  static void loadData(UT_IStream &is, fpreal64 &v)
724  { is.bread<fpreal64>(&v, 1); }
725  static void loadData(UT_IStream &is, UT_Vector2D &v)
726  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
727  static void loadData(UT_IStream &is, UT_Vector3D &v)
728  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
729  is.bread<fpreal64>(&v.z(), 1); }
730  static void loadData(UT_IStream &is, UT_Vector4D &v)
731  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
732  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
733  static void loadData(UT_IStream &is, UT_Matrix2D &v)
734  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
735  static void loadData(UT_IStream &is, UT_Matrix3D &v)
736  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
737  static void loadData(UT_IStream &is, UT_Matrix4D &v)
738  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
739  static void loadData(UT_IStream &is, UT_Vector2I &v)
740  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
741  static void loadData(UT_IStream &is, UT_Vector3I &v)
742  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
743  is.bread<int64>(&v.z(), 1); }
744  static void loadData(UT_IStream &is, UT_Vector4I &v)
745  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
746  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
748  { is.bread(v); }
750  { UT_StringHolder rampdata;
751  loadData(is, rampdata);
752  if (rampdata.isstring())
753  {
754  v.reset(new UT_Ramp());
755  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
756  v->load(istr);
757  }
758  else v.reset();
759  }
762  loadData(is, data);
763  if (data.isstring())
764  {
765  // Find the data type.
766  char *colon = UT_StringWrap(data).findChar(':');
767  if (colon)
768  {
769  int typelen = colon - data.buffer();
771  type.strncpy(data.buffer(), typelen);
772  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
773 
774  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
775  }
776  }
777  else v.reset();
778  }
779 
780  static void saveData(std::ostream &os, int64 v)
781  { UTwrite(os, &v); }
782  static void saveData(std::ostream &os, bool v)
783  { int64 iv = v; UTwrite(os, &iv); }
784  static void saveData(std::ostream &os, fpreal64 v)
785  { UTwrite<fpreal64>(os, &v); }
786  static void saveData(std::ostream &os, UT_Vector2D v)
787  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
788  static void saveData(std::ostream &os, UT_Vector3D v)
789  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
790  UTwrite<fpreal64>(os, &v.z()); }
791  static void saveData(std::ostream &os, UT_Vector4D v)
792  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
793  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
794  static void saveData(std::ostream &os, UT_Matrix2D v)
796  static void saveData(std::ostream &os, UT_Matrix3D v)
798  static void saveData(std::ostream &os, UT_Matrix4D v)
800  static void saveData(std::ostream &os, UT_StringHolder s)
801  { UT_StringWrap(s).saveBinary(os); }
802  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
803  { UT_StringHolder result;
804  UT_OStringStream ostr;
805  if (s) s->save(ostr);
806  result = ostr.str();
807  saveData(os, result);
808  }
809  static void saveData(std::ostream &os, PRM_DataItemHandle s)
810  { UT_StringHolder result;
811  UT_OStringStream ostr;
812  if (s)
813  {
814  ostr << s->getDataTypeToken();
815  ostr << ":";
816  s->saveBinary(ostr);
817  }
818  result = ostr.str();
819  saveData(os, result);
820  }
821 
822 
823  void save(std::ostream &os) const
824  {
825  int32 v = version();
826  UTwrite(os, &v);
827  saveData(os, myKernelname);
828  saveData(os, myUsecode);
829  saveData(os, myKernelfile);
830  saveData(os, myKernelcode);
831  saveData(os, myKerneloptions);
832  saveData(os, myUsewritebackkernel);
833  saveData(os, myWritebackkernelname);
834  saveData(os, myRecompile);
835  saveData(os, myRunOver);
836  saveData(os, myIterations);
837  saveData(os, myWorksets_begin);
838  saveData(os, myWorksets_length);
839  saveData(os, myFinish);
840  saveData(os, myTime);
841  saveData(os, myTimeinc);
842  saveData(os, myTimescale);
843  saveData(os, myTimemethod);
844  saveData(os, myXnoise);
845  {
846  int64 length = myBindings.entries();
847  UTwrite(os, &length);
848  for (exint i = 0; i < length; i++)
849  {
850  saveData(os, myBindings(i).bindings_name);
851  saveData(os, myBindings(i).bindings_type);
852  saveData(os, myBindings(i).bindings_intval);
853  saveData(os, myBindings(i).bindings_fval);
854  saveData(os, myBindings(i).bindings_v3val);
855  saveData(os, myBindings(i).bindings_v4val);
856  saveData(os, myBindings(i).bindings_timescale);
857  saveData(os, myBindings(i).bindings_ramp);
858  saveData(os, myBindings(i).bindings_rampsize);
859  saveData(os, myBindings(i).bindings_volume);
860  saveData(os, myBindings(i).bindings_forcealign);
861  saveData(os, myBindings(i).bindings_resolution);
862  saveData(os, myBindings(i).bindings_voxelsize);
863  saveData(os, myBindings(i).bindings_xformtoworld);
864  saveData(os, myBindings(i).bindings_xformtovoxel);
865  saveData(os, myBindings(i).bindings_attribute);
866  saveData(os, myBindings(i).bindings_attribclass);
867  saveData(os, myBindings(i).bindings_attribtype);
868  saveData(os, myBindings(i).bindings_attribsize);
869  saveData(os, myBindings(i).bindings_readable);
870  saveData(os, myBindings(i).bindings_writeable);
871  saveData(os, myBindings(i).bindings_optional);
872 
873  }
874  }
875 
876  }
877 
878  bool load(UT_IStream &is)
879  {
880  int32 v;
881  is.bread(&v, 1);
882  if (version() != v)
883  {
884  // Fail incompatible versions
885  return false;
886  }
887  loadData(is, myKernelname);
888  loadData(is, myUsecode);
889  loadData(is, myKernelfile);
890  loadData(is, myKernelcode);
891  loadData(is, myKerneloptions);
892  loadData(is, myUsewritebackkernel);
893  loadData(is, myWritebackkernelname);
894  loadData(is, myRecompile);
895  loadData(is, myRunOver);
896  loadData(is, myIterations);
897  loadData(is, myWorksets_begin);
898  loadData(is, myWorksets_length);
899  loadData(is, myFinish);
900  loadData(is, myTime);
901  loadData(is, myTimeinc);
902  loadData(is, myTimescale);
903  loadData(is, myTimemethod);
904  loadData(is, myXnoise);
905  {
906  int64 length;
907  is.read(&length, 1);
908  myBindings.entries(length);
909  for (exint i = 0; i < length; i++)
910  {
911  loadData(is, myBindings(i).bindings_name);
912  loadData(is, myBindings(i).bindings_type);
913  loadData(is, myBindings(i).bindings_intval);
914  loadData(is, myBindings(i).bindings_fval);
915  loadData(is, myBindings(i).bindings_v3val);
916  loadData(is, myBindings(i).bindings_v4val);
917  loadData(is, myBindings(i).bindings_timescale);
918  loadData(is, myBindings(i).bindings_ramp);
919  loadData(is, myBindings(i).bindings_rampsize);
920  loadData(is, myBindings(i).bindings_volume);
921  loadData(is, myBindings(i).bindings_forcealign);
922  loadData(is, myBindings(i).bindings_resolution);
923  loadData(is, myBindings(i).bindings_voxelsize);
924  loadData(is, myBindings(i).bindings_xformtoworld);
925  loadData(is, myBindings(i).bindings_xformtovoxel);
926  loadData(is, myBindings(i).bindings_attribute);
927  loadData(is, myBindings(i).bindings_attribclass);
928  loadData(is, myBindings(i).bindings_attribtype);
929  loadData(is, myBindings(i).bindings_attribsize);
930  loadData(is, myBindings(i).bindings_readable);
931  loadData(is, myBindings(i).bindings_writeable);
932  loadData(is, myBindings(i).bindings_optional);
933 
934  }
935  }
936 
937  return true;
938  }
939 
940  const UT_StringHolder & getKernelname() const { return myKernelname; }
941  void setKernelname(const UT_StringHolder & val) { myKernelname = val; }
943  {
944  SOP_Node *thissop = cookparms.getNode();
945  if (!thissop) return getKernelname();
946  UT_StringHolder result;
947  OP_Utils::evalOpParm(result, thissop, "kernelname", cookparms.getCookTime(), 0);
948  return result;
949  }
950  bool getUsecode() const { return myUsecode; }
951  void setUsecode(bool val) { myUsecode = val; }
952  bool opUsecode(const SOP_NodeVerb::CookParms &cookparms) const
953  {
954  SOP_Node *thissop = cookparms.getNode();
955  if (!thissop) return getUsecode();
956  bool result;
957  OP_Utils::evalOpParm(result, thissop, "usecode", cookparms.getCookTime(), 0);
958  return result;
959  }
960  const UT_StringHolder & getKernelfile() const { return myKernelfile; }
961  void setKernelfile(const UT_StringHolder & val) { myKernelfile = val; }
963  {
964  SOP_Node *thissop = cookparms.getNode();
965  if (!thissop) return getKernelfile();
966  UT_StringHolder result;
967  OP_Utils::evalOpParm(result, thissop, "kernelfile", cookparms.getCookTime(), 0);
968  return result;
969  }
970  const UT_StringHolder & getKernelcode() const { return myKernelcode; }
971  void setKernelcode(const UT_StringHolder & val) { myKernelcode = val; }
973  {
974  SOP_Node *thissop = cookparms.getNode();
975  if (!thissop) return getKernelcode();
976  UT_StringHolder result;
977  OP_Utils::evalOpParm(result, thissop, "kernelcode", cookparms.getCookTime(), 0);
978  return result;
979  }
980  const UT_StringHolder & getKerneloptions() const { return myKerneloptions; }
981  void setKerneloptions(const UT_StringHolder & val) { myKerneloptions = val; }
983  {
984  SOP_Node *thissop = cookparms.getNode();
985  if (!thissop) return getKerneloptions();
986  UT_StringHolder result;
987  OP_Utils::evalOpParm(result, thissop, "kerneloptions", cookparms.getCookTime(), 0);
988  return result;
989  }
990  bool getUsewritebackkernel() const { return myUsewritebackkernel; }
991  void setUsewritebackkernel(bool val) { myUsewritebackkernel = val; }
992  bool opUsewritebackkernel(const SOP_NodeVerb::CookParms &cookparms) const
993  {
994  SOP_Node *thissop = cookparms.getNode();
995  if (!thissop) return getUsewritebackkernel();
996  bool result;
997  OP_Utils::evalOpParm(result, thissop, "usewritebackkernel", cookparms.getCookTime(), 0);
998  return result;
999  }
1000  const UT_StringHolder & getWritebackkernelname() const { return myWritebackkernelname; }
1001  void setWritebackkernelname(const UT_StringHolder & val) { myWritebackkernelname = val; }
1003  {
1004  SOP_Node *thissop = cookparms.getNode();
1005  if (!thissop) return getWritebackkernelname();
1006  UT_StringHolder result;
1007  OP_Utils::evalOpParm(result, thissop, "writebackkernelname", cookparms.getCookTime(), 0);
1008  return result;
1009  }
1010  bool getRecompile() const { return myRecompile; }
1011  void setRecompile(bool val) { myRecompile = val; }
1012  bool opRecompile(const SOP_NodeVerb::CookParms &cookparms) const
1013  {
1014  SOP_Node *thissop = cookparms.getNode();
1015  if (!thissop) return getRecompile();
1016  bool result;
1017  OP_Utils::evalOpParm(result, thissop, "recompile", cookparms.getCookTime(), 0);
1018  return result;
1019  }
1020  RunOver getRunOver() const { return RunOver(myRunOver); }
1021  void setRunOver(RunOver val) { myRunOver = int64(val); }
1023  {
1024  SOP_Node *thissop = cookparms.getNode();
1025  if (!thissop) return getRunOver();
1026  int64 result;
1027  OP_Utils::evalOpParm(result, thissop, "runover", cookparms.getCookTime(), 0);
1028  return RunOver(result);
1029  }
1030  int64 getIterations() const { return myIterations; }
1031  void setIterations(int64 val) { myIterations = val; }
1033  {
1034  SOP_Node *thissop = cookparms.getNode();
1035  if (!thissop) return getIterations();
1036  int64 result;
1037  OP_Utils::evalOpParm(result, thissop, "iterations", cookparms.getCookTime(), 0);
1038  return result;
1039  }
1040  const UT_StringHolder & getWorksets_begin() const { return myWorksets_begin; }
1041  void setWorksets_begin(const UT_StringHolder & val) { myWorksets_begin = val; }
1043  {
1044  SOP_Node *thissop = cookparms.getNode();
1045  if (!thissop) return getWorksets_begin();
1046  UT_StringHolder result;
1047  OP_Utils::evalOpParm(result, thissop, "worksets_begin", cookparms.getCookTime(), 0);
1048  return result;
1049  }
1050  const UT_StringHolder & getWorksets_length() const { return myWorksets_length; }
1051  void setWorksets_length(const UT_StringHolder & val) { myWorksets_length = val; }
1053  {
1054  SOP_Node *thissop = cookparms.getNode();
1055  if (!thissop) return getWorksets_length();
1056  UT_StringHolder result;
1057  OP_Utils::evalOpParm(result, thissop, "worksets_length", cookparms.getCookTime(), 0);
1058  return result;
1059  }
1060  bool getFinish() const { return myFinish; }
1061  void setFinish(bool val) { myFinish = val; }
1062  bool opFinish(const SOP_NodeVerb::CookParms &cookparms) const
1063  {
1064  SOP_Node *thissop = cookparms.getNode();
1065  if (!thissop) return getFinish();
1066  bool result;
1067  OP_Utils::evalOpParm(result, thissop, "finish", cookparms.getCookTime(), 0);
1068  return result;
1069  }
1070  bool getTime() const { return myTime; }
1071  void setTime(bool val) { myTime = val; }
1072  bool opTime(const SOP_NodeVerb::CookParms &cookparms) const
1073  {
1074  SOP_Node *thissop = cookparms.getNode();
1075  if (!thissop) return getTime();
1076  bool result;
1077  OP_Utils::evalOpParm(result, thissop, "time", cookparms.getCookTime(), 0);
1078  return result;
1079  }
1080  bool getTimeinc() const { return myTimeinc; }
1081  void setTimeinc(bool val) { myTimeinc = val; }
1082  bool opTimeinc(const SOP_NodeVerb::CookParms &cookparms) const
1083  {
1084  SOP_Node *thissop = cookparms.getNode();
1085  if (!thissop) return getTimeinc();
1086  bool result;
1087  OP_Utils::evalOpParm(result, thissop, "timeinc", cookparms.getCookTime(), 0);
1088  return result;
1089  }
1090  fpreal64 getTimescale() const { return myTimescale; }
1091  void setTimescale(fpreal64 val) { myTimescale = val; }
1093  {
1094  SOP_Node *thissop = cookparms.getNode();
1095  if (!thissop) return getTimescale();
1096  fpreal64 result;
1097  OP_Utils::evalOpParm(result, thissop, "timescale", cookparms.getCookTime(), 0);
1098  return result;
1099  }
1100  Timemethod getTimemethod() const { return Timemethod(myTimemethod); }
1101  void setTimemethod(Timemethod val) { myTimemethod = int64(val); }
1103  {
1104  SOP_Node *thissop = cookparms.getNode();
1105  if (!thissop) return getTimemethod();
1106  int64 result;
1107  OP_Utils::evalOpParm(result, thissop, "timemethod", cookparms.getCookTime(), 0);
1108  return Timemethod(result);
1109  }
1110  bool getXnoise() const { return myXnoise; }
1111  void setXnoise(bool val) { myXnoise = val; }
1112  bool opXnoise(const SOP_NodeVerb::CookParms &cookparms) const
1113  {
1114  SOP_Node *thissop = cookparms.getNode();
1115  if (!thissop) return getXnoise();
1116  bool result;
1117  OP_Utils::evalOpParm(result, thissop, "xnoise", cookparms.getCookTime(), 0);
1118  return result;
1119  }
1120  const UT_Array<Bindings> &getBindings() const { return myBindings; }
1121  void setBindings(const UT_Array<Bindings> &val) { myBindings = val; }
1122  exint opBindings(const SOP_NodeVerb::CookParms &cookparms) const
1123  {
1124  SOP_Node *thissop = cookparms.getNode();
1125  if (!thissop) return getBindings().entries();
1126  exint result;
1127  OP_Utils::evalOpParm(result, thissop, "bindings", cookparms.getCookTime(), 0);
1128  return result;
1129  }
1131  {
1132  SOP_Node *thissop = cookparms.getNode();
1133  if (!thissop) return (myBindings(_idx).bindings_name);
1134  int _parmidx = _idx + 1;
1135  UT_StringHolder result;
1136  OP_Utils::evalOpParmInst(result, thissop, "bindings#_name", &_parmidx, cookparms.getCookTime(), 0);
1137  return (result);
1138  }
1140  {
1141  SOP_Node *thissop = cookparms.getNode();
1142  if (!thissop) return (myBindings(_idx).bindings_type);
1143  int _parmidx = _idx + 1;
1144  int64 result;
1145  OP_Utils::evalOpParmInst(result, thissop, "bindings#_type", &_parmidx, cookparms.getCookTime(), 0);
1146  return (result);
1147  }
1149  {
1150  SOP_Node *thissop = cookparms.getNode();
1151  if (!thissop) return (myBindings(_idx).bindings_intval);
1152  int _parmidx = _idx + 1;
1153  int64 result;
1154  OP_Utils::evalOpParmInst(result, thissop, "bindings#_intval", &_parmidx, cookparms.getCookTime(), 0);
1155  return (result);
1156  }
1158  {
1159  SOP_Node *thissop = cookparms.getNode();
1160  if (!thissop) return (myBindings(_idx).bindings_fval);
1161  int _parmidx = _idx + 1;
1162  fpreal64 result;
1163  OP_Utils::evalOpParmInst(result, thissop, "bindings#_fval", &_parmidx, cookparms.getCookTime(), 0);
1164  return (result);
1165  }
1167  {
1168  SOP_Node *thissop = cookparms.getNode();
1169  if (!thissop) return (myBindings(_idx).bindings_v3val);
1170  int _parmidx = _idx + 1;
1171  UT_Vector3D result;
1172  OP_Utils::evalOpParmInst(result, thissop, "bindings#_v3val", &_parmidx, cookparms.getCookTime(), 0);
1173  return (result);
1174  }
1176  {
1177  SOP_Node *thissop = cookparms.getNode();
1178  if (!thissop) return (myBindings(_idx).bindings_v4val);
1179  int _parmidx = _idx + 1;
1180  UT_Vector4D result;
1181  OP_Utils::evalOpParmInst(result, thissop, "bindings#_v4val", &_parmidx, cookparms.getCookTime(), 0);
1182  return (result);
1183  }
1185  {
1186  SOP_Node *thissop = cookparms.getNode();
1187  if (!thissop) return (myBindings(_idx).bindings_timescale);
1188  int _parmidx = _idx + 1;
1189  int64 result;
1190  OP_Utils::evalOpParmInst(result, thissop, "bindings#_timescale", &_parmidx, cookparms.getCookTime(), 0);
1191  return (result);
1192  }
1194  {
1195  SOP_Node *thissop = cookparms.getNode();
1196  if (!thissop) return (myBindings(_idx).bindings_ramp);
1197  int _parmidx = _idx + 1;
1198  UT_SharedPtr<UT_Ramp> result;
1199  OP_Utils::evalOpParmInst(result, thissop, "bindings#_ramp", &_parmidx, cookparms.getCookTime(), 0);
1200  return (result);
1201  }
1203  {
1204  SOP_Node *thissop = cookparms.getNode();
1205  if (!thissop) return (myBindings(_idx).bindings_rampsize);
1206  int _parmidx = _idx + 1;
1207  int64 result;
1208  OP_Utils::evalOpParmInst(result, thissop, "bindings#_rampsize", &_parmidx, cookparms.getCookTime(), 0);
1209  return (result);
1210  }
1212  {
1213  SOP_Node *thissop = cookparms.getNode();
1214  if (!thissop) return (myBindings(_idx).bindings_volume);
1215  int _parmidx = _idx + 1;
1216  UT_StringHolder result;
1217  OP_Utils::evalOpParmInst(result, thissop, "bindings#_volume", &_parmidx, cookparms.getCookTime(), 0);
1218  return (result);
1219  }
1221  {
1222  SOP_Node *thissop = cookparms.getNode();
1223  if (!thissop) return (myBindings(_idx).bindings_forcealign);
1224  int _parmidx = _idx + 1;
1225  bool result;
1226  OP_Utils::evalOpParmInst(result, thissop, "bindings#_forcealign", &_parmidx, cookparms.getCookTime(), 0);
1227  return (result);
1228  }
1230  {
1231  SOP_Node *thissop = cookparms.getNode();
1232  if (!thissop) return (myBindings(_idx).bindings_resolution);
1233  int _parmidx = _idx + 1;
1234  bool result;
1235  OP_Utils::evalOpParmInst(result, thissop, "bindings#_resolution", &_parmidx, cookparms.getCookTime(), 0);
1236  return (result);
1237  }
1239  {
1240  SOP_Node *thissop = cookparms.getNode();
1241  if (!thissop) return (myBindings(_idx).bindings_voxelsize);
1242  int _parmidx = _idx + 1;
1243  bool result;
1244  OP_Utils::evalOpParmInst(result, thissop, "bindings#_voxelsize", &_parmidx, cookparms.getCookTime(), 0);
1245  return (result);
1246  }
1248  {
1249  SOP_Node *thissop = cookparms.getNode();
1250  if (!thissop) return (myBindings(_idx).bindings_xformtoworld);
1251  int _parmidx = _idx + 1;
1252  bool result;
1253  OP_Utils::evalOpParmInst(result, thissop, "bindings#_xformtoworld", &_parmidx, cookparms.getCookTime(), 0);
1254  return (result);
1255  }
1257  {
1258  SOP_Node *thissop = cookparms.getNode();
1259  if (!thissop) return (myBindings(_idx).bindings_xformtovoxel);
1260  int _parmidx = _idx + 1;
1261  bool result;
1262  OP_Utils::evalOpParmInst(result, thissop, "bindings#_xformtovoxel", &_parmidx, cookparms.getCookTime(), 0);
1263  return (result);
1264  }
1266  {
1267  SOP_Node *thissop = cookparms.getNode();
1268  if (!thissop) return (myBindings(_idx).bindings_attribute);
1269  int _parmidx = _idx + 1;
1270  UT_StringHolder result;
1271  OP_Utils::evalOpParmInst(result, thissop, "bindings#_attribute", &_parmidx, cookparms.getCookTime(), 0);
1272  return (result);
1273  }
1275  {
1276  SOP_Node *thissop = cookparms.getNode();
1277  if (!thissop) return (myBindings(_idx).bindings_attribclass);
1278  int _parmidx = _idx + 1;
1279  int64 result;
1280  OP_Utils::evalOpParmInst(result, thissop, "bindings#_attribclass", &_parmidx, cookparms.getCookTime(), 0);
1281  return (result);
1282  }
1284  {
1285  SOP_Node *thissop = cookparms.getNode();
1286  if (!thissop) return (myBindings(_idx).bindings_attribtype);
1287  int _parmidx = _idx + 1;
1288  int64 result;
1289  OP_Utils::evalOpParmInst(result, thissop, "bindings#_attribtype", &_parmidx, cookparms.getCookTime(), 0);
1290  return (result);
1291  }
1293  {
1294  SOP_Node *thissop = cookparms.getNode();
1295  if (!thissop) return (myBindings(_idx).bindings_attribsize);
1296  int _parmidx = _idx + 1;
1297  int64 result;
1298  OP_Utils::evalOpParmInst(result, thissop, "bindings#_attribsize", &_parmidx, cookparms.getCookTime(), 0);
1299  return (result);
1300  }
1302  {
1303  SOP_Node *thissop = cookparms.getNode();
1304  if (!thissop) return (myBindings(_idx).bindings_readable);
1305  int _parmidx = _idx + 1;
1306  bool result;
1307  OP_Utils::evalOpParmInst(result, thissop, "bindings#_readable", &_parmidx, cookparms.getCookTime(), 0);
1308  return (result);
1309  }
1311  {
1312  SOP_Node *thissop = cookparms.getNode();
1313  if (!thissop) return (myBindings(_idx).bindings_writeable);
1314  int _parmidx = _idx + 1;
1315  bool result;
1316  OP_Utils::evalOpParmInst(result, thissop, "bindings#_writeable", &_parmidx, cookparms.getCookTime(), 0);
1317  return (result);
1318  }
1320  {
1321  SOP_Node *thissop = cookparms.getNode();
1322  if (!thissop) return (myBindings(_idx).bindings_optional);
1323  int _parmidx = _idx + 1;
1324  bool result;
1325  OP_Utils::evalOpParmInst(result, thissop, "bindings#_optional", &_parmidx, cookparms.getCookTime(), 0);
1326  return (result);
1327  }
1328 
1329 
1330 private:
1331  UT_StringHolder myKernelname;
1332  bool myUsecode;
1333  UT_StringHolder myKernelfile;
1334  UT_StringHolder myKernelcode;
1335  UT_StringHolder myKerneloptions;
1336  bool myUsewritebackkernel;
1337  UT_StringHolder myWritebackkernelname;
1338  bool myRecompile;
1339  int64 myRunOver;
1340  int64 myIterations;
1341  UT_StringHolder myWorksets_begin;
1342  UT_StringHolder myWorksets_length;
1343  bool myFinish;
1344  bool myTime;
1345  bool myTimeinc;
1346  fpreal64 myTimescale;
1347  int64 myTimemethod;
1348  bool myXnoise;
1349  UT_Array<Bindings> myBindings;
1350 
1351 };
const UT_StringHolder & getWorksets_length() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool getRecompile() const
bool opXnoise(const SOP_NodeVerb::CookParms &cookparms) const
int64 opBindings_bindings_type(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
bool opBindings_bindings_forcealign(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void getParmValue(exint idx, UT_StringHolder &value) const
virtual void copyFrom(const SOP_NodeParms *src)
static void loadData(UT_IStream &is, UT_Vector3D &v)
UT_StringHolder opKernelname(const SOP_NodeVerb::CookParms &cookparms) const
bool opBindings_bindings_readable(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:494
void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
bool opBindings_bindings_xformtoworld(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
int64 opBindings_bindings_intval(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
T & z(void)
Definition: UT_Vector4.h:379
void setKernelname(const UT_StringHolder &val)
UT_StringHolder opKerneloptions(const SOP_NodeVerb::CookParms &cookparms) const
void setWorksets_begin(const UT_StringHolder &val)
Timemethod opTimemethod(const SOP_NodeVerb::CookParms &cookparms) const
void doSetParmValue(exint idx, const T &value)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
fpreal getTime() const
Definition: OP_Context.h:60
const GLdouble * v
Definition: glcorearb.h:836
static void saveData(std::ostream &os, int64 v)
bool opBindings_bindings_writeable(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void setTimemethod(Timemethod val)
UT_StringHolder opKernelcode(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
const UT_StringHolder & getKernelname() const
void setRecompile(bool val)
void getParmValue(exint idx, PRM_DataItemHandle &value) const
virtual const char * getParmName(exint fieldnum) const
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
void setParmValue(exint idx, const UT_Vector2D &value)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, fpreal64 v)
bool operator!=(const Bindings &src) const
SYS_FORCE_INLINE const char * buffer() const
T & x(void)
Definition: UT_Vector2.h:285
virtual ~SOP_OpenCLParms()
bool opFinish(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
int64 opBindings_bindings_timescale(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
fpreal64 opTimescale(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opWorksets_length(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getKernelfile() const
An output stream object that owns its own string buffer storage.
void setTime(bool val)
UT_StringHolder bindings_volume
static void loadData(UT_IStream &is, UT_Vector3I &v)
const UT_WorkBuffer & str() const
Returns a read-only reference to the underlying UT_WorkBuffer.
void getParmValue(exint idx, UT_Matrix4D &value) const
int64 getIterations() const
void getParmValue(exint idx, exint &value) const
static void saveData(std::ostream &os, UT_Vector2D v)
void setUsewritebackkernel(bool val)
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:498
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
png_uint_32 i
Definition: png.h:2877
void setParmValue(exint idx, const UT_Vector4D &value)
void save(std::ostream &os) const
bool opUsewritebackkernel(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector4D opBindings_bindings_v4val(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void getParmValue(exint idx, UT_Matrix2D &value) const
void setTimescale(fpreal64 val)
const UT_StringHolder & getWorksets_begin() const
bool opBindings_bindings_optional(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void setParmValue(exint idx, const UT_StringHolder &value)
RunOver getRunOver() const
UT_StringHolder opWorksets_begin(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:502
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static void saveData(std::ostream &os, UT_Matrix3D v)
long long int64
Definition: SYS_Types.h:107
fpreal64 getTimescale() const
void setXnoise(bool val)
bool opTimeinc(const SOP_NodeVerb::CookParms &cookparms) const
exint opBindings(const SOP_NodeVerb::CookParms &cookparms) const
bool opTime(const SOP_NodeVerb::CookParms &cookparms) const
void setUsecode(bool val)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setKerneloptions(const UT_StringHolder &val)
void setParmValue(exint idx, const UT_Matrix2D &value)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setParmValue(exint idx, const UT_Matrix3D &value)
exint length() const
static void saveData(std::ostream &os, UT_Vector4D v)
char * findChar(int c) const
Find first occurrance of character. Returns NULL upon failure.
Definition: UT_String.h:550
UT_SharedPtr< UT_Ramp > bindings_ramp
static void loadData(UT_IStream &is, UT_Vector4I &v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
int64 exint
Definition: SYS_Types.h:116
UT_StringHolder opKernelfile(const SOP_NodeVerb::CookParms &cookparms) const
bool getTime() const
fpreal64 opBindings_bindings_fval(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
const OP_Node * node() const
Definition: SOP_NodeVerb.h:104
double fpreal64
Definition: SYS_Types.h:192
void setWorksets_length(const UT_StringHolder &val)
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:284
bool opUsecode(const SOP_NodeVerb::CookParms &cookparms) const
int64 opBindings_bindings_attribclass(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
int64 opBindings_bindings_attribsize(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
bool getUsecode() const
bool opBindings_bindings_resolution(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector2I &v)
const UT_StringHolder & getKerneloptions() const
UT_StringHolder bindings_name
static void saveData(std::ostream &os, UT_Vector3D v)
virtual ParmType getParmType(exint fieldnum) const
UT_Vector3T< fpreal64 > UT_Vector3D
GLboolean * data
Definition: glcorearb.h:130
static void loadData(UT_IStream &is, int64 &v)
int int32
Definition: SYS_Types.h:35
T & y(void)
Definition: UT_Vector4.h:377
void setKernelcode(const UT_StringHolder &val)
const UT_StringHolder & getKernelcode() const
void setTimeinc(bool val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void getParmValue(exint idx, UT_Vector3D &value) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
UT_StringHolder createString(const UT_Array< Bindings > &list) const
void setParmValue(exint idx, const UT_Vector3D &value)
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:111
void setParmValue(exint idx, const PRM_DataItemHandle &value)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:453
UT_StringHolder bindings_attribute
UT_StringHolder opWritebackkernelname(const SOP_NodeVerb::CookParms &cookparms) const
bool getXnoise() const
bool operator==(const SOP_OpenCLParms &src) const
bool operator==(const Bindings &src) const
bool getTimeinc() const
const UT_StringHolder & getWritebackkernelname() const
SYS_FORCE_INLINE T & y(void)
Definition: UT_Vector3.h:500
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:270
void doGetParmValue(exint idx, T &value) const
void setIterations(int64 val)
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
virtual exint getNumParms() const
void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
void setKernelfile(const UT_StringHolder &val)
void setFinish(bool val)
static void loadData(UT_IStream &is, fpreal64 &v)
void setRunOver(RunOver val)
static int version()
UT_StringHolder opBindings_bindings_attribute(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
bool getFinish() const
bool opRecompile(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const fpreal &value)
Timemethod getTimemethod() const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
int64 opBindings_bindings_rampsize(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
bool load(UT_IStream &is)
bool opBindings_bindings_voxelsize(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void getParmValue(exint idx, UT_Vector2D &value) const
SYS_FORCE_INLINE void append(char character)
void setBindings(const UT_Array< Bindings > &val)
GLuint GLfloat * val
Definition: glcorearb.h:1607
const UT_Array< Bindings > & getBindings() const
#define SOP_API
Definition: SOP_API.h:10
void getParmValue(exint idx, fpreal &value) const
int64 opIterations(const SOP_NodeVerb::CookParms &cookparms) const
void getParmValue(exint idx, UT_Vector4D &value) const
UT_SharedPtr< UT_Ramp > opBindings_bindings_ramp(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:501
T & x(void)
Definition: UT_Vector4.h:375
bool operator!=(const SOP_OpenCLParms &src) const
bool getUsewritebackkernel() const
static void saveData(std::ostream &os, bool v)
T & y(void)
Definition: UT_Vector2.h:287
GLboolean r
Definition: glcorearb.h:1221
UT_Vector3D opBindings_bindings_v3val(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
UT_StringHolder opBindings_bindings_volume(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
static void saveData(std::ostream &os, UT_Matrix4D v)
virtual void loadFromOpSubclass(const LoadParms &loadparms)
UT_Vector4T< fpreal64 > UT_Vector4D
T & w(void)
Definition: UT_Vector4.h:381
void setWritebackkernelname(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
int64 opBindings_bindings_attribtype(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
void setParmValue(exint idx, const exint &value)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:109
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:88
void getParmValue(exint idx, UT_Matrix3D &value) const
bool opBindings_bindings_xformtovoxel(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, bool &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setParmValue(exint idx, const UT_Matrix4D &value)
RunOver opRunOver(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opBindings_bindings_name(const SOP_NodeVerb::CookParms &cookparms, exint _idx) const
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794
static void loadData(UT_IStream &is, UT_StringHolder &v)
GLenum src
Definition: glcorearb.h:1792