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;
166 myUVAttrib =
"uv"_UTsh;
168 graph->
evalOpParm(myUVAttrib, nodeidx,
"uvattrib", time, graph->
isDirect()?
nullptr:depnode);
171 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
172 myPlaneGroup =
""_UTsh;
173 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,1)>=0)==0)))) ) )
174 graph->
evalOpParm(myPlaneGroup, nodeidx,
"planegroup", time, graph->
isDirect()?
nullptr:depnode);
176 if (
true && ( (
true&&!((((graph->
getInput(nodeidx,1)>=0)!=0)))) ) )
177 graph->
evalOpParm(myPlanes, nodeidx,
"nplanes", time, graph->
isDirect()?
nullptr:depnode);
180 graph->
evalOpParm(myLayoutType, nodeidx,
"layout", time, graph->
isDirect()?
nullptr:depnode);
183 graph->
evalOpParm(myScaleType, nodeidx,
"scale", time, graph->
isDirect()?
nullptr:depnode);
186 graph->
evalOpParm(mySpacing, nodeidx,
"spacing", time, graph->
isDirect()?
nullptr:depnode);
189 graph->
evalOpParm(myRotateOrder, nodeidx,
"rOrd", time, graph->
isDirect()?
nullptr:depnode);
208 template <
typename T>
215 if (idx.
size() != instance.
size()+1)
220 coerceValue(value, myUVAttrib);
223 coerceValue(value, myGroup);
226 coerceValue(value, myPlaneGroup);
229 coerceValue(value, myPlanes);
232 coerceValue(value, myLayoutType);
235 coerceValue(value, myScaleType);
238 coerceValue(value, mySpacing);
241 coerceValue(value, myRotateOrder);
244 coerceValue(value, myRotate);
260 { doGetParmValue(idx, instance, value); }
262 { doGetParmValue(idx, instance, value); }
264 { doGetParmValue(idx, instance, value); }
266 { doGetParmValue(idx, instance, value); }
268 { doGetParmValue(idx, instance, value); }
270 { doGetParmValue(idx, instance, value); }
272 { doGetParmValue(idx, instance, value); }
274 { doGetParmValue(idx, instance, value); }
276 { doGetParmValue(idx, instance, value); }
278 { doGetParmValue(idx, instance, value); }
280 { doGetParmValue(idx, instance, value); }
282 template <
typename T>
289 if (idx.
size() != instance.
size()+1)
294 coerceValue(myUVAttrib, ( ( value ) ));
297 coerceValue(myGroup, ( ( value ) ));
300 coerceValue(myPlaneGroup, ( ( value ) ));
303 coerceValue(myPlanes, clampMinValue(0, clampMaxValue(3, value ) ));
306 coerceValue(myLayoutType, clampMinValue(0, clampMaxValue(1, value ) ));
309 coerceValue(myScaleType, clampMinValue(0, clampMaxValue(2, value ) ));
312 coerceValue(mySpacing, clampMinValue(0, ( value ) ));
315 coerceValue(myRotateOrder, clampMinValue(0, clampMaxValue(5, value ) ));
318 coerceValue(myRotate, ( ( value ) ));
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
331 { doSetParmValue(idx, instance, value); }
333 { doSetParmValue(idx, instance, value); }
335 { doSetParmValue(idx, instance, value); }
337 { doSetParmValue(idx, instance, value); }
339 { doSetParmValue(idx, instance, value); }
341 { doSetParmValue(idx, instance, value); }
343 { doSetParmValue(idx, instance, value); }
345 { doSetParmValue(idx, instance, value); }
361 if (fieldnum.
size() < 1)
390 if (fieldnum.
size() < 1)
391 return PARM_UNSUPPORTED;
414 return PARM_UNSUPPORTED;
450 loadData(is, rampdata);
468 int typelen = colon - data.
buffer();
482 {
int64 iv =
v; UTwrite(os, &iv); }
484 { UTwrite<fpreal64>(os, &
v); }
486 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
488 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
489 UTwrite<fpreal64>(os, &v.
z()); }
491 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
492 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
504 if (s) s->save(ostr);
506 saveData(os, result);
513 ostr << s->getDataTypeToken();
518 saveData(os, result);
522 void save(std::ostream &os)
const
526 saveData(os, myUVAttrib);
527 saveData(os, myGroup);
528 saveData(os, myPlaneGroup);
529 saveData(os, myPlanes);
530 saveData(os, myLayoutType);
531 saveData(os, myScaleType);
532 saveData(os, mySpacing);
533 saveData(os, myRotateOrder);
534 saveData(os, myRotate);
547 loadData(is, myUVAttrib);
548 loadData(is, myGroup);
549 loadData(is, myPlaneGroup);
550 loadData(is, myPlanes);
551 loadData(is, myLayoutType);
552 loadData(is, myScaleType);
553 loadData(is, mySpacing);
554 loadData(is, myRotateOrder);
555 loadData(is, myRotate);
565 if (!thissop)
return getUVAttrib();
567 OP_Utils::evalOpParm(result, thissop,
"uvattrib", cookparms.
getCookTime(), 0);
575 if (!thissop)
return getGroup();
577 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
585 if (!thissop)
return getPlaneGroup();
587 OP_Utils::evalOpParm(result, thissop,
"planegroup", cookparms.
getCookTime(), 0);
595 if (!thissop)
return getPlanes();
597 OP_Utils::evalOpParm(result, thissop,
"nplanes", cookparms.
getCookTime(), 0);
605 if (!thissop)
return getLayoutType();
607 OP_Utils::evalOpParm(result, thissop,
"layout", cookparms.
getCookTime(), 0);
615 if (!thissop)
return getScaleType();
617 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
625 if (!thissop)
return getSpacing();
627 OP_Utils::evalOpParm(result, thissop,
"spacing", cookparms.
getCookTime(), 0);
635 if (!thissop)
return getRotateOrder();
637 OP_Utils::evalOpParm(result, thissop,
"rOrd", cookparms.
getCookTime(), 0);
645 if (!thissop)
return getRotate();
647 OP_Utils::evalOpParm(result, thissop,
"r", cookparms.
getCookTime(), 0);
virtual NodeIdx getInput(NodeIdx idx, OP_InputIdx input, bool markused=false) const =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
GLsizei const GLfloat * value
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
constexpr SYS_FORCE_INLINE T & x() noexcept
LayoutType opLayoutType(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)
virtual UT_StringHolder baseGetSignature() const
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)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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
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