23 namespace SOP_UVAutoseamEnums
34 using namespace UT::Literal;
53 myAvoidAttr =
""_UTsh;
54 myAvoidanceWeight = 1;
56 myGrainTolerance = 0.1;
57 myMergeThreshold = 0.5;
58 myUVAttrib =
"uv"_UTsh;
60 mySeamsGroupName =
"seams"_UTsh;
61 myUseOutputIslandAttr =
false;
62 myOutputIslandAttr =
"island"_UTsh;
64 myIslandAttr =
""_UTsh;
78 if (myGroup != src.myGroup)
return false;
79 if (myAvoidAttr != src.myAvoidAttr)
return false;
80 if (myAvoidanceWeight != src.myAvoidanceWeight)
return false;
81 if (myBaseSplit != src.myBaseSplit)
return false;
82 if (myGrainTolerance != src.myGrainTolerance)
return false;
83 if (myMergeThreshold != src.myMergeThreshold)
return false;
84 if (myUVAttrib != src.myUVAttrib)
return false;
85 if (myUVTolerance != src.myUVTolerance)
return false;
86 if (mySeamsGroupName != src.mySeamsGroupName)
return false;
87 if (myUseOutputIslandAttr != src.myUseOutputIslandAttr)
return false;
88 if (myOutputIslandAttr != src.myOutputIslandAttr)
return false;
89 if (myPreseams != src.myPreseams)
return false;
90 if (myIslandAttr != src.myIslandAttr)
return false;
91 if (myNonseams != src.myNonseams)
return false;
107 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
108 myAvoidAttr =
""_UTsh;
110 graph->
evalOpParm(myAvoidAttr, nodeidx,
"avoidattr", time, 0);
111 myAvoidanceWeight = 1;
113 graph->
evalOpParm(myAvoidanceWeight, nodeidx,
"avoidanceweight", time, 0);
116 graph->
evalOpParm(myBaseSplit, nodeidx,
"basesplit", time, 0);
117 myGrainTolerance = 0.1;
118 if (
true && ( (
true&&!(((
int64(getBaseSplit())==1)))) ) )
119 graph->
evalOpParm(myGrainTolerance, nodeidx,
"graintol", time, 0);
120 myMergeThreshold = 0.5;
122 graph->
evalOpParm(myMergeThreshold, nodeidx,
"mergethreshold", time, 0);
123 myUVAttrib =
"uv"_UTsh;
124 if (
true && ( (
true&&!(((
int64(getBaseSplit())==0)))) ) )
125 graph->
evalOpParm(myUVAttrib, nodeidx,
"uvattrib", time, 0);
126 myUVTolerance = 1e-5;
127 if (
true && ( (
true&&!(((
int64(getBaseSplit())==0)))) ) )
128 graph->
evalOpParm(myUVTolerance, nodeidx,
"uvtolerance", time, 0);
129 mySeamsGroupName =
"seams"_UTsh;
131 graph->
evalOpParm(mySeamsGroupName, nodeidx,
"seamsgroupname", time, 0);
132 myUseOutputIslandAttr =
false;
134 graph->
evalOpParm(myUseOutputIslandAttr, nodeidx,
"useoutputislandattr", time, 0);
135 myOutputIslandAttr =
"island"_UTsh;
136 if (
true && ( (
true&&!(((getUseOutputIslandAttr()==0)))) ) )
137 graph->
evalOpParm(myOutputIslandAttr, nodeidx,
"outputislandattr", time, 0);
138 myPreseams =
""_UTsh;
139 if (
true && ( (
true&&!(((
int64(getBaseSplit())==1)))) ) )
140 graph->
evalOpParm(myPreseams, nodeidx,
"preseams", time, 0);
141 myIslandAttr =
""_UTsh;
142 if (
true && ( (
true&&!(((
int64(getBaseSplit())==1)))) ) )
143 graph->
evalOpParm(myIslandAttr, nodeidx,
"islandattr", time, 0);
144 myNonseams =
""_UTsh;
145 if (
true && ( (
true&&!(((
int64(getBaseSplit())==1)))) ) )
146 graph->
evalOpParm(myNonseams, nodeidx,
"nonseams", time, 0);
162 template <
typename T>
169 if (idx.
size() != instance.
size()+1)
174 coerceValue(value, myGroup);
177 coerceValue(value, myAvoidAttr);
180 coerceValue(value, myAvoidanceWeight);
183 coerceValue(value, myBaseSplit);
186 coerceValue(value, myGrainTolerance);
189 coerceValue(value, myMergeThreshold);
192 coerceValue(value, myUVAttrib);
195 coerceValue(value, myUVTolerance);
198 coerceValue(value, mySeamsGroupName);
201 coerceValue(value, myUseOutputIslandAttr);
204 coerceValue(value, myOutputIslandAttr);
207 coerceValue(value, myPreseams);
210 coerceValue(value, myIslandAttr);
213 coerceValue(value, myNonseams);
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 { doGetParmValue(idx, instance, value); }
235 { doGetParmValue(idx, instance, value); }
237 { doGetParmValue(idx, instance, value); }
239 { doGetParmValue(idx, instance, value); }
241 { doGetParmValue(idx, instance, value); }
243 { doGetParmValue(idx, instance, value); }
245 { doGetParmValue(idx, instance, value); }
247 { doGetParmValue(idx, instance, value); }
249 { doGetParmValue(idx, instance, value); }
251 template <
typename T>
258 if (idx.
size() != instance.
size()+1)
263 coerceValue(myGroup, ( ( value ) ));
266 coerceValue(myAvoidAttr, ( ( value ) ));
269 coerceValue(myAvoidanceWeight, ( ( value ) ));
272 coerceValue(myBaseSplit, clampMinValue(0, clampMaxValue(1, value ) ));
275 coerceValue(myGrainTolerance, clampMinValue(0, ( value ) ));
278 coerceValue(myMergeThreshold, clampMinValue(0, clampMaxValue(1, value ) ));
281 coerceValue(myUVAttrib, ( ( value ) ));
284 coerceValue(myUVTolerance, clampMinValue(0, ( value ) ));
287 coerceValue(mySeamsGroupName, ( ( value ) ));
290 coerceValue(myUseOutputIslandAttr, ( ( value ) ));
293 coerceValue(myOutputIslandAttr, ( ( value ) ));
296 coerceValue(myPreseams, ( ( value ) ));
299 coerceValue(myIslandAttr, ( ( value ) ));
302 coerceValue(myNonseams, ( ( value ) ));
309 { doSetParmValue(idx, instance, value); }
311 { doSetParmValue(idx, instance, value); }
313 { doSetParmValue(idx, instance, value); }
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
323 { doSetParmValue(idx, instance, value); }
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
345 if (fieldnum.
size() < 1)
354 return "avoidanceweight";
360 return "mergethreshold";
364 return "uvtolerance";
366 return "seamsgroupname";
368 return "useoutputislandattr";
370 return "outputislandattr";
384 if (fieldnum.
size() < 1)
385 return PARM_UNSUPPORTED;
418 return PARM_UNSUPPORTED;
454 loadData(is, rampdata);
472 int typelen = colon - data.
buffer();
486 {
int64 iv =
v; UTwrite(os, &iv); }
488 { UTwrite<fpreal64>(os, &
v); }
490 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
492 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
493 UTwrite<fpreal64>(os, &v.
z()); }
495 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
496 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
508 if (s) s->save(ostr);
510 saveData(os, result);
517 ostr << s->getDataTypeToken();
522 saveData(os, result);
526 void save(std::ostream &os)
const
530 saveData(os, myGroup);
531 saveData(os, myAvoidAttr);
532 saveData(os, myAvoidanceWeight);
533 saveData(os, myBaseSplit);
534 saveData(os, myGrainTolerance);
535 saveData(os, myMergeThreshold);
536 saveData(os, myUVAttrib);
537 saveData(os, myUVTolerance);
538 saveData(os, mySeamsGroupName);
539 saveData(os, myUseOutputIslandAttr);
540 saveData(os, myOutputIslandAttr);
541 saveData(os, myPreseams);
542 saveData(os, myIslandAttr);
543 saveData(os, myNonseams);
556 loadData(is, myGroup);
557 loadData(is, myAvoidAttr);
558 loadData(is, myAvoidanceWeight);
559 loadData(is, myBaseSplit);
560 loadData(is, myGrainTolerance);
561 loadData(is, myMergeThreshold);
562 loadData(is, myUVAttrib);
563 loadData(is, myUVTolerance);
564 loadData(is, mySeamsGroupName);
565 loadData(is, myUseOutputIslandAttr);
566 loadData(is, myOutputIslandAttr);
567 loadData(is, myPreseams);
568 loadData(is, myIslandAttr);
569 loadData(is, myNonseams);
579 if (!thissop)
return getGroup();
581 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
589 if (!thissop)
return getAvoidAttr();
591 OP_Utils::evalOpParm(result, thissop,
"avoidattr", cookparms.
getCookTime(), 0);
599 if (!thissop)
return getAvoidanceWeight();
601 OP_Utils::evalOpParm(result, thissop,
"avoidanceweight", cookparms.
getCookTime(), 0);
609 if (!thissop)
return getBaseSplit();
611 OP_Utils::evalOpParm(result, thissop,
"basesplit", cookparms.
getCookTime(), 0);
619 if (!thissop)
return getGrainTolerance();
621 OP_Utils::evalOpParm(result, thissop,
"graintol", cookparms.
getCookTime(), 0);
629 if (!thissop)
return getMergeThreshold();
631 OP_Utils::evalOpParm(result, thissop,
"mergethreshold", cookparms.
getCookTime(), 0);
639 if (!thissop)
return getUVAttrib();
641 OP_Utils::evalOpParm(result, thissop,
"uvattrib", cookparms.
getCookTime(), 0);
649 if (!thissop)
return getUVTolerance();
651 OP_Utils::evalOpParm(result, thissop,
"uvtolerance", cookparms.
getCookTime(), 0);
659 if (!thissop)
return getSeamsGroupName();
661 OP_Utils::evalOpParm(result, thissop,
"seamsgroupname", cookparms.
getCookTime(), 0);
669 if (!thissop)
return getUseOutputIslandAttr();
671 OP_Utils::evalOpParm(result, thissop,
"useoutputislandattr", cookparms.
getCookTime(), 0);
679 if (!thissop)
return getOutputIslandAttr();
681 OP_Utils::evalOpParm(result, thissop,
"outputislandattr", cookparms.
getCookTime(), 0);
689 if (!thissop)
return getPreseams();
691 OP_Utils::evalOpParm(result, thissop,
"preseams", cookparms.
getCookTime(), 0);
699 if (!thissop)
return getIslandAttr();
701 OP_Utils::evalOpParm(result, thissop,
"islandattr", cookparms.
getCookTime(), 0);
709 if (!thissop)
return getNonseams();
711 OP_Utils::evalOpParm(result, thissop,
"nonseams", cookparms.
getCookTime(), 0);
725 bool myUseOutputIslandAttr;
void setOutputIslandAttr(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
const UT_StringHolder & getIslandAttr() const
fpreal64 opUVTolerance(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
SOP_Node * getNode() const
static void saveData(std::ostream &os, fpreal64 v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, UT_Vector2I &v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_StringHolder opAvoidAttr(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const OP_Context & context() const
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
UT_StringHolder opOutputIslandAttr(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getOutputIslandAttr() const
SYS_FORCE_INLINE const char * buffer() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
An output stream object that owns its own string buffer storage.
fpreal64 opGrainTolerance(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPreseams(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getPreseams() const
bool isParmColorRamp(exint idx) const override
**But if you need a result
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_StringHolder & getAvoidAttr() const
static void saveData(std::ostream &os, UT_Vector4D v)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
const UT_StringHolder & getNonseams() const
void setPreseams(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
bool opUseOutputIslandAttr(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector4D &v)
BaseSplit getBaseSplit() const
static void saveData(std::ostream &os, bool v)
void setGroup(const UT_StringHolder &val)
void setUVAttrib(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix4D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Matrix3D &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setSeamsGroupName(const UT_StringHolder &val)
static void saveData(std::ostream &os, int64 v)
UT_StringHolder opUVAttrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
BaseSplit opBaseSplit(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void loadFromOpSubclass(const LoadParms &loadparms) override
bool operator==(const SOP_UVAutoseamParms &src) const
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
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
const OP_GraphProxy * graph() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
UT_StringHolder opIslandAttr(const SOP_NodeVerb::CookParms &cookparms) const
void setMergeThreshold(fpreal64 val)
bool getUseOutputIslandAttr() const
void setIslandAttr(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setBaseSplit(BaseSplit val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const UT_StringHolder & getUVAttrib() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, UT_Matrix2D v)
const UT_StringHolder & getGroup() const
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
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, bool &v)
const UT_StringHolder & getSeamsGroupName() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
fpreal64 getAvoidanceWeight() const
fpreal64 getMergeThreshold() const
void setAvoidanceWeight(fpreal64 val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
UT_StringHolder opNonseams(const SOP_NodeVerb::CookParms &cookparms) const
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
Utility class for containing a color ramp.
void save(std::ostream &os) const
constexpr SYS_FORCE_INLINE T & w() noexcept
fpreal64 getGrainTolerance() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
fpreal getCookTime() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
const char * findChar(int c) const
bool load(UT_IStream &is)
void setNonseams(const UT_StringHolder &val)
fpreal64 opAvoidanceWeight(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void setGrainTolerance(fpreal64 val)
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
fpreal64 getUVTolerance() const
bool operator!=(const SOP_UVAutoseamParms &src) const
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
void setAvoidAttr(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
SYS_FORCE_INLINE UT_StringHolder getToken(BaseSplit enum_value)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_Matrix3D v)
void setUVTolerance(fpreal64 val)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
UT_StringHolder opSeamsGroupName(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
fpreal64 opMergeThreshold(const SOP_NodeVerb::CookParms &cookparms) const
void setUseOutputIslandAttr(bool val)