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  enum class CellStructure
32  {
33  MINPTMAXPOLY = 0,
35  };
36 }
37 
38 
40 {
41 public:
42  static int version() { return 1; }
43 
45  {
46  myGroup = ""_UTsh;
47  mySrcAttrib = "P"_UTsh;
48  mySrcComp = 0;
49  myCellStructure = 0;
50  myThreshold = 0;
51  myGenMinima = false;
52  myMinima = "minima"_UTsh;
53  myGenMaxima = false;
54  myMaxima = "maxima"_UTsh;
55  myGenSaddleEdges = false;
56  mySaddleEdges = "valleys"_UTsh;
57  myGenRidgeEdges = false;
58  myRidgeEdges = "ridges"_UTsh;
59  myGenValleyEdges = false;
60  myValleyEdges = "valleys"_UTsh;
61 
62  }
63 
64  explicit SOP_WatershedParms(const SOP_WatershedParms &) = default;
66  SOP_WatershedParms(SOP_WatershedParms &&) noexcept = default;
67  SOP_WatershedParms &operator=(SOP_WatershedParms &&) noexcept = default;
68 
69  ~SOP_WatershedParms() override {}
70 
71  bool operator==(const SOP_WatershedParms &src) const
72  {
73  if (myGroup != src.myGroup) return false;
74  if (mySrcAttrib != src.mySrcAttrib) return false;
75  if (mySrcComp != src.mySrcComp) return false;
76  if (myCellStructure != src.myCellStructure) return false;
77  if (myThreshold != src.myThreshold) return false;
78  if (myGenMinima != src.myGenMinima) return false;
79  if (myMinima != src.myMinima) return false;
80  if (myGenMaxima != src.myGenMaxima) return false;
81  if (myMaxima != src.myMaxima) return false;
82  if (myGenSaddleEdges != src.myGenSaddleEdges) return false;
83  if (mySaddleEdges != src.mySaddleEdges) return false;
84  if (myGenRidgeEdges != src.myGenRidgeEdges) return false;
85  if (myRidgeEdges != src.myRidgeEdges) return false;
86  if (myGenValleyEdges != src.myGenValleyEdges) return false;
87  if (myValleyEdges != src.myValleyEdges) return false;
88 
89  return true;
90  }
91  bool operator!=(const SOP_WatershedParms &src) const
92  {
93  return !operator==(src);
94  }
97 
98 
99 
100  void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
101  {
102  myGroup = ""_UTsh;
103  if (true)
104  graph->evalOpParm(myGroup, nodeidx, "group", time, 0);
105  mySrcAttrib = "P"_UTsh;
106  if (true)
107  graph->evalOpParm(mySrcAttrib, nodeidx, "srcattrib", time, 0);
108  mySrcComp = 0;
109  if (true)
110  graph->evalOpParm(mySrcComp, nodeidx, "srccomp", time, 0);
111  myCellStructure = 0;
112  if (true)
113  graph->evalOpParm(myCellStructure, nodeidx, "cellstructure", time, 0);
114  myThreshold = 0;
115  if (true)
116  graph->evalOpParm(myThreshold, nodeidx, "threshold", time, 0);
117  myGenMinima = false;
118  if (true)
119  graph->evalOpParm(myGenMinima, nodeidx, "genminima", time, 0);
120  myMinima = "minima"_UTsh;
121  if (true && ( (true&&!(((getGenMinima()==0)))) ) )
122  graph->evalOpParm(myMinima, nodeidx, "minima", time, 0);
123  myGenMaxima = false;
124  if (true)
125  graph->evalOpParm(myGenMaxima, nodeidx, "genmaxima", time, 0);
126  myMaxima = "maxima"_UTsh;
127  if (true && ( (true&&!(((getGenMaxima()==0)))) ) )
128  graph->evalOpParm(myMaxima, nodeidx, "maxima", time, 0);
129  myGenSaddleEdges = false;
130  if (true)
131  graph->evalOpParm(myGenSaddleEdges, nodeidx, "gensaddleedges", time, 0);
132  mySaddleEdges = "valleys"_UTsh;
133  if (true && ( (true&&!(((getGenSaddleEdges()==0)))) ) )
134  graph->evalOpParm(mySaddleEdges, nodeidx, "saddleedges", time, 0);
135  myGenRidgeEdges = false;
136  if (true)
137  graph->evalOpParm(myGenRidgeEdges, nodeidx, "genridgeedges", time, 0);
138  myRidgeEdges = "ridges"_UTsh;
139  if (true && ( (true&&!(((getGenRidgeEdges()==0)))) ) )
140  graph->evalOpParm(myRidgeEdges, nodeidx, "ridgeedges", time, 0);
141  myGenValleyEdges = false;
142  if (true)
143  graph->evalOpParm(myGenValleyEdges, nodeidx, "genvalleyedges", time, 0);
144  myValleyEdges = "valleys"_UTsh;
145  if (true && ( (true&&!(((getGenValleyEdges()==0)))) ) )
146  graph->evalOpParm(myValleyEdges, nodeidx, "valleyedges", time, 0);
147 
148  }
149 
150 
151  void loadFromOpSubclass(const LoadParms &loadparms) override
152  {
153  buildFromOp(loadparms.graph(), loadparms.nodeIdx(), loadparms.context().getTime(), loadparms.depnode());
154  }
155 
156 
157  void copyFrom(const OP_NodeParms *src) override
158  {
159  *this = *((const SOP_WatershedParms *)src);
160  }
161 
162  template <typename T>
163  void
164  doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
165  {
166  if (idx.size() < 1)
167  return;
168  UT_ASSERT(idx.size() == instance.size()+1);
169  if (idx.size() != instance.size()+1)
170  return;
171  switch (idx[0])
172  {
173  case 0:
174  coerceValue(value, myGroup);
175  break;
176  case 1:
177  coerceValue(value, mySrcAttrib);
178  break;
179  case 2:
180  coerceValue(value, mySrcComp);
181  break;
182  case 3:
183  coerceValue(value, myCellStructure);
184  break;
185  case 4:
186  coerceValue(value, myThreshold);
187  break;
188  case 5:
189  coerceValue(value, myGenMinima);
190  break;
191  case 6:
192  coerceValue(value, myMinima);
193  break;
194  case 7:
195  coerceValue(value, myGenMaxima);
196  break;
197  case 8:
198  coerceValue(value, myMaxima);
199  break;
200  case 9:
201  coerceValue(value, myGenSaddleEdges);
202  break;
203  case 10:
204  coerceValue(value, mySaddleEdges);
205  break;
206  case 11:
207  coerceValue(value, myGenRidgeEdges);
208  break;
209  case 12:
210  coerceValue(value, myRidgeEdges);
211  break;
212  case 13:
213  coerceValue(value, myGenValleyEdges);
214  break;
215  case 14:
216  coerceValue(value, myValleyEdges);
217  break;
218 
219  }
220  }
221 
222  bool isParmColorRamp(exint idx) const override
223  {
224  switch (idx)
225  {
226 
227  }
228  return false;
229  }
230 
231  void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
232  { doGetParmValue(idx, instance, value); }
233  void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
234  { doGetParmValue(idx, instance, value); }
235  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
236  { doGetParmValue(idx, instance, value); }
237  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
238  { doGetParmValue(idx, instance, value); }
239  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
240  { doGetParmValue(idx, instance, value); }
241  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
242  { doGetParmValue(idx, instance, value); }
243  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
244  { doGetParmValue(idx, instance, value); }
245  void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
246  { doGetParmValue(idx, instance, value); }
247  void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
248  { doGetParmValue(idx, instance, value); }
249  void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr<UT_Ramp> &value) const override
250  { doGetParmValue(idx, instance, value); }
251  void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
252  { doGetParmValue(idx, instance, value); }
253 
254  template <typename T>
255  void
256  doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
257  {
258  if (idx.size() < 1)
259  return;
260  UT_ASSERT(idx.size() == instance.size()+1);
261  if (idx.size() != instance.size()+1)
262  return;
263  switch (idx[0])
264  {
265  case 0:
266  coerceValue(myGroup, ( ( value ) ));
267  break;
268  case 1:
269  coerceValue(mySrcAttrib, ( ( value ) ));
270  break;
271  case 2:
272  coerceValue(mySrcComp, clampMinValue(0, clampMaxValue(2, value ) ));
273  break;
274  case 3:
275  coerceValue(myCellStructure, clampMinValue(0, clampMaxValue(1, value ) ));
276  break;
277  case 4:
278  coerceValue(myThreshold, ( ( value ) ));
279  break;
280  case 5:
281  coerceValue(myGenMinima, ( ( value ) ));
282  break;
283  case 6:
284  coerceValue(myMinima, ( ( value ) ));
285  break;
286  case 7:
287  coerceValue(myGenMaxima, ( ( value ) ));
288  break;
289  case 8:
290  coerceValue(myMaxima, ( ( value ) ));
291  break;
292  case 9:
293  coerceValue(myGenSaddleEdges, ( ( value ) ));
294  break;
295  case 10:
296  coerceValue(mySaddleEdges, ( ( value ) ));
297  break;
298  case 11:
299  coerceValue(myGenRidgeEdges, ( ( value ) ));
300  break;
301  case 12:
302  coerceValue(myRidgeEdges, ( ( value ) ));
303  break;
304  case 13:
305  coerceValue(myGenValleyEdges, ( ( value ) ));
306  break;
307  case 14:
308  coerceValue(myValleyEdges, ( ( value ) ));
309  break;
310 
311  }
312  }
313 
314  void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
315  { doSetParmValue(idx, instance, value); }
316  void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
317  { doSetParmValue(idx, instance, value); }
318  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
319  { doSetParmValue(idx, instance, value); }
320  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
321  { doSetParmValue(idx, instance, value); }
322  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
323  { doSetParmValue(idx, instance, value); }
324  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
325  { doSetParmValue(idx, instance, value); }
326  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
327  { doSetParmValue(idx, instance, value); }
328  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
329  { doSetParmValue(idx, instance, value); }
330  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
331  { doSetParmValue(idx, instance, value); }
332  void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr<UT_Ramp> &value) override
333  { doSetParmValue(idx, instance, value); }
334  void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
335  { doSetParmValue(idx, instance, value); }
336 
337  exint getNestNumParms(TempIndex idx) const override
338  {
339  if (idx.size() == 0)
340  return 15;
341  switch (idx[0])
342  {
343 
344  }
345  // Invalid
346  return 0;
347  }
348 
349  const char *getNestParmName(TempIndex fieldnum) const override
350  {
351  if (fieldnum.size() < 1)
352  return 0;
353  switch (fieldnum[0])
354  {
355  case 0:
356  return "group";
357  case 1:
358  return "srcattrib";
359  case 2:
360  return "srccomp";
361  case 3:
362  return "cellstructure";
363  case 4:
364  return "threshold";
365  case 5:
366  return "genminima";
367  case 6:
368  return "minima";
369  case 7:
370  return "genmaxima";
371  case 8:
372  return "maxima";
373  case 9:
374  return "gensaddleedges";
375  case 10:
376  return "saddleedges";
377  case 11:
378  return "genridgeedges";
379  case 12:
380  return "ridgeedges";
381  case 13:
382  return "genvalleyedges";
383  case 14:
384  return "valleyedges";
385 
386  }
387  return 0;
388  }
389 
390  ParmType getNestParmType(TempIndex fieldnum) const override
391  {
392  if (fieldnum.size() < 1)
393  return PARM_UNSUPPORTED;
394  switch (fieldnum[0])
395  {
396  case 0:
397  return PARM_STRING;
398  case 1:
399  return PARM_STRING;
400  case 2:
401  return PARM_INTEGER;
402  case 3:
403  return PARM_INTEGER;
404  case 4:
405  return PARM_FLOAT;
406  case 5:
407  return PARM_INTEGER;
408  case 6:
409  return PARM_STRING;
410  case 7:
411  return PARM_INTEGER;
412  case 8:
413  return PARM_STRING;
414  case 9:
415  return PARM_INTEGER;
416  case 10:
417  return PARM_STRING;
418  case 11:
419  return PARM_INTEGER;
420  case 12:
421  return PARM_STRING;
422  case 13:
423  return PARM_INTEGER;
424  case 14:
425  return PARM_STRING;
426 
427  }
428  return PARM_UNSUPPORTED;
429  }
430 
431  // Boiler plate to load individual types.
432  static void loadData(UT_IStream &is, int64 &v)
433  { is.bread(&v, 1); }
434  static void loadData(UT_IStream &is, bool &v)
435  { int64 iv; is.bread(&iv, 1); v = iv; }
436  static void loadData(UT_IStream &is, fpreal64 &v)
437  { is.bread<fpreal64>(&v, 1); }
438  static void loadData(UT_IStream &is, UT_Vector2D &v)
439  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1); }
440  static void loadData(UT_IStream &is, UT_Vector3D &v)
441  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
442  is.bread<fpreal64>(&v.z(), 1); }
443  static void loadData(UT_IStream &is, UT_Vector4D &v)
444  { is.bread<fpreal64>(&v.x(), 1); is.bread<fpreal64>(&v.y(), 1);
445  is.bread<fpreal64>(&v.z(), 1); is.bread<fpreal64>(&v.w(), 1); }
446  static void loadData(UT_IStream &is, UT_Matrix2D &v)
447  { for (int r = 0; r < 2; r++) for (int c = 0; c < 2; c++) is.bread<fpreal64>(&v(r, c), 1); }
448  static void loadData(UT_IStream &is, UT_Matrix3D &v)
449  { for (int r = 0; r < 3; r++) for (int c = 0; c < 3; c++) is.bread<fpreal64>(&v(r, c), 1); }
450  static void loadData(UT_IStream &is, UT_Matrix4D &v)
451  { for (int r = 0; r < 4; r++) for (int c = 0; c < 4; c++) is.bread<fpreal64>(&v(r, c), 1); }
452  static void loadData(UT_IStream &is, UT_Vector2I &v)
453  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1); }
454  static void loadData(UT_IStream &is, UT_Vector3I &v)
455  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
456  is.bread<int64>(&v.z(), 1); }
457  static void loadData(UT_IStream &is, UT_Vector4I &v)
458  { is.bread<int64>(&v.x(), 1); is.bread<int64>(&v.y(), 1);
459  is.bread<int64>(&v.z(), 1); is.bread<int64>(&v.w(), 1); }
461  { is.bread(v); }
463  { UT_StringHolder rampdata;
464  loadData(is, rampdata);
465  if (rampdata.isstring())
466  {
467  v.reset(new UT_Ramp());
468  UT_IStream istr((const char *) rampdata, rampdata.length(), UT_ISTREAM_ASCII);
469  v->load(istr);
470  }
471  else v.reset();
472  }
475  loadData(is, data);
476  if (data.isstring())
477  {
478  // Find the data type.
479  const char *colon = UT_StringWrap(data).findChar(':');
480  if (colon)
481  {
482  int typelen = colon - data.buffer();
484  type.strncpy(data.buffer(), typelen);
485  UT_IStream istr(((const char *) data) + typelen + 1, data.length() - (typelen + 1), UT_ISTREAM_BINARY);
486 
487  v = PRM_DataFactory::parseBinary(type.buffer(), istr);
488  }
489  }
490  else v.reset();
491  }
492 
493  static void saveData(std::ostream &os, int64 v)
494  { UTwrite(os, &v); }
495  static void saveData(std::ostream &os, bool v)
496  { int64 iv = v; UTwrite(os, &iv); }
497  static void saveData(std::ostream &os, fpreal64 v)
498  { UTwrite<fpreal64>(os, &v); }
499  static void saveData(std::ostream &os, UT_Vector2D v)
500  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y()); }
501  static void saveData(std::ostream &os, UT_Vector3D v)
502  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
503  UTwrite<fpreal64>(os, &v.z()); }
504  static void saveData(std::ostream &os, UT_Vector4D v)
505  { UTwrite<fpreal64>(os, &v.x()); UTwrite<fpreal64>(os, &v.y());
506  UTwrite<fpreal64>(os, &v.z()); UTwrite<fpreal64>(os, &v.w()); }
507  static void saveData(std::ostream &os, UT_Matrix2D v)
509  static void saveData(std::ostream &os, UT_Matrix3D v)
511  static void saveData(std::ostream &os, UT_Matrix4D v)
513  static void saveData(std::ostream &os, UT_StringHolder s)
514  { UT_StringWrap(s).saveBinary(os); }
515  static void saveData(std::ostream &os, UT_SharedPtr<UT_Ramp> s)
517  UT_OStringStream ostr;
518  if (s) s->save(ostr);
519  result = ostr.str();
520  saveData(os, result);
521  }
522  static void saveData(std::ostream &os, PRM_DataItemHandle s)
524  UT_OStringStream ostr;
525  if (s)
526  {
527  ostr << s->getDataTypeToken();
528  ostr << ":";
529  s->saveBinary(ostr);
530  }
531  result = ostr.str();
532  saveData(os, result);
533  }
534 
535 
536  void save(std::ostream &os) const
537  {
538  int32 v = version();
539  UTwrite(os, &v);
540  saveData(os, myGroup);
541  saveData(os, mySrcAttrib);
542  saveData(os, mySrcComp);
543  saveData(os, myCellStructure);
544  saveData(os, myThreshold);
545  saveData(os, myGenMinima);
546  saveData(os, myMinima);
547  saveData(os, myGenMaxima);
548  saveData(os, myMaxima);
549  saveData(os, myGenSaddleEdges);
550  saveData(os, mySaddleEdges);
551  saveData(os, myGenRidgeEdges);
552  saveData(os, myRidgeEdges);
553  saveData(os, myGenValleyEdges);
554  saveData(os, myValleyEdges);
555 
556  }
557 
558  bool load(UT_IStream &is)
559  {
560  int32 v;
561  is.bread(&v, 1);
562  if (version() != v)
563  {
564  // Fail incompatible versions
565  return false;
566  }
567  loadData(is, myGroup);
568  loadData(is, mySrcAttrib);
569  loadData(is, mySrcComp);
570  loadData(is, myCellStructure);
571  loadData(is, myThreshold);
572  loadData(is, myGenMinima);
573  loadData(is, myMinima);
574  loadData(is, myGenMaxima);
575  loadData(is, myMaxima);
576  loadData(is, myGenSaddleEdges);
577  loadData(is, mySaddleEdges);
578  loadData(is, myGenRidgeEdges);
579  loadData(is, myRidgeEdges);
580  loadData(is, myGenValleyEdges);
581  loadData(is, myValleyEdges);
582 
583  return true;
584  }
585 
586  const UT_StringHolder & getGroup() const { return myGroup; }
587  void setGroup(const UT_StringHolder & val) { myGroup = val; }
589  {
590  SOP_Node *thissop = cookparms.getNode();
591  if (!thissop) return getGroup();
593  OP_Utils::evalOpParm(result, thissop, "group", cookparms.getCookTime(), 0);
594  return result;
595  }
596  const UT_StringHolder & getSrcAttrib() const { return mySrcAttrib; }
597  void setSrcAttrib(const UT_StringHolder & val) { mySrcAttrib = val; }
599  {
600  SOP_Node *thissop = cookparms.getNode();
601  if (!thissop) return getSrcAttrib();
603  OP_Utils::evalOpParm(result, thissop, "srcattrib", cookparms.getCookTime(), 0);
604  return result;
605  }
606  SrcComp getSrcComp() const { return SrcComp(mySrcComp); }
607  void setSrcComp(SrcComp val) { mySrcComp = int64(val); }
608  SrcComp opSrcComp(const SOP_NodeVerb::CookParms &cookparms) const
609  {
610  SOP_Node *thissop = cookparms.getNode();
611  if (!thissop) return getSrcComp();
612  int64 result;
613  OP_Utils::evalOpParm(result, thissop, "srccomp", cookparms.getCookTime(), 0);
614  return SrcComp(result);
615  }
616  CellStructure getCellStructure() const { return CellStructure(myCellStructure); }
617  void setCellStructure(CellStructure val) { myCellStructure = int64(val); }
619  {
620  SOP_Node *thissop = cookparms.getNode();
621  if (!thissop) return getCellStructure();
622  int64 result;
623  OP_Utils::evalOpParm(result, thissop, "cellstructure", cookparms.getCookTime(), 0);
624  return CellStructure(result);
625  }
626  fpreal64 getThreshold() const { return myThreshold; }
627  void setThreshold(fpreal64 val) { myThreshold = val; }
629  {
630  SOP_Node *thissop = cookparms.getNode();
631  if (!thissop) return getThreshold();
633  OP_Utils::evalOpParm(result, thissop, "threshold", cookparms.getCookTime(), 0);
634  return result;
635  }
636  bool getGenMinima() const { return myGenMinima; }
637  void setGenMinima(bool val) { myGenMinima = val; }
638  bool opGenMinima(const SOP_NodeVerb::CookParms &cookparms) const
639  {
640  SOP_Node *thissop = cookparms.getNode();
641  if (!thissop) return getGenMinima();
642  bool result;
643  OP_Utils::evalOpParm(result, thissop, "genminima", cookparms.getCookTime(), 0);
644  return result;
645  }
646  const UT_StringHolder & getMinima() const { return myMinima; }
647  void setMinima(const UT_StringHolder & val) { myMinima = val; }
649  {
650  SOP_Node *thissop = cookparms.getNode();
651  if (!thissop) return getMinima();
653  OP_Utils::evalOpParm(result, thissop, "minima", cookparms.getCookTime(), 0);
654  return result;
655  }
656  bool getGenMaxima() const { return myGenMaxima; }
657  void setGenMaxima(bool val) { myGenMaxima = val; }
658  bool opGenMaxima(const SOP_NodeVerb::CookParms &cookparms) const
659  {
660  SOP_Node *thissop = cookparms.getNode();
661  if (!thissop) return getGenMaxima();
662  bool result;
663  OP_Utils::evalOpParm(result, thissop, "genmaxima", cookparms.getCookTime(), 0);
664  return result;
665  }
666  const UT_StringHolder & getMaxima() const { return myMaxima; }
667  void setMaxima(const UT_StringHolder & val) { myMaxima = val; }
669  {
670  SOP_Node *thissop = cookparms.getNode();
671  if (!thissop) return getMaxima();
673  OP_Utils::evalOpParm(result, thissop, "maxima", cookparms.getCookTime(), 0);
674  return result;
675  }
676  bool getGenSaddleEdges() const { return myGenSaddleEdges; }
677  void setGenSaddleEdges(bool val) { myGenSaddleEdges = val; }
678  bool opGenSaddleEdges(const SOP_NodeVerb::CookParms &cookparms) const
679  {
680  SOP_Node *thissop = cookparms.getNode();
681  if (!thissop) return getGenSaddleEdges();
682  bool result;
683  OP_Utils::evalOpParm(result, thissop, "gensaddleedges", cookparms.getCookTime(), 0);
684  return result;
685  }
686  const UT_StringHolder & getSaddleEdges() const { return mySaddleEdges; }
687  void setSaddleEdges(const UT_StringHolder & val) { mySaddleEdges = val; }
689  {
690  SOP_Node *thissop = cookparms.getNode();
691  if (!thissop) return getSaddleEdges();
693  OP_Utils::evalOpParm(result, thissop, "saddleedges", cookparms.getCookTime(), 0);
694  return result;
695  }
696  bool getGenRidgeEdges() const { return myGenRidgeEdges; }
697  void setGenRidgeEdges(bool val) { myGenRidgeEdges = val; }
698  bool opGenRidgeEdges(const SOP_NodeVerb::CookParms &cookparms) const
699  {
700  SOP_Node *thissop = cookparms.getNode();
701  if (!thissop) return getGenRidgeEdges();
702  bool result;
703  OP_Utils::evalOpParm(result, thissop, "genridgeedges", cookparms.getCookTime(), 0);
704  return result;
705  }
706  const UT_StringHolder & getRidgeEdges() const { return myRidgeEdges; }
707  void setRidgeEdges(const UT_StringHolder & val) { myRidgeEdges = val; }
709  {
710  SOP_Node *thissop = cookparms.getNode();
711  if (!thissop) return getRidgeEdges();
713  OP_Utils::evalOpParm(result, thissop, "ridgeedges", cookparms.getCookTime(), 0);
714  return result;
715  }
716  bool getGenValleyEdges() const { return myGenValleyEdges; }
717  void setGenValleyEdges(bool val) { myGenValleyEdges = val; }
718  bool opGenValleyEdges(const SOP_NodeVerb::CookParms &cookparms) const
719  {
720  SOP_Node *thissop = cookparms.getNode();
721  if (!thissop) return getGenValleyEdges();
722  bool result;
723  OP_Utils::evalOpParm(result, thissop, "genvalleyedges", cookparms.getCookTime(), 0);
724  return result;
725  }
726  const UT_StringHolder & getValleyEdges() const { return myValleyEdges; }
727  void setValleyEdges(const UT_StringHolder & val) { myValleyEdges = val; }
729  {
730  SOP_Node *thissop = cookparms.getNode();
731  if (!thissop) return getValleyEdges();
733  OP_Utils::evalOpParm(result, thissop, "valleyedges", cookparms.getCookTime(), 0);
734  return result;
735  }
736 
737 private:
738  UT_StringHolder myGroup;
739  UT_StringHolder mySrcAttrib;
740  int64 mySrcComp;
741  int64 myCellStructure;
742  fpreal64 myThreshold;
743  bool myGenMinima;
744  UT_StringHolder myMinima;
745  bool myGenMaxima;
746  UT_StringHolder myMaxima;
747  bool myGenSaddleEdges;
748  UT_StringHolder mySaddleEdges;
749  bool myGenRidgeEdges;
750  UT_StringHolder myRidgeEdges;
751  bool myGenValleyEdges;
752  UT_StringHolder myValleyEdges;
753 
754 };
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)
T clampMaxValue(fpreal maxvalue, const T &src) const
Definition: OP_NodeParms.h:315
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
T clampMinValue(fpreal minvalue, const T &src) const
Definition: OP_NodeParms.h:308
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)
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 coerceValue(T &result, const S &src) const
Definition: OP_NodeParms.h:301
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
Utility class for containing a color ramp.
Definition: UT_Ramp.h:88
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:1385
#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)
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:89
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
OP_NodeParms & operator=(const OP_NodeParms &)=default
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