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