23 namespace SOP_TextureFeatureEnums
34 using namespace UT::Literal;
51 using namespace UT::Literal;
70 myMaximumFeatureSize = 200;
71 myMinimumSpacing = 32;
72 myQualityTolerance = .01;
73 myBlurringWindowRadius = 10;
74 myGradientWindowRadius = 1;
78 myOutputName =
"features"_UTsh;
91 if (myGroup != src.myGroup)
return false;
92 if (myMaximumFeatureSize != src.myMaximumFeatureSize)
return false;
93 if (myMinimumSpacing != src.myMinimumSpacing)
return false;
94 if (myQualityTolerance != src.myQualityTolerance)
return false;
95 if (myBlurringWindowRadius != src.myBlurringWindowRadius)
return false;
96 if (myGradientWindowRadius != src.myGradientWindowRadius)
return false;
97 if (myMethod != src.myMethod)
return false;
98 if (myCornerWeight != src.myCornerWeight)
return false;
99 if (myOutput != src.myOutput)
return false;
100 if (myOutputName != src.myOutputName)
return false;
117 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
118 myMaximumFeatureSize = 200;
120 graph->
evalOpParm(myMaximumFeatureSize, nodeidx,
"maxfeaturesize", time, 0);
121 myMinimumSpacing = 32;
123 graph->
evalOpParm(myMinimumSpacing, nodeidx,
"minimumspacing", time, 0);
124 myQualityTolerance = .01;
126 graph->
evalOpParm(myQualityTolerance, nodeidx,
"qualitytolerance", time, 0);
127 myBlurringWindowRadius = 10;
129 graph->
evalOpParm(myBlurringWindowRadius, nodeidx,
"blurringwindowradius", time, 0);
130 myGradientWindowRadius = 1;
132 graph->
evalOpParm(myGradientWindowRadius, nodeidx,
"gradientwindowradius", time, 0);
135 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
136 myCornerWeight = .04;
137 if (
true && ( (
true&&!(((
int64(getMethod())!=0)))) ) )
138 graph->
evalOpParm(myCornerWeight, nodeidx,
"cornerweight", time, 0);
141 graph->
evalOpParm(myOutput, nodeidx,
"output", time, 0);
142 myOutputName =
"features"_UTsh;
143 if (
true && ( (
true&&!(((
int64(getOutput())!=1)))) ) )
144 graph->
evalOpParm(myOutputName, nodeidx,
"outputname", time, 0);
160 template <
typename T>
167 if (idx.
size() != instance.
size()+1)
172 coerceValue(value, myGroup);
175 coerceValue(value, myMaximumFeatureSize);
178 coerceValue(value, myMinimumSpacing);
181 coerceValue(value, myQualityTolerance);
184 coerceValue(value, myBlurringWindowRadius);
187 coerceValue(value, myGradientWindowRadius);
190 coerceValue(value, myMethod);
193 coerceValue(value, myCornerWeight);
196 coerceValue(value, myOutput);
199 coerceValue(value, myOutputName);
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 { doGetParmValue(idx, instance, value); }
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 { doGetParmValue(idx, instance, value); }
235 { doGetParmValue(idx, instance, value); }
237 template <
typename T>
244 if (idx.
size() != instance.
size()+1)
249 coerceValue(myGroup, ( ( value ) ));
252 coerceValue(myMaximumFeatureSize, clampMinValue(0, ( value ) ));
255 coerceValue(myMinimumSpacing, clampMinValue(0, ( value ) ));
258 coerceValue(myQualityTolerance, ( clampMaxValue(-12, value ) ));
261 coerceValue(myBlurringWindowRadius, clampMinValue(1, ( value ) ));
264 coerceValue(myGradientWindowRadius, clampMinValue(0, clampMaxValue(15, value ) ));
267 coerceValue(myMethod, clampMinValue(0, clampMaxValue(1, value ) ));
270 coerceValue(myCornerWeight, clampMinValue(0, clampMaxValue(1., value ) ));
273 coerceValue(myOutput, clampMinValue(0, clampMaxValue(1, value ) ));
276 coerceValue(myOutputName, ( ( value ) ));
283 { doSetParmValue(idx, instance, value); }
285 { doSetParmValue(idx, instance, value); }
287 { doSetParmValue(idx, instance, value); }
289 { doSetParmValue(idx, instance, value); }
291 { doSetParmValue(idx, instance, value); }
293 { doSetParmValue(idx, instance, value); }
295 { doSetParmValue(idx, instance, value); }
297 { doSetParmValue(idx, instance, value); }
299 { doSetParmValue(idx, instance, value); }
301 { doSetParmValue(idx, instance, value); }
303 { doSetParmValue(idx, instance, value); }
319 if (fieldnum.
size() < 1)
326 return "maxfeaturesize";
328 return "minimumspacing";
330 return "qualitytolerance";
332 return "blurringwindowradius";
334 return "gradientwindowradius";
338 return "cornerweight";
350 if (fieldnum.
size() < 1)
351 return PARM_UNSUPPORTED;
376 return PARM_UNSUPPORTED;
412 loadData(is, rampdata);
430 int typelen = colon - data.
buffer();
444 {
int64 iv =
v; UTwrite(os, &iv); }
446 { UTwrite<fpreal64>(os, &
v); }
448 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
450 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
451 UTwrite<fpreal64>(os, &v.
z()); }
453 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
454 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
466 if (s) s->save(ostr);
468 saveData(os, result);
475 ostr << s->getDataTypeToken();
480 saveData(os, result);
484 void save(std::ostream &os)
const
488 saveData(os, myGroup);
489 saveData(os, myMaximumFeatureSize);
490 saveData(os, myMinimumSpacing);
491 saveData(os, myQualityTolerance);
492 saveData(os, myBlurringWindowRadius);
493 saveData(os, myGradientWindowRadius);
494 saveData(os, myMethod);
495 saveData(os, myCornerWeight);
496 saveData(os, myOutput);
497 saveData(os, myOutputName);
510 loadData(is, myGroup);
511 loadData(is, myMaximumFeatureSize);
512 loadData(is, myMinimumSpacing);
513 loadData(is, myQualityTolerance);
514 loadData(is, myBlurringWindowRadius);
515 loadData(is, myGradientWindowRadius);
516 loadData(is, myMethod);
517 loadData(is, myCornerWeight);
518 loadData(is, myOutput);
519 loadData(is, myOutputName);
529 if (!thissop)
return getGroup();
531 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
539 if (!thissop)
return getMaximumFeatureSize();
541 OP_Utils::evalOpParm(result, thissop,
"maxfeaturesize", cookparms.
getCookTime(), 0);
549 if (!thissop)
return getMinimumSpacing();
551 OP_Utils::evalOpParm(result, thissop,
"minimumspacing", cookparms.
getCookTime(), 0);
559 if (!thissop)
return getQualityTolerance();
561 OP_Utils::evalOpParm(result, thissop,
"qualitytolerance", cookparms.
getCookTime(), 0);
569 if (!thissop)
return getBlurringWindowRadius();
571 OP_Utils::evalOpParm(result, thissop,
"blurringwindowradius", cookparms.
getCookTime(), 0);
579 if (!thissop)
return getGradientWindowRadius();
581 OP_Utils::evalOpParm(result, thissop,
"gradientwindowradius", cookparms.
getCookTime(), 0);
589 if (!thissop)
return getMethod();
591 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
599 if (!thissop)
return getCornerWeight();
601 OP_Utils::evalOpParm(result, thissop,
"cornerweight", cookparms.
getCookTime(), 0);
609 if (!thissop)
return getOutput();
611 OP_Utils::evalOpParm(result, thissop,
"output", cookparms.
getCookTime(), 0);
619 if (!thissop)
return getOutputName();
621 OP_Utils::evalOpParm(result, thissop,
"outputname", cookparms.
getCookTime(), 0);
627 int64 myMaximumFeatureSize;
628 int64 myMinimumSpacing;
630 int64 myBlurringWindowRadius;
631 int64 myGradientWindowRadius;
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
bool operator==(const SOP_TextureFeatureParms &src) const
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
fpreal64 getQualityTolerance() const
SOP_Node * getNode() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, bool v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
fpreal64 opCornerWeight(const SOP_NodeVerb::CookParms &cookparms) const
exint getNestNumParms(TempIndex idx) const override
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, bool &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
Output opOutput(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setBlurringWindowRadius(int64 val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
int64 opMaximumFeatureSize(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void copyFrom(const OP_NodeParms *src) override
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void saveData(std::ostream &os, UT_Matrix4D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
SYS_FORCE_INLINE const char * buffer() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, UT_Vector2D v)
An output stream object that owns its own string buffer storage.
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
**But if you need a result
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
UT_StringHolder opOutputName(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
int64 getGradientWindowRadius() const
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setOutputName(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setOutput(Output val)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
int64 opGradientWindowRadius(const SOP_NodeVerb::CookParms &cookparms) const
void setCornerWeight(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
const OP_GraphProxy * graph() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
SOP_TextureFeatureParms()
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
int64 opBlurringWindowRadius(const SOP_NodeVerb::CookParms &cookparms) const
void loadFromOpSubclass(const LoadParms &loadparms) override
void setMinimumSpacing(int64 val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setGradientWindowRadius(int64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal64 opQualityTolerance(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, fpreal64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setGroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void saveData(std::ostream &os, fpreal64 v)
const UT_StringHolder & getOutputName() const
const char * getNestParmName(TempIndex fieldnum) const override
const UT_StringHolder & getGroup() const
static void saveData(std::ostream &os, int64 v)
void setQualityTolerance(fpreal64 val)
int64 getMinimumSpacing() const
DEP_MicroNode * depnode() const
int64 getMaximumFeatureSize() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
fpreal64 getCornerWeight() const
fpreal getCookTime() const
int64 getBlurringWindowRadius() const
int64 opMinimumSpacing(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
bool operator!=(const SOP_TextureFeatureParms &src) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setMaximumFeatureSize(int64 val)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setMethod(Method val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override