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;
146 myUvAttr =
"uv"_UTsh;
148 graph->
evalOpParm(myUvAttr, nodeidx,
"uvattr", time, graph->
isDirect()?
nullptr:depnode);
151 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
152 myPackBetween =
false;
154 graph->
evalOpParm(myPackBetween, nodeidx,
"packbetween", time, graph->
isDirect()?
nullptr:depnode);
155 myAdditionalSeams =
""_UTsh;
157 graph->
evalOpParm(myAdditionalSeams, nodeidx,
"additionalseams", time, graph->
isDirect()?
nullptr:depnode);
160 graph->
evalOpParm(myPacking, nodeidx,
"packing", time, graph->
isDirect()?
nullptr:depnode);
162 if (
true && ( (
true&&!(((
int64(getPacking())!=1)))) ) )
163 graph->
evalOpParm(myScale, nodeidx,
"scale", time, graph->
isDirect()?
nullptr:depnode);
166 graph->
evalOpParm(myPadding, nodeidx,
"padding", time, graph->
isDirect()?
nullptr:depnode);
167 myPaddingBoundary =
false;
169 graph->
evalOpParm(myPaddingBoundary, nodeidx,
"paddingboundary", time, graph->
isDirect()?
nullptr:depnode);
170 myPackInCavities =
true;
172 graph->
evalOpParm(myPackInCavities, nodeidx,
"packincavities", time, graph->
isDirect()?
nullptr:depnode);
174 if (
true && ( (
true&&!(((
int64(getPacking())!=0)))) ) )
175 graph->
evalOpParm(myBBoxCenter, nodeidx,
"bboxcenter", time, graph->
isDirect()?
nullptr:depnode);
177 if (
true && ( (
true&&!(((
int64(getPacking())!=0)))) ) )
178 graph->
evalOpParm(myBBoxSize, nodeidx,
"bboxsize", time, graph->
isDirect()?
nullptr:depnode);
179 myCorrectAreas =
false;
181 graph->
evalOpParm(myCorrectAreas, nodeidx,
"correctareas", time, graph->
isDirect()?
nullptr:depnode);
182 myAxisAlignIslands =
true;
184 graph->
evalOpParm(myAxisAlignIslands, nodeidx,
"axisalignislands", time, graph->
isDirect()?
nullptr:depnode);
187 graph->
evalOpParm(myRotations, nodeidx,
"rotations", time, graph->
isDirect()?
nullptr:depnode);
190 graph->
evalOpParm(myIterations, nodeidx,
"iterations", time, graph->
isDirect()?
nullptr:depnode);
192 if (
true && ( (
true&&!(((
int64(getIterations())==1)))) ) )
193 graph->
evalOpParm(myRandSeed, nodeidx,
"randseed", time, graph->
isDirect()?
nullptr:depnode);
196 graph->
evalOpParm(myResolution, nodeidx,
"resolution", time, graph->
isDirect()?
nullptr:depnode);
197 myUvTolerance = 1e-05;
199 graph->
evalOpParm(myUvTolerance, nodeidx,
"uvtolerance", time, graph->
isDirect()?
nullptr:depnode);
200 myScaleTolerance = 0.005;
201 if (
true && ( (
true&&!(((
int64(getPacking())==1)))) ) )
202 graph->
evalOpParm(myScaleTolerance, nodeidx,
"scaletolerance", time, graph->
isDirect()?
nullptr:depnode);
218 template <
typename T>
225 if (idx.
size() != instance.
size()+1)
230 coerceValue(value, myUvAttr);
233 coerceValue(value, myGroup);
236 coerceValue(value, myPackBetween);
239 coerceValue(value, myAdditionalSeams);
242 coerceValue(value, myPacking);
245 coerceValue(value, myScale);
248 coerceValue(value, myPadding);
251 coerceValue(value, myPaddingBoundary);
254 coerceValue(value, myPackInCavities);
257 coerceValue(value, myBBoxCenter);
260 coerceValue(value, myBBoxSize);
263 coerceValue(value, myCorrectAreas);
266 coerceValue(value, myAxisAlignIslands);
269 coerceValue(value, myRotations);
272 coerceValue(value, myIterations);
275 coerceValue(value, myRandSeed);
278 coerceValue(value, myResolution);
281 coerceValue(value, myUvTolerance);
284 coerceValue(value, myScaleTolerance);
300 { doGetParmValue(idx, instance, value); }
302 { doGetParmValue(idx, instance, value); }
304 { doGetParmValue(idx, instance, value); }
306 { doGetParmValue(idx, instance, value); }
308 { doGetParmValue(idx, instance, value); }
310 { doGetParmValue(idx, instance, value); }
312 { doGetParmValue(idx, instance, value); }
314 { doGetParmValue(idx, instance, value); }
316 { doGetParmValue(idx, instance, value); }
318 { doGetParmValue(idx, instance, value); }
320 { doGetParmValue(idx, instance, value); }
322 template <
typename T>
329 if (idx.
size() != instance.
size()+1)
334 coerceValue(myUvAttr, ( ( value ) ));
337 coerceValue(myGroup, ( ( value ) ));
340 coerceValue(myPackBetween, ( ( value ) ));
343 coerceValue(myAdditionalSeams, ( ( value ) ));
346 coerceValue(myPacking, clampMinValue(0, clampMaxValue(3, value ) ));
349 coerceValue(myScale, clampMinValue(0, ( value ) ));
352 coerceValue(myPadding, clampMinValue(0, ( value ) ));
355 coerceValue(myPaddingBoundary, ( ( value ) ));
358 coerceValue(myPackInCavities, ( ( value ) ));
361 coerceValue(myBBoxCenter, ( ( value ) ));
364 coerceValue(myBBoxSize, clampMinValue(0, ( value ) ));
367 coerceValue(myCorrectAreas, ( ( value ) ));
370 coerceValue(myAxisAlignIslands, ( ( value ) ));
373 coerceValue(myRotations, clampMinValue(1, ( value ) ));
376 coerceValue(myIterations, clampMinValue(1, ( value ) ));
379 coerceValue(myRandSeed, clampMinValue(0, ( value ) ));
382 coerceValue(myResolution, clampMinValue(0, clampMaxValue(4, value ) ));
385 coerceValue(myUvTolerance, clampMinValue(0, ( value ) ));
388 coerceValue(myScaleTolerance, ( clampMaxValue(-06, value ) ));
395 { doSetParmValue(idx, instance, value); }
397 { doSetParmValue(idx, instance, value); }
399 { doSetParmValue(idx, instance, value); }
401 { doSetParmValue(idx, instance, value); }
403 { doSetParmValue(idx, instance, value); }
405 { doSetParmValue(idx, instance, value); }
407 { doSetParmValue(idx, instance, value); }
409 { doSetParmValue(idx, instance, value); }
411 { doSetParmValue(idx, instance, value); }
413 { doSetParmValue(idx, instance, value); }
415 { doSetParmValue(idx, instance, value); }
431 if (fieldnum.
size() < 1)
440 return "packbetween";
442 return "additionalseams";
450 return "paddingboundary";
452 return "packincavities";
458 return "correctareas";
460 return "axisalignislands";
470 return "uvtolerance";
472 return "scaletolerance";
480 if (fieldnum.
size() < 1)
481 return PARM_UNSUPPORTED;
524 return PARM_UNSUPPORTED;
560 loadData(is, rampdata);
578 int typelen = colon - data.
buffer();
592 {
int64 iv =
v; UTwrite(os, &iv); }
594 { UTwrite<fpreal64>(os, &
v); }
596 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
598 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
599 UTwrite<fpreal64>(os, &v.
z()); }
601 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
602 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
614 if (s) s->save(ostr);
616 saveData(os, result);
623 ostr << s->getDataTypeToken();
628 saveData(os, result);
632 void save(std::ostream &os)
const
636 saveData(os, myUvAttr);
637 saveData(os, myGroup);
638 saveData(os, myPackBetween);
639 saveData(os, myAdditionalSeams);
640 saveData(os, myPacking);
641 saveData(os, myScale);
642 saveData(os, myPadding);
643 saveData(os, myPaddingBoundary);
644 saveData(os, myPackInCavities);
645 saveData(os, myBBoxCenter);
646 saveData(os, myBBoxSize);
647 saveData(os, myCorrectAreas);
648 saveData(os, myAxisAlignIslands);
649 saveData(os, myRotations);
650 saveData(os, myIterations);
651 saveData(os, myRandSeed);
652 saveData(os, myResolution);
653 saveData(os, myUvTolerance);
654 saveData(os, myScaleTolerance);
667 loadData(is, myUvAttr);
668 loadData(is, myGroup);
669 loadData(is, myPackBetween);
670 loadData(is, myAdditionalSeams);
671 loadData(is, myPacking);
672 loadData(is, myScale);
673 loadData(is, myPadding);
674 loadData(is, myPaddingBoundary);
675 loadData(is, myPackInCavities);
676 loadData(is, myBBoxCenter);
677 loadData(is, myBBoxSize);
678 loadData(is, myCorrectAreas);
679 loadData(is, myAxisAlignIslands);
680 loadData(is, myRotations);
681 loadData(is, myIterations);
682 loadData(is, myRandSeed);
683 loadData(is, myResolution);
684 loadData(is, myUvTolerance);
685 loadData(is, myScaleTolerance);
695 if (!thissop)
return getUvAttr();
697 OP_Utils::evalOpParm(result, thissop,
"uvattr", cookparms.
getCookTime(), 0);
705 if (!thissop)
return getGroup();
707 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
715 if (!thissop)
return getPackBetween();
717 OP_Utils::evalOpParm(result, thissop,
"packbetween", cookparms.
getCookTime(), 0);
725 if (!thissop)
return getAdditionalSeams();
727 OP_Utils::evalOpParm(result, thissop,
"additionalseams", cookparms.
getCookTime(), 0);
735 if (!thissop)
return getPacking();
737 OP_Utils::evalOpParm(result, thissop,
"packing", cookparms.
getCookTime(), 0);
747 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
755 if (!thissop)
return getPadding();
757 OP_Utils::evalOpParm(result, thissop,
"padding", cookparms.
getCookTime(), 0);
765 if (!thissop)
return getPaddingBoundary();
767 OP_Utils::evalOpParm(result, thissop,
"paddingboundary", cookparms.
getCookTime(), 0);
775 if (!thissop)
return getPackInCavities();
777 OP_Utils::evalOpParm(result, thissop,
"packincavities", cookparms.
getCookTime(), 0);
785 if (!thissop)
return getBBoxCenter();
787 OP_Utils::evalOpParm(result, thissop,
"bboxcenter", cookparms.
getCookTime(), 0);
795 if (!thissop)
return getBBoxSize();
797 OP_Utils::evalOpParm(result, thissop,
"bboxsize", cookparms.
getCookTime(), 0);
805 if (!thissop)
return getCorrectAreas();
807 OP_Utils::evalOpParm(result, thissop,
"correctareas", cookparms.
getCookTime(), 0);
815 if (!thissop)
return getAxisAlignIslands();
817 OP_Utils::evalOpParm(result, thissop,
"axisalignislands", cookparms.
getCookTime(), 0);
825 if (!thissop)
return getRotations();
827 OP_Utils::evalOpParm(result, thissop,
"rotations", cookparms.
getCookTime(), 0);
835 if (!thissop)
return getIterations();
837 OP_Utils::evalOpParm(result, thissop,
"iterations", cookparms.
getCookTime(), 0);
845 if (!thissop)
return getRandSeed();
847 OP_Utils::evalOpParm(result, thissop,
"randseed", cookparms.
getCookTime(), 0);
855 if (!thissop)
return getResolution();
857 OP_Utils::evalOpParm(result, thissop,
"resolution", cookparms.
getCookTime(), 0);
865 if (!thissop)
return getUvTolerance();
867 OP_Utils::evalOpParm(result, thissop,
"uvtolerance", cookparms.
getCookTime(), 0);
875 if (!thissop)
return getScaleTolerance();
877 OP_Utils::evalOpParm(result, thissop,
"scaletolerance", cookparms.
getCookTime(), 0);
889 bool myPaddingBoundary;
890 bool myPackInCavities;
894 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)
GLsizei const GLfloat * value
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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
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.
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void saveData(std::ostream &os, UT_Vector4D v)
int64 getRotations() const
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