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