23 namespace SOP_TextureFeatureEnums
46 myMaximumFeatureSize = 200;
47 myMinimumSpacing = 32;
48 myQualityTolerance = .01;
49 myBlurringWindowRadius = 10;
50 myGradientWindowRadius = 1;
54 myOutputName =
"features"_UTsh;
67 if (myGroup != src.myGroup)
return false;
68 if (myMaximumFeatureSize != src.myMaximumFeatureSize)
return false;
69 if (myMinimumSpacing != src.myMinimumSpacing)
return false;
70 if (myQualityTolerance != src.myQualityTolerance)
return false;
71 if (myBlurringWindowRadius != src.myBlurringWindowRadius)
return false;
72 if (myGradientWindowRadius != src.myGradientWindowRadius)
return false;
73 if (myMethod != src.myMethod)
return false;
74 if (myCornerWeight != src.myCornerWeight)
return false;
75 if (myOutput != src.myOutput)
return false;
76 if (myOutputName != src.myOutputName)
return false;
93 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
94 myMaximumFeatureSize = 200;
96 graph->
evalOpParm(myMaximumFeatureSize, nodeidx,
"maxfeaturesize", time, 0);
97 myMinimumSpacing = 32;
99 graph->
evalOpParm(myMinimumSpacing, nodeidx,
"minimumspacing", time, 0);
100 myQualityTolerance = .01;
102 graph->
evalOpParm(myQualityTolerance, nodeidx,
"qualitytolerance", time, 0);
103 myBlurringWindowRadius = 10;
105 graph->
evalOpParm(myBlurringWindowRadius, nodeidx,
"blurringwindowradius", time, 0);
106 myGradientWindowRadius = 1;
108 graph->
evalOpParm(myGradientWindowRadius, nodeidx,
"gradientwindowradius", time, 0);
111 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
112 myCornerWeight = .04;
113 if (
true && ( (
true&&!(((
int64(getMethod())!=0)))) ) )
114 graph->
evalOpParm(myCornerWeight, nodeidx,
"cornerweight", time, 0);
117 graph->
evalOpParm(myOutput, nodeidx,
"output", time, 0);
118 myOutputName =
"features"_UTsh;
119 if (
true && ( (
true&&!(((
int64(getOutput())!=1)))) ) )
120 graph->
evalOpParm(myOutputName, nodeidx,
"outputname", time, 0);
136 template <
typename T>
143 if (idx.
size() != instance.
size()+1)
191 { doGetParmValue(idx, instance, value); }
193 { doGetParmValue(idx, instance, value); }
195 { doGetParmValue(idx, instance, value); }
197 { doGetParmValue(idx, instance, value); }
199 { doGetParmValue(idx, instance, value); }
201 { doGetParmValue(idx, instance, value); }
203 { doGetParmValue(idx, instance, value); }
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 { doGetParmValue(idx, instance, value); }
211 { doGetParmValue(idx, instance, value); }
213 template <
typename T>
220 if (idx.
size() != instance.
size()+1)
259 { doSetParmValue(idx, instance, value); }
261 { doSetParmValue(idx, instance, value); }
263 { doSetParmValue(idx, instance, value); }
265 { doSetParmValue(idx, instance, value); }
267 { doSetParmValue(idx, instance, value); }
269 { doSetParmValue(idx, instance, value); }
271 { doSetParmValue(idx, instance, value); }
273 { doSetParmValue(idx, instance, value); }
275 { doSetParmValue(idx, instance, value); }
277 { doSetParmValue(idx, instance, value); }
279 { doSetParmValue(idx, instance, value); }
295 if (fieldnum.
size() < 1)
302 return "maxfeaturesize";
304 return "minimumspacing";
306 return "qualitytolerance";
308 return "blurringwindowradius";
310 return "gradientwindowradius";
314 return "cornerweight";
326 if (fieldnum.
size() < 1)
327 return PARM_UNSUPPORTED;
371 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
373 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
375 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
388 loadData(is, rampdata);
406 int typelen = colon - data.
buffer();
420 {
int64 iv =
v; UTwrite(os, &iv); }
422 { UTwrite<fpreal64>(os, &
v); }
424 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
426 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
427 UTwrite<fpreal64>(os, &v.
z()); }
429 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
430 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
442 if (s) s->save(ostr);
444 saveData(os, result);
451 ostr << s->getDataTypeToken();
456 saveData(os, result);
460 void save(std::ostream &os)
const
464 saveData(os, myGroup);
465 saveData(os, myMaximumFeatureSize);
466 saveData(os, myMinimumSpacing);
467 saveData(os, myQualityTolerance);
468 saveData(os, myBlurringWindowRadius);
469 saveData(os, myGradientWindowRadius);
470 saveData(os, myMethod);
471 saveData(os, myCornerWeight);
472 saveData(os, myOutput);
473 saveData(os, myOutputName);
486 loadData(is, myGroup);
487 loadData(is, myMaximumFeatureSize);
488 loadData(is, myMinimumSpacing);
489 loadData(is, myQualityTolerance);
490 loadData(is, myBlurringWindowRadius);
491 loadData(is, myGradientWindowRadius);
492 loadData(is, myMethod);
493 loadData(is, myCornerWeight);
494 loadData(is, myOutput);
495 loadData(is, myOutputName);
505 if (!thissop)
return getGroup();
507 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
515 if (!thissop)
return getMaximumFeatureSize();
517 OP_Utils::evalOpParm(result, thissop,
"maxfeaturesize", cookparms.
getCookTime(), 0);
525 if (!thissop)
return getMinimumSpacing();
527 OP_Utils::evalOpParm(result, thissop,
"minimumspacing", cookparms.
getCookTime(), 0);
535 if (!thissop)
return getQualityTolerance();
537 OP_Utils::evalOpParm(result, thissop,
"qualitytolerance", cookparms.
getCookTime(), 0);
545 if (!thissop)
return getBlurringWindowRadius();
547 OP_Utils::evalOpParm(result, thissop,
"blurringwindowradius", cookparms.
getCookTime(), 0);
555 if (!thissop)
return getGradientWindowRadius();
557 OP_Utils::evalOpParm(result, thissop,
"gradientwindowradius", cookparms.
getCookTime(), 0);
565 if (!thissop)
return getMethod();
567 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
575 if (!thissop)
return getCornerWeight();
577 OP_Utils::evalOpParm(result, thissop,
"cornerweight", cookparms.
getCookTime(), 0);
585 if (!thissop)
return getOutput();
587 OP_Utils::evalOpParm(result, thissop,
"output", cookparms.
getCookTime(), 0);
595 if (!thissop)
return getOutputName();
597 OP_Utils::evalOpParm(result, thissop,
"outputname", cookparms.
getCookTime(), 0);
603 int64 myMaximumFeatureSize;
604 int64 myMinimumSpacing;
606 int64 myBlurringWindowRadius;
607 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
T clampMaxValue(fpreal maxvalue, const T &src) const
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
**But if you need a result
T clampMinValue(fpreal minvalue, const T &src) const
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
void coerceValue(T &result, const S &src) const
static void saveData(std::ostream &os, int64 v)
void setQualityTolerance(fpreal64 val)
int64 getMinimumSpacing() const
DEP_MicroNode * depnode() const
int64 getMaximumFeatureSize() const
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
OP_NodeParms & operator=(const OP_NodeParms &)=default
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