23 namespace SOP_UVRelaxEnums
34 using namespace UT::Literal;
53 myUVAttrib =
"uv"_UTsh;
54 myMaxOptimizationIterations = 1;
55 myPinnedVertices =
""_UTsh;
56 myPinUVBoundaries =
false;
57 mySeamEdges =
""_UTsh;
75 if (myGroup != src.myGroup)
return false;
76 if (myUVAttrib != src.myUVAttrib)
return false;
77 if (myMaxOptimizationIterations != src.myMaxOptimizationIterations)
return false;
78 if (myPinnedVertices != src.myPinnedVertices)
return false;
79 if (myPinUVBoundaries != src.myPinUVBoundaries)
return false;
80 if (mySeamEdges != src.mySeamEdges)
return false;
81 if (mySewEdges != src.mySewEdges)
return false;
82 if (myScale != src.myScale)
return false;
83 if (myPackingMethod != src.myPackingMethod)
return false;
84 if (myBBoxCenter != src.myBBoxCenter)
return false;
85 if (myBBoxSize != src.myBBoxSize)
return false;
104 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
105 myUVAttrib =
"uv"_UTsh;
107 graph->
evalOpParm(myUVAttrib, nodeidx,
"uvattrib", time, graph->
isDirect()?
nullptr:depnode);
108 myMaxOptimizationIterations = 1;
110 graph->
evalOpParm(myMaxOptimizationIterations, nodeidx,
"maxoptimizationiterations", time, graph->
isDirect()?
nullptr:depnode);
111 myPinnedVertices =
""_UTsh;
113 graph->
evalOpParm(myPinnedVertices, nodeidx,
"pinnedvertices", time, graph->
isDirect()?
nullptr:depnode);
114 myPinUVBoundaries =
false;
116 graph->
evalOpParm(myPinUVBoundaries, nodeidx,
"pinboundaries", time, graph->
isDirect()?
nullptr:depnode);
117 mySeamEdges =
""_UTsh;
118 if (
true && ( (
true&&!(((getPinUVBoundaries()==1)))) ) )
119 graph->
evalOpParm(mySeamEdges, nodeidx,
"seamedges", time, graph->
isDirect()?
nullptr:depnode);
120 mySewEdges =
""_UTsh;
121 if (
true && ( (
true&&!(((getPinUVBoundaries()==1)))) ) )
122 graph->
evalOpParm(mySewEdges, nodeidx,
"sewedges", time, graph->
isDirect()?
nullptr:depnode);
125 graph->
evalOpParm(myScale, nodeidx,
"scale", time, graph->
isDirect()?
nullptr:depnode);
128 graph->
evalOpParm(myPackingMethod, nodeidx,
"packingmethod", time, graph->
isDirect()?
nullptr:depnode);
130 if (
true && ( (
true&&!(((
int64(getPackingMethod())!=0)))) ) )
131 graph->
evalOpParm(myBBoxCenter, nodeidx,
"bboxcenter", time, graph->
isDirect()?
nullptr:depnode);
133 if (
true && ( (
true&&!(((
int64(getPackingMethod())!=0)))) ) )
134 graph->
evalOpParm(myBBoxSize, nodeidx,
"bboxsize", time, graph->
isDirect()?
nullptr:depnode);
150 template <
typename T>
157 if (idx.
size() != instance.
size()+1)
162 coerceValue(value, myGroup);
165 coerceValue(value, myUVAttrib);
168 coerceValue(value, myMaxOptimizationIterations);
171 coerceValue(value, myPinnedVertices);
174 coerceValue(value, myPinUVBoundaries);
177 coerceValue(value, mySeamEdges);
180 coerceValue(value, mySewEdges);
183 coerceValue(value, myScale);
186 coerceValue(value, myPackingMethod);
189 coerceValue(value, myBBoxCenter);
192 coerceValue(value, myBBoxSize);
208 { doGetParmValue(idx, instance, value); }
210 { doGetParmValue(idx, instance, value); }
212 { doGetParmValue(idx, instance, value); }
214 { doGetParmValue(idx, instance, value); }
216 { doGetParmValue(idx, instance, value); }
218 { doGetParmValue(idx, instance, value); }
220 { doGetParmValue(idx, instance, value); }
222 { doGetParmValue(idx, instance, value); }
224 { doGetParmValue(idx, instance, value); }
226 { doGetParmValue(idx, instance, value); }
228 { doGetParmValue(idx, instance, value); }
230 template <
typename T>
237 if (idx.
size() != instance.
size()+1)
242 coerceValue(myGroup, ( ( value ) ));
245 coerceValue(myUVAttrib, ( ( value ) ));
248 coerceValue(myMaxOptimizationIterations, clampMinValue(0, ( value ) ));
251 coerceValue(myPinnedVertices, ( ( value ) ));
254 coerceValue(myPinUVBoundaries, ( ( value ) ));
257 coerceValue(mySeamEdges, ( ( value ) ));
260 coerceValue(mySewEdges, ( ( value ) ));
263 coerceValue(myScale, clampMinValue(0.5, ( value ) ));
266 coerceValue(myPackingMethod, clampMinValue(0, clampMaxValue(1, value ) ));
269 coerceValue(myBBoxCenter, ( ( value ) ));
272 coerceValue(myBBoxSize, clampMinValue(0, ( value ) ));
279 { doSetParmValue(idx, instance, value); }
281 { doSetParmValue(idx, instance, 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); }
315 if (fieldnum.
size() < 1)
324 return "maxoptimizationiterations";
326 return "pinnedvertices";
328 return "pinboundaries";
336 return "packingmethod";
348 if (fieldnum.
size() < 1)
349 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, myUVAttrib);
490 saveData(os, myMaxOptimizationIterations);
491 saveData(os, myPinnedVertices);
492 saveData(os, myPinUVBoundaries);
493 saveData(os, mySeamEdges);
494 saveData(os, mySewEdges);
495 saveData(os, myScale);
496 saveData(os, myPackingMethod);
497 saveData(os, myBBoxCenter);
498 saveData(os, myBBoxSize);
511 loadData(is, myGroup);
512 loadData(is, myUVAttrib);
513 loadData(is, myMaxOptimizationIterations);
514 loadData(is, myPinnedVertices);
515 loadData(is, myPinUVBoundaries);
516 loadData(is, mySeamEdges);
517 loadData(is, mySewEdges);
518 loadData(is, myScale);
519 loadData(is, myPackingMethod);
520 loadData(is, myBBoxCenter);
521 loadData(is, myBBoxSize);
531 if (!thissop)
return getGroup();
533 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
541 if (!thissop)
return getUVAttrib();
543 OP_Utils::evalOpParm(result, thissop,
"uvattrib", cookparms.
getCookTime(), 0);
551 if (!thissop)
return getMaxOptimizationIterations();
553 OP_Utils::evalOpParm(result, thissop,
"maxoptimizationiterations", cookparms.
getCookTime(), 0);
561 if (!thissop)
return getPinnedVertices();
563 OP_Utils::evalOpParm(result, thissop,
"pinnedvertices", cookparms.
getCookTime(), 0);
571 if (!thissop)
return getPinUVBoundaries();
573 OP_Utils::evalOpParm(result, thissop,
"pinboundaries", cookparms.
getCookTime(), 0);
581 if (!thissop)
return getSeamEdges();
583 OP_Utils::evalOpParm(result, thissop,
"seamedges", cookparms.
getCookTime(), 0);
591 if (!thissop)
return getSewEdges();
593 OP_Utils::evalOpParm(result, thissop,
"sewedges", cookparms.
getCookTime(), 0);
603 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
611 if (!thissop)
return getPackingMethod();
613 OP_Utils::evalOpParm(result, thissop,
"packingmethod", cookparms.
getCookTime(), 0);
621 if (!thissop)
return getBBoxCenter();
623 OP_Utils::evalOpParm(result, thissop,
"bboxcenter", cookparms.
getCookTime(), 0);
631 if (!thissop)
return getBBoxSize();
633 OP_Utils::evalOpParm(result, thissop,
"bboxsize", cookparms.
getCookTime(), 0);
640 int64 myMaxOptimizationIterations;
642 bool myPinUVBoundaries;
646 int64 myPackingMethod;
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, int64 v)
PackingMethod getPackingMethod() const
PackingMethod opPackingMethod(const SOP_NodeVerb::CookParms &cookparms) const
void setSeamEdges(const UT_StringHolder &val)
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)
const UT_StringHolder & getSeamEdges() const
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)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setMaxOptimizationIterations(int64 val)
UT_Vector2T< fpreal64 > UT_Vector2D
GLsizei const GLfloat * value
SYS_FORCE_INLINE UT_StringHolder getToken(PackingMethod enum_value)
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
UT_StringHolder opSewEdges(const SOP_NodeVerb::CookParms &cookparms) const
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)
UT_StringHolder opSeamEdges(const SOP_NodeVerb::CookParms &cookparms) const
**But if you need a result
fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void saveData(std::ostream &os, PRM_DataItemHandle s)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setPackingMethod(PackingMethod val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void saveData(std::ostream &os, fpreal64 v)
void setSewEdges(const UT_StringHolder &val)
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
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
const UT_StringHolder & getSewEdges() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void copyFrom(const OP_NodeParms *src) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
UT_Vector2D getBBoxSize() const
UT_StringHolder opUVAttrib(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector2D getBBoxCenter() const
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
const UT_StringHolder & getUVAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setBBoxCenter(UT_Vector2D val)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
GT_API const UT_StringHolder version
void setUVAttrib(const UT_StringHolder &val)
void setBBoxSize(UT_Vector2D val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
const UT_StringHolder & getPinnedVertices() const
UT_StringHolder opPinnedVertices(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setPinUVBoundaries(bool val)
static void saveData(std::ostream &os, UT_Matrix2D v)
bool opPinUVBoundaries(const SOP_NodeVerb::CookParms &cookparms) const
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 buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
int64 getMaxOptimizationIterations() const
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)
virtual UT_StringHolder baseGetSignature() const
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows.
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setScale(fpreal64 val)
fpreal64 getScale() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
int64 opMaxOptimizationIterations(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
bool getPinUVBoundaries() const
UT_Vector2D opBBoxSize(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
exint bread(uint8 *buffer, exint asize=1)
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Vector4D v)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void setPinnedVertices(const UT_StringHolder &val)
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
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Vector3D v)
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Matrix4D v)
UT_Vector2D opBBoxCenter(const SOP_NodeVerb::CookParms &cookparms) const