HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_VolumeNormalize.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_VolumeNormalizeEnums
24 {
25  enum class Norm
26  {
27  NORM0 = 0,
28  NORM1,
29  NORM2,
30  NORMINF,
31  LIMIT1
32  };
33 }
34 
35 
37 {
38 public:
39  static int version() { return 1; }
40  struct Numvolumes
41  {
43 
44 
46  {
47  volname = ""_UTsh;
48 
49  }
50 
51  bool operator==(const Numvolumes &src) const
52  {
53  if (volname != src.volname) return false;
54 
55  return true;
56  }
57  bool operator!=(const Numvolumes &src) const
58  {
59  return !operator==(src);
60  }
61 
62  };
63 
65  {
67 
68  buf.strcat("[ ");
69  for (int i = 0; i < list.entries(); i++)
70  {
71  if (i)
72  buf.strcat(", ");
73  buf.strcat("( ");
74  buf.append("");
75  { UT_String tmp; tmp = UT_StringWrap(list(i).volname).makeQuotedString('"'); buf.strcat(tmp); }
76 
77  buf.strcat(" )");
78  }
79  buf.strcat(" ]");
80 
82  return result;
83  }
84 
86  {
87  myNumvolumes.setSize(4);
88  myNorm = 1;
89  myNorm0Tol = 0.0001;
90  myNormalize = true;
91  myThreshold = 0.0001;
92  myAddRemainder = false;
93  myAbs = false;
94  myClampZero = false;
95  myClampOne = false;
96 
97  }
98 
99  explicit SOP_VolumeNormalizeParms(const SOP_VolumeNormalizeParms &) = default;
101  SOP_VolumeNormalizeParms(SOP_VolumeNormalizeParms &&) noexcept = default;
102  SOP_VolumeNormalizeParms &operator=(SOP_VolumeNormalizeParms &&) noexcept = default;
103 
105 
107  {
108  if (myNumvolumes != src.myNumvolumes) return false;
109  if (myNorm != src.myNorm) return false;
110  if (myNorm0Tol != src.myNorm0Tol) return false;
111  if (myNormalize != src.myNormalize) return false;
112  if (myThreshold != src.myThreshold) return false;
113  if (myAddRemainder != src.myAddRemainder) return false;
114  if (myAbs != src.myAbs) return false;
115  if (myClampZero != src.myClampZero) return false;
116  if (myClampOne != src.myClampOne) return false;
117 
118  return true;
119  }
121  {
122  return !operator==(src);
123  }
125 
126 
127 
128  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
129  {
130  if (true)
131  {
132  int64 length = 0;
133  graph->evalOpParm(length, nodeidx, "numvolumes", time, 0);
134  if (length < 0) length = 0;
135  myNumvolumes.setSize(length);
136  for (exint i = 0; i < length; i++)
137  {
138  int parmidx[1];
139  int offsets[1];
140  parmidx[0] = i+1;
141  offsets[0] = 1;
142  auto && _curentry = myNumvolumes(i);
143  (void) _curentry;
144  _curentry.volname = ""_UTsh;
145  if (true)
146  graph->evalOpParmInst(_curentry.volname, nodeidx, "volname#", parmidx, offsets, time, 0, 2-1);
147 
148  }
149  }
150  else
151  myNumvolumes.clear();
152  myNorm = 1;
153  if (true)
154  graph->evalOpParm(myNorm, nodeidx, "norm", time, 0);
155  myNorm0Tol = 0.0001;
156  if (true && ( (true&&!(((int64(getNorm())!=0)))) ) )
157  graph->evalOpParm(myNorm0Tol, nodeidx, "norm0tol", time, 0);
158  myNormalize = true;
159  if (true)
160  graph->evalOpParm(myNormalize, nodeidx, "normalize", time, 0);
161  myThreshold = 0.0001;
162  if (true)
163  graph->evalOpParm(myThreshold, nodeidx, "threshold", time, 0);
164  myAddRemainder = false;
165  if (true)
166  graph->evalOpParm(myAddRemainder, nodeidx, "addremainder", time, 0);
167  myAbs = false;
168  if (true)
169  graph->evalOpParm(myAbs, nodeidx, "abs", time, 0);
170  myClampZero = false;
171  if (true)
172  graph->evalOpParm(myClampZero, nodeidx, "clampzero", time, 0);
173  myClampOne = false;
174  if (true)
175  graph->evalOpParm(myClampOne, nodeidx, "clampone", time, 0);
176 
177  }
178 
179 
180  void loadFromOpSubclass(const LoadParms &loadparms) override
181  {
182  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
183  }
184 
185 
186  void copyFrom(const OP_NodeParms *src) override
187  {
188  *this = *((const SOP_VolumeNormalizeParms *)src);
189  }
190 
191  template <typename T>
192  void
193  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
194  {
195  if (idx.size() < 1)
196  return;
197  UT_ASSERT(idx.size() == instance.size()+1);
198  if (idx.size() != instance.size()+1)
199  return;
200  switch (idx[0])
201  {
202  case 0:
203  if (idx.size() == 1)
204  coerceValue(value, myNumvolumes.entries());
205  else if (instance[0] < myNumvolumes.entries())
206  {
207  auto && _data = myNumvolumes(instance[0]);
208  switch (idx[1])
209  {
210  case 0:
211  coerceValue(value, _data.volname);
212  break;
213 
214  }
215  }
216  break;
217  case 1:
218  coerceValue(value, myNorm);
219  break;
220  case 2:
221  coerceValue(value, myNorm0Tol);
222  break;
223  case 3:
224  coerceValue(value, myNormalize);
225  break;
226  case 4:
227  coerceValue(value, myThreshold);
228  break;
229  case 5:
230  coerceValue(value, myAddRemainder);
231  break;
232  case 6:
233  coerceValue(value, myAbs);
234  break;
235  case 7:
236  coerceValue(value, myClampZero);
237  break;
238  case 8:
239  coerceValue(value, myClampOne);
240  break;
241 
242  }
243  }
244 
245  bool isParmColorRamp(exint idx) const override
246  {
247  switch (idx)
248  {
249 
250  }
251  return false;
252  }
253 
254  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
255  { doGetParmValue(idx, instance, value); }
256  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
257  { doGetParmValue(idx, instance, value); }
258  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
259  { doGetParmValue(idx, instance, value); }
260  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
261  { doGetParmValue(idx, instance, value); }
262  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
263  { doGetParmValue(idx, instance, value); }
264  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
265  { doGetParmValue(idx, instance, value); }
266  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
267  { doGetParmValue(idx, instance, value); }
268  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
269  { doGetParmValue(idx, instance, value); }
270  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
271  { doGetParmValue(idx, instance, value); }
272  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
273  { doGetParmValue(idx, instance, value); }
274  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
275  { doGetParmValue(idx, instance, value); }
276 
277  template <typename T>
278  void
279  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
280  {
281  if (idx.size() < 1)
282  return;
283  UT_ASSERT(idx.size() == instance.size()+1);
284  if (idx.size() != instance.size()+1)
285  return;
286  switch (idx[0])
287  {
288  case 0:
289  if (idx.size() == 1)
290  {
291  exint newsize;
292  coerceValue(newsize, value);
293  if (newsize < 0) newsize = 0;
294  myNumvolumes.setSize(newsize);
295  }
296  else
297  {
298  if (instance[0] < 0)
299  return;
300  myNumvolumes.setSizeIfNeeded(instance[0]+1);
301  auto && _data = myNumvolumes(instance[0]);
302  switch (idx[1])
303  {
304  case 0:
305  coerceValue(_data.volname, value);
306  break;
307 
308  }
309  }
310  break;
311  case 1:
312  coerceValue(myNorm, clampMinValue(0, clampMaxValue(4, value ) ));
313  break;
314  case 2:
315  coerceValue(myNorm0Tol, ( ( value ) ));
316  break;
317  case 3:
318  coerceValue(myNormalize, ( ( value ) ));
319  break;
320  case 4:
321  coerceValue(myThreshold, clampMinValue(0, ( value ) ));
322  break;
323  case 5:
324  coerceValue(myAddRemainder, ( ( value ) ));
325  break;
326  case 6:
327  coerceValue(myAbs, ( ( value ) ));
328  break;
329  case 7:
330  coerceValue(myClampZero, ( ( value ) ));
331  break;
332  case 8:
333  coerceValue(myClampOne, ( ( value ) ));
334  break;
335 
336  }
337  }
338 
339  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
340  { doSetParmValue(idx, instance, value); }
341  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
342  { doSetParmValue(idx, instance, value); }
343  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
344  { doSetParmValue(idx, instance, value); }
345  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
346  { doSetParmValue(idx, instance, value); }
347  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
348  { doSetParmValue(idx, instance, value); }
349  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
350  { doSetParmValue(idx, instance, value); }
351  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
352  { doSetParmValue(idx, instance, value); }
353  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
354  { doSetParmValue(idx, instance, value); }
355  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
356  { doSetParmValue(idx, instance, value); }
357  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
358  { doSetParmValue(idx, instance, value); }
359  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
360  { doSetParmValue(idx, instance, value); }
361 
362  exint getNestNumParms(TempIndex idx) const override
363  {
364  if (idx.size() == 0)
365  return 9;
366  switch (idx[0])
367  {
368  case 0:
369  return 1;
370 
371  }
372  // Invalid
373  return 0;
374  }
375 
376  const char *getNestParmName(TempIndex fieldnum) const override
377  {
378  if (fieldnum.size() < 1)
379  return 0;
380  switch (fieldnum[0])
381  {
382  case 0:
383  if (fieldnum.size() == 1)
384  return "numvolumes";
385  switch (fieldnum[1])
386  {
387  case 0:
388  return "volname#";
389 
390  }
391  return 0;
392  case 1:
393  return "norm";
394  case 2:
395  return "norm0tol";
396  case 3:
397  return "normalize";
398  case 4:
399  return "threshold";
400  case 5:
401  return "addremainder";
402  case 6:
403  return "abs";
404  case 7:
405  return "clampzero";
406  case 8:
407  return "clampone";
408 
409  }
410  return 0;
411  }
412 
413  ParmType getNestParmType(TempIndex fieldnum) const override
414  {
415  if (fieldnum.size() < 1)
416  return PARM_UNSUPPORTED;
417  switch (fieldnum[0])
418  {
419  case 0:
420  if (fieldnum.size() == 1)
421  return PARM_MULTIPARM;
422  switch (fieldnum[1])
423  {
424  case 0:
425  return PARM_STRING;
426 
427  }
428  return PARM_UNSUPPORTED;
429  case 1:
430  return PARM_INTEGER;
431  case 2:
432  return PARM_FLOAT;
433  case 3:
434  return PARM_INTEGER;
435  case 4:
436  return PARM_FLOAT;
437  case 5:
438  return PARM_INTEGER;
439  case 6:
440  return PARM_INTEGER;
441  case 7:
442  return PARM_INTEGER;
443  case 8:
444  return PARM_INTEGER;
445 
446  }
447  return PARM_UNSUPPORTED;
448  }
449 
450  // Boiler plate to load individual types.
451  static void loadData(UT_IStream &is, int64 &v)
452  { is.bread(&v, 1); }
453  static void loadData(UT_IStream &is, bool &v)
454  { int64 iv; is.bread(&iv, 1); v = iv; }
455  static void loadData(UT_IStream &is, fpreal64 &v)
456  { is.bread<fpreal64>(&v, 1); }
457  static void loadData(UT_IStream &is, UT_Vector2D &v)
458  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
459  static void loadData(UT_IStream &is, UT_Vector3D &v)
460  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
461  is.bread<fpreal64>(&v.z(), 1); }
462  static void loadData(UT_IStream &is, UT_Vector4D &v)
463  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
464  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
465  static void loadData(UT_IStream &is, UT_Matrix2D &v)
466  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
467  static void loadData(UT_IStream &is, UT_Matrix3D &v)
468  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
469  static void loadData(UT_IStream &is, UT_Matrix4D &v)
470  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
471  static void loadData(UT_IStream &is, UT_Vector2I &v)
472  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
473  static void loadData(UT_IStream &is, UT_Vector3I &v)
474  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
475  is.bread<int64>(&v.z(), 1); }
476  static void loadData(UT_IStream &is, UT_Vector4I &v)
477  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
478  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
480  { is.bread(v); }
482  { UT_StringHolder rampdata;
483  loadData(is, rampdata);
484  if (rampdata.isstring())
485  {
486  v.reset(new UT_Ramp());
487  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
488  v->load(istr);
489  }
490  else v.reset();
491  }
494  loadData(is, data);
495  if (data.isstring())
496  {
497  // Find the data type.
498  const char *colon = UT_StringWrap(data).findChar(':');
499  if (colon)
500  {
501  int typelen = colon - data.buffer();
503  type.strncpy(data.buffer(), typelen);
504  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
505 
506  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
507  }
508  }
509  else v.reset();
510  }
511 
512  static void saveData(std::ostream &os, int64 v)
513  { UTwrite(os, &v); }
514  static void saveData(std::ostream &os, bool v)
515  { int64 iv = v; UTwrite(os, &iv); }
516  static void saveData(std::ostream &os, fpreal64 v)
517  { UTwrite<fpreal64>(os, &v); }
518  static void saveData(std::ostream &os, UT_Vector2D v)
519  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
520  static void saveData(std::ostream &os, UT_Vector3D v)
521  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
522  UTwrite<fpreal64>(os, &v.z()); }
523  static void saveData(std::ostream &os, UT_Vector4D v)
524  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
525  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
526  static void saveData(std::ostream &os, UT_Matrix2D v)
528  static void saveData(std::ostream &os, UT_Matrix3D v)
530  static void saveData(std::ostream &os, UT_Matrix4D v)
532  static void saveData(std::ostream &os, UT_StringHolder s)
533  { UT_StringWrap(s).saveBinary(os); }
534  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
536  UT_OStringStream ostr;
537  if (s) s->save(ostr);
538  result = ostr.str();
539  saveData(os, result);
540  }
541  static void saveData(std::ostream &os, PRM_DataItemHandle s)
543  UT_OStringStream ostr;
544  if (s)
545  {
546  ostr << s->getDataTypeToken();
547  ostr << ":";
548  s->saveBinary(ostr);
549  }
550  result = ostr.str();
551  saveData(os, result);
552  }
553 
554 
555  void save(std::ostream &os) const
556  {
557  int32 v = version();
558  UTwrite(os, &v);
559  {
560  int64 length = myNumvolumes.entries();
561  UTwrite(os, &length);
562  for (exint i = 0; i < length; i++)
563  {
564  auto && _curentry = myNumvolumes(i);
565  (void) _curentry;
566  saveData(os, _curentry.volname);
567 
568  }
569  }
570  saveData(os, myNorm);
571  saveData(os, myNorm0Tol);
572  saveData(os, myNormalize);
573  saveData(os, myThreshold);
574  saveData(os, myAddRemainder);
575  saveData(os, myAbs);
576  saveData(os, myClampZero);
577  saveData(os, myClampOne);
578 
579  }
580 
581  bool load(UT_IStream &is)
582  {
583  int32 v;
584  is.bread(&v, 1);
585  if (version() != v)
586  {
587  // Fail incompatible versions
588  return false;
589  }
590  {
591  int64 length;
592  is.read(&length, 1);
593  myNumvolumes.setSize(length);
594  for (exint i = 0; i < length; i++)
595  {
596  auto && _curentry = myNumvolumes(i);
597  (void) _curentry;
598  loadData(is, _curentry.volname);
599 
600  }
601  }
602  loadData(is, myNorm);
603  loadData(is, myNorm0Tol);
604  loadData(is, myNormalize);
605  loadData(is, myThreshold);
606  loadData(is, myAddRemainder);
607  loadData(is, myAbs);
608  loadData(is, myClampZero);
609  loadData(is, myClampOne);
610 
611  return true;
612  }
613 
614  const UT_Array<Numvolumes> &getNumvolumes() const { return myNumvolumes; }
615 void setNumvolumes(const UT_Array<Numvolumes> &val) { myNumvolumes = val; }
617  {
618  SOP_Node *thissop = cookparms.getNode();
619  if (!thissop) return getNumvolumes().entries();
620  exint result;
621  OP_Utils::evalOpParm(result, thissop, "numvolumes", cookparms.getCookTime(), 0);
622  return result;
623  }
625  { return opinstNumvolumes_volname(cookparms, &_idx); }
626  UT_StringHolder opinstNumvolumes_volname(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
627  {
628  SOP_Node *thissop = cookparms.getNode();
629  if (!thissop) return (myNumvolumes(_idx[0]).volname);
630  int _parmidx[2-1];
631  _parmidx[1-1] = _idx[1-1] + 1;
632 
634  OP_Utils::evalOpParmInst(result, thissop, "volname#", _parmidx, cookparms.getCookTime(), 0, 2-1);
635  return (result);
636  }
637 
638  Norm getNorm() const { return Norm(myNorm); }
639  void setNorm(Norm val) { myNorm = int64(val); }
640  Norm opNorm(const SOP_NodeVerb::CookParms &cookparms) const
641  {
642  SOP_Node *thissop = cookparms.getNode();
643  if (!thissop) return getNorm();
644  int64 result;
645  OP_Utils::evalOpParm(result, thissop, "norm", cookparms.getCookTime(), 0);
646  return Norm(result);
647  }
648  fpreal64 getNorm0Tol() const { return myNorm0Tol; }
649  void setNorm0Tol(fpreal64 val) { myNorm0Tol = val; }
651  {
652  SOP_Node *thissop = cookparms.getNode();
653  if (!thissop) return getNorm0Tol();
655  OP_Utils::evalOpParm(result, thissop, "norm0tol", cookparms.getCookTime(), 0);
656  return result;
657  }
658  bool getNormalize() const { return myNormalize; }
659  void setNormalize(bool val) { myNormalize = val; }
660  bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
661  {
662  SOP_Node *thissop = cookparms.getNode();
663  if (!thissop) return getNormalize();
664  bool result;
665  OP_Utils::evalOpParm(result, thissop, "normalize", cookparms.getCookTime(), 0);
666  return result;
667  }
668  fpreal64 getThreshold() const { return myThreshold; }
669  void setThreshold(fpreal64 val) { myThreshold = val; }
671  {
672  SOP_Node *thissop = cookparms.getNode();
673  if (!thissop) return getThreshold();
675  OP_Utils::evalOpParm(result, thissop, "threshold", cookparms.getCookTime(), 0);
676  return result;
677  }
678  bool getAddRemainder() const { return myAddRemainder; }
679  void setAddRemainder(bool val) { myAddRemainder = val; }
680  bool opAddRemainder(const SOP_NodeVerb::CookParms &cookparms) const
681  {
682  SOP_Node *thissop = cookparms.getNode();
683  if (!thissop) return getAddRemainder();
684  bool result;
685  OP_Utils::evalOpParm(result, thissop, "addremainder", cookparms.getCookTime(), 0);
686  return result;
687  }
688  bool getAbs() const { return myAbs; }
689  void setAbs(bool val) { myAbs = val; }
690  bool opAbs(const SOP_NodeVerb::CookParms &cookparms) const
691  {
692  SOP_Node *thissop = cookparms.getNode();
693  if (!thissop) return getAbs();
694  bool result;
695  OP_Utils::evalOpParm(result, thissop, "abs", cookparms.getCookTime(), 0);
696  return result;
697  }
698  bool getClampZero() const { return myClampZero; }
699  void setClampZero(bool val) { myClampZero = val; }
700  bool opClampZero(const SOP_NodeVerb::CookParms &cookparms) const
701  {
702  SOP_Node *thissop = cookparms.getNode();
703  if (!thissop) return getClampZero();
704  bool result;
705  OP_Utils::evalOpParm(result, thissop, "clampzero", cookparms.getCookTime(), 0);
706  return result;
707  }
708  bool getClampOne() const { return myClampOne; }
709  void setClampOne(bool val) { myClampOne = val; }
710  bool opClampOne(const SOP_NodeVerb::CookParms &cookparms) const
711  {
712  SOP_Node *thissop = cookparms.getNode();
713  if (!thissop) return getClampOne();
714  bool result;
715  OP_Utils::evalOpParm(result, thissop, "clampone", cookparms.getCookTime(), 0);
716  return result;
717  }
718 
719 private:
720  UT_Array<Numvolumes> myNumvolumes;
721  int64 myNorm;
722  fpreal64 myNorm0Tol;
723  bool myNormalize;
724  fpreal64 myThreshold;
725  bool myAddRemainder;
726  bool myAbs;
727  bool myClampZero;
728  bool myClampOne;
729 
730 };
bool operator==(const SOP_VolumeNormalizeParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
fpreal64 opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void
Definition: png.h:1083
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) 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 saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
exint getNestNumParms(TempIndex idx) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
exint opNumvolumes(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_VolumeNormalizeParms &src) const
UT_String makeQuotedString(char delimiter='\'', bool escape_nonprinting=false) const
Norm opNorm(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector3.h:667
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, UT_Matrix2D &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 loadFromOpSubclass(const LoadParms &loadparms) override
**But if you need a result
Definition: thread.h:613
static void loadData(UT_IStream &is, UT_Matrix3D &v)
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
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
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
bool operator==(const Numvolumes &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
exint length() const
static void saveData(std::ostream &os, UT_Vector3D v)
UT_StringHolder createString(const UT_Array< Numvolumes > &list) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
static void saveData(std::ostream &os, int64 v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
exint read(bool *array, exint sz=1)
Definition: UT_IStream.h:276
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
bool isParmColorRamp(exint idx) const override
bool opAbs(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
virtual void evalOpParmInst(int64 &v, NodeIdx node, const char *parmname, const int *inst, const int *offsets, fpreal time, DEP_MicroNode *depnode, int nestlevel=1) const =0
long long int64
Definition: SYS_Types.h:116
static void saveData(std::ostream &os, UT_Vector2D v)
UT_StringHolder opinstNumvolumes_volname(const SOP_NodeVerb::CookParms &cookparms, const int *_idx) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_StringHolder &v)
SYS_FORCE_INLINE void strcat(const char *src)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal64 opNorm0Tol(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Vector2I &v)
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
bool operator!=(const Numvolumes &src) const
bool opAddRemainder(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, fpreal64 &v)
void coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
bool opClampOne(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 fpreal
Definition: SYS_Types.h:277
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool opClampZero(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opNumvolumes_volname(const SOP_NodeVerb::CookParms &cookparms, int _idx) const
static void loadData(UT_IStream &is, int64 &v)
bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNumvolumes(const UT_Array< Numvolumes > &val)
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
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
#define SOP_API
Definition: SOP_API.h:10
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void saveData(std::ostream &os, bool v)
const char * findChar(int c) const
Definition: UT_String.h:1385
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
GLboolean r
Definition: glcorearb.h:1222
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
type
Definition: core.h:1059
const UT_Array< Numvolumes > & getNumvolumes() const
const char * getNestParmName(TempIndex fieldnum) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:89
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, bool &v)
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override