23 namespace SOP_WatershedEnums
47 mySrcAttrib =
"P"_UTsh;
52 myMinima =
"minima"_UTsh;
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;
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;
104 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
105 mySrcAttrib =
"P"_UTsh;
107 graph->
evalOpParm(mySrcAttrib, nodeidx,
"srcattrib", time, 0);
110 graph->
evalOpParm(mySrcComp, nodeidx,
"srccomp", time, 0);
113 graph->
evalOpParm(myCellStructure, nodeidx,
"cellstructure", time, 0);
116 graph->
evalOpParm(myThreshold, nodeidx,
"threshold", time, 0);
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);
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;
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;
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;
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);
162 template <
typename T>
169 if (idx.
size() != instance.
size()+1)
232 { doGetParmValue(idx, instance, value); }
234 { doGetParmValue(idx, instance, value); }
236 { doGetParmValue(idx, instance, value); }
238 { doGetParmValue(idx, instance, value); }
240 { doGetParmValue(idx, instance, value); }
242 { doGetParmValue(idx, instance, value); }
244 { doGetParmValue(idx, instance, value); }
246 { doGetParmValue(idx, instance, value); }
248 { doGetParmValue(idx, instance, value); }
250 { doGetParmValue(idx, instance, value); }
252 { doGetParmValue(idx, instance, value); }
254 template <
typename T>
261 if (idx.
size() != instance.
size()+1)
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
323 { doSetParmValue(idx, instance, value); }
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
331 { doSetParmValue(idx, instance, value); }
333 { doSetParmValue(idx, instance, value); }
335 { doSetParmValue(idx, instance, value); }
351 if (fieldnum.
size() < 1)
362 return "cellstructure";
374 return "gensaddleedges";
376 return "saddleedges";
378 return "genridgeedges";
382 return "genvalleyedges";
384 return "valleyedges";
392 if (fieldnum.
size() < 1)
393 return PARM_UNSUPPORTED;
447 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
449 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
451 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
464 loadData(is, rampdata);
482 int typelen = colon - data.
buffer();
496 {
int64 iv =
v; UTwrite(os, &iv); }
498 { UTwrite<fpreal64>(os, &
v); }
500 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
502 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
503 UTwrite<fpreal64>(os, &v.
z()); }
505 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
506 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
518 if (s) s->save(ostr);
520 saveData(os, result);
527 ostr << s->getDataTypeToken();
532 saveData(os, result);
536 void save(std::ostream &os)
const
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);
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);
591 if (!thissop)
return getGroup();
593 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
601 if (!thissop)
return getSrcAttrib();
603 OP_Utils::evalOpParm(result, thissop,
"srcattrib", cookparms.
getCookTime(), 0);
611 if (!thissop)
return getSrcComp();
613 OP_Utils::evalOpParm(result, thissop,
"srccomp", cookparms.
getCookTime(), 0);
621 if (!thissop)
return getCellStructure();
623 OP_Utils::evalOpParm(result, thissop,
"cellstructure", cookparms.
getCookTime(), 0);
631 if (!thissop)
return getThreshold();
633 OP_Utils::evalOpParm(result, thissop,
"threshold", cookparms.
getCookTime(), 0);
641 if (!thissop)
return getGenMinima();
643 OP_Utils::evalOpParm(result, thissop,
"genminima", cookparms.
getCookTime(), 0);
651 if (!thissop)
return getMinima();
653 OP_Utils::evalOpParm(result, thissop,
"minima", cookparms.
getCookTime(), 0);
661 if (!thissop)
return getGenMaxima();
663 OP_Utils::evalOpParm(result, thissop,
"genmaxima", cookparms.
getCookTime(), 0);
671 if (!thissop)
return getMaxima();
673 OP_Utils::evalOpParm(result, thissop,
"maxima", cookparms.
getCookTime(), 0);
681 if (!thissop)
return getGenSaddleEdges();
683 OP_Utils::evalOpParm(result, thissop,
"gensaddleedges", cookparms.
getCookTime(), 0);
691 if (!thissop)
return getSaddleEdges();
693 OP_Utils::evalOpParm(result, thissop,
"saddleedges", cookparms.
getCookTime(), 0);
701 if (!thissop)
return getGenRidgeEdges();
703 OP_Utils::evalOpParm(result, thissop,
"genridgeedges", cookparms.
getCookTime(), 0);
711 if (!thissop)
return getRidgeEdges();
713 OP_Utils::evalOpParm(result, thissop,
"ridgeedges", cookparms.
getCookTime(), 0);
721 if (!thissop)
return getGenValleyEdges();
723 OP_Utils::evalOpParm(result, thissop,
"genvalleyedges", cookparms.
getCookTime(), 0);
731 if (!thissop)
return getValleyEdges();
733 OP_Utils::evalOpParm(result, thissop,
"valleyedges", cookparms.
getCookTime(), 0);
741 int64 myCellStructure;
747 bool myGenSaddleEdges;
749 bool myGenRidgeEdges;
751 bool myGenValleyEdges;
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)
SOP_Node * getNode() const
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
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
constexpr SYS_FORCE_INLINE T & y() noexcept
void setThreshold(fpreal64 val)
const UT_StringHolder & getSaddleEdges() const
UT_StringHolder opMaxima(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
bool opGenMinima(const SOP_NodeVerb::CookParms &cookparms) const
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
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
T clampMinValue(fpreal minvalue, const T &src) const
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)
constexpr SYS_FORCE_INLINE T & x() noexcept
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
constexpr SYS_FORCE_INLINE T & x() noexcept
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)
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
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
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
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
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.
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
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
DEP_MicroNode * depnode() const
const UT_StringHolder & getMaxima() const
Utility class for containing a color ramp.
const UT_StringHolder & getGroup() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
constexpr SYS_FORCE_INLINE T & w() noexcept
fpreal64 opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opValleyEdges(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getValleyEdges() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
const UT_StringHolder & getRidgeEdges() const
fpreal getCookTime() const
bool opGenSaddleEdges(const SOP_NodeVerb::CookParms &cookparms) const
SrcComp opSrcComp(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
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
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)
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
constexpr SYS_FORCE_INLINE T & y() noexcept
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
constexpr SYS_FORCE_INLINE T & x() noexcept