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