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