23 namespace SOP_Smooth_2_0Enums
35 using namespace UT::Literal;
54 using namespace UT::Literal;
74 myConstrainedBoundary = 2;
75 myConstrainedPoints =
""_UTsh;
76 myAttributes =
"P"_UTsh;
80 myUpdateAffectedNmls =
true;
93 if (myGroup != src.myGroup)
return false;
94 if (myConstrainedBoundary != src.myConstrainedBoundary)
return false;
95 if (myConstrainedPoints != src.myConstrainedPoints)
return false;
96 if (myAttributes != src.myAttributes)
return false;
97 if (myMethod != src.myMethod)
return false;
98 if (myStrength != src.myStrength)
return false;
99 if (myFilterQuality != src.myFilterQuality)
return false;
100 if (myUpdateAffectedNmls != src.myUpdateAffectedNmls)
return false;
117 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
118 myConstrainedBoundary = 2;
120 graph->
evalOpParm(myConstrainedBoundary, nodeidx,
"contrainedboundary", time, 0);
121 myConstrainedPoints =
""_UTsh;
123 graph->
evalOpParm(myConstrainedPoints, nodeidx,
"constrainedpoints", time, 0);
124 myAttributes =
"P"_UTsh;
126 graph->
evalOpParm(myAttributes, nodeidx,
"attributes", time, 0);
129 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
132 graph->
evalOpParm(myStrength, nodeidx,
"strength", time, 0);
135 graph->
evalOpParm(myFilterQuality, nodeidx,
"filterquality", time, 0);
136 myUpdateAffectedNmls =
true;
138 graph->
evalOpParm(myUpdateAffectedNmls, nodeidx,
"updateaffectednmls", time, 0);
154 template <
typename T>
161 if (idx.
size() != instance.
size()+1)
166 coerceValue(value, myGroup);
169 coerceValue(value, myConstrainedBoundary);
172 coerceValue(value, myConstrainedPoints);
175 coerceValue(value, myAttributes);
178 coerceValue(value, myMethod);
181 coerceValue(value, myStrength);
184 coerceValue(value, myFilterQuality);
187 coerceValue(value, myUpdateAffectedNmls);
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 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
232 if (idx.
size() != instance.
size()+1)
237 coerceValue(myGroup, ( ( value ) ));
240 coerceValue(myConstrainedBoundary, clampMinValue(0, clampMaxValue(2, value ) ));
243 coerceValue(myConstrainedPoints, ( ( value ) ));
246 coerceValue(myAttributes, ( ( value ) ));
249 coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
252 coerceValue(myStrength, clampMinValue(0, ( value ) ));
255 coerceValue(myFilterQuality, clampMinValue(1, clampMaxValue(5, value ) ));
258 coerceValue(myUpdateAffectedNmls, ( ( 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); }
281 { doSetParmValue(idx, instance, value); }
283 { doSetParmValue(idx, instance, value); }
285 { doSetParmValue(idx, instance, value); }
301 if (fieldnum.
size() < 1)
308 return "contrainedboundary";
310 return "constrainedpoints";
318 return "filterquality";
320 return "updateaffectednmls";
328 if (fieldnum.
size() < 1)
329 return PARM_UNSUPPORTED;
350 return PARM_UNSUPPORTED;
386 loadData(is, rampdata);
404 int typelen = colon - data.
buffer();
418 {
int64 iv =
v; UTwrite(os, &iv); }
420 { UTwrite<fpreal64>(os, &
v); }
422 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
424 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
425 UTwrite<fpreal64>(os, &v.
z()); }
427 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
428 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
440 if (s) s->save(ostr);
442 saveData(os, result);
449 ostr << s->getDataTypeToken();
454 saveData(os, result);
458 void save(std::ostream &os)
const
462 saveData(os, myGroup);
463 saveData(os, myConstrainedBoundary);
464 saveData(os, myConstrainedPoints);
465 saveData(os, myAttributes);
466 saveData(os, myMethod);
467 saveData(os, myStrength);
468 saveData(os, myFilterQuality);
469 saveData(os, myUpdateAffectedNmls);
482 loadData(is, myGroup);
483 loadData(is, myConstrainedBoundary);
484 loadData(is, myConstrainedPoints);
485 loadData(is, myAttributes);
486 loadData(is, myMethod);
487 loadData(is, myStrength);
488 loadData(is, myFilterQuality);
489 loadData(is, myUpdateAffectedNmls);
499 if (!thissop)
return getGroup();
501 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
509 if (!thissop)
return getConstrainedBoundary();
511 OP_Utils::evalOpParm(result, thissop,
"contrainedboundary", cookparms.
getCookTime(), 0);
519 if (!thissop)
return getConstrainedPoints();
521 OP_Utils::evalOpParm(result, thissop,
"constrainedpoints", cookparms.
getCookTime(), 0);
529 if (!thissop)
return getAttributes();
531 OP_Utils::evalOpParm(result, thissop,
"attributes", cookparms.
getCookTime(), 0);
539 if (!thissop)
return getMethod();
541 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
549 if (!thissop)
return getStrength();
551 OP_Utils::evalOpParm(result, thissop,
"strength", cookparms.
getCookTime(), 0);
559 if (!thissop)
return getFilterQuality();
561 OP_Utils::evalOpParm(result, thissop,
"filterquality", cookparms.
getCookTime(), 0);
569 if (!thissop)
return getUpdateAffectedNmls();
571 OP_Utils::evalOpParm(result, thissop,
"updateaffectednmls", cookparms.
getCookTime(), 0);
577 int64 myConstrainedBoundary;
582 int64 myFilterQuality;
583 bool myUpdateAffectedNmls;
void setStrength(fpreal64 val)
const UT_StringHolder & getConstrainedPoints() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
fpreal64 opStrength(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix2D v)
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setMethod(Method val)
const UT_StringHolder & getAttributes() const
const OP_Context & context() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
SYS_FORCE_INLINE const char * buffer() const
exint getNestNumParms(TempIndex idx) const override
const char * getNestParmName(TempIndex fieldnum) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
fpreal64 getStrength() const
An output stream object that owns its own string buffer storage.
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void save(std::ostream &os) const
**But if you need a result
bool operator!=(const SOP_Smooth_2_0Parms &src) const
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setFilterQuality(int64 val)
bool operator==(const SOP_Smooth_2_0Parms &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.
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void saveData(std::ostream &os, int64 v)
ConstrainedBoundary getConstrainedBoundary() const
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool load(UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
static void loadData(UT_IStream &is, UT_Matrix4D &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
void setUpdateAffectedNmls(bool val)
bool opUpdateAffectedNmls(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_Vector4D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
bool getUpdateAffectedNmls() const
void setGroup(const UT_StringHolder &val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
GT_API const UT_StringHolder version
bool isParmColorRamp(exint idx) const override
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setConstrainedBoundary(ConstrainedBoundary val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
DEP_MicroNode * depnode() const
void setConstrainedPoints(const UT_StringHolder &val)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
int64 getFilterQuality() const
static void saveData(std::ostream &os, UT_Vector4D v)
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_StringHolder s)
fpreal getCookTime() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
UT_StringHolder opAttributes(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, fpreal64 &v)
int64 opFilterQuality(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setAttributes(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, bool v)
UT_StringHolder opConstrainedPoints(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
ConstrainedBoundary opConstrainedBoundary(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE UT_StringHolder getToken(ConstrainedBoundary enum_value)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept
const UT_StringHolder & getGroup() const