HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Scatter-2.0.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_Scatter_2_0Enums
22 {
23  enum class GenerateBy
24  {
25  BYDENSITY = 0,
28  };
29 }
30 
31 
33 {
34 public:
35  static int version() { return 1; }
36 
38  {
39  myGroup = ""_sh;
40  myGenerateBy = 0;
41  myUseDensityAttrib = false;
42  myDensityAttrib = "density"_sh;
43  myUseAreaAttrib = false;
44  myAreaAttrib = "area"_sh;
45  myIndepVoxel = false;
46  myForceTotal = false;
47  myNpts = 1000;
48  myUseDensityTexture = false;
49  myDensityTexture = "default.pic"_sh;
50  myCountPerPrimAttrib = "count"_sh;
51  myUseEmergencyLimit = false;
52  myEmergencyLimit = 1e+06;
53  mySeed = 0;
54  myOverridePrimSeed = false;
55  myPrimSeedAttrib = "primid"_sh;
56  myRandomizeOrder = false;
57  myRelaxPoints = false;
58  myRelaxIterations = 10;
59  myUsePrimNumAttrib = false;
60  myPrimNumAttrib = "sourceprim"_sh;
61  myUsePrimUVWAttrib = false;
62  myPrimUVWAttrib = "sourceprimuv"_sh;
63  myUseOutputDensityAttrib = false;
64  myOutputDensityAttrib = "density"_sh;
65  myUseOutputRadiusAttrib = false;
66  myOutputRadiusAttrib = "pscale"_sh;
67  myRadiusInTextureSpace = false;
68  myPointAttribs = "*"_sh;
69  myVertAttribs = ""_sh;
70  myPrimAttribs = ""_sh;
71  myDetailAttribs = ""_sh;
72  myDensityScale = 10;
73  myUseAreaForVolumes = false;
74  myScaleRadiiBy = 1;
75  myUseMaxRadius = false;
76  myMaxRadius = 10;
77 
78  }
79 
80  explicit SOP_Scatter_2_0Parms(const SOP_Scatter_2_0Parms &) = default;
81 
82  virtual ~SOP_Scatter_2_0Parms() {}
83 
84  bool operator==(const SOP_Scatter_2_0Parms &src) const
85  {
86  if (myGroup != src.myGroup) return false;
87  if (myGenerateBy != src.myGenerateBy) return false;
88  if (myUseDensityAttrib != src.myUseDensityAttrib) return false;
89  if (myDensityAttrib != src.myDensityAttrib) return false;
90  if (myUseAreaAttrib != src.myUseAreaAttrib) return false;
91  if (myAreaAttrib != src.myAreaAttrib) return false;
92  if (myIndepVoxel != src.myIndepVoxel) return false;
93  if (myForceTotal != src.myForceTotal) return false;
94  if (myNpts != src.myNpts) return false;
95  if (myUseDensityTexture != src.myUseDensityTexture) return false;
96  if (myDensityTexture != src.myDensityTexture) return false;
97  if (myCountPerPrimAttrib != src.myCountPerPrimAttrib) return false;
98  if (myUseEmergencyLimit != src.myUseEmergencyLimit) return false;
99  if (myEmergencyLimit != src.myEmergencyLimit) return false;
100  if (mySeed != src.mySeed) return false;
101  if (myOverridePrimSeed != src.myOverridePrimSeed) return false;
102  if (myPrimSeedAttrib != src.myPrimSeedAttrib) return false;
103  if (myRandomizeOrder != src.myRandomizeOrder) return false;
104  if (myRelaxPoints != src.myRelaxPoints) return false;
105  if (myRelaxIterations != src.myRelaxIterations) return false;
106  if (myUsePrimNumAttrib != src.myUsePrimNumAttrib) return false;
107  if (myPrimNumAttrib != src.myPrimNumAttrib) return false;
108  if (myUsePrimUVWAttrib != src.myUsePrimUVWAttrib) return false;
109  if (myPrimUVWAttrib != src.myPrimUVWAttrib) return false;
110  if (myUseOutputDensityAttrib != src.myUseOutputDensityAttrib) return false;
111  if (myOutputDensityAttrib != src.myOutputDensityAttrib) return false;
112  if (myUseOutputRadiusAttrib != src.myUseOutputRadiusAttrib) return false;
113  if (myOutputRadiusAttrib != src.myOutputRadiusAttrib) return false;
114  if (myRadiusInTextureSpace != src.myRadiusInTextureSpace) return false;
115  if (myPointAttribs != src.myPointAttribs) return false;
116  if (myVertAttribs != src.myVertAttribs) return false;
117  if (myPrimAttribs != src.myPrimAttribs) return false;
118  if (myDetailAttribs != src.myDetailAttribs) return false;
119  if (myDensityScale != src.myDensityScale) return false;
120  if (myUseAreaForVolumes != src.myUseAreaForVolumes) return false;
121  if (myScaleRadiiBy != src.myScaleRadiiBy) return false;
122  if (myUseMaxRadius != src.myUseMaxRadius) return false;
123  if (myMaxRadius != src.myMaxRadius) return false;
124 
125  return true;
126  }
128  {
129  return !operator==(src);
130  }
132 
133 
134 
135  void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
136  {
137  if (true)
138  OP_Utils::evalOpParm(myGroup, node, "group", time, 0);
139  else myGroup = ""_sh;
140  if (true)
141  OP_Utils::evalOpParm(myGenerateBy, node, "generateby", time, 0);
142  else myGenerateBy = 0;
143  if (true && ( (!(((int64(getGenerateBy())!=0)))) ) )
144  OP_Utils::evalOpParm(myUseDensityAttrib, node, "usedensityattrib", time, 0);
145  else myUseDensityAttrib = false;
146  if (true && ( (!(((int64(getGenerateBy())!=0))||((getUseDensityAttrib()==0)))) ) )
147  OP_Utils::evalOpParm(myDensityAttrib, node, "densityattrib", time, 0);
148  else myDensityAttrib = "density"_sh;
149  if (true && ( (!(((int64(getGenerateBy())!=0)))) ) )
150  OP_Utils::evalOpParm(myUseAreaAttrib, node, "useareaattrib", time, 0);
151  else myUseAreaAttrib = false;
152  if (true && ( (!(((int64(getGenerateBy())!=0))||((getUseAreaAttrib()==0)))) ) )
153  OP_Utils::evalOpParm(myAreaAttrib, node, "areaattrib", time, 0);
154  else myAreaAttrib = "area"_sh;
155  if (true && ( (!(((int64(getGenerateBy())!=0)))) ) )
156  OP_Utils::evalOpParm(myIndepVoxel, node, "indepvoxel", time, 0);
157  else myIndepVoxel = false;
158  if (true && ( (!(((int64(getGenerateBy())!=0))||((getIndepVoxel()==1)))) ) )
159  OP_Utils::evalOpParm(myForceTotal, node, "forcetotal", time, 0);
160  else myForceTotal = false;
161  if (true && ( (!(((int64(getGenerateBy())!=0))||((getForceTotal()==0))||((getIndepVoxel()==1)))) ) )
162  OP_Utils::evalOpParm(myNpts, node, "npts", time, 0);
163  else myNpts = 1000;
164  if (true && ( (!(((int64(getGenerateBy())!=2)))) ) )
165  OP_Utils::evalOpParm(myUseDensityTexture, node, "usedensitytexture", time, 0);
166  else myUseDensityTexture = false;
167  if (true && ( (!(((int64(getGenerateBy())!=2))||((getUseDensityTexture()==0)))) ) )
168  OP_Utils::evalOpParm(myDensityTexture, node, "densitytexture", time, 0);
169  else myDensityTexture = "default.pic"_sh;
170  if (true && ( (!(((int64(getGenerateBy())!=1)))) ) )
171  OP_Utils::evalOpParm(myCountPerPrimAttrib, node, "primcountattrib", time, 0);
172  else myCountPerPrimAttrib = "count"_sh;
173  if (true)
174  OP_Utils::evalOpParm(myUseEmergencyLimit, node, "useemergencylimit", time, 0);
175  else myUseEmergencyLimit = false;
176  if (true && ( (!(((getUseEmergencyLimit()==0)))) ) )
177  OP_Utils::evalOpParm(myEmergencyLimit, node, "emergencylimit", time, 0);
178  else myEmergencyLimit = 1e+06;
179  if (true)
180  OP_Utils::evalOpParm(mySeed, node, "seed", time, 0);
181  else mySeed = 0;
182  if (true && ( (!(((int64(getGenerateBy())==2)))) ) )
183  OP_Utils::evalOpParm(myOverridePrimSeed, node, "overrideprimseed", time, 0);
184  else myOverridePrimSeed = false;
185  if (true && ( (!(((int64(getGenerateBy())==2))||((getOverridePrimSeed()==0)))) ) )
186  OP_Utils::evalOpParm(myPrimSeedAttrib, node, "primseedattrib", time, 0);
187  else myPrimSeedAttrib = "primid"_sh;
188  if (true)
189  OP_Utils::evalOpParm(myRandomizeOrder, node, "randomizeorder", time, 0);
190  else myRandomizeOrder = false;
191  if (true)
192  OP_Utils::evalOpParm(myRelaxPoints, node, "relaxpoints", time, 0);
193  else myRelaxPoints = false;
194  if (true && ( (!(((getRelaxPoints()==0)))) ) )
195  OP_Utils::evalOpParm(myRelaxIterations, node, "relaxiterations", time, 0);
196  else myRelaxIterations = 10;
197  if (true)
198  OP_Utils::evalOpParm(myUsePrimNumAttrib, node, "useprimnumattrib", time, 0);
199  else myUsePrimNumAttrib = false;
200  if (true && ( (!(((getUsePrimNumAttrib()==0)))) ) )
201  OP_Utils::evalOpParm(myPrimNumAttrib, node, "primnumattrib", time, 0);
202  else myPrimNumAttrib = "sourceprim"_sh;
203  if (true)
204  OP_Utils::evalOpParm(myUsePrimUVWAttrib, node, "useprimuvwattrib", time, 0);
205  else myUsePrimUVWAttrib = false;
206  if (true && ( (!(((getUsePrimUVWAttrib()==0)))) ) )
207  OP_Utils::evalOpParm(myPrimUVWAttrib, node, "primuvwattrib", time, 0);
208  else myPrimUVWAttrib = "sourceprimuv"_sh;
209  if (true)
210  OP_Utils::evalOpParm(myUseOutputDensityAttrib, node, "useoutputdensityattrib", time, 0);
211  else myUseOutputDensityAttrib = false;
212  if (true && ( (!(((getUseOutputDensityAttrib()==0)))) ) )
213  OP_Utils::evalOpParm(myOutputDensityAttrib, node, "outputdensityattrib", time, 0);
214  else myOutputDensityAttrib = "density"_sh;
215  if (true)
216  OP_Utils::evalOpParm(myUseOutputRadiusAttrib, node, "useoutputradiusattrib", time, 0);
217  else myUseOutputRadiusAttrib = false;
218  if (true && ( (!(((getUseOutputRadiusAttrib()==0)))) ) )
219  OP_Utils::evalOpParm(myOutputRadiusAttrib, node, "outputradiusattrib", time, 0);
220  else myOutputRadiusAttrib = "pscale"_sh;
221  if (true && ( (!(((int64(getGenerateBy())!=2))||((getUseOutputRadiusAttrib()==0)&&(getUseOutputDensityAttrib()==0)))) ) )
222  OP_Utils::evalOpParm(myRadiusInTextureSpace, node, "radiusintexturespace", time, 0);
223  else myRadiusInTextureSpace = false;
224  if (true)
225  OP_Utils::evalOpParm(myPointAttribs, node, "pointattribs", time, 0);
226  else myPointAttribs = "*"_sh;
227  if (true)
228  OP_Utils::evalOpParm(myVertAttribs, node, "vertattribs", time, 0);
229  else myVertAttribs = ""_sh;
230  if (true)
231  OP_Utils::evalOpParm(myPrimAttribs, node, "primattribs", time, 0);
232  else myPrimAttribs = ""_sh;
233  if (true)
234  OP_Utils::evalOpParm(myDetailAttribs, node, "detailattribs", time, 0);
235  else myDetailAttribs = ""_sh;
236  if (true && ( (!(((int64(getGenerateBy())==1))||((int64(getGenerateBy())==0)&&(getForceTotal()==1)&&(getIndepVoxel()==0)))) ) )
237  OP_Utils::evalOpParm(myDensityScale, node, "densityscale", time, 0);
238  else myDensityScale = 10;
239  if (true && ( (!(((int64(getGenerateBy())!=0))||((getForceTotal()==1)&&(getIndepVoxel()==0)))) ) )
240  OP_Utils::evalOpParm(myUseAreaForVolumes, node, "useareaforvolumes", time, 0);
241  else myUseAreaForVolumes = false;
242  if (true && ( (!(((getRelaxPoints()==0)&&(getUseOutputRadiusAttrib()==0)))) ) )
243  OP_Utils::evalOpParm(myScaleRadiiBy, node, "scaleradiiby", time, 0);
244  else myScaleRadiiBy = 1;
245  if (true && ( (!(((getRelaxPoints()==0)&&(getUseOutputRadiusAttrib()==0)))) ) )
246  OP_Utils::evalOpParm(myUseMaxRadius, node, "usemaxradius", time, 0);
247  else myUseMaxRadius = false;
248  if (true && ( (!(((getRelaxPoints()==0)&&(getUseOutputRadiusAttrib()==0))||((getUseMaxRadius()==0)))) ) )
249  OP_Utils::evalOpParm(myMaxRadius, node, "maxradius", time, 0);
250  else myMaxRadius = 10;
251 
252  }
253 
254 
255  virtual void loadFromOpSubclass(const LoadParms &loadparms)
256  {
257  buildFromOp(loadparms.node(), loadparms.context().getTime(), loadparms.depnode());
258  }
259 
260 
261  virtual void copyFrom(const SOP_NodeParms *src)
262  {
263  *this = *((const SOP_Scatter_2_0Parms *)src);
264  }
265 
266  template <typename T>
267  void
268  doGetParmValue(exint idx, T &value) const
269  {
270  switch (idx)
271  {
272  case 0:
273  coerceValue(value, myGroup);
274  break;
275  case 1:
276  coerceValue(value, myGenerateBy);
277  break;
278  case 2:
279  coerceValue(value, myUseDensityAttrib);
280  break;
281  case 3:
282  coerceValue(value, myDensityAttrib);
283  break;
284  case 4:
285  coerceValue(value, myUseAreaAttrib);
286  break;
287  case 5:
288  coerceValue(value, myAreaAttrib);
289  break;
290  case 6:
291  coerceValue(value, myIndepVoxel);
292  break;
293  case 7:
294  coerceValue(value, myForceTotal);
295  break;
296  case 8:
297  coerceValue(value, myNpts);
298  break;
299  case 9:
300  coerceValue(value, myUseDensityTexture);
301  break;
302  case 10:
303  coerceValue(value, myDensityTexture);
304  break;
305  case 11:
306  coerceValue(value, myCountPerPrimAttrib);
307  break;
308  case 12:
309  coerceValue(value, myUseEmergencyLimit);
310  break;
311  case 13:
312  coerceValue(value, myEmergencyLimit);
313  break;
314  case 14:
315  coerceValue(value, mySeed);
316  break;
317  case 15:
318  coerceValue(value, myOverridePrimSeed);
319  break;
320  case 16:
321  coerceValue(value, myPrimSeedAttrib);
322  break;
323  case 17:
324  coerceValue(value, myRandomizeOrder);
325  break;
326  case 18:
327  coerceValue(value, myRelaxPoints);
328  break;
329  case 19:
330  coerceValue(value, myRelaxIterations);
331  break;
332  case 20:
333  coerceValue(value, myUsePrimNumAttrib);
334  break;
335  case 21:
336  coerceValue(value, myPrimNumAttrib);
337  break;
338  case 22:
339  coerceValue(value, myUsePrimUVWAttrib);
340  break;
341  case 23:
342  coerceValue(value, myPrimUVWAttrib);
343  break;
344  case 24:
345  coerceValue(value, myUseOutputDensityAttrib);
346  break;
347  case 25:
348  coerceValue(value, myOutputDensityAttrib);
349  break;
350  case 26:
351  coerceValue(value, myUseOutputRadiusAttrib);
352  break;
353  case 27:
354  coerceValue(value, myOutputRadiusAttrib);
355  break;
356  case 28:
357  coerceValue(value, myRadiusInTextureSpace);
358  break;
359  case 29:
360  coerceValue(value, myPointAttribs);
361  break;
362  case 30:
363  coerceValue(value, myVertAttribs);
364  break;
365  case 31:
366  coerceValue(value, myPrimAttribs);
367  break;
368  case 32:
369  coerceValue(value, myDetailAttribs);
370  break;
371  case 33:
372  coerceValue(value, myDensityScale);
373  break;
374  case 34:
375  coerceValue(value, myUseAreaForVolumes);
376  break;
377  case 35:
378  coerceValue(value, myScaleRadiiBy);
379  break;
380  case 36:
381  coerceValue(value, myUseMaxRadius);
382  break;
383  case 37:
384  coerceValue(value, myMaxRadius);
385  break;
386 
387  }
388  }
389 
390  void getParmValue(exint idx, exint &value) const
391  { doGetParmValue(idx, value); }
392  void getParmValue(exint idx, fpreal &value) const
393  { doGetParmValue(idx, value); }
395  { doGetParmValue(idx, value); }
397  { doGetParmValue(idx, value); }
399  { doGetParmValue(idx, value); }
401  { doGetParmValue(idx, value); }
403  { doGetParmValue(idx, value); }
405  { doGetParmValue(idx, value); }
407  { doGetParmValue(idx, value); }
409  { doGetParmValue(idx, value); }
411  { doGetParmValue(idx, value); }
412 
413  template <typename T>
414  void
415  doSetParmValue(exint idx, const T &value)
416  {
417  switch (idx)
418  {
419  case 0:
420  coerceValue(myGroup, value);
421  break;
422  case 1:
423  coerceValue(myGenerateBy, value);
424  break;
425  case 2:
426  coerceValue(myUseDensityAttrib, value);
427  break;
428  case 3:
429  coerceValue(myDensityAttrib, value);
430  break;
431  case 4:
432  coerceValue(myUseAreaAttrib, value);
433  break;
434  case 5:
435  coerceValue(myAreaAttrib, value);
436  break;
437  case 6:
438  coerceValue(myIndepVoxel, value);
439  break;
440  case 7:
441  coerceValue(myForceTotal, value);
442  break;
443  case 8:
444  coerceValue(myNpts, value);
445  break;
446  case 9:
447  coerceValue(myUseDensityTexture, value);
448  break;
449  case 10:
450  coerceValue(myDensityTexture, value);
451  break;
452  case 11:
453  coerceValue(myCountPerPrimAttrib, value);
454  break;
455  case 12:
456  coerceValue(myUseEmergencyLimit, value);
457  break;
458  case 13:
459  coerceValue(myEmergencyLimit, value);
460  break;
461  case 14:
462  coerceValue(mySeed, value);
463  break;
464  case 15:
465  coerceValue(myOverridePrimSeed, value);
466  break;
467  case 16:
468  coerceValue(myPrimSeedAttrib, value);
469  break;
470  case 17:
471  coerceValue(myRandomizeOrder, value);
472  break;
473  case 18:
474  coerceValue(myRelaxPoints, value);
475  break;
476  case 19:
477  coerceValue(myRelaxIterations, value);
478  break;
479  case 20:
480  coerceValue(myUsePrimNumAttrib, value);
481  break;
482  case 21:
483  coerceValue(myPrimNumAttrib, value);
484  break;
485  case 22:
486  coerceValue(myUsePrimUVWAttrib, value);
487  break;
488  case 23:
489  coerceValue(myPrimUVWAttrib, value);
490  break;
491  case 24:
492  coerceValue(myUseOutputDensityAttrib, value);
493  break;
494  case 25:
495  coerceValue(myOutputDensityAttrib, value);
496  break;
497  case 26:
498  coerceValue(myUseOutputRadiusAttrib, value);
499  break;
500  case 27:
501  coerceValue(myOutputRadiusAttrib, value);
502  break;
503  case 28:
504  coerceValue(myRadiusInTextureSpace, value);
505  break;
506  case 29:
507  coerceValue(myPointAttribs, value);
508  break;
509  case 30:
510  coerceValue(myVertAttribs, value);
511  break;
512  case 31:
513  coerceValue(myPrimAttribs, value);
514  break;
515  case 32:
516  coerceValue(myDetailAttribs, value);
517  break;
518  case 33:
519  coerceValue(myDensityScale, value);
520  break;
521  case 34:
522  coerceValue(myUseAreaForVolumes, value);
523  break;
524  case 35:
525  coerceValue(myScaleRadiiBy, value);
526  break;
527  case 36:
528  coerceValue(myUseMaxRadius, value);
529  break;
530  case 37:
531  coerceValue(myMaxRadius, value);
532  break;
533 
534  }
535  }
536 
537  void setParmValue(exint idx, const exint &value)
538  { doSetParmValue(idx, value); }
539  void setParmValue(exint idx, const fpreal &value)
540  { doSetParmValue(idx, value); }
541  void setParmValue(exint idx, const UT_Vector2D &value)
542  { doSetParmValue(idx, value); }
543  void setParmValue(exint idx, const UT_Vector3D &value)
544  { doSetParmValue(idx, value); }
545  void setParmValue(exint idx, const UT_Vector4D &value)
546  { doSetParmValue(idx, value); }
547  void setParmValue(exint idx, const UT_Matrix2D &value)
548  { doSetParmValue(idx, value); }
549  void setParmValue(exint idx, const UT_Matrix3D &value)
550  { doSetParmValue(idx, value); }
551  void setParmValue(exint idx, const UT_Matrix4D &value)
552  { doSetParmValue(idx, value); }
554  { doSetParmValue(idx, value); }
556  { doSetParmValue(idx, value); }
558  { doSetParmValue(idx, value); }
559 
560  virtual exint getNumParms() const
561  {
562  return 38;
563  }
564 
565  virtual const char *getParmName(exint fieldnum) const
566  {
567  switch (fieldnum)
568  {
569  case 0:
570  return "group";
571  case 1:
572  return "generateby";
573  case 2:
574  return "usedensityattrib";
575  case 3:
576  return "densityattrib";
577  case 4:
578  return "useareaattrib";
579  case 5:
580  return "areaattrib";
581  case 6:
582  return "indepvoxel";
583  case 7:
584  return "forcetotal";
585  case 8:
586  return "npts";
587  case 9:
588  return "usedensitytexture";
589  case 10:
590  return "densitytexture";
591  case 11:
592  return "primcountattrib";
593  case 12:
594  return "useemergencylimit";
595  case 13:
596  return "emergencylimit";
597  case 14:
598  return "seed";
599  case 15:
600  return "overrideprimseed";
601  case 16:
602  return "primseedattrib";
603  case 17:
604  return "randomizeorder";
605  case 18:
606  return "relaxpoints";
607  case 19:
608  return "relaxiterations";
609  case 20:
610  return "useprimnumattrib";
611  case 21:
612  return "primnumattrib";
613  case 22:
614  return "useprimuvwattrib";
615  case 23:
616  return "primuvwattrib";
617  case 24:
618  return "useoutputdensityattrib";
619  case 25:
620  return "outputdensityattrib";
621  case 26:
622  return "useoutputradiusattrib";
623  case 27:
624  return "outputradiusattrib";
625  case 28:
626  return "radiusintexturespace";
627  case 29:
628  return "pointattribs";
629  case 30:
630  return "vertattribs";
631  case 31:
632  return "primattribs";
633  case 32:
634  return "detailattribs";
635  case 33:
636  return "densityscale";
637  case 34:
638  return "useareaforvolumes";
639  case 35:
640  return "scaleradiiby";
641  case 36:
642  return "usemaxradius";
643  case 37:
644  return "maxradius";
645 
646  }
647  return 0;
648  }
649 
650  virtual ParmType getParmType(exint fieldnum) const
651  {
652  switch (fieldnum)
653  {
654  case 0:
655  return PARM_STRING;
656  case 1:
657  return PARM_INTEGER;
658  case 2:
659  return PARM_INTEGER;
660  case 3:
661  return PARM_STRING;
662  case 4:
663  return PARM_INTEGER;
664  case 5:
665  return PARM_STRING;
666  case 6:
667  return PARM_INTEGER;
668  case 7:
669  return PARM_INTEGER;
670  case 8:
671  return PARM_INTEGER;
672  case 9:
673  return PARM_INTEGER;
674  case 10:
675  return PARM_STRING;
676  case 11:
677  return PARM_STRING;
678  case 12:
679  return PARM_INTEGER;
680  case 13:
681  return PARM_INTEGER;
682  case 14:
683  return PARM_FLOAT;
684  case 15:
685  return PARM_INTEGER;
686  case 16:
687  return PARM_STRING;
688  case 17:
689  return PARM_INTEGER;
690  case 18:
691  return PARM_INTEGER;
692  case 19:
693  return PARM_INTEGER;
694  case 20:
695  return PARM_INTEGER;
696  case 21:
697  return PARM_STRING;
698  case 22:
699  return PARM_INTEGER;
700  case 23:
701  return PARM_STRING;
702  case 24:
703  return PARM_INTEGER;
704  case 25:
705  return PARM_STRING;
706  case 26:
707  return PARM_INTEGER;
708  case 27:
709  return PARM_STRING;
710  case 28:
711  return PARM_INTEGER;
712  case 29:
713  return PARM_STRING;
714  case 30:
715  return PARM_STRING;
716  case 31:
717  return PARM_STRING;
718  case 32:
719  return PARM_STRING;
720  case 33:
721  return PARM_FLOAT;
722  case 34:
723  return PARM_INTEGER;
724  case 35:
725  return PARM_FLOAT;
726  case 36:
727  return PARM_INTEGER;
728  case 37:
729  return PARM_FLOAT;
730 
731  }
732  return PARM_UNSUPPORTED;
733  }
734 
735  // Boiler plate to load individual types.
736  static void loadData(UT_IStream &is, int64 &v)
737  { is.bread(&v, 1); }
738  static void loadData(UT_IStream &is, bool &v)
739  { int64 iv; is.bread(&iv, 1); v = iv; }
740  static void loadData(UT_IStream &is, fpreal64 &v)
741  { is.bread<fpreal64>(&v, 1); }
742  static void loadData(UT_IStream &is, UT_Vector2D &v)
743  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
744  static void loadData(UT_IStream &is, UT_Vector3D &v)
745  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
746  is.bread<fpreal64>(&v.z(), 1); }
747  static void loadData(UT_IStream &is, UT_Vector4D &v)
748  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
749  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
750  static void loadData(UT_IStream &is, UT_Matrix2D &v)
751  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
752  static void loadData(UT_IStream &is, UT_Matrix3D &v)
753  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
754  static void loadData(UT_IStream &is, UT_Matrix4D &v)
755  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
756  static void loadData(UT_IStream &is, UT_Vector2I &v)
757  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
758  static void loadData(UT_IStream &is, UT_Vector3I &v)
759  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
760  is.bread<int64>(&v.z(), 1); }
761  static void loadData(UT_IStream &is, UT_Vector4I &v)
762  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
763  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
765  { is.bread(v); }
767  { UT_StringHolder rampdata;
768  loadData(is, rampdata);
769  if (rampdata.isstring())
770  {
771  v.reset(new UT_Ramp());
772  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
773  v->load(istr);
774  }
775  else v.reset();
776  }
779  loadData(is, data);
780  if (data.isstring())
781  {
782  // Find the data type.
783  char *colon = UT_StringWrap(data).findChar(':');
784  if (colon)
785  {
786  int typelen = colon - data.buffer();
788  type.strncpy(data.buffer(), typelen);
789  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
790 
791  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
792  }
793  }
794  else v.reset();
795  }
796 
797  static void saveData(std::ostream &os, int64 v)
798  { UTwrite(os, &v); }
799  static void saveData(std::ostream &os, bool v)
800  { int64 iv = v; UTwrite(os, &iv); }
801  static void saveData(std::ostream &os, fpreal64 v)
802  { UTwrite<fpreal64>(os, &v); }
803  static void saveData(std::ostream &os, UT_Vector2D v)
804  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
805  static void saveData(std::ostream &os, UT_Vector3D v)
806  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
807  UTwrite<fpreal64>(os, &v.z()); }
808  static void saveData(std::ostream &os, UT_Vector4D v)
809  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
810  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
811  static void saveData(std::ostream &os, UT_Matrix2D v)
813  static void saveData(std::ostream &os, UT_Matrix3D v)
815  static void saveData(std::ostream &os, UT_Matrix4D v)
817  static void saveData(std::ostream &os, UT_StringHolder s)
818  { UT_StringWrap(s).saveBinary(os); }
819  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
820  { UT_StringHolder result;
821  UT_OStringStream ostr;
822  if (s) s->save(ostr);
823  result = ostr.str();
824  saveData(os, result);
825  }
826  static void saveData(std::ostream &os, PRM_DataItemHandle s)
827  { UT_StringHolder result;
828  UT_OStringStream ostr;
829  if (s)
830  {
831  ostr << s->getDataTypeToken();
832  ostr << ":";
833  s->saveBinary(ostr);
834  }
835  result = ostr.str();
836  saveData(os, result);
837  }
838 
839 
840  void save(std::ostream &os) const
841  {
842  int32 v = version();
843  UTwrite(os, &v);
844  saveData(os, myGroup);
845  saveData(os, myGenerateBy);
846  saveData(os, myUseDensityAttrib);
847  saveData(os, myDensityAttrib);
848  saveData(os, myUseAreaAttrib);
849  saveData(os, myAreaAttrib);
850  saveData(os, myIndepVoxel);
851  saveData(os, myForceTotal);
852  saveData(os, myNpts);
853  saveData(os, myUseDensityTexture);
854  saveData(os, myDensityTexture);
855  saveData(os, myCountPerPrimAttrib);
856  saveData(os, myUseEmergencyLimit);
857  saveData(os, myEmergencyLimit);
858  saveData(os, mySeed);
859  saveData(os, myOverridePrimSeed);
860  saveData(os, myPrimSeedAttrib);
861  saveData(os, myRandomizeOrder);
862  saveData(os, myRelaxPoints);
863  saveData(os, myRelaxIterations);
864  saveData(os, myUsePrimNumAttrib);
865  saveData(os, myPrimNumAttrib);
866  saveData(os, myUsePrimUVWAttrib);
867  saveData(os, myPrimUVWAttrib);
868  saveData(os, myUseOutputDensityAttrib);
869  saveData(os, myOutputDensityAttrib);
870  saveData(os, myUseOutputRadiusAttrib);
871  saveData(os, myOutputRadiusAttrib);
872  saveData(os, myRadiusInTextureSpace);
873  saveData(os, myPointAttribs);
874  saveData(os, myVertAttribs);
875  saveData(os, myPrimAttribs);
876  saveData(os, myDetailAttribs);
877  saveData(os, myDensityScale);
878  saveData(os, myUseAreaForVolumes);
879  saveData(os, myScaleRadiiBy);
880  saveData(os, myUseMaxRadius);
881  saveData(os, myMaxRadius);
882 
883  }
884 
885  bool load(UT_IStream &is)
886  {
887  int32 v;
888  is.bread(&v, 1);
889  if (version() != v)
890  {
891  // Fail incompatible versions
892  return false;
893  }
894  loadData(is, myGroup);
895  loadData(is, myGenerateBy);
896  loadData(is, myUseDensityAttrib);
897  loadData(is, myDensityAttrib);
898  loadData(is, myUseAreaAttrib);
899  loadData(is, myAreaAttrib);
900  loadData(is, myIndepVoxel);
901  loadData(is, myForceTotal);
902  loadData(is, myNpts);
903  loadData(is, myUseDensityTexture);
904  loadData(is, myDensityTexture);
905  loadData(is, myCountPerPrimAttrib);
906  loadData(is, myUseEmergencyLimit);
907  loadData(is, myEmergencyLimit);
908  loadData(is, mySeed);
909  loadData(is, myOverridePrimSeed);
910  loadData(is, myPrimSeedAttrib);
911  loadData(is, myRandomizeOrder);
912  loadData(is, myRelaxPoints);
913  loadData(is, myRelaxIterations);
914  loadData(is, myUsePrimNumAttrib);
915  loadData(is, myPrimNumAttrib);
916  loadData(is, myUsePrimUVWAttrib);
917  loadData(is, myPrimUVWAttrib);
918  loadData(is, myUseOutputDensityAttrib);
919  loadData(is, myOutputDensityAttrib);
920  loadData(is, myUseOutputRadiusAttrib);
921  loadData(is, myOutputRadiusAttrib);
922  loadData(is, myRadiusInTextureSpace);
923  loadData(is, myPointAttribs);
924  loadData(is, myVertAttribs);
925  loadData(is, myPrimAttribs);
926  loadData(is, myDetailAttribs);
927  loadData(is, myDensityScale);
928  loadData(is, myUseAreaForVolumes);
929  loadData(is, myScaleRadiiBy);
930  loadData(is, myUseMaxRadius);
931  loadData(is, myMaxRadius);
932 
933  return true;
934  }
935 
936  const UT_StringHolder & getGroup() const { return myGroup; }
937  void setGroup(const UT_StringHolder & val) { myGroup = val; }
939  {
940  SOP_Node *thissop = cookparms.getNode();
941  if (!thissop) return getGroup();
942  UT_StringHolder result;
943  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
944  return result;
945  }
946  GenerateBy getGenerateBy() const { return GenerateBy(myGenerateBy); }
947  void setGenerateBy(GenerateBy val) { myGenerateBy = int64(val); }
949  {
950  SOP_Node *thissop = cookparms.getNode();
951  if (!thissop) return getGenerateBy();
952  int64 result;
953  OP_Utils::evalOpParm(result, thissop, "generateby", cookparms.getCookTime(), 0);
954  return GenerateBy(result);
955  }
956  bool getUseDensityAttrib() const { return myUseDensityAttrib; }
957  void setUseDensityAttrib(bool val) { myUseDensityAttrib = val; }
958  bool opUseDensityAttrib(const SOP_NodeVerb::CookParms &cookparms) const
959  {
960  SOP_Node *thissop = cookparms.getNode();
961  if (!thissop) return getUseDensityAttrib();
962  bool result;
963  OP_Utils::evalOpParm(result, thissop, "usedensityattrib", cookparms.getCookTime(), 0);
964  return result;
965  }
966  const UT_StringHolder & getDensityAttrib() const { return myDensityAttrib; }
967  void setDensityAttrib(const UT_StringHolder & val) { myDensityAttrib = val; }
969  {
970  SOP_Node *thissop = cookparms.getNode();
971  if (!thissop) return getDensityAttrib();
972  UT_StringHolder result;
973  OP_Utils::evalOpParm(result, thissop, "densityattrib", cookparms.getCookTime(), 0);
974  return result;
975  }
976  bool getUseAreaAttrib() const { return myUseAreaAttrib; }
977  void setUseAreaAttrib(bool val) { myUseAreaAttrib = val; }
978  bool opUseAreaAttrib(const SOP_NodeVerb::CookParms &cookparms) const
979  {
980  SOP_Node *thissop = cookparms.getNode();
981  if (!thissop) return getUseAreaAttrib();
982  bool result;
983  OP_Utils::evalOpParm(result, thissop, "useareaattrib", cookparms.getCookTime(), 0);
984  return result;
985  }
986  const UT_StringHolder & getAreaAttrib() const { return myAreaAttrib; }
987  void setAreaAttrib(const UT_StringHolder & val) { myAreaAttrib = val; }
989  {
990  SOP_Node *thissop = cookparms.getNode();
991  if (!thissop) return getAreaAttrib();
992  UT_StringHolder result;
993  OP_Utils::evalOpParm(result, thissop, "areaattrib", cookparms.getCookTime(), 0);
994  return result;
995  }
996  bool getIndepVoxel() const { return myIndepVoxel; }
997  void setIndepVoxel(bool val) { myIndepVoxel = val; }
998  bool opIndepVoxel(const SOP_NodeVerb::CookParms &cookparms) const
999  {
1000  SOP_Node *thissop = cookparms.getNode();
1001  if (!thissop) return getIndepVoxel();
1002  bool result;
1003  OP_Utils::evalOpParm(result, thissop, "indepvoxel", cookparms.getCookTime(), 0);
1004  return result;
1005  }
1006  bool getForceTotal() const { return myForceTotal; }
1007  void setForceTotal(bool val) { myForceTotal = val; }
1008  bool opForceTotal(const SOP_NodeVerb::CookParms &cookparms) const
1009  {
1010  SOP_Node *thissop = cookparms.getNode();
1011  if (!thissop) return getForceTotal();
1012  bool result;
1013  OP_Utils::evalOpParm(result, thissop, "forcetotal", cookparms.getCookTime(), 0);
1014  return result;
1015  }
1016  int64 getNpts() const { return myNpts; }
1017  void setNpts(int64 val) { myNpts = val; }
1018  int64 opNpts(const SOP_NodeVerb::CookParms &cookparms) const
1019  {
1020  SOP_Node *thissop = cookparms.getNode();
1021  if (!thissop) return getNpts();
1022  int64 result;
1023  OP_Utils::evalOpParm(result, thissop, "npts", cookparms.getCookTime(), 0);
1024  return result;
1025  }
1026  bool getUseDensityTexture() const { return myUseDensityTexture; }
1027  void setUseDensityTexture(bool val) { myUseDensityTexture = val; }
1028  bool opUseDensityTexture(const SOP_NodeVerb::CookParms &cookparms) const
1029  {
1030  SOP_Node *thissop = cookparms.getNode();
1031  if (!thissop) return getUseDensityTexture();
1032  bool result;
1033  OP_Utils::evalOpParm(result, thissop, "usedensitytexture", cookparms.getCookTime(), 0);
1034  return result;
1035  }
1036  const UT_StringHolder & getDensityTexture() const { return myDensityTexture; }
1037  void setDensityTexture(const UT_StringHolder & val) { myDensityTexture = val; }
1039  {
1040  SOP_Node *thissop = cookparms.getNode();
1041  if (!thissop) return getDensityTexture();
1042  UT_StringHolder result;
1043  OP_Utils::evalOpParm(result, thissop, "densitytexture", cookparms.getCookTime(), 0);
1044  return result;
1045  }
1046  const UT_StringHolder & getCountPerPrimAttrib() const { return myCountPerPrimAttrib; }
1047  void setCountPerPrimAttrib(const UT_StringHolder & val) { myCountPerPrimAttrib = val; }
1049  {
1050  SOP_Node *thissop = cookparms.getNode();
1051  if (!thissop) return getCountPerPrimAttrib();
1052  UT_StringHolder result;
1053  OP_Utils::evalOpParm(result, thissop, "primcountattrib", cookparms.getCookTime(), 0);
1054  return result;
1055  }
1056  bool getUseEmergencyLimit() const { return myUseEmergencyLimit; }
1057  void setUseEmergencyLimit(bool val) { myUseEmergencyLimit = val; }
1058  bool opUseEmergencyLimit(const SOP_NodeVerb::CookParms &cookparms) const
1059  {
1060  SOP_Node *thissop = cookparms.getNode();
1061  if (!thissop) return getUseEmergencyLimit();
1062  bool result;
1063  OP_Utils::evalOpParm(result, thissop, "useemergencylimit", cookparms.getCookTime(), 0);
1064  return result;
1065  }
1066  int64 getEmergencyLimit() const { return myEmergencyLimit; }
1067  void setEmergencyLimit(int64 val) { myEmergencyLimit = val; }
1069  {
1070  SOP_Node *thissop = cookparms.getNode();
1071  if (!thissop) return getEmergencyLimit();
1072  int64 result;
1073  OP_Utils::evalOpParm(result, thissop, "emergencylimit", cookparms.getCookTime(), 0);
1074  return result;
1075  }
1076  fpreal64 getSeed() const { return mySeed; }
1077  void setSeed(fpreal64 val) { mySeed = val; }
1078  fpreal64 opSeed(const SOP_NodeVerb::CookParms &cookparms) const
1079  {
1080  SOP_Node *thissop = cookparms.getNode();
1081  if (!thissop) return getSeed();
1082  fpreal64 result;
1083  OP_Utils::evalOpParm(result, thissop, "seed", cookparms.getCookTime(), 0);
1084  return result;
1085  }
1086  bool getOverridePrimSeed() const { return myOverridePrimSeed; }
1087  void setOverridePrimSeed(bool val) { myOverridePrimSeed = val; }
1088  bool opOverridePrimSeed(const SOP_NodeVerb::CookParms &cookparms) const
1089  {
1090  SOP_Node *thissop = cookparms.getNode();
1091  if (!thissop) return getOverridePrimSeed();
1092  bool result;
1093  OP_Utils::evalOpParm(result, thissop, "overrideprimseed", cookparms.getCookTime(), 0);
1094  return result;
1095  }
1096  const UT_StringHolder & getPrimSeedAttrib() const { return myPrimSeedAttrib; }
1097  void setPrimSeedAttrib(const UT_StringHolder & val) { myPrimSeedAttrib = val; }
1099  {
1100  SOP_Node *thissop = cookparms.getNode();
1101  if (!thissop) return getPrimSeedAttrib();
1102  UT_StringHolder result;
1103  OP_Utils::evalOpParm(result, thissop, "primseedattrib", cookparms.getCookTime(), 0);
1104  return result;
1105  }
1106  bool getRandomizeOrder() const { return myRandomizeOrder; }
1107  void setRandomizeOrder(bool val) { myRandomizeOrder = val; }
1108  bool opRandomizeOrder(const SOP_NodeVerb::CookParms &cookparms) const
1109  {
1110  SOP_Node *thissop = cookparms.getNode();
1111  if (!thissop) return getRandomizeOrder();
1112  bool result;
1113  OP_Utils::evalOpParm(result, thissop, "randomizeorder", cookparms.getCookTime(), 0);
1114  return result;
1115  }
1116  bool getRelaxPoints() const { return myRelaxPoints; }
1117  void setRelaxPoints(bool val) { myRelaxPoints = val; }
1118  bool opRelaxPoints(const SOP_NodeVerb::CookParms &cookparms) const
1119  {
1120  SOP_Node *thissop = cookparms.getNode();
1121  if (!thissop) return getRelaxPoints();
1122  bool result;
1123  OP_Utils::evalOpParm(result, thissop, "relaxpoints", cookparms.getCookTime(), 0);
1124  return result;
1125  }
1126  int64 getRelaxIterations() const { return myRelaxIterations; }
1127  void setRelaxIterations(int64 val) { myRelaxIterations = val; }
1129  {
1130  SOP_Node *thissop = cookparms.getNode();
1131  if (!thissop) return getRelaxIterations();
1132  int64 result;
1133  OP_Utils::evalOpParm(result, thissop, "relaxiterations", cookparms.getCookTime(), 0);
1134  return result;
1135  }
1136  bool getUsePrimNumAttrib() const { return myUsePrimNumAttrib; }
1137  void setUsePrimNumAttrib(bool val) { myUsePrimNumAttrib = val; }
1138  bool opUsePrimNumAttrib(const SOP_NodeVerb::CookParms &cookparms) const
1139  {
1140  SOP_Node *thissop = cookparms.getNode();
1141  if (!thissop) return getUsePrimNumAttrib();
1142  bool result;
1143  OP_Utils::evalOpParm(result, thissop, "useprimnumattrib", cookparms.getCookTime(), 0);
1144  return result;
1145  }
1146  const UT_StringHolder & getPrimNumAttrib() const { return myPrimNumAttrib; }
1147  void setPrimNumAttrib(const UT_StringHolder & val) { myPrimNumAttrib = val; }
1149  {
1150  SOP_Node *thissop = cookparms.getNode();
1151  if (!thissop) return getPrimNumAttrib();
1152  UT_StringHolder result;
1153  OP_Utils::evalOpParm(result, thissop, "primnumattrib", cookparms.getCookTime(), 0);
1154  return result;
1155  }
1156  bool getUsePrimUVWAttrib() const { return myUsePrimUVWAttrib; }
1157  void setUsePrimUVWAttrib(bool val) { myUsePrimUVWAttrib = val; }
1158  bool opUsePrimUVWAttrib(const SOP_NodeVerb::CookParms &cookparms) const
1159  {
1160  SOP_Node *thissop = cookparms.getNode();
1161  if (!thissop) return getUsePrimUVWAttrib();
1162  bool result;
1163  OP_Utils::evalOpParm(result, thissop, "useprimuvwattrib", cookparms.getCookTime(), 0);
1164  return result;
1165  }
1166  const UT_StringHolder & getPrimUVWAttrib() const { return myPrimUVWAttrib; }
1167  void setPrimUVWAttrib(const UT_StringHolder & val) { myPrimUVWAttrib = val; }
1169  {
1170  SOP_Node *thissop = cookparms.getNode();
1171  if (!thissop) return getPrimUVWAttrib();
1172  UT_StringHolder result;
1173  OP_Utils::evalOpParm(result, thissop, "primuvwattrib", cookparms.getCookTime(), 0);
1174  return result;
1175  }
1176  bool getUseOutputDensityAttrib() const { return myUseOutputDensityAttrib; }
1177  void setUseOutputDensityAttrib(bool val) { myUseOutputDensityAttrib = val; }
1179  {
1180  SOP_Node *thissop = cookparms.getNode();
1181  if (!thissop) return getUseOutputDensityAttrib();
1182  bool result;
1183  OP_Utils::evalOpParm(result, thissop, "useoutputdensityattrib", cookparms.getCookTime(), 0);
1184  return result;
1185  }
1186  const UT_StringHolder & getOutputDensityAttrib() const { return myOutputDensityAttrib; }
1187  void setOutputDensityAttrib(const UT_StringHolder & val) { myOutputDensityAttrib = val; }
1189  {
1190  SOP_Node *thissop = cookparms.getNode();
1191  if (!thissop) return getOutputDensityAttrib();
1192  UT_StringHolder result;
1193  OP_Utils::evalOpParm(result, thissop, "outputdensityattrib", cookparms.getCookTime(), 0);
1194  return result;
1195  }
1196  bool getUseOutputRadiusAttrib() const { return myUseOutputRadiusAttrib; }
1197  void setUseOutputRadiusAttrib(bool val) { myUseOutputRadiusAttrib = val; }
1199  {
1200  SOP_Node *thissop = cookparms.getNode();
1201  if (!thissop) return getUseOutputRadiusAttrib();
1202  bool result;
1203  OP_Utils::evalOpParm(result, thissop, "useoutputradiusattrib", cookparms.getCookTime(), 0);
1204  return result;
1205  }
1206  const UT_StringHolder & getOutputRadiusAttrib() const { return myOutputRadiusAttrib; }
1207  void setOutputRadiusAttrib(const UT_StringHolder & val) { myOutputRadiusAttrib = val; }
1209  {
1210  SOP_Node *thissop = cookparms.getNode();
1211  if (!thissop) return getOutputRadiusAttrib();
1212  UT_StringHolder result;
1213  OP_Utils::evalOpParm(result, thissop, "outputradiusattrib", cookparms.getCookTime(), 0);
1214  return result;
1215  }
1216  bool getRadiusInTextureSpace() const { return myRadiusInTextureSpace; }
1217  void setRadiusInTextureSpace(bool val) { myRadiusInTextureSpace = val; }
1219  {
1220  SOP_Node *thissop = cookparms.getNode();
1221  if (!thissop) return getRadiusInTextureSpace();
1222  bool result;
1223  OP_Utils::evalOpParm(result, thissop, "radiusintexturespace", cookparms.getCookTime(), 0);
1224  return result;
1225  }
1226  const UT_StringHolder & getPointAttribs() const { return myPointAttribs; }
1227  void setPointAttribs(const UT_StringHolder & val) { myPointAttribs = val; }
1229  {
1230  SOP_Node *thissop = cookparms.getNode();
1231  if (!thissop) return getPointAttribs();
1232  UT_StringHolder result;
1233  OP_Utils::evalOpParm(result, thissop, "pointattribs", cookparms.getCookTime(), 0);
1234  return result;
1235  }
1236  const UT_StringHolder & getVertAttribs() const { return myVertAttribs; }
1237  void setVertAttribs(const UT_StringHolder & val) { myVertAttribs = val; }
1239  {
1240  SOP_Node *thissop = cookparms.getNode();
1241  if (!thissop) return getVertAttribs();
1242  UT_StringHolder result;
1243  OP_Utils::evalOpParm(result, thissop, "vertattribs", cookparms.getCookTime(), 0);
1244  return result;
1245  }
1246  const UT_StringHolder & getPrimAttribs() const { return myPrimAttribs; }
1247  void setPrimAttribs(const UT_StringHolder & val) { myPrimAttribs = val; }
1249  {
1250  SOP_Node *thissop = cookparms.getNode();
1251  if (!thissop) return getPrimAttribs();
1252  UT_StringHolder result;
1253  OP_Utils::evalOpParm(result, thissop, "primattribs", cookparms.getCookTime(), 0);
1254  return result;
1255  }
1256  const UT_StringHolder & getDetailAttribs() const { return myDetailAttribs; }
1257  void setDetailAttribs(const UT_StringHolder & val) { myDetailAttribs = val; }
1259  {
1260  SOP_Node *thissop = cookparms.getNode();
1261  if (!thissop) return getDetailAttribs();
1262  UT_StringHolder result;
1263  OP_Utils::evalOpParm(result, thissop, "detailattribs", cookparms.getCookTime(), 0);
1264  return result;
1265  }
1266  fpreal64 getDensityScale() const { return myDensityScale; }
1267  void setDensityScale(fpreal64 val) { myDensityScale = val; }
1269  {
1270  SOP_Node *thissop = cookparms.getNode();
1271  if (!thissop) return getDensityScale();
1272  fpreal64 result;
1273  OP_Utils::evalOpParm(result, thissop, "densityscale", cookparms.getCookTime(), 0);
1274  return result;
1275  }
1276  bool getUseAreaForVolumes() const { return myUseAreaForVolumes; }
1277  void setUseAreaForVolumes(bool val) { myUseAreaForVolumes = val; }
1278  bool opUseAreaForVolumes(const SOP_NodeVerb::CookParms &cookparms) const
1279  {
1280  SOP_Node *thissop = cookparms.getNode();
1281  if (!thissop) return getUseAreaForVolumes();
1282  bool result;
1283  OP_Utils::evalOpParm(result, thissop, "useareaforvolumes", cookparms.getCookTime(), 0);
1284  return result;
1285  }
1286  fpreal64 getScaleRadiiBy() const { return myScaleRadiiBy; }
1287  void setScaleRadiiBy(fpreal64 val) { myScaleRadiiBy = val; }
1289  {
1290  SOP_Node *thissop = cookparms.getNode();
1291  if (!thissop) return getScaleRadiiBy();
1292  fpreal64 result;
1293  OP_Utils::evalOpParm(result, thissop, "scaleradiiby", cookparms.getCookTime(), 0);
1294  return result;
1295  }
1296  bool getUseMaxRadius() const { return myUseMaxRadius; }
1297  void setUseMaxRadius(bool val) { myUseMaxRadius = val; }
1298  bool opUseMaxRadius(const SOP_NodeVerb::CookParms &cookparms) const
1299  {
1300  SOP_Node *thissop = cookparms.getNode();
1301  if (!thissop) return getUseMaxRadius();
1302  bool result;
1303  OP_Utils::evalOpParm(result, thissop, "usemaxradius", cookparms.getCookTime(), 0);
1304  return result;
1305  }
1306  fpreal64 getMaxRadius() const { return myMaxRadius; }
1307  void setMaxRadius(fpreal64 val) { myMaxRadius = val; }
1309  {
1310  SOP_Node *thissop = cookparms.getNode();
1311  if (!thissop) return getMaxRadius();
1312  fpreal64 result;
1313  OP_Utils::evalOpParm(result, thissop, "maxradius", cookparms.getCookTime(), 0);
1314  return result;
1315  }
1316 
1317 private:
1318  UT_StringHolder myGroup;
1319  int64 myGenerateBy;
1320  bool myUseDensityAttrib;
1321  UT_StringHolder myDensityAttrib;
1322  bool myUseAreaAttrib;
1323  UT_StringHolder myAreaAttrib;
1324  bool myIndepVoxel;
1325  bool myForceTotal;
1326  int64 myNpts;
1327  bool myUseDensityTexture;
1328  UT_StringHolder myDensityTexture;
1329  UT_StringHolder myCountPerPrimAttrib;
1330  bool myUseEmergencyLimit;
1331  int64 myEmergencyLimit;
1332  fpreal64 mySeed;
1333  bool myOverridePrimSeed;
1334  UT_StringHolder myPrimSeedAttrib;
1335  bool myRandomizeOrder;
1336  bool myRelaxPoints;
1337  int64 myRelaxIterations;
1338  bool myUsePrimNumAttrib;
1339  UT_StringHolder myPrimNumAttrib;
1340  bool myUsePrimUVWAttrib;
1341  UT_StringHolder myPrimUVWAttrib;
1342  bool myUseOutputDensityAttrib;
1343  UT_StringHolder myOutputDensityAttrib;
1344  bool myUseOutputRadiusAttrib;
1345  UT_StringHolder myOutputRadiusAttrib;
1346  bool myRadiusInTextureSpace;
1347  UT_StringHolder myPointAttribs;
1348  UT_StringHolder myVertAttribs;
1349  UT_StringHolder myPrimAttribs;
1350  UT_StringHolder myDetailAttribs;
1351  fpreal64 myDensityScale;
1352  bool myUseAreaForVolumes;
1353  fpreal64 myScaleRadiiBy;
1354  bool myUseMaxRadius;
1355  fpreal64 myMaxRadius;
1356 
1357 };
void setParmValue(exint idx, const UT_Matrix2D &value)
UT_StringHolder opVertAttribs(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getScaleRadiiBy() const
static void saveData(std::ostream &os, UT_Vector4D v)
const UT_StringHolder & getPrimNumAttrib() const
void doSetParmValue(exint idx, const T &value)
void setParmValue(exint idx, const fpreal &value)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setGroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:494
void setSeed(fpreal64 val)
void setScaleRadiiBy(fpreal64 val)
T & z(void)
Definition: UT_Vector4.h:379
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_StringHolder s)
void getParmValue(exint idx, exint &value) const
UT_StringHolder opPrimAttribs(const SOP_NodeVerb::CookParms &cookparms) const
void setUseDensityTexture(bool val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setVertAttribs(const UT_StringHolder &val)
void setGenerateBy(GenerateBy val)
exint bread(int32 *buffer, exint asize=1)
void getParmValue(exint idx, fpreal &value) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
GT_API const UT_StringHolder time
fpreal getTime() const
Definition: OP_Context.h:60
const GLdouble * v
Definition: glcorearb.h:836
bool opUseDensityAttrib(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPrimSeedAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setDensityScale(fpreal64 val)
static void saveData(std::ostream &os, UT_Matrix3D v)
bool opUseOutputRadiusAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const PRM_DataItemHandle &value)
void setUseOutputRadiusAttrib(bool val)
void setUseOutputDensityAttrib(bool val)
UT_StringHolder opOutputDensityAttrib(const SOP_NodeVerb::CookParms &cookparms) const
virtual void loadFromOpSubclass(const LoadParms &loadparms)
SYS_FORCE_INLINE const char * buffer() const
void setPrimUVWAttrib(const UT_StringHolder &val)
T & x(void)
Definition: UT_Vector2.h:285
static void loadData(UT_IStream &is, UT_Vector3I &v)
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, bool &v)
UT_StringHolder opDetailAttribs(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opDensityTexture(const SOP_NodeVerb::CookParms &cookparms) const
const UT_WorkBuffer & str() const
Returns a read-only reference to the underlying UT_WorkBuffer.
void setPrimAttribs(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Vector3D v)
const UT_StringHolder & getPrimSeedAttrib() const
static void saveData(std::ostream &os, UT_Vector2D v)
SYS_FORCE_INLINE T & x(void)
Definition: UT_Vector3.h:498
bool opRandomizeOrder(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opOutputRadiusAttrib(const SOP_NodeVerb::CookParms &cookparms) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setPointAttribs(const UT_StringHolder &val)
void doGetParmValue(exint idx, T &value) const
const UT_StringHolder & getVertAttribs() const
void getParmValue(exint idx, UT_Vector2D &value) const
void setDensityAttrib(const UT_StringHolder &val)
const UT_StringHolder & getOutputDensityAttrib() const
bool opUseMaxRadius(const SOP_NodeVerb::CookParms &cookparms) const
bool opOverridePrimSeed(const SOP_NodeVerb::CookParms &cookparms) const
void setMaxRadius(fpreal64 val)
void setUseAreaForVolumes(bool val)
UT_StringHolder opAreaAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setDensityTexture(const UT_StringHolder &val)
void setOutputDensityAttrib(const UT_StringHolder &val)
SYS_FORCE_INLINE T & z(void)
Definition: UT_Vector3.h:502
void setParmValue(exint idx, const UT_StringHolder &value)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
long long int64
Definition: SYS_Types.h:107
UT_StringHolder opDensityAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void getParmValue(exint idx, UT_Vector3D &value) const
const UT_StringHolder & getAreaAttrib() const
void getParmValue(exint idx, UT_Matrix3D &value) const
bool opUsePrimNumAttrib(const SOP_NodeVerb::CookParms &cookparms) const
bool opRadiusInTextureSpace(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opSeed(const SOP_NodeVerb::CookParms &cookparms) const
GenerateBy opGenerateBy(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
const UT_StringHolder & getCountPerPrimAttrib() const
char * findChar(int c) const
Find first occurrance of character. Returns NULL upon failure.
Definition: UT_String.h:550
void setParmValue(exint idx, const UT_Vector3D &value)
SYS_FORCE_INLINE const char * buffer() const
const UT_StringHolder & getDensityTexture() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
void getParmValue(exint idx, UT_Matrix2D &value) const
int64 exint
Definition: SYS_Types.h:116
const OP_Node * node() const
Definition: SOP_NodeVerb.h:104
double fpreal64
Definition: SYS_Types.h:192
bool opIndepVoxel(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getDetailAttribs() const
const UT_StringHolder & getPrimAttribs() const
const UT_StringHolder & getGroup() const
void setAreaAttrib(const UT_StringHolder &val)
const UT_StringHolder & getOutputRadiusAttrib() const
int64 opNpts(const SOP_NodeVerb::CookParms &cookparms) const
bool opUseAreaForVolumes(const SOP_NodeVerb::CookParms &cookparms) const
void getParmValue(exint idx, UT_StringHolder &value) const
bool operator==(const SOP_Scatter_2_0Parms &src) const
static void saveData(std::ostream &os, int64 v)
void setParmValue(exint idx, const UT_Matrix3D &value)
bool opUseAreaAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setCountPerPrimAttrib(const UT_StringHolder &val)
bool getUseOutputRadiusAttrib() const
void getParmValue(exint idx, PRM_DataItemHandle &value) const
virtual exint getNumParms() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void save(std::ostream &os) const
GLboolean * data
Definition: glcorearb.h:130
const UT_StringHolder & getPointAttribs() const
UT_StringHolder opPrimUVWAttrib(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:35
T & y(void)
Definition: UT_Vector4.h:377
fpreal64 opMaxRadius(const SOP_NodeVerb::CookParms &cookparms) const
GenerateBy getGenerateBy() const
const UT_StringHolder & getDensityAttrib() const
bool opForceTotal(const SOP_NodeVerb::CookParms &cookparms) const
bool opUsePrimUVWAttrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:294
UT_StringHolder opPrimNumAttrib(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
void getParmValue(exint idx, UT_Vector4D &value) const
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:111
static void loadData(UT_IStream &is, int64 &v)
bool opUseDensityTexture(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getParmValue(exint idx, UT_SharedPtr< UT_Ramp > &value) const
void setUsePrimUVWAttrib(bool val)
void getParmValue(exint idx, UT_Matrix4D &value) const
bool opRelaxPoints(const SOP_NodeVerb::CookParms &cookparms) 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
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, fpreal64 v)
virtual void copyFrom(const SOP_NodeParms *src)
bool operator!=(const SOP_Scatter_2_0Parms &src) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
const UT_StringHolder & getPrimUVWAttrib() const
bool opUseOutputDensityAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const UT_Vector2D &value)
fpreal64 opScaleRadiiBy(const SOP_NodeVerb::CookParms &cookparms) const
void setParmValue(exint idx, const exint &value)
static void loadData(UT_IStream &is, fpreal64 &v)
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
UT_StringHolder opPointAttribs(const SOP_NodeVerb::CookParms &cookparms) const
void setDetailAttribs(const UT_StringHolder &val)
fpreal64 getDensityScale() const
void setUseDensityAttrib(bool val)
GLuint GLfloat * val
Definition: glcorearb.h:1607
void setParmValue(exint idx, const UT_SharedPtr< UT_Ramp > &value)
bool getRadiusInTextureSpace() const
fpreal64 getMaxRadius() const
#define SOP_API
Definition: SOP_API.h:10
bool opUseEmergencyLimit(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opCountPerPrimAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setRadiusInTextureSpace(bool val)
int64 opEmergencyLimit(const SOP_NodeVerb::CookParms &cookparms) const
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:501
bool load(UT_IStream &is)
void setParmValue(exint idx, const UT_Matrix4D &value)
T & x(void)
Definition: UT_Vector4.h:375
void setEmergencyLimit(int64 val)
T & y(void)
Definition: UT_Vector2.h:287
void setOutputRadiusAttrib(const UT_StringHolder &val)
void setPrimNumAttrib(const UT_StringHolder &val)
GLboolean r
Definition: glcorearb.h:1221
static void saveData(std::ostream &os, UT_Matrix2D v)
void buildFromOp(const OP_Node *node, fpreal time, DEP_MicroNode *depnode)
void setRelaxIterations(int64 val)
static void saveData(std::ostream &os, bool v)
void setPrimSeedAttrib(const UT_StringHolder &val)
T & w(void)
Definition: UT_Vector4.h:381
int64 opRelaxIterations(const SOP_NodeVerb::CookParms &cookparms) const
bool getUseOutputDensityAttrib() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setUsePrimNumAttrib(bool val)
void setOverridePrimSeed(bool val)
const OP_Context & context() const
Definition: SOP_NodeVerb.h:109
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:88
void setUseEmergencyLimit(bool val)
virtual ParmType getParmType(exint fieldnum) const
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setParmValue(exint idx, const UT_Vector4D &value)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
GLenum src
Definition: glcorearb.h:1792
fpreal64 opDensityScale(const SOP_NodeVerb::CookParms &cookparms) const
virtual const char * getParmName(exint fieldnum) const