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