23 namespace SOP_UVRelaxEnums
34 using namespace UT::Literal;
53 using namespace UT::Literal;
77 myIncludeBoundary =
true;
79 myTogglecorrection =
false;
94 if (myUVAttr != src.myUVAttr)
return false;
95 if (myGroup != src.myGroup)
return false;
96 if (myPingroup != src.myPingroup)
return false;
97 if (myAlgorithm != src.myAlgorithm)
return false;
98 if (myIncludeBoundary != src.myIncludeBoundary)
return false;
99 if (myBoundaryflex != src.myBoundaryflex)
return false;
100 if (myTogglecorrection != src.myTogglecorrection)
return false;
101 if (myAttrname != src.myAttrname)
return false;
102 if (myAttrclass != src.myAttrclass)
return false;
117 myUVAttr =
"uv"_UTsh;
119 graph->
evalOpParm(myUVAttr, nodeidx,
"uvattrib", time, 0);
122 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
123 myPingroup =
""_UTsh;
125 graph->
evalOpParm(myPingroup, nodeidx,
"pingroup", time, 0);
128 graph->
evalOpParm(myAlgorithm, nodeidx,
"algorithm", time, 0);
129 myIncludeBoundary =
true;
131 graph->
evalOpParm(myIncludeBoundary, nodeidx,
"includeboundary", time, 0);
132 myBoundaryflex = 0.1;
134 graph->
evalOpParm(myBoundaryflex, nodeidx,
"boundaryflex", time, 0);
135 myTogglecorrection =
false;
137 graph->
evalOpParm(myTogglecorrection, nodeidx,
"togglecorrection", time, 0);
138 myAttrname =
""_UTsh;
140 graph->
evalOpParm(myAttrname, nodeidx,
"attrname", time, 0);
143 graph->
evalOpParm(myAttrclass, nodeidx,
"attrclass", time, 0);
159 template <
typename T>
166 if (idx.
size() != instance.
size()+1)
171 coerceValue(value, myUVAttr);
174 coerceValue(value, myGroup);
177 coerceValue(value, myPingroup);
180 coerceValue(value, myAlgorithm);
183 coerceValue(value, myIncludeBoundary);
186 coerceValue(value, myBoundaryflex);
189 coerceValue(value, myTogglecorrection);
192 coerceValue(value, myAttrname);
195 coerceValue(value, myAttrclass);
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 { doGetParmValue(idx, instance, value); }
227 { doGetParmValue(idx, instance, value); }
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 template <
typename T>
240 if (idx.
size() != instance.
size()+1)
245 coerceValue(myUVAttr, ( ( value ) ));
248 coerceValue(myGroup, ( ( value ) ));
251 coerceValue(myPingroup, ( ( value ) ));
254 coerceValue(myAlgorithm, clampMinValue(0, clampMaxValue(1, value ) ));
257 coerceValue(myIncludeBoundary, ( ( value ) ));
260 coerceValue(myBoundaryflex, clampMinValue(0, ( value ) ));
263 coerceValue(myTogglecorrection, ( ( value ) ));
266 coerceValue(myAttrname, ( ( value ) ));
269 coerceValue(myAttrclass, clampMinValue(0, clampMaxValue(3, value ) ));
276 { doSetParmValue(idx, instance, value); }
278 { doSetParmValue(idx, instance, value); }
280 { doSetParmValue(idx, instance, value); }
282 { doSetParmValue(idx, instance, value); }
284 { doSetParmValue(idx, instance, value); }
286 { doSetParmValue(idx, instance, value); }
288 { doSetParmValue(idx, instance, value); }
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
312 if (fieldnum.
size() < 1)
325 return "includeboundary";
327 return "boundaryflex";
329 return "togglecorrection";
341 if (fieldnum.
size() < 1)
342 return PARM_UNSUPPORTED;
365 return PARM_UNSUPPORTED;
401 loadData(is, rampdata);
419 int typelen = colon - data.
buffer();
433 {
int64 iv =
v; UTwrite(os, &iv); }
435 { UTwrite<fpreal64>(os, &
v); }
437 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
439 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
440 UTwrite<fpreal64>(os, &v.
z()); }
442 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
443 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
455 if (s) s->save(ostr);
457 saveData(os, result);
464 ostr << s->getDataTypeToken();
469 saveData(os, result);
473 void save(std::ostream &os)
const
477 saveData(os, myUVAttr);
478 saveData(os, myGroup);
479 saveData(os, myPingroup);
480 saveData(os, myAlgorithm);
481 saveData(os, myIncludeBoundary);
482 saveData(os, myBoundaryflex);
483 saveData(os, myTogglecorrection);
484 saveData(os, myAttrname);
485 saveData(os, myAttrclass);
498 loadData(is, myUVAttr);
499 loadData(is, myGroup);
500 loadData(is, myPingroup);
501 loadData(is, myAlgorithm);
502 loadData(is, myIncludeBoundary);
503 loadData(is, myBoundaryflex);
504 loadData(is, myTogglecorrection);
505 loadData(is, myAttrname);
506 loadData(is, myAttrclass);
516 if (!thissop)
return getUVAttr();
518 OP_Utils::evalOpParm(result, thissop,
"uvattrib", cookparms.
getCookTime(), 0);
526 if (!thissop)
return getGroup();
528 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
536 if (!thissop)
return getPingroup();
538 OP_Utils::evalOpParm(result, thissop,
"pingroup", cookparms.
getCookTime(), 0);
546 if (!thissop)
return getAlgorithm();
548 OP_Utils::evalOpParm(result, thissop,
"algorithm", cookparms.
getCookTime(), 0);
556 if (!thissop)
return getIncludeBoundary();
558 OP_Utils::evalOpParm(result, thissop,
"includeboundary", cookparms.
getCookTime(), 0);
566 if (!thissop)
return getBoundaryflex();
568 OP_Utils::evalOpParm(result, thissop,
"boundaryflex", cookparms.
getCookTime(), 0);
576 if (!thissop)
return getTogglecorrection();
578 OP_Utils::evalOpParm(result, thissop,
"togglecorrection", cookparms.
getCookTime(), 0);
586 if (!thissop)
return getAttrname();
588 OP_Utils::evalOpParm(result, thissop,
"attrname", cookparms.
getCookTime(), 0);
596 if (!thissop)
return getAttrclass();
598 OP_Utils::evalOpParm(result, thissop,
"attrclass", cookparms.
getCookTime(), 0);
607 bool myIncludeBoundary;
609 bool myTogglecorrection;
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
ParmType getNestParmType(TempIndex fieldnum) const override
SOP_Node * getNode() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
bool operator==(const SOP_UVRelaxParms &src) const
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setGroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool load(UT_IStream &is)
void setAttrclass(Attrclass val)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
const UT_StringHolder & getGroup() const
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Vector4D &v)
SYS_FORCE_INLINE UT_StringHolder getToken(Algorithm enum_value)
**But if you need a result
bool opIncludeBoundary(const SOP_NodeVerb::CookParms &cookparms) const
void setAttrname(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Vector2D v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setPingroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setUVAttr(const UT_StringHolder &val)
void setAlgorithm(Algorithm val)
static void saveData(std::ostream &os, fpreal64 v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
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
Attrclass opAttrclass(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, bool &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
fpreal64 opBoundaryflex(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
Algorithm getAlgorithm() const
Algorithm opAlgorithm(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getAttrname() const
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool operator!=(const SOP_UVRelaxParms &src) const
void save(std::ostream &os) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setTogglecorrection(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
const UT_StringHolder & getUVAttr() const
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool getTogglecorrection() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
DEP_MicroNode * depnode() const
static void saveData(std::ostream &os, UT_Matrix3D v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setBoundaryflex(fpreal64 val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
bool opTogglecorrection(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getBoundaryflex() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal getCookTime() const
UT_StringHolder opAttrname(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opUVAttr(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
Attrclass getAttrclass() const
exint getNestNumParms(TempIndex idx) const override
UT_StringHolder opPingroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
bool getIncludeBoundary() const
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
const char * getNestParmName(TempIndex fieldnum) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Vector3D v)
const UT_StringHolder & getPingroup() const
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setIncludeBoundary(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Matrix4D v)