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;
77 myUseWeightAttribute =
false;
78 myWeightAttribute =
"weight"_UTsh;
82 myUpdateAffectedNmls =
true;
95 if (myGroup != src.myGroup)
return false;
96 if (myConstrainedBoundary != src.myConstrainedBoundary)
return false;
97 if (myConstrainedPoints != src.myConstrainedPoints)
return false;
98 if (myAttributes != src.myAttributes)
return false;
99 if (myUseWeightAttribute != src.myUseWeightAttribute)
return false;
100 if (myWeightAttribute != src.myWeightAttribute)
return false;
101 if (myMethod != src.myMethod)
return false;
102 if (myStrength != src.myStrength)
return false;
103 if (myFilterQuality != src.myFilterQuality)
return false;
104 if (myUpdateAffectedNmls != src.myUpdateAffectedNmls)
return false;
124 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
125 myConstrainedBoundary = 2;
127 graph->
evalOpParm(myConstrainedBoundary, nodeidx,
"contrainedboundary", time, graph->
isDirect()?
nullptr:depnode);
128 myConstrainedPoints =
""_UTsh;
130 graph->
evalOpParm(myConstrainedPoints, nodeidx,
"constrainedpoints", time, graph->
isDirect()?
nullptr:depnode);
131 myAttributes =
"P"_UTsh;
133 graph->
evalOpParm(myAttributes, nodeidx,
"attributes", time, graph->
isDirect()?
nullptr:depnode);
134 myUseWeightAttribute =
false;
136 graph->
evalOpParm(myUseWeightAttribute, nodeidx,
"useweightattribute", time, graph->
isDirect()?
nullptr:depnode);
137 myWeightAttribute =
"weight"_UTsh;
138 if (
true && ( (
true&&!(((getUseWeightAttribute()==0)))) ) )
139 graph->
evalOpParm(myWeightAttribute, nodeidx,
"weightattribute", time, graph->
isDirect()?
nullptr:depnode);
142 graph->
evalOpParm(myMethod, nodeidx,
"method", time, graph->
isDirect()?
nullptr:depnode);
145 graph->
evalOpParm(myStrength, nodeidx,
"strength", time, graph->
isDirect()?
nullptr:depnode);
148 graph->
evalOpParm(myFilterQuality, nodeidx,
"filterquality", time, graph->
isDirect()?
nullptr:depnode);
149 myUpdateAffectedNmls =
true;
151 graph->
evalOpParm(myUpdateAffectedNmls, nodeidx,
"updateaffectednmls", time, graph->
isDirect()?
nullptr:depnode);
167 template <
typename T>
174 if (idx.
size() != instance.
size()+1)
179 coerceValue(value, myGroup);
182 coerceValue(value, myConstrainedBoundary);
185 coerceValue(value, myConstrainedPoints);
188 coerceValue(value, myAttributes);
191 coerceValue(value, myUseWeightAttribute);
194 coerceValue(value, myWeightAttribute);
197 coerceValue(value, myMethod);
200 coerceValue(value, myStrength);
203 coerceValue(value, myFilterQuality);
206 coerceValue(value, myUpdateAffectedNmls);
222 { doGetParmValue(idx, instance, value); }
224 { doGetParmValue(idx, instance, value); }
226 { doGetParmValue(idx, instance, value); }
228 { doGetParmValue(idx, instance, value); }
230 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
251 if (idx.
size() != instance.
size()+1)
256 coerceValue(myGroup, ( ( value ) ));
259 coerceValue(myConstrainedBoundary, clampMinValue(0, clampMaxValue(2, value ) ));
262 coerceValue(myConstrainedPoints, ( ( value ) ));
265 coerceValue(myAttributes, ( ( value ) ));
268 coerceValue(myUseWeightAttribute, ( ( value ) ));
271 coerceValue(myWeightAttribute, ( ( value ) ));
274 coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
277 coerceValue(myStrength, clampMinValue(0, ( value ) ));
280 coerceValue(myFilterQuality, clampMinValue(1, clampMaxValue(5, value ) ));
283 coerceValue(myUpdateAffectedNmls, ( ( value ) ));
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
298 { doSetParmValue(idx, instance, value); }
300 { doSetParmValue(idx, instance, value); }
302 { doSetParmValue(idx, instance, value); }
304 { doSetParmValue(idx, instance, value); }
306 { doSetParmValue(idx, instance, value); }
308 { doSetParmValue(idx, instance, value); }
310 { doSetParmValue(idx, instance, value); }
326 if (fieldnum.
size() < 1)
333 return "contrainedboundary";
335 return "constrainedpoints";
339 return "useweightattribute";
341 return "weightattribute";
347 return "filterquality";
349 return "updateaffectednmls";
357 if (fieldnum.
size() < 1)
358 return PARM_UNSUPPORTED;
383 return PARM_UNSUPPORTED;
419 loadData(is, rampdata);
437 int typelen = colon - data.
buffer();
451 {
int64 iv =
v; UTwrite(os, &iv); }
453 { UTwrite<fpreal64>(os, &
v); }
455 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
457 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
458 UTwrite<fpreal64>(os, &v.
z()); }
460 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
461 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
473 if (s) s->save(ostr);
475 saveData(os, result);
482 ostr << s->getDataTypeToken();
487 saveData(os, result);
491 void save(std::ostream &os)
const
495 saveData(os, myGroup);
496 saveData(os, myConstrainedBoundary);
497 saveData(os, myConstrainedPoints);
498 saveData(os, myAttributes);
499 saveData(os, myUseWeightAttribute);
500 saveData(os, myWeightAttribute);
501 saveData(os, myMethod);
502 saveData(os, myStrength);
503 saveData(os, myFilterQuality);
504 saveData(os, myUpdateAffectedNmls);
517 loadData(is, myGroup);
518 loadData(is, myConstrainedBoundary);
519 loadData(is, myConstrainedPoints);
520 loadData(is, myAttributes);
521 loadData(is, myUseWeightAttribute);
522 loadData(is, myWeightAttribute);
523 loadData(is, myMethod);
524 loadData(is, myStrength);
525 loadData(is, myFilterQuality);
526 loadData(is, myUpdateAffectedNmls);
536 if (!thissop)
return getGroup();
538 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
546 if (!thissop)
return getConstrainedBoundary();
548 OP_Utils::evalOpParm(result, thissop,
"contrainedboundary", cookparms.
getCookTime(), 0);
556 if (!thissop)
return getConstrainedPoints();
558 OP_Utils::evalOpParm(result, thissop,
"constrainedpoints", cookparms.
getCookTime(), 0);
566 if (!thissop)
return getAttributes();
568 OP_Utils::evalOpParm(result, thissop,
"attributes", cookparms.
getCookTime(), 0);
576 if (!thissop)
return getUseWeightAttribute();
578 OP_Utils::evalOpParm(result, thissop,
"useweightattribute", cookparms.
getCookTime(), 0);
586 if (!thissop)
return getWeightAttribute();
588 OP_Utils::evalOpParm(result, thissop,
"weightattribute", cookparms.
getCookTime(), 0);
596 if (!thissop)
return getMethod();
598 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
606 if (!thissop)
return getStrength();
608 OP_Utils::evalOpParm(result, thissop,
"strength", cookparms.
getCookTime(), 0);
616 if (!thissop)
return getFilterQuality();
618 OP_Utils::evalOpParm(result, thissop,
"filterquality", cookparms.
getCookTime(), 0);
626 if (!thissop)
return getUpdateAffectedNmls();
628 OP_Utils::evalOpParm(result, thissop,
"updateaffectednmls", cookparms.
getCookTime(), 0);
634 int64 myConstrainedBoundary;
637 bool myUseWeightAttribute;
641 int64 myFilterQuality;
642 bool myUpdateAffectedNmls;
void setUseWeightAttribute(bool val)
void setStrength(fpreal64 val)
const UT_StringHolder & getConstrainedPoints() const
bool opUseWeightAttribute(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
bool getUseWeightAttribute() 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)
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)
UT_StringHolder opWeightAttribute(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setWeightAttribute(const UT_StringHolder &val)
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)
const UT_StringHolder & getWeightAttribute() const
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
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
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