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