23 namespace SOP_UVLayout_2_0Enums
36 using namespace UT::Literal;
58 using namespace UT::Literal;
81 myPackBetween =
false;
82 myAdditionalSeams =
""_UTsh;
86 myPaddingBoundary =
false;
87 myPackInCavities =
true;
90 myCorrectAreas =
false;
91 myAxisAlignIslands =
true;
96 myUvTolerance = 1e-05;
97 myScaleTolerance = 0.005;
110 if (myUvAttr != src.myUvAttr)
return false;
111 if (myGroup != src.myGroup)
return false;
112 if (myPackBetween != src.myPackBetween)
return false;
113 if (myAdditionalSeams != src.myAdditionalSeams)
return false;
114 if (myPacking != src.myPacking)
return false;
115 if (myScale != src.myScale)
return false;
116 if (myPadding != src.myPadding)
return false;
117 if (myPaddingBoundary != src.myPaddingBoundary)
return false;
118 if (myPackInCavities != src.myPackInCavities)
return false;
119 if (myBBoxCenter != src.myBBoxCenter)
return false;
120 if (myBBoxSize != src.myBBoxSize)
return false;
121 if (myCorrectAreas != src.myCorrectAreas)
return false;
122 if (myAxisAlignIslands != src.myAxisAlignIslands)
return false;
123 if (myRotations != src.myRotations)
return false;
124 if (myIterations != src.myIterations)
return false;
125 if (myRandSeed != src.myRandSeed)
return false;
126 if (myResolution != src.myResolution)
return false;
127 if (myUvTolerance != src.myUvTolerance)
return false;
128 if (myScaleTolerance != src.myScaleTolerance)
return false;
143 myUvAttr =
"uv"_UTsh;
145 graph->
evalOpParm(myUvAttr, nodeidx,
"uvattr", time, 0);
148 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
149 myPackBetween =
false;
151 graph->
evalOpParm(myPackBetween, nodeidx,
"packbetween", time, 0);
152 myAdditionalSeams =
""_UTsh;
154 graph->
evalOpParm(myAdditionalSeams, nodeidx,
"additionalseams", time, 0);
157 graph->
evalOpParm(myPacking, nodeidx,
"packing", time, 0);
159 if (
true && ( (
true&&!(((
int64(getPacking())!=1)))) ) )
160 graph->
evalOpParm(myScale, nodeidx,
"scale", time, 0);
163 graph->
evalOpParm(myPadding, nodeidx,
"padding", time, 0);
164 myPaddingBoundary =
false;
166 graph->
evalOpParm(myPaddingBoundary, nodeidx,
"paddingboundary", time, 0);
167 myPackInCavities =
true;
169 graph->
evalOpParm(myPackInCavities, nodeidx,
"packincavities", time, 0);
171 if (
true && ( (
true&&!(((
int64(getPacking())!=0)))) ) )
172 graph->
evalOpParm(myBBoxCenter, nodeidx,
"bboxcenter", time, 0);
174 if (
true && ( (
true&&!(((
int64(getPacking())!=0)))) ) )
175 graph->
evalOpParm(myBBoxSize, nodeidx,
"bboxsize", time, 0);
176 myCorrectAreas =
false;
178 graph->
evalOpParm(myCorrectAreas, nodeidx,
"correctareas", time, 0);
179 myAxisAlignIslands =
true;
181 graph->
evalOpParm(myAxisAlignIslands, nodeidx,
"axisalignislands", time, 0);
184 graph->
evalOpParm(myRotations, nodeidx,
"rotations", time, 0);
187 graph->
evalOpParm(myIterations, nodeidx,
"iterations", time, 0);
189 if (
true && ( (
true&&!(((
int64(getIterations())==1)))) ) )
190 graph->
evalOpParm(myRandSeed, nodeidx,
"randseed", time, 0);
193 graph->
evalOpParm(myResolution, nodeidx,
"resolution", time, 0);
194 myUvTolerance = 1e-05;
196 graph->
evalOpParm(myUvTolerance, nodeidx,
"uvtolerance", time, 0);
197 myScaleTolerance = 0.005;
198 if (
true && ( (
true&&!(((
int64(getPacking())==1)))) ) )
199 graph->
evalOpParm(myScaleTolerance, nodeidx,
"scaletolerance", time, 0);
215 template <
typename T>
222 if (idx.
size() != instance.
size()+1)
227 coerceValue(value, myUvAttr);
230 coerceValue(value, myGroup);
233 coerceValue(value, myPackBetween);
236 coerceValue(value, myAdditionalSeams);
239 coerceValue(value, myPacking);
242 coerceValue(value, myScale);
245 coerceValue(value, myPadding);
248 coerceValue(value, myPaddingBoundary);
251 coerceValue(value, myPackInCavities);
254 coerceValue(value, myBBoxCenter);
257 coerceValue(value, myBBoxSize);
260 coerceValue(value, myCorrectAreas);
263 coerceValue(value, myAxisAlignIslands);
266 coerceValue(value, myRotations);
269 coerceValue(value, myIterations);
272 coerceValue(value, myRandSeed);
275 coerceValue(value, myResolution);
278 coerceValue(value, myUvTolerance);
281 coerceValue(value, myScaleTolerance);
297 { doGetParmValue(idx, instance, value); }
299 { doGetParmValue(idx, instance, value); }
301 { doGetParmValue(idx, instance, value); }
303 { doGetParmValue(idx, instance, value); }
305 { doGetParmValue(idx, instance, value); }
307 { doGetParmValue(idx, instance, value); }
309 { doGetParmValue(idx, instance, value); }
311 { doGetParmValue(idx, instance, value); }
313 { doGetParmValue(idx, instance, value); }
315 { doGetParmValue(idx, instance, value); }
317 { doGetParmValue(idx, instance, value); }
319 template <
typename T>
326 if (idx.
size() != instance.
size()+1)
331 coerceValue(myUvAttr, ( ( value ) ));
334 coerceValue(myGroup, ( ( value ) ));
337 coerceValue(myPackBetween, ( ( value ) ));
340 coerceValue(myAdditionalSeams, ( ( value ) ));
343 coerceValue(myPacking, clampMinValue(0, clampMaxValue(3, value ) ));
346 coerceValue(myScale, clampMinValue(0, ( value ) ));
349 coerceValue(myPadding, clampMinValue(0, ( value ) ));
352 coerceValue(myPaddingBoundary, ( ( value ) ));
355 coerceValue(myPackInCavities, ( ( value ) ));
358 coerceValue(myBBoxCenter, ( ( value ) ));
361 coerceValue(myBBoxSize, clampMinValue(0, ( value ) ));
364 coerceValue(myCorrectAreas, ( ( value ) ));
367 coerceValue(myAxisAlignIslands, ( ( value ) ));
370 coerceValue(myRotations, clampMinValue(1, ( value ) ));
373 coerceValue(myIterations, clampMinValue(1, ( value ) ));
376 coerceValue(myRandSeed, clampMinValue(0, ( value ) ));
379 coerceValue(myResolution, clampMinValue(0, clampMaxValue(4, value ) ));
382 coerceValue(myUvTolerance, clampMinValue(0, ( value ) ));
385 coerceValue(myScaleTolerance, ( clampMaxValue(-06, value ) ));
392 { doSetParmValue(idx, instance, value); }
394 { doSetParmValue(idx, instance, value); }
396 { doSetParmValue(idx, instance, value); }
398 { doSetParmValue(idx, instance, value); }
400 { doSetParmValue(idx, instance, value); }
402 { doSetParmValue(idx, instance, value); }
404 { doSetParmValue(idx, instance, value); }
406 { doSetParmValue(idx, instance, value); }
408 { doSetParmValue(idx, instance, value); }
410 { doSetParmValue(idx, instance, value); }
412 { doSetParmValue(idx, instance, value); }
428 if (fieldnum.
size() < 1)
437 return "packbetween";
439 return "additionalseams";
447 return "paddingboundary";
449 return "packincavities";
455 return "correctareas";
457 return "axisalignislands";
467 return "uvtolerance";
469 return "scaletolerance";
477 if (fieldnum.
size() < 1)
478 return PARM_UNSUPPORTED;
521 return PARM_UNSUPPORTED;
557 loadData(is, rampdata);
575 int typelen = colon - data.
buffer();
589 {
int64 iv =
v; UTwrite(os, &iv); }
591 { UTwrite<fpreal64>(os, &
v); }
593 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
595 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
596 UTwrite<fpreal64>(os, &v.
z()); }
598 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
599 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
611 if (s) s->save(ostr);
613 saveData(os, result);
620 ostr << s->getDataTypeToken();
625 saveData(os, result);
629 void save(std::ostream &os)
const
633 saveData(os, myUvAttr);
634 saveData(os, myGroup);
635 saveData(os, myPackBetween);
636 saveData(os, myAdditionalSeams);
637 saveData(os, myPacking);
638 saveData(os, myScale);
639 saveData(os, myPadding);
640 saveData(os, myPaddingBoundary);
641 saveData(os, myPackInCavities);
642 saveData(os, myBBoxCenter);
643 saveData(os, myBBoxSize);
644 saveData(os, myCorrectAreas);
645 saveData(os, myAxisAlignIslands);
646 saveData(os, myRotations);
647 saveData(os, myIterations);
648 saveData(os, myRandSeed);
649 saveData(os, myResolution);
650 saveData(os, myUvTolerance);
651 saveData(os, myScaleTolerance);
664 loadData(is, myUvAttr);
665 loadData(is, myGroup);
666 loadData(is, myPackBetween);
667 loadData(is, myAdditionalSeams);
668 loadData(is, myPacking);
669 loadData(is, myScale);
670 loadData(is, myPadding);
671 loadData(is, myPaddingBoundary);
672 loadData(is, myPackInCavities);
673 loadData(is, myBBoxCenter);
674 loadData(is, myBBoxSize);
675 loadData(is, myCorrectAreas);
676 loadData(is, myAxisAlignIslands);
677 loadData(is, myRotations);
678 loadData(is, myIterations);
679 loadData(is, myRandSeed);
680 loadData(is, myResolution);
681 loadData(is, myUvTolerance);
682 loadData(is, myScaleTolerance);
692 if (!thissop)
return getUvAttr();
694 OP_Utils::evalOpParm(result, thissop,
"uvattr", cookparms.
getCookTime(), 0);
702 if (!thissop)
return getGroup();
704 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
712 if (!thissop)
return getPackBetween();
714 OP_Utils::evalOpParm(result, thissop,
"packbetween", cookparms.
getCookTime(), 0);
722 if (!thissop)
return getAdditionalSeams();
724 OP_Utils::evalOpParm(result, thissop,
"additionalseams", cookparms.
getCookTime(), 0);
732 if (!thissop)
return getPacking();
734 OP_Utils::evalOpParm(result, thissop,
"packing", cookparms.
getCookTime(), 0);
744 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
752 if (!thissop)
return getPadding();
754 OP_Utils::evalOpParm(result, thissop,
"padding", cookparms.
getCookTime(), 0);
762 if (!thissop)
return getPaddingBoundary();
764 OP_Utils::evalOpParm(result, thissop,
"paddingboundary", cookparms.
getCookTime(), 0);
772 if (!thissop)
return getPackInCavities();
774 OP_Utils::evalOpParm(result, thissop,
"packincavities", cookparms.
getCookTime(), 0);
782 if (!thissop)
return getBBoxCenter();
784 OP_Utils::evalOpParm(result, thissop,
"bboxcenter", cookparms.
getCookTime(), 0);
792 if (!thissop)
return getBBoxSize();
794 OP_Utils::evalOpParm(result, thissop,
"bboxsize", cookparms.
getCookTime(), 0);
802 if (!thissop)
return getCorrectAreas();
804 OP_Utils::evalOpParm(result, thissop,
"correctareas", cookparms.
getCookTime(), 0);
812 if (!thissop)
return getAxisAlignIslands();
814 OP_Utils::evalOpParm(result, thissop,
"axisalignislands", cookparms.
getCookTime(), 0);
822 if (!thissop)
return getRotations();
824 OP_Utils::evalOpParm(result, thissop,
"rotations", cookparms.
getCookTime(), 0);
832 if (!thissop)
return getIterations();
834 OP_Utils::evalOpParm(result, thissop,
"iterations", cookparms.
getCookTime(), 0);
842 if (!thissop)
return getRandSeed();
844 OP_Utils::evalOpParm(result, thissop,
"randseed", cookparms.
getCookTime(), 0);
852 if (!thissop)
return getResolution();
854 OP_Utils::evalOpParm(result, thissop,
"resolution", cookparms.
getCookTime(), 0);
862 if (!thissop)
return getUvTolerance();
864 OP_Utils::evalOpParm(result, thissop,
"uvtolerance", cookparms.
getCookTime(), 0);
872 if (!thissop)
return getScaleTolerance();
874 OP_Utils::evalOpParm(result, thissop,
"scaletolerance", cookparms.
getCookTime(), 0);
886 bool myPaddingBoundary;
887 bool myPackInCavities;
891 bool myAxisAlignIslands;
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
Packing getPacking() const
int64 opPadding(const SOP_NodeVerb::CookParms &cookparms) const
bool getPackInCavities() const
void setGroup(const UT_StringHolder &val)
bool operator!=(const SOP_UVLayout_2_0Parms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
fpreal64 getUvTolerance() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opPaddingBoundary(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
static void loadData(UT_IStream &is, fpreal64 &v)
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void saveData(std::ostream &os, UT_StringHolder s)
UT_Vector2D getBBoxSize() const
void setPackBetween(bool val)
UT_StringHolder opAdditionalSeams(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE UT_StringHolder getToken(Packing enum_value)
int64 opRandSeed(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_Vector2T< fpreal64 > UT_Vector2D
int64 getRandSeed() const
static void saveData(std::ostream &os, UT_Matrix2D v)
void save(std::ostream &os) const
bool getPaddingBoundary() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
fpreal64 getScale() const
void setPackInCavities(bool val)
const OP_Context & context() const
static void saveData(std::ostream &os, UT_Matrix3D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
Resolution getResolution() const
SYS_FORCE_INLINE const char * buffer() const
An output stream object that owns its own string buffer storage.
fpreal64 getScaleTolerance() const
bool opPackInCavities(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
**But if you need a result
void setAdditionalSeams(const UT_StringHolder &val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setResolution(Resolution val)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool getAxisAlignIslands() const
void setUvTolerance(fpreal64 val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Packing opPacking(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
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 setAxisAlignIslands(bool val)
const UT_StringHolder & getUvAttr() const
const OP_GraphProxy * graph() const
bool operator==(const SOP_UVLayout_2_0Parms &src) const
void copyFrom(const OP_NodeParms *src) override
UT_Vector2D getBBoxCenter() const
void setRandSeed(int64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
const UT_StringHolder & getGroup() const
static void saveData(std::ostream &os, fpreal64 v)
void setUvAttr(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setBBoxCenter(UT_Vector2D val)
UT_StringHolder opUvAttr(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setIterations(int64 val)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
UT_Vector2D opBBoxSize(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void setPadding(int64 val)
Resolution opResolution(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
bool getCorrectAreas() const
GT_API const UT_StringHolder version
fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
int64 opIterations(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
bool opAxisAlignIslands(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, int64 &v)
void setPaddingBoundary(bool val)
void setScaleTolerance(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setBBoxSize(UT_Vector2D val)
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, bool v)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
static void loadData(UT_IStream &is, UT_Vector3D &v)
const UT_StringHolder & getAdditionalSeams() const
void setCorrectAreas(bool val)
constexpr SYS_FORCE_INLINE T & w() noexcept
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.
int64 opRotations(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
fpreal getCookTime() const
static void saveData(std::ostream &os, UT_Matrix4D v)
exint getNestNumParms(TempIndex idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setScale(fpreal64 val)
const char * findChar(int c) const
const char * getNestParmName(TempIndex fieldnum) const override
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
fpreal64 opScaleTolerance(const SOP_NodeVerb::CookParms &cookparms) const
bool getPackBetween() const
constexpr SYS_FORCE_INLINE T & y() noexcept
fpreal64 opUvTolerance(const SOP_NodeVerb::CookParms &cookparms) const
bool opCorrectAreas(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector4D v)
int64 getRotations() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
int64 getIterations() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
void setPacking(Packing val)
UT_Vector2D opBBoxCenter(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, int64 v)
void setRotations(int64 val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void loadFromOpSubclass(const LoadParms &loadparms) override
bool opPackBetween(const SOP_NodeVerb::CookParms &cookparms) const
bool load(UT_IStream &is)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override