23 namespace SOP_UVUnwrapEnums
36 using namespace UT::Literal;
55 using namespace UT::Literal;
73 using namespace UT::Literal;
95 using namespace UT::Literal;
117 myUVAttrib =
"uv"_UTsh;
119 myPlaneGroup =
""_UTsh;
138 if (myUVAttrib != src.myUVAttrib)
return false;
139 if (myGroup != src.myGroup)
return false;
140 if (myPlaneGroup != src.myPlaneGroup)
return false;
141 if (myPlanes != src.myPlanes)
return false;
142 if (myLayoutType != src.myLayoutType)
return false;
143 if (myScaleType != src.myScaleType)
return false;
144 if (mySpacing != src.mySpacing)
return false;
145 if (myRotateOrder != src.myRotateOrder)
return false;
146 if (myRotate != src.myRotate)
return false;
163 myUVAttrib =
"uv"_UTsh;
165 graph->
evalOpParm(myUVAttrib, nodeidx,
"uvattrib", time, 0);
168 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
169 myPlaneGroup =
""_UTsh;
170 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,1)>=0)==0)))) ) )
171 graph->
evalOpParm(myPlaneGroup, nodeidx,
"planegroup", time, 0);
173 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,1)>=0)!=0)))) ) )
174 graph->
evalOpParm(myPlanes, nodeidx,
"nplanes", time, 0);
177 graph->
evalOpParm(myLayoutType, nodeidx,
"layout", time, 0);
180 graph->
evalOpParm(myScaleType, nodeidx,
"scale", time, 0);
183 graph->
evalOpParm(mySpacing, nodeidx,
"spacing", time, 0);
186 graph->
evalOpParm(myRotateOrder, nodeidx,
"rOrd", time, 0);
189 graph->
evalOpParm(myRotate, nodeidx,
"r", time, 0);
205 template <
typename T>
212 if (idx.
size() != instance.
size()+1)
217 coerceValue(value, myUVAttrib);
220 coerceValue(value, myGroup);
223 coerceValue(value, myPlaneGroup);
226 coerceValue(value, myPlanes);
229 coerceValue(value, myLayoutType);
232 coerceValue(value, myScaleType);
235 coerceValue(value, mySpacing);
238 coerceValue(value, myRotateOrder);
241 coerceValue(value, myRotate);
257 { doGetParmValue(idx, instance, value); }
259 { doGetParmValue(idx, instance, value); }
261 { doGetParmValue(idx, instance, value); }
263 { doGetParmValue(idx, instance, value); }
265 { doGetParmValue(idx, instance, value); }
267 { doGetParmValue(idx, instance, value); }
269 { doGetParmValue(idx, instance, value); }
271 { doGetParmValue(idx, instance, value); }
273 { doGetParmValue(idx, instance, value); }
275 { doGetParmValue(idx, instance, value); }
277 { doGetParmValue(idx, instance, value); }
279 template <
typename T>
286 if (idx.
size() != instance.
size()+1)
291 coerceValue(myUVAttrib, ( ( value ) ));
294 coerceValue(myGroup, ( ( value ) ));
297 coerceValue(myPlaneGroup, ( ( value ) ));
300 coerceValue(myPlanes, clampMinValue(0, clampMaxValue(3, value ) ));
303 coerceValue(myLayoutType, clampMinValue(0, clampMaxValue(1, value ) ));
306 coerceValue(myScaleType, clampMinValue(0, clampMaxValue(2, value ) ));
309 coerceValue(mySpacing, clampMinValue(0, ( value ) ));
312 coerceValue(myRotateOrder, clampMinValue(0, clampMaxValue(5, value ) ));
315 coerceValue(myRotate, ( ( value ) ));
322 { doSetParmValue(idx, instance, value); }
324 { doSetParmValue(idx, instance, value); }
326 { doSetParmValue(idx, instance, value); }
328 { doSetParmValue(idx, instance, value); }
330 { doSetParmValue(idx, instance, value); }
332 { doSetParmValue(idx, instance, value); }
334 { doSetParmValue(idx, instance, value); }
336 { doSetParmValue(idx, instance, value); }
338 { doSetParmValue(idx, instance, value); }
340 { doSetParmValue(idx, instance, value); }
342 { doSetParmValue(idx, instance, value); }
358 if (fieldnum.
size() < 1)
387 if (fieldnum.
size() < 1)
388 return PARM_UNSUPPORTED;
411 return PARM_UNSUPPORTED;
447 loadData(is, rampdata);
465 int typelen = colon - data.
buffer();
479 {
int64 iv =
v; UTwrite(os, &iv); }
481 { UTwrite<fpreal64>(os, &
v); }
483 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
485 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
486 UTwrite<fpreal64>(os, &v.
z()); }
488 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
489 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
501 if (s) s->save(ostr);
503 saveData(os, result);
510 ostr << s->getDataTypeToken();
515 saveData(os, result);
519 void save(std::ostream &os)
const
523 saveData(os, myUVAttrib);
524 saveData(os, myGroup);
525 saveData(os, myPlaneGroup);
526 saveData(os, myPlanes);
527 saveData(os, myLayoutType);
528 saveData(os, myScaleType);
529 saveData(os, mySpacing);
530 saveData(os, myRotateOrder);
531 saveData(os, myRotate);
544 loadData(is, myUVAttrib);
545 loadData(is, myGroup);
546 loadData(is, myPlaneGroup);
547 loadData(is, myPlanes);
548 loadData(is, myLayoutType);
549 loadData(is, myScaleType);
550 loadData(is, mySpacing);
551 loadData(is, myRotateOrder);
552 loadData(is, myRotate);
562 if (!thissop)
return getUVAttrib();
564 OP_Utils::evalOpParm(result, thissop,
"uvattrib", cookparms.
getCookTime(), 0);
572 if (!thissop)
return getGroup();
574 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
582 if (!thissop)
return getPlaneGroup();
584 OP_Utils::evalOpParm(result, thissop,
"planegroup", cookparms.
getCookTime(), 0);
592 if (!thissop)
return getPlanes();
594 OP_Utils::evalOpParm(result, thissop,
"nplanes", cookparms.
getCookTime(), 0);
602 if (!thissop)
return getLayoutType();
604 OP_Utils::evalOpParm(result, thissop,
"layout", cookparms.
getCookTime(), 0);
612 if (!thissop)
return getScaleType();
614 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
622 if (!thissop)
return getSpacing();
624 OP_Utils::evalOpParm(result, thissop,
"spacing", cookparms.
getCookTime(), 0);
632 if (!thissop)
return getRotateOrder();
634 OP_Utils::evalOpParm(result, thissop,
"rOrd", cookparms.
getCookTime(), 0);
642 if (!thissop)
return getRotate();
644 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
SYS_FORCE_INLINE UT_StringHolder getToken(Planes enum_value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setRotate(UT_Vector3D val)
static void saveData(std::ostream &os, bool v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
SOP_Node * getNode() const
bool isParmColorRamp(exint idx) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void copyFrom(const OP_NodeParms *src) override
UT_StringHolder opPlaneGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, int64 &v)
UT_Vector3D getRotate() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setPlaneGroup(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
const OP_Context & context() const
UT_Vector3D opRotate(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
ParmType getNestParmType(TempIndex fieldnum) const override
bool operator==(const SOP_UVUnwrapParms &src) const
void loadFromOpSubclass(const LoadParms &loadparms) override
const UT_StringHolder & getPlaneGroup() const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
**But if you need a result
static void loadData(UT_IStream &is, UT_Vector3I &v)
void save(std::ostream &os) const
static void loadData(UT_IStream &is, fpreal64 &v)
bool load(UT_IStream &is)
void setPlanes(Planes val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
virtual NodeIdx getInput(NodeIdx idx, int input, bool markused=false) const =0
constexpr SYS_FORCE_INLINE T & x() noexcept
LayoutType opLayoutType(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
RotateOrder getRotateOrder() const
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
UT_StringHolder opUVAttrib(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const UT_StringHolder & getUVAttrib() 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 exint &value) override
const OP_GraphProxy * graph() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setRotateOrder(RotateOrder val)
LayoutType getLayoutType() const
UT_Vector3T< fpreal64 > UT_Vector3D
const UT_StringHolder & getGroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void saveBinary(std::ostream &os) const
Save string to binary stream.
exint getNestNumParms(TempIndex idx) const override
GT_API const UT_StringHolder version
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setSpacing(fpreal64 val)
bool operator!=(const SOP_UVUnwrapParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setScaleType(ScaleType val)
ScaleType getScaleType() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
fpreal64 getSpacing() const
fpreal64 opSpacing(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
Planes opPlanes(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, UT_Vector2D v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
fpreal getCookTime() const
const char * findChar(int c) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
ScaleType opScaleType(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setUVAttrib(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
RotateOrder opRotateOrder(const SOP_NodeVerb::CookParms &cookparms) const
void setGroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_StringHolder s)
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setLayoutType(LayoutType val)
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept