HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Watershed.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_WatershedEnums
24 {
25  enum class SrcComp
26  {
27  X = 0,
28  Y,
29  Z
30  };
31 
33  getToken(SrcComp enum_value)
34  {
35  using namespace UT::Literal;
36  switch (enum_value) {
37  case SrcComp::X: return "x"_sh;
38  case SrcComp::Y: return "y"_sh;
39  case SrcComp::Z: return "z"_sh;
40  default: UT_ASSERT(false); return ""_sh;
41  }
42  }
43 
44  enum class CellStructure
45  {
46  MINPTMAXPOLY = 0,
48  };
49 
51  getToken(CellStructure enum_value)
52  {
53  using namespace UT::Literal;
54  switch (enum_value) {
55  case CellStructure::MINPTMAXPOLY: return "minptmaxpoly"_sh;
56  case CellStructure::MINPOLYMAXPT: return "minpolymaxpt"_sh;
57  default: UT_ASSERT(false); return ""_sh;
58  }
59  }
60 
61 }
62 
63 
65 {
66 public:
67  static int version() { return 1; }
68 
70  {
71  myGroup = ""_UTsh;
72  mySrcAttrib = "P"_UTsh;
73  mySrcComp = 0;
74  myCellStructure = 0;
75  myThreshold = 0;
76  myGenMinima = false;
77  myMinima = "minima"_UTsh;
78  myGenMaxima = false;
79  myMaxima = "maxima"_UTsh;
80  myGenSaddleEdges = false;
81  mySaddleEdges = "valleys"_UTsh;
82  myGenRidgeEdges = false;
83  myRidgeEdges = "ridges"_UTsh;
84  myGenValleyEdges = false;
85  myValleyEdges = "valleys"_UTsh;
86 
87  }
88 
89  explicit SOP_WatershedParms(const SOP_WatershedParms &) = default;
91  SOP_WatershedParms(SOP_WatershedParms &&) noexcept = default;
92  SOP_WatershedParms &operator=(SOP_WatershedParms &&) noexcept = default;
93 
94  ~SOP_WatershedParms() override {}
95 
96  bool operator==(const SOP_WatershedParms &src) const
97  {
98  if (myGroup != src.myGroup) return false;
99  if (mySrcAttrib != src.mySrcAttrib) return false;
100  if (mySrcComp != src.mySrcComp) return false;
101  if (myCellStructure != src.myCellStructure) return false;
102  if (myThreshold != src.myThreshold) return false;
103  if (myGenMinima != src.myGenMinima) return false;
104  if (myMinima != src.myMinima) return false;
105  if (myGenMaxima != src.myGenMaxima) return false;
106  if (myMaxima != src.myMaxima) return false;
107  if (myGenSaddleEdges != src.myGenSaddleEdges) return false;
108  if (mySaddleEdges != src.mySaddleEdges) return false;
109  if (myGenRidgeEdges != src.myGenRidgeEdges) return false;
110  if (myRidgeEdges != src.myRidgeEdges) return false;
111  if (myGenValleyEdges != src.myGenValleyEdges) return false;
112  if (myValleyEdges != src.myValleyEdges) return false;
113 
114  return true;
115  }
116  bool operator!=(const SOP_WatershedParms &src) const
117  {
118  return !operator==(src);
119  }
122 
123 
124 
125  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
126  {
127  myGroup = ""_UTsh;
128  if (true)
129  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
130  mySrcAttrib = "P"_UTsh;
131  if (true)
132  graph->evalOpParm(mySrcAttrib, nodeidx, "srcattrib", time, 0);
133  mySrcComp = 0;
134  if (true)
135  graph->evalOpParm(mySrcComp, nodeidx, "srccomp", time, 0);
136  myCellStructure = 0;
137  if (true)
138  graph->evalOpParm(myCellStructure, nodeidx, "cellstructure", time, 0);
139  myThreshold = 0;
140  if (true)
141  graph->evalOpParm(myThreshold, nodeidx, "threshold", time, 0);
142  myGenMinima = false;
143  if (true)
144  graph->evalOpParm(myGenMinima, nodeidx, "genminima", time, 0);
145  myMinima = "minima"_UTsh;
146  if (true && ( (true&&!(((getGenMinima()==0)))) ) )
147  graph->evalOpParm(myMinima, nodeidx, "minima", time, 0);
148  myGenMaxima = false;
149  if (true)
150  graph->evalOpParm(myGenMaxima, nodeidx, "genmaxima", time, 0);
151  myMaxima = "maxima"_UTsh;
152  if (true && ( (true&&!(((getGenMaxima()==0)))) ) )
153  graph->evalOpParm(myMaxima, nodeidx, "maxima", time, 0);
154  myGenSaddleEdges = false;
155  if (true)
156  graph->evalOpParm(myGenSaddleEdges, nodeidx, "gensaddleedges", time, 0);
157  mySaddleEdges = "valleys"_UTsh;
158  if (true && ( (true&&!(((getGenSaddleEdges()==0)))) ) )
159  graph->evalOpParm(mySaddleEdges, nodeidx, "saddleedges", time, 0);
160  myGenRidgeEdges = false;
161  if (true)
162  graph->evalOpParm(myGenRidgeEdges, nodeidx, "genridgeedges", time, 0);
163  myRidgeEdges = "ridges"_UTsh;
164  if (true && ( (true&&!(((getGenRidgeEdges()==0)))) ) )
165  graph->evalOpParm(myRidgeEdges, nodeidx, "ridgeedges", time, 0);
166  myGenValleyEdges = false;
167  if (true)
168  graph->evalOpParm(myGenValleyEdges, nodeidx, "genvalleyedges", time, 0);
169  myValleyEdges = "valleys"_UTsh;
170  if (true && ( (true&&!(((getGenValleyEdges()==0)))) ) )
171  graph->evalOpParm(myValleyEdges, nodeidx, "valleyedges", time, 0);
172 
173  }
174 
175 
176  void loadFromOpSubclass(const LoadParms &loadparms) override
177  {
178  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
179  }
180 
181 
182  void copyFrom(const OP_NodeParms *src) override
183  {
184  *this = *((const SOP_WatershedParms *)src);
185  }
186 
187  template <typename T>
188  void
189  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
190  {
191  if (idx.size() < 1)
192  return;
193  UT_ASSERT(idx.size() == instance.size()+1);
194  if (idx.size() != instance.size()+1)
195  return;
196  switch (idx[0])
197  {
198  case 0:
199  coerceValue(value, myGroup);
200  break;
201  case 1:
202  coerceValue(value, mySrcAttrib);
203  break;
204  case 2:
205  coerceValue(value, mySrcComp);
206  break;
207  case 3:
208  coerceValue(value, myCellStructure);
209  break;
210  case 4:
211  coerceValue(value, myThreshold);
212  break;
213  case 5:
214  coerceValue(value, myGenMinima);
215  break;
216  case 6:
217  coerceValue(value, myMinima);
218  break;
219  case 7:
220  coerceValue(value, myGenMaxima);
221  break;
222  case 8:
223  coerceValue(value, myMaxima);
224  break;
225  case 9:
226  coerceValue(value, myGenSaddleEdges);
227  break;
228  case 10:
229  coerceValue(value, mySaddleEdges);
230  break;
231  case 11:
232  coerceValue(value, myGenRidgeEdges);
233  break;
234  case 12:
235  coerceValue(value, myRidgeEdges);
236  break;
237  case 13:
238  coerceValue(value, myGenValleyEdges);
239  break;
240  case 14:
241  coerceValue(value, myValleyEdges);
242  break;
243 
244  }
245  }
246 
247  bool isParmColorRamp(exint idx) const override
248  {
249  switch (idx)
250  {
251 
252  }
253  return false;
254  }
255 
256  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
257  { doGetParmValue(idx, instance, value); }
258  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
259  { doGetParmValue(idx, instance, value); }
260  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
261  { doGetParmValue(idx, instance, value); }
262  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
263  { doGetParmValue(idx, instance, value); }
264  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
265  { doGetParmValue(idx, instance, value); }
266  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
267  { doGetParmValue(idx, instance, value); }
268  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
269  { doGetParmValue(idx, instance, value); }
270  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
271  { doGetParmValue(idx, instance, value); }
272  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
273  { doGetParmValue(idx, instance, value); }
274  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
275  { doGetParmValue(idx, instance, value); }
276  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
277  { doGetParmValue(idx, instance, value); }
278 
279  template <typename T>
280  void
281  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
282  {
283  if (idx.size() < 1)
284  return;
285  UT_ASSERT(idx.size() == instance.size()+1);
286  if (idx.size() != instance.size()+1)
287  return;
288  switch (idx[0])
289  {
290  case 0:
291  coerceValue(myGroup, ( ( value ) ));
292  break;
293  case 1:
294  coerceValue(mySrcAttrib, ( ( value ) ));
295  break;
296  case 2:
297  coerceValue(mySrcComp, clampMinValue(0, clampMaxValue(2, value ) ));
298  break;
299  case 3:
300  coerceValue(myCellStructure, clampMinValue(0, clampMaxValue(1, value ) ));
301  break;
302  case 4:
303  coerceValue(myThreshold, ( ( value ) ));
304  break;
305  case 5:
306  coerceValue(myGenMinima, ( ( value ) ));
307  break;
308  case 6:
309  coerceValue(myMinima, ( ( value ) ));
310  break;
311  case 7:
312  coerceValue(myGenMaxima, ( ( value ) ));
313  break;
314  case 8:
315  coerceValue(myMaxima, ( ( value ) ));
316  break;
317  case 9:
318  coerceValue(myGenSaddleEdges, ( ( value ) ));
319  break;
320  case 10:
321  coerceValue(mySaddleEdges, ( ( value ) ));
322  break;
323  case 11:
324  coerceValue(myGenRidgeEdges, ( ( value ) ));
325  break;
326  case 12:
327  coerceValue(myRidgeEdges, ( ( value ) ));
328  break;
329  case 13:
330  coerceValue(myGenValleyEdges, ( ( value ) ));
331  break;
332  case 14:
333  coerceValue(myValleyEdges, ( ( 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 15;
366  switch (idx[0])
367  {
368 
369  }
370  // Invalid
371  return 0;
372  }
373 
374  const char *getNestParmName(TempIndex fieldnum) const override
375  {
376  if (fieldnum.size() < 1)
377  return 0;
378  switch (fieldnum[0])
379  {
380  case 0:
381  return "group";
382  case 1:
383  return "srcattrib";
384  case 2:
385  return "srccomp";
386  case 3:
387  return "cellstructure";
388  case 4:
389  return "threshold";
390  case 5:
391  return "genminima";
392  case 6:
393  return "minima";
394  case 7:
395  return "genmaxima";
396  case 8:
397  return "maxima";
398  case 9:
399  return "gensaddleedges";
400  case 10:
401  return "saddleedges";
402  case 11:
403  return "genridgeedges";
404  case 12:
405  return "ridgeedges";
406  case 13:
407  return "genvalleyedges";
408  case 14:
409  return "valleyedges";
410 
411  }
412  return 0;
413  }
414 
415  ParmType getNestParmType(TempIndex fieldnum) const override
416  {
417  if (fieldnum.size() < 1)
418  return PARM_UNSUPPORTED;
419  switch (fieldnum[0])
420  {
421  case 0:
422  return PARM_STRING;
423  case 1:
424  return PARM_STRING;
425  case 2:
426  return PARM_INTEGER;
427  case 3:
428  return PARM_INTEGER;
429  case 4:
430  return PARM_FLOAT;
431  case 5:
432  return PARM_INTEGER;
433  case 6:
434  return PARM_STRING;
435  case 7:
436  return PARM_INTEGER;
437  case 8:
438  return PARM_STRING;
439  case 9:
440  return PARM_INTEGER;
441  case 10:
442  return PARM_STRING;
443  case 11:
444  return PARM_INTEGER;
445  case 12:
446  return PARM_STRING;
447  case 13:
448  return PARM_INTEGER;
449  case 14:
450  return PARM_STRING;
451 
452  }
453  return PARM_UNSUPPORTED;
454  }
455 
456  // Boiler plate to load individual types.
457  static void loadData(UT_IStream &is, int64 &v)
458  { is.bread(&v, 1); }
459  static void loadData(UT_IStream &is, bool &v)
460  { int64 iv; is.bread(&iv, 1); v = iv; }
461  static void loadData(UT_IStream &is, fpreal64 &v)
462  { is.bread<fpreal64>(&v, 1); }
463  static void loadData(UT_IStream &is, UT_Vector2D &v)
464  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
465  static void loadData(UT_IStream &is, UT_Vector3D &v)
466  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
467  is.bread<fpreal64>(&v.z(), 1); }
468  static void loadData(UT_IStream &is, UT_Vector4D &v)
469  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
470  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
471  static void loadData(UT_IStream &is, UT_Matrix2D &v)
472  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
473  static void loadData(UT_IStream &is, UT_Matrix3D &v)
474  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
475  static void loadData(UT_IStream &is, UT_Matrix4D &v)
476  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
477  static void loadData(UT_IStream &is, UT_Vector2I &v)
478  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
479  static void loadData(UT_IStream &is, UT_Vector3I &v)
480  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
481  is.bread<int64>(&v.z(), 1); }
482  static void loadData(UT_IStream &is, UT_Vector4I &v)
483  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
484  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
486  { is.bread(v); }
488  { UT_StringHolder rampdata;
489  loadData(is, rampdata);
490  if (rampdata.isstring())
491  {
492  v.reset(new UT_Ramp());
493  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
494  v->load(istr);
495  }
496  else v.reset();
497  }
500  loadData(is, data);
501  if (data.isstring())
502  {
503  // Find the data type.
504  const char *colon = UT_StringWrap(data).findChar(':');
505  if (colon)
506  {
507  int typelen = colon - data.buffer();
509  type.strncpy(data.buffer(), typelen);
510  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
511 
512  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
513  }
514  }
515  else v.reset();
516  }
517 
518  static void saveData(std::ostream &os, int64 v)
519  { UTwrite(os, &v); }
520  static void saveData(std::ostream &os, bool v)
521  { int64 iv = v; UTwrite(os, &iv); }
522  static void saveData(std::ostream &os, fpreal64 v)
523  { UTwrite<fpreal64>(os, &v); }
524  static void saveData(std::ostream &os, UT_Vector2D v)
525  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
526  static void saveData(std::ostream &os, UT_Vector3D v)
527  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
528  UTwrite<fpreal64>(os, &v.z()); }
529  static void saveData(std::ostream &os, UT_Vector4D v)
530  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
531  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
532  static void saveData(std::ostream &os, UT_Matrix2D v)
534  static void saveData(std::ostream &os, UT_Matrix3D v)
536  static void saveData(std::ostream &os, UT_Matrix4D v)
538  static void saveData(std::ostream &os, UT_StringHolder s)
539  { UT_StringWrap(s).saveBinary(os); }
540  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
542  UT_OStringStream ostr;
543  if (s) s->save(ostr);
544  result = ostr.str();
545  saveData(os, result);
546  }
547  static void saveData(std::ostream &os, PRM_DataItemHandle s)
549  UT_OStringStream ostr;
550  if (s)
551  {
552  ostr << s->getDataTypeToken();
553  ostr << ":";
554  s->saveBinary(ostr);
555  }
556  result = ostr.str();
557  saveData(os, result);
558  }
559 
560 
561  void save(std::ostream &os) const
562  {
563  int32 v = version();
564  UTwrite(os, &v);
565  saveData(os, myGroup);
566  saveData(os, mySrcAttrib);
567  saveData(os, mySrcComp);
568  saveData(os, myCellStructure);
569  saveData(os, myThreshold);
570  saveData(os, myGenMinima);
571  saveData(os, myMinima);
572  saveData(os, myGenMaxima);
573  saveData(os, myMaxima);
574  saveData(os, myGenSaddleEdges);
575  saveData(os, mySaddleEdges);
576  saveData(os, myGenRidgeEdges);
577  saveData(os, myRidgeEdges);
578  saveData(os, myGenValleyEdges);
579  saveData(os, myValleyEdges);
580 
581  }
582 
583  bool load(UT_IStream &is)
584  {
585  int32 v;
586  is.bread(&v, 1);
587  if (version() != v)
588  {
589  // Fail incompatible versions
590  return false;
591  }
592  loadData(is, myGroup);
593  loadData(is, mySrcAttrib);
594  loadData(is, mySrcComp);
595  loadData(is, myCellStructure);
596  loadData(is, myThreshold);
597  loadData(is, myGenMinima);
598  loadData(is, myMinima);
599  loadData(is, myGenMaxima);
600  loadData(is, myMaxima);
601  loadData(is, myGenSaddleEdges);
602  loadData(is, mySaddleEdges);
603  loadData(is, myGenRidgeEdges);
604  loadData(is, myRidgeEdges);
605  loadData(is, myGenValleyEdges);
606  loadData(is, myValleyEdges);
607 
608  return true;
609  }
610 
611  const UT_StringHolder & getGroup() const { return myGroup; }
612  void setGroup(const UT_StringHolder & val) { myGroup = val; }
614  {
615  SOP_Node *thissop = cookparms.getNode();
616  if (!thissop) return getGroup();
618  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
619  return result;
620  }
621  const UT_StringHolder & getSrcAttrib() const { return mySrcAttrib; }
622  void setSrcAttrib(const UT_StringHolder & val) { mySrcAttrib = val; }
624  {
625  SOP_Node *thissop = cookparms.getNode();
626  if (!thissop) return getSrcAttrib();
628  OP_Utils::evalOpParm(result, thissop, "srcattrib", cookparms.getCookTime(), 0);
629  return result;
630  }
631  SrcComp getSrcComp() const { return SrcComp(mySrcComp); }
632  void setSrcComp(SrcComp val) { mySrcComp = int64(val); }
633  SrcComp opSrcComp(const SOP_NodeVerb::CookParms &cookparms) const
634  {
635  SOP_Node *thissop = cookparms.getNode();
636  if (!thissop) return getSrcComp();
637  int64 result;
638  OP_Utils::evalOpParm(result, thissop, "srccomp", cookparms.getCookTime(), 0);
639  return SrcComp(result);
640  }
641  CellStructure getCellStructure() const { return CellStructure(myCellStructure); }
642  void setCellStructure(CellStructure val) { myCellStructure = int64(val); }
644  {
645  SOP_Node *thissop = cookparms.getNode();
646  if (!thissop) return getCellStructure();
647  int64 result;
648  OP_Utils::evalOpParm(result, thissop, "cellstructure", cookparms.getCookTime(), 0);
649  return CellStructure(result);
650  }
651  fpreal64 getThreshold() const { return myThreshold; }
652  void setThreshold(fpreal64 val) { myThreshold = val; }
654  {
655  SOP_Node *thissop = cookparms.getNode();
656  if (!thissop) return getThreshold();
658  OP_Utils::evalOpParm(result, thissop, "threshold", cookparms.getCookTime(), 0);
659  return result;
660  }
661  bool getGenMinima() const { return myGenMinima; }
662  void setGenMinima(bool val) { myGenMinima = val; }
663  bool opGenMinima(const SOP_NodeVerb::CookParms &cookparms) const
664  {
665  SOP_Node *thissop = cookparms.getNode();
666  if (!thissop) return getGenMinima();
667  bool result;
668  OP_Utils::evalOpParm(result, thissop, "genminima", cookparms.getCookTime(), 0);
669  return result;
670  }
671  const UT_StringHolder & getMinima() const { return myMinima; }
672  void setMinima(const UT_StringHolder & val) { myMinima = val; }
674  {
675  SOP_Node *thissop = cookparms.getNode();
676  if (!thissop) return getMinima();
678  OP_Utils::evalOpParm(result, thissop, "minima", cookparms.getCookTime(), 0);
679  return result;
680  }
681  bool getGenMaxima() const { return myGenMaxima; }
682  void setGenMaxima(bool val) { myGenMaxima = val; }
683  bool opGenMaxima(const SOP_NodeVerb::CookParms &cookparms) const
684  {
685  SOP_Node *thissop = cookparms.getNode();
686  if (!thissop) return getGenMaxima();
687  bool result;
688  OP_Utils::evalOpParm(result, thissop, "genmaxima", cookparms.getCookTime(), 0);
689  return result;
690  }
691  const UT_StringHolder & getMaxima() const { return myMaxima; }
692  void setMaxima(const UT_StringHolder & val) { myMaxima = val; }
694  {
695  SOP_Node *thissop = cookparms.getNode();
696  if (!thissop) return getMaxima();
698  OP_Utils::evalOpParm(result, thissop, "maxima", cookparms.getCookTime(), 0);
699  return result;
700  }
701  bool getGenSaddleEdges() const { return myGenSaddleEdges; }
702  void setGenSaddleEdges(bool val) { myGenSaddleEdges = val; }
703  bool opGenSaddleEdges(const SOP_NodeVerb::CookParms &cookparms) const
704  {
705  SOP_Node *thissop = cookparms.getNode();
706  if (!thissop) return getGenSaddleEdges();
707  bool result;
708  OP_Utils::evalOpParm(result, thissop, "gensaddleedges", cookparms.getCookTime(), 0);
709  return result;
710  }
711  const UT_StringHolder & getSaddleEdges() const { return mySaddleEdges; }
712  void setSaddleEdges(const UT_StringHolder & val) { mySaddleEdges = val; }
714  {
715  SOP_Node *thissop = cookparms.getNode();
716  if (!thissop) return getSaddleEdges();
718  OP_Utils::evalOpParm(result, thissop, "saddleedges", cookparms.getCookTime(), 0);
719  return result;
720  }
721  bool getGenRidgeEdges() const { return myGenRidgeEdges; }
722  void setGenRidgeEdges(bool val) { myGenRidgeEdges = val; }
723  bool opGenRidgeEdges(const SOP_NodeVerb::CookParms &cookparms) const
724  {
725  SOP_Node *thissop = cookparms.getNode();
726  if (!thissop) return getGenRidgeEdges();
727  bool result;
728  OP_Utils::evalOpParm(result, thissop, "genridgeedges", cookparms.getCookTime(), 0);
729  return result;
730  }
731  const UT_StringHolder & getRidgeEdges() const { return myRidgeEdges; }
732  void setRidgeEdges(const UT_StringHolder & val) { myRidgeEdges = val; }
734  {
735  SOP_Node *thissop = cookparms.getNode();
736  if (!thissop) return getRidgeEdges();
738  OP_Utils::evalOpParm(result, thissop, "ridgeedges", cookparms.getCookTime(), 0);
739  return result;
740  }
741  bool getGenValleyEdges() const { return myGenValleyEdges; }
742  void setGenValleyEdges(bool val) { myGenValleyEdges = val; }
743  bool opGenValleyEdges(const SOP_NodeVerb::CookParms &cookparms) const
744  {
745  SOP_Node *thissop = cookparms.getNode();
746  if (!thissop) return getGenValleyEdges();
747  bool result;
748  OP_Utils::evalOpParm(result, thissop, "genvalleyedges", cookparms.getCookTime(), 0);
749  return result;
750  }
751  const UT_StringHolder & getValleyEdges() const { return myValleyEdges; }
752  void setValleyEdges(const UT_StringHolder & val) { myValleyEdges = val; }
754  {
755  SOP_Node *thissop = cookparms.getNode();
756  if (!thissop) return getValleyEdges();
758  OP_Utils::evalOpParm(result, thissop, "valleyedges", cookparms.getCookTime(), 0);
759  return result;
760  }
761 
762 private:
763  UT_StringHolder myGroup;
764  UT_StringHolder mySrcAttrib;
765  int64 mySrcComp;
766  int64 myCellStructure;
767  fpreal64 myThreshold;
768  bool myGenMinima;
769  UT_StringHolder myMinima;
770  bool myGenMaxima;
771  UT_StringHolder myMaxima;
772  bool myGenSaddleEdges;
773  UT_StringHolder mySaddleEdges;
774  bool myGenRidgeEdges;
775  UT_StringHolder myRidgeEdges;
776  bool myGenValleyEdges;
777  UT_StringHolder myValleyEdges;
778 
779 };
void setMaxima(const UT_StringHolder &val)
UT_StringHolder opRidgeEdges(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
int int32
Definition: SYS_Types.h:39
SOP_Node * getNode() const
Definition: SOP_NodeVerb.h:347
CellStructure opCellStructure(const SOP_NodeVerb::CookParms &cookparms) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
bool getGenSaddleEdges() const
static void loadData(UT_IStream &is, int64 &v)
void setMinima(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void save(std::ostream &os) const
bool load(UT_IStream &is)
exint bread(int32 *buffer, exint asize=1)
GLboolean * data
Definition: glcorearb.h:131
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
void setThreshold(fpreal64 val)
const UT_StringHolder & getSaddleEdges() const
UT_StringHolder opMaxima(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
Definition: OP_NodeParms.h:97
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
bool opGenMinima(const SOP_NodeVerb::CookParms &cookparms) const
GLdouble s
Definition: glad.h:3009
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, bool &v)
**But if you need a result
Definition: thread.h:613
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
exint nodeIdx() const
Definition: OP_NodeParms.h:95
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
void setGenSaddleEdges(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector4.h:491
const UT_StringHolder & getSrcAttrib() const
bool getGenMaxima() const
bool getGenValleyEdges() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool operator==(const SOP_WatershedParms &src) const
double fpreal64
Definition: SYS_Types.h:201
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector2.h:423
bool opGenValleyEdges(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
void setSrcComp(SrcComp val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
CellStructure getCellStructure() const
bool operator!=(const SOP_WatershedParms &src) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_StringHolder s)
bool getGenMinima() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const UT_StringHolder & getMinima() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setGenMinima(bool val)
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, fpreal64 &v)
UT_StringHolder opSaddleEdges(const SOP_NodeVerb::CookParms &cookparms) const
exint length() const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
Definition: UT_Vector4.h:495
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
bool opGenMaxima(const SOP_NodeVerb::CookParms &cookparms) const
SrcComp getSrcComp() const
const OP_GraphProxy * graph() const
Definition: OP_NodeParms.h:94
void setRidgeEdges(const UT_StringHolder &val)
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setGenMaxima(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
long long int64
Definition: SYS_Types.h:116
void loadFromOpSubclass(const LoadParms &loadparms) override
static void saveData(std::ostream &os, fpreal64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
fpreal64 getThreshold() const
void setValleyEdges(const UT_StringHolder &val)
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
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const char * getNestParmName(TempIndex fieldnum) const override
void setCellStructure(CellStructure val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
Definition: UT_String.h:296
static void saveData(std::ostream &os, int64 v)
void setSaddleEdges(const UT_StringHolder &val)
void setGenValleyEdges(bool val)
GT_API const UT_StringHolder version
void setSrcAttrib(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
fpreal64 fpreal
Definition: SYS_Types.h:277
static void loadData(UT_IStream &is, UT_Vector2D &v)
DEP_MicroNode * depnode() const
Definition: OP_NodeParms.h:99
const UT_StringHolder & getMaxima() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
Definition: UT_Ramp.h:92
const UT_StringHolder & getGroup() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
constexpr SYS_FORCE_INLINE T & w() noexcept
Definition: UT_Vector4.h:497
fpreal64 opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
GLuint GLfloat * val
Definition: glcorearb.h:1608
UT_StringHolder opValleyEdges(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getValleyEdges() const
#define SOP_API
Definition: SOP_API.h:10
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
const UT_StringHolder & getRidgeEdges() const
fpreal getCookTime() const
Definition: SOP_NodeVerb.h:361
bool opGenSaddleEdges(const SOP_NodeVerb::CookParms &cookparms) const
SrcComp opSrcComp(const SOP_NodeVerb::CookParms &cookparms) const
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 loadData(UT_IStream &is, UT_Vector4D &v)
bool opGenRidgeEdges(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool getGenRidgeEdges() const
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector3.h:665
static void saveData(std::ostream &os, UT_Vector2D v)
type
Definition: core.h:1059
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
UT_StringHolder opSrcAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setGenRidgeEdges(bool val)
SYS_FORCE_INLINE UT_StringHolder getToken(SrcComp enum_value)
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setGroup(const UT_StringHolder &val)
ParmType getNestParmType(TempIndex fieldnum) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
Definition: PRM_Parm.h:97
constexpr SYS_FORCE_INLINE T & y() noexcept
Definition: UT_Vector2.h:425
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_StringHolder opMinima(const SOP_NodeVerb::CookParms &cookparms) const
GLenum src
Definition: glcorearb.h:1793
constexpr SYS_FORCE_INLINE T & x() noexcept
Definition: UT_Vector3.h:663