HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_VolumeRasterizeParticles.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_API.h>
7 #include <SOP/SOP_NodeVerb.h>
8 #include <SOP/SOP_GraphProxy.h>
9 
10 #include <OP/OP_Utils.h>
11 #include <PRM/PRM_Parm.h>
12 #include <UT/UT_IStream.h>
13 #include <UT/UT_NTStreamUtil.h>
14 #include <UT/UT_Ramp.h>
15 #include <UT/UT_SharedPtr.h>
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringStream.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_EnvControl.h>
20 #include <SYS/SYS_Types.h>
21 
22 using namespace UT::Literal;
23 
24 class DEP_MicroNode;
25 namespace SOP_VolumeRasterizeParticlesEnums
26 {
27  enum class Rule
28  {
29  WAVG = 0,
30  THRESHOLD,
33  };
34 }
35 
36 
38 {
39 public:
40  static int version() { return 1; }
41  struct Attribrules
42  {
45 
46 
48  {
49  attribute = ""_sh;
50  rule = 0;
51 
52  }
53 
54  bool operator==(const Attribrules &src) const
55  {
56  if (attribute != src.attribute) return false;
57  if (rule != src.rule) return false;
58 
59  return true;
60  }
61  bool operator!=(const Attribrules &src) const
62  {
63  return !operator==(src);
64  }
65 
66  };
67 
69  {
71 
72  buf.strcat("[ ");
73  for (int i = 0; i < list.entries(); i++)
74  {
75  if (i)
76  buf.strcat(", ");
77  buf.strcat("( ");
78  buf.append("");
79  { UT_String tmp; tmp = UT_StringWrap(list(i).attribute).makeQuotedString('"'); buf.strcat(tmp); }
80  buf.append(", ");
81  buf.appendSprintf("%d", (int) list(i).rule);
82 
83  buf.strcat(" )");
84  }
85  buf.strcat(" ]");
86 
88  return result;
89  }
90 
92  {
93  myGroup = ""_sh;
94  myPoints = ""_sh;
95  myFilter = "gauss"_sh;
96  myDensityattrib = "density"_sh;
97  myDensityscale = 1;
98  myParticlescale = 1;
99  myMinfilter = 0.75;
100  myVelocityblur = false;
101  myShutter = 0.5;
102  myShutteroffset = 1;
103  myBlursamples = 4;
104  myNormalize = false;
105  myAttribrules.setSize(0);
106 
107  }
108 
110 
112 
114  {
115  if (myGroup != src.myGroup) return false;
116  if (myPoints != src.myPoints) return false;
117  if (myFilter != src.myFilter) return false;
118  if (myDensityattrib != src.myDensityattrib) return false;
119  if (myDensityscale != src.myDensityscale) return false;
120  if (myParticlescale != src.myParticlescale) return false;
121  if (myMinfilter != src.myMinfilter) return false;
122  if (myVelocityblur != src.myVelocityblur) return false;
123  if (myShutter != src.myShutter) return false;
124  if (myShutteroffset != src.myShutteroffset) return false;
125  if (myBlursamples != src.myBlursamples) return false;
126  if (myNormalize != src.myNormalize) return false;
127  if (myAttribrules != src.myAttribrules) return false;
128 
129  return true;
130  }
132  {
133  return !operator==(src);
134  }
136 
137 
138 
139  void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
140  {
141  myGroup = ""_sh;
142  if (true)
143  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
144  myPoints = ""_sh;
145  if (true)
146  graph->evalOpParm(myPoints, nodeidx, "points", time, 0);
147  myFilter = "gauss"_sh;
148  if (true)
149  graph->evalOpParm(myFilter, nodeidx, "filter", time, 0);
150  myDensityattrib = "density"_sh;
151  if (true)
152  graph->evalOpParm(myDensityattrib, nodeidx, "densityattrib", time, 0);
153  myDensityscale = 1;
154  if (true)
155  graph->evalOpParm(myDensityscale, nodeidx, "densityscale", time, 0);
156  myParticlescale = 1;
157  if (true)
158  graph->evalOpParm(myParticlescale, nodeidx, "particlescale", time, 0);
159  myMinfilter = 0.75;
160  if (true)
161  graph->evalOpParm(myMinfilter, nodeidx, "minfilter", time, 0);
162  myVelocityblur = false;
163  if (true)
164  graph->evalOpParm(myVelocityblur, nodeidx, "velocityblur", time, 0);
165  myShutter = 0.5;
166  if (true && ( (true&&!(((getVelocityblur()==0)))) ) )
167  graph->evalOpParm(myShutter, nodeidx, "shutter", time, 0);
168  myShutteroffset = 1;
169  if (true && ( (true&&!(((getVelocityblur()==0)))) ) )
170  graph->evalOpParm(myShutteroffset, nodeidx, "shutteroffset", time, 0);
171  myBlursamples = 4;
172  if (true && ( (true&&!(((getVelocityblur()==0)))) ) )
173  graph->evalOpParm(myBlursamples, nodeidx, "blursamples", time, 0);
174  myNormalize = false;
175  if (true)
176  graph->evalOpParm(myNormalize, nodeidx, "normalize", time, 0);
177  if (true)
178  {
179  int64 length = 0;
180  graph->evalOpParm(length, nodeidx, "attribrules", time, 0);
181  if (length < 0) length = 0;
182  myAttribrules.setSize(length);
183  for (exint i = 0; i < length; i++)
184  {
185  int parmidx[1];
186  int offsets[1];
187  parmidx[0] = i+1;
188  offsets[0] = 1;
189  auto && _curentry = myAttribrules(i);
190  (void) _curentry;
191  _curentry.attribute = ""_sh;
192  if (true)
193  graph->evalOpParmInst(_curentry.attribute, nodeidx, "attribute#", parmidx, offsets, time, 0, 2-1);
194  _curentry.rule = 0;
195  if (true)
196  graph->evalOpParmInst(_curentry.rule, nodeidx, "rule#", parmidx, offsets, time, 0, 2-1);
197 
198  }
199  }
200  else
201  myAttribrules.clear();
202 
203  }
204 
205 
206  void loadFromOpSubclass(const LoadParms &loadparms) override
207  {
208  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
209  }
210 
211 
212  void copyFrom(const SOP_NodeParms *src) override
213  {
214  *this = *((const SOP_VolumeRasterizeParticlesParms *)src);
215  }
216 
217  template <typename T>
218  void
219  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
220  {
221  if (idx.size() < 1)
222  return;
223  UT_ASSERT(idx.size() == instance.size()+1);
224  if (idx.size() != instance.size()+1)
225  return;
226  switch (idx[0])
227  {
228  case 0:
229  coerceValue(value, myGroup);
230  break;
231  case 1:
232  coerceValue(value, myPoints);
233  break;
234  case 2:
235  coerceValue(value, myFilter);
236  break;
237  case 3:
238  coerceValue(value, myDensityattrib);
239  break;
240  case 4:
241  coerceValue(value, myDensityscale);
242  break;
243  case 5:
244  coerceValue(value, myParticlescale);
245  break;
246  case 6:
247  coerceValue(value, myMinfilter);
248  break;
249  case 7:
250  coerceValue(value, myVelocityblur);
251  break;
252  case 8:
253  coerceValue(value, myShutter);
254  break;
255  case 9:
256  coerceValue(value, myShutteroffset);
257  break;
258  case 10:
259  coerceValue(value, myBlursamples);
260  break;
261  case 11:
262  coerceValue(value, myNormalize);
263  break;
264  case 12:
265  if (idx.size() == 1)
266  coerceValue(value, myAttribrules.entries());
267  else if (instance[0] < myAttribrules.entries())
268  {
269  auto && _data = myAttribrules(instance[0]);
270  switch (idx[1])
271  {
272  case 0:
273  coerceValue(value, _data.attribute);
274  break;
275  case 1:
276  coerceValue(value, _data.rule);
277  break;
278 
279  }
280  }
281  break;
282 
283  }
284  }
285 
286  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
287  { doGetParmValue(idx, instance, value); }
288  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
289  { doGetParmValue(idx, instance, value); }
290  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
291  { doGetParmValue(idx, instance, value); }
292  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
293  { doGetParmValue(idx, instance, value); }
294  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
295  { doGetParmValue(idx, instance, value); }
296  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
297  { doGetParmValue(idx, instance, value); }
298  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
299  { doGetParmValue(idx, instance, value); }
300  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
301  { doGetParmValue(idx, instance, value); }
302  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
303  { doGetParmValue(idx, instance, value); }
304  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
305  { doGetParmValue(idx, instance, value); }
306  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
307  { doGetParmValue(idx, instance, value); }
308 
309  template <typename T>
310  void
311  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
312  {
313  if (idx.size() < 1)
314  return;
315  UT_ASSERT(idx.size() == instance.size()+1);
316  if (idx.size() != instance.size()+1)
317  return;
318  switch (idx[0])
319  {
320  case 0:
321  coerceValue(myGroup, ( ( value ) ));
322  break;
323  case 1:
324  coerceValue(myPoints, ( ( value ) ));
325  break;
326  case 2:
327  coerceValue(myFilter, ( ( value ) ));
328  break;
329  case 3:
330  coerceValue(myDensityattrib, ( ( value ) ));
331  break;
332  case 4:
333  coerceValue(myDensityscale, clampMinValue(0, ( value ) ));
334  break;
335  case 5:
336  coerceValue(myParticlescale, clampMinValue(0, ( value ) ));
337  break;
338  case 6:
339  coerceValue(myMinfilter, ( ( value ) ));
340  break;
341  case 7:
342  coerceValue(myVelocityblur, ( ( value ) ));
343  break;
344  case 8:
345  coerceValue(myShutter, clampMinValue(0, ( value ) ));
346  break;
347  case 9:
348  coerceValue(myShutteroffset, ( ( value ) ));
349  break;
350  case 10:
351  coerceValue(myBlursamples, clampMinValue(1, ( value ) ));
352  break;
353  case 11:
354  coerceValue(myNormalize, ( ( value ) ));
355  break;
356  case 12:
357  if (idx.size() == 1)
358  {
359  exint newsize;
360  coerceValue(newsize, value);
361  if (newsize < 0) newsize = 0;
362  myAttribrules.setSize(newsize);
363  }
364  else
365  {
366  if (instance[0] < 0)
367  return;
368  myAttribrules.setSizeIfNeeded(instance[0]+1);
369  auto && _data = myAttribrules(instance[0]);
370  switch (idx[1])
371  {
372  case 0:
373  coerceValue(_data.attribute, value);
374  break;
375  case 1:
376  coerceValue(_data.rule, value);
377  break;
378 
379  }
380  }
381  break;
382 
383  }
384  }
385 
386  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
387  { doSetParmValue(idx, instance, value); }
388  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
389  { doSetParmValue(idx, instance, value); }
390  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
391  { doSetParmValue(idx, instance, value); }
392  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
393  { doSetParmValue(idx, instance, value); }
394  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
395  { doSetParmValue(idx, instance, value); }
396  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
397  { doSetParmValue(idx, instance, value); }
398  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
399  { doSetParmValue(idx, instance, value); }
400  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
401  { doSetParmValue(idx, instance, value); }
402  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
403  { doSetParmValue(idx, instance, value); }
404  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
405  { doSetParmValue(idx, instance, value); }
406  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
407  { doSetParmValue(idx, instance, value); }
408 
409  exint getNestNumParms(TempIndex idx) const override
410  {
411  if (idx.size() == 0)
412  return 13;
413  switch (idx[0])
414  {
415  case 12:
416  return 2;
417 
418  }
419  // Invalid
420  return 0;
421  }
422 
423  const char *getNestParmName(TempIndex fieldnum) const override
424  {
425  if (fieldnum.size() < 1)
426  return 0;
427  switch (fieldnum[0])
428  {
429  case 0:
430  return "group";
431  case 1:
432  return "points";
433  case 2:
434  return "filter";
435  case 3:
436  return "densityattrib";
437  case 4:
438  return "densityscale";
439  case 5:
440  return "particlescale";
441  case 6:
442  return "minfilter";
443  case 7:
444  return "velocityblur";
445  case 8:
446  return "shutter";
447  case 9:
448  return "shutteroffset";
449  case 10:
450  return "blursamples";
451  case 11:
452  return "normalize";
453  case 12:
454  if (fieldnum.size() == 1)
455  return "attribrules";
456  switch (fieldnum[1])
457  {
458  case 0:
459  return "attribute#";
460  case 1:
461  return "rule#";
462 
463  }
464  return 0;
465 
466  }
467  return 0;
468  }
469 
470  ParmType getNestParmType(TempIndex fieldnum) const override
471  {
472  if (fieldnum.size() < 1)
473  return PARM_UNSUPPORTED;
474  switch (fieldnum[0])
475  {
476  case 0:
477  return PARM_STRING;
478  case 1:
479  return PARM_STRING;
480  case 2:
481  return PARM_STRING;
482  case 3:
483  return PARM_STRING;
484  case 4:
485  return PARM_FLOAT;
486  case 5:
487  return PARM_FLOAT;
488  case 6:
489  return PARM_FLOAT;
490  case 7:
491  return PARM_INTEGER;
492  case 8:
493  return PARM_FLOAT;
494  case 9:
495  return PARM_FLOAT;
496  case 10:
497  return PARM_INTEGER;
498  case 11:
499  return PARM_INTEGER;
500  case 12:
501  if (fieldnum.size() == 1)
502  return PARM_MULTIPARM;
503  switch (fieldnum[1])
504  {
505  case 0:
506  return PARM_STRING;
507  case 1:
508  return PARM_INTEGER;
509 
510  }
511  return PARM_UNSUPPORTED;
512 
513  }
514  return PARM_UNSUPPORTED;
515  }
516 
517  // Boiler plate to load individual types.
518  static void loadData(UT_IStream &is, int64 &v)
519  { is.bread(&v, 1); }
520  static void loadData(UT_IStream &is, bool &v)
521  { int64 iv; is.bread(&iv, 1); v = iv; }
522  static void loadData(UT_IStream &is, fpreal64 &v)
523  { is.bread<fpreal64>(&v, 1); }
524  static void loadData(UT_IStream &is, UT_Vector2D &v)
525  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
526  static void loadData(UT_IStream &is, UT_Vector3D &v)
527  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
528  is.bread<fpreal64>(&v.z(), 1); }
529  static void loadData(UT_IStream &is, UT_Vector4D &v)
530  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
531  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
532  static void loadData(UT_IStream &is, UT_Matrix2D &v)
533  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
534  static void loadData(UT_IStream &is, UT_Matrix3D &v)
535  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
536  static void loadData(UT_IStream &is, UT_Matrix4D &v)
537  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
538  static void loadData(UT_IStream &is, UT_Vector2I &v)
539  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
540  static void loadData(UT_IStream &is, UT_Vector3I &v)
541  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
542  is.bread<int64>(&v.z(), 1); }
543  static void loadData(UT_IStream &is, UT_Vector4I &v)
544  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
545  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
547  { is.bread(v); }
549  { UT_StringHolder rampdata;
550  loadData(is, rampdata);
551  if (rampdata.isstring())
552  {
553  v.reset(new UT_Ramp());
554  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
555  v->load(istr);
556  }
557  else v.reset();
558  }
561  loadData(is, data);
562  if (data.isstring())
563  {
564  // Find the data type.
565  const char *colon = UT_StringWrap(data).findChar(':');
566  if (colon)
567  {
568  int typelen = colon - data.buffer();
570  type.strncpy(data.buffer(), typelen);
571  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
572 
573  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
574  }
575  }
576  else v.reset();
577  }
578 
579  static void saveData(std::ostream &os, int64 v)
580  { UTwrite(os, &v); }
581  static void saveData(std::ostream &os, bool v)
582  { int64 iv = v; UTwrite(os, &iv); }
583  static void saveData(std::ostream &os, fpreal64 v)
584  { UTwrite<fpreal64>(os, &v); }
585  static void saveData(std::ostream &os, UT_Vector2D v)
586  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
587  static void saveData(std::ostream &os, UT_Vector3D v)
588  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
589  UTwrite<fpreal64>(os, &v.z()); }
590  static void saveData(std::ostream &os, UT_Vector4D v)
591  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
592  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
593  static void saveData(std::ostream &os, UT_Matrix2D v)
595  static void saveData(std::ostream &os, UT_Matrix3D v)
597  static void saveData(std::ostream &os, UT_Matrix4D v)
599  static void saveData(std::ostream &os, UT_StringHolder s)
600  { UT_StringWrap(s).saveBinary(os); }
601  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
603  UT_OStringStream ostr;
604  if (s) s->save(ostr);
605  result = ostr.str();
606  saveData(os, result);
607  }
608  static void saveData(std::ostream &os, PRM_DataItemHandle s)
610  UT_OStringStream ostr;
611  if (s)
612  {
613  ostr << s->getDataTypeToken();
614  ostr << ":";
615  s->saveBinary(ostr);
616  }
617  result = ostr.str();
618  saveData(os, result);
619  }
620 
621 
622  void save(std::ostream &os) const
623  {
624  int32 v = version();
625  UTwrite(os, &v);
626  saveData(os, myGroup);
627  saveData(os, myPoints);
628  saveData(os, myFilter);
629  saveData(os, myDensityattrib);
630  saveData(os, myDensityscale);
631  saveData(os, myParticlescale);
632  saveData(os, myMinfilter);
633  saveData(os, myVelocityblur);
634  saveData(os, myShutter);
635  saveData(os, myShutteroffset);
636  saveData(os, myBlursamples);
637  saveData(os, myNormalize);
638  {
639  int64 length = myAttribrules.entries();
640  UTwrite(os, &length);
641  for (exint i = 0; i < length; i++)
642  {
643  auto && _curentry = myAttribrules(i);
644  (void) _curentry;
645  saveData(os, _curentry.attribute);
646  saveData(os, _curentry.rule);
647 
648  }
649  }
650 
651  }
652 
653  bool load(UT_IStream &is)
654  {
655  int32 v;
656  is.bread(&v, 1);
657  if (version() != v)
658  {
659  // Fail incompatible versions
660  return false;
661  }
662  loadData(is, myGroup);
663  loadData(is, myPoints);
664  loadData(is, myFilter);
665  loadData(is, myDensityattrib);
666  loadData(is, myDensityscale);
667  loadData(is, myParticlescale);
668  loadData(is, myMinfilter);
669  loadData(is, myVelocityblur);
670  loadData(is, myShutter);
671  loadData(is, myShutteroffset);
672  loadData(is, myBlursamples);
673  loadData(is, myNormalize);
674  {
675  int64 length;
676  is.read(&length, 1);
677  myAttribrules.setSize(length);
678  for (exint i = 0; i < length; i++)
679  {
680  auto && _curentry = myAttribrules(i);
681  (void) _curentry;
682  loadData(is, _curentry.attribute);
683  loadData(is, _curentry.rule);
684 
685  }
686  }
687 
688  return true;
689  }
690 
691  const UT_StringHolder & getGroup() const { return myGroup; }
692  void setGroup(const UT_StringHolder & val) { myGroup = val; }
694  {
695  SOP_Node *thissop = cookparms.getNode();
696  if (!thissop) return getGroup();
698  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
699  return result;
700  }
701  const UT_StringHolder & getPoints() const { return myPoints; }
702  void setPoints(const UT_StringHolder & val) { myPoints = val; }
704  {
705  SOP_Node *thissop = cookparms.getNode();
706  if (!thissop) return getPoints();
708  OP_Utils::evalOpParm(result, thissop, "points", cookparms.getCookTime(), 0);
709  return result;
710  }
711  const UT_StringHolder & getFilter() const { return myFilter; }
712  void setFilter(const UT_StringHolder & val) { myFilter = val; }
714  {
715  SOP_Node *thissop = cookparms.getNode();
716  if (!thissop) return getFilter();
718  OP_Utils::evalOpParm(result, thissop, "filter", cookparms.getCookTime(), 0);
719  return result;
720  }
721  const UT_StringHolder & getDensityattrib() const { return myDensityattrib; }
722  void setDensityattrib(const UT_StringHolder & val) { myDensityattrib = val; }
724  {
725  SOP_Node *thissop = cookparms.getNode();
726  if (!thissop) return getDensityattrib();
728  OP_Utils::evalOpParm(result, thissop, "densityattrib", cookparms.getCookTime(), 0);
729  return result;
730  }
731  fpreal64 getDensityscale() const { return myDensityscale; }
732  void setDensityscale(fpreal64 val) { myDensityscale = val; }
734  {
735  SOP_Node *thissop = cookparms.getNode();
736  if (!thissop) return getDensityscale();
738  OP_Utils::evalOpParm(result, thissop, "densityscale", cookparms.getCookTime(), 0);
739  return result;
740  }
741  fpreal64 getParticlescale() const { return myParticlescale; }
742  void setParticlescale(fpreal64 val) { myParticlescale = val; }
744  {
745  SOP_Node *thissop = cookparms.getNode();
746  if (!thissop) return getParticlescale();
748  OP_Utils::evalOpParm(result, thissop, "particlescale", cookparms.getCookTime(), 0);
749  return result;
750  }
751  fpreal64 getMinfilter() const { return myMinfilter; }
752  void setMinfilter(fpreal64 val) { myMinfilter = val; }
754  {
755  SOP_Node *thissop = cookparms.getNode();
756  if (!thissop) return getMinfilter();
758  OP_Utils::evalOpParm(result, thissop, "minfilter", cookparms.getCookTime(), 0);
759  return result;
760  }
761  bool getVelocityblur() const { return myVelocityblur; }
762  void setVelocityblur(bool val) { myVelocityblur = val; }
763  bool opVelocityblur(const SOP_NodeVerb::CookParms &cookparms) const
764  {
765  SOP_Node *thissop = cookparms.getNode();
766  if (!thissop) return getVelocityblur();
767  bool result;
768  OP_Utils::evalOpParm(result, thissop, "velocityblur", cookparms.getCookTime(), 0);
769  return result;
770  }
771  fpreal64 getShutter() const { return myShutter; }
772  void setShutter(fpreal64 val) { myShutter = val; }
774  {
775  SOP_Node *thissop = cookparms.getNode();
776  if (!thissop) return getShutter();
778  OP_Utils::evalOpParm(result, thissop, "shutter", cookparms.getCookTime(), 0);
779  return result;
780  }
781  fpreal64 getShutteroffset() const { return myShutteroffset; }
782  void setShutteroffset(fpreal64 val) { myShutteroffset = val; }
784  {
785  SOP_Node *thissop = cookparms.getNode();
786  if (!thissop) return getShutteroffset();
788  OP_Utils::evalOpParm(result, thissop, "shutteroffset", cookparms.getCookTime(), 0);
789  return result;
790  }
791  int64 getBlursamples() const { return myBlursamples; }
792  void setBlursamples(int64 val) { myBlursamples = val; }
794  {
795  SOP_Node *thissop = cookparms.getNode();
796  if (!thissop) return getBlursamples();
797  int64 result;
798  OP_Utils::evalOpParm(result, thissop, "blursamples", cookparms.getCookTime(), 0);
799  return result;
800  }
801  bool getNormalize() const { return myNormalize; }
802  void setNormalize(bool val) { myNormalize = val; }
803  bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
804  {
805  SOP_Node *thissop = cookparms.getNode();
806  if (!thissop) return getNormalize();
807  bool result;
808  OP_Utils::evalOpParm(result, thissop, "normalize", cookparms.getCookTime(), 0);
809  return result;
810  }
811  const UT_Array<Attribrules> &getAttribrules() const { return myAttribrules; }
812 void setAttribrules(const UT_Array<Attribrules> &val) { myAttribrules = val; }
814  {
815  SOP_Node *thissop = cookparms.getNode();
816  if (!thissop) return getAttribrules().entries();
817  exint result;
818  OP_Utils::evalOpParm(result, thissop, "attribrules", cookparms.getCookTime(), 0);
819  return result;
820  }
822  { return opinstAttribrules_attribute(cookparms, &_idx); }
823  UT_StringHolder opinstAttribrules_attribute(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
824  {
825  SOP_Node *thissop = cookparms.getNode();
826  if (!thissop) return (myAttribrules(_idx[0]).attribute);
827  int _parmidx[2-1];
828  _parmidx[1-1] = _idx[1-1] + 1;
829 
831  OP_Utils::evalOpParmInst(result, thissop, "attribute#", _parmidx, cookparms.getCookTime(), 0, 2-1);
832  return (result);
833  }
834  int64 opAttribrules_rule(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
835  { return opinstAttribrules_rule(cookparms, &_idx); }
836  int64 opinstAttribrules_rule(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
837  {
838  SOP_Node *thissop = cookparms.getNode();
839  if (!thissop) return (myAttribrules(_idx[0]).rule);
840  int _parmidx[2-1];
841  _parmidx[1-1] = _idx[1-1] + 1;
842 
843  int64 result;
844  OP_Utils::evalOpParmInst(result, thissop, "rule#", _parmidx, cookparms.getCookTime(), 0, 2-1);
845  return (result);
846  }
847 
848 
849 private:
850  UT_StringHolder myGroup;
851  UT_StringHolder myPoints;
852  UT_StringHolder myFilter;
853  UT_StringHolder myDensityattrib;
854  fpreal64 myDensityscale;
855  fpreal64 myParticlescale;
856  fpreal64 myMinfilter;
857  bool myVelocityblur;
858  fpreal64 myShutter;
859  fpreal64 myShutteroffset;
860  int64 myBlursamples;
861  bool myNormalize;
862  UT_Array<Attribrules> myAttribrules;
863 
864 };
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
type
Definition: core.h:977
static void saveData(std::ostream &os, bool v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
UT_StringHolder opDensityattrib(const SOP_NodeVerb::CookParms &cookparms) const
bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
const UT_Array< Attribrules > & getAttribrules() const
exint nodeIdx() const
Definition: SOP_NodeVerb.h:102
static void loadData(UT_IStream &is, bool &v)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:734
const char * getNestParmName(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, UT_Vector4D v)
void
Definition: png.h:1083
exint bread(int32 *buffer, exint asize=1)
const UT_StringHolder & getDensityattrib() const
GT_API const UT_StringHolder time
fpreal getTime() const
Definition: OP_Context.h:60
static void loadData(UT_IStream &is, UT_Vector4I &v)
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2620
const GLfloat * c
Definition: glew.h:16631
void copyFrom(const SOP_NodeParms *src) override
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
int64 exint
Definition: SYS_Types.h:125
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, UT_Matrix4D v)
const SOP_GraphProxy * graph() const
Definition: SOP_NodeVerb.h:101
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Matrix3D &v)
GLenum src
Definition: glcorearb.h:1792
fpreal64 opDensityscale(const SOP_NodeVerb::CookParms &cookparms) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setDensityattrib(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_StringHolder opinstAttribrules_attribute(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
UT_StringHolder opAttribrules_attribute(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
double fpreal64
Definition: SYS_Types.h:201
exint getNestNumParms(TempIndex idx) const override
fpreal64 opShutteroffset(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
GLuint64EXT * result
Definition: glew.h:14311
void loadFromOpSubclass(const LoadParms &loadparms) override
SYS_FORCE_INLINE T & y()
Definition: UT_Vector3.h:508
bool operator==(const SOP_VolumeRasterizeParticlesParms &src) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
int64 opBlursamples(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
ParmType getNestParmType(TempIndex fieldnum) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:30
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const GLdouble * v
Definition: glcorearb.h:836
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:288
SYS_FORCE_INLINE T & z()
Definition: UT_Vector3.h:510
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, fpreal64 &v)
long long int64
Definition: SYS_Types.h:116
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opShutter(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
fpreal64 opMinfilter(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
bool operator!=(const SOP_VolumeRasterizeParticlesParms &src) const
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:287
fpreal64 opParticlescale(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
DEP_MicroNode * depnode() const
Definition: SOP_NodeVerb.h:109
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:481
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
GLboolean * data
Definition: glcorearb.h:130
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:794
GLuint GLfloat * val
Definition: glcorearb.h:1607
int int appendSprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
static void saveData(std::ostream &os, UT_Vector2D v)
bool opVelocityblur(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
fpreal64 fpreal
Definition: SYS_Types.h:277
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
Utility class for containing a color ramp.
Definition: UT_Ramp.h:84
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
SYS_FORCE_INLINE void append(char character)
UT_StringHolder createString(const UT_Array< Attribrules > &list) const
#define SOP_API
Definition: SOP_API.h:10
GLsizei const GLfloat * value
Definition: glcorearb.h:823
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
SYS_FORCE_INLINE T & x()
Definition: UT_Vector3.h:506
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:748
UT_StringHolder opFilter(const SOP_NodeVerb::CookParms &cookparms) const
void setAttribrules(const UT_Array< Attribrules > &val)
int64 opAttribrules_rule(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const char * findChar(int c) const
Definition: UT_String.h:1371
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:171
UT_StringHolder opPoints(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int64 opinstAttribrules_rule(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
GLboolean r
Definition: glcorearb.h:1221
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
GLdouble s
Definition: glew.h:1395
exint opAttribrules(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const OP_Context & context() const
Definition: SOP_NodeVerb.h:107
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
static void loadData(UT_IStream &is, UT_StringHolder &v)
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0