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