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