23 namespace SOP_CreaseEnums
35 using namespace UT::Literal;
58 myCreaseattrib =
"creaseweight"_UTsh;
71 if (myGroup != src.myGroup)
return false;
72 if (myOp != src.myOp)
return false;
73 if (myCrease != src.myCrease)
return false;
74 if (myAddcolor != src.myAddcolor)
return false;
75 if (myCreaseattrib != src.myCreaseattrib)
return false;
91 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
94 graph->
evalOpParm(myOp, nodeidx,
"op", time, 0);
96 if (
true && ( (
true&&!(((
int64(getOp())==2)))) ) )
97 graph->
evalOpParm(myCrease, nodeidx,
"crease", time, 0);
99 if (
true && ( (
true&&!(((
int64(getOp())==2)))) ) )
100 graph->
evalOpParm(myAddcolor, nodeidx,
"addcolor", time, 0);
101 myCreaseattrib =
"creaseweight"_UTsh;
103 graph->
evalOpParm(myCreaseattrib, nodeidx,
"creaseattrib", time, 0);
119 template <
typename T>
126 if (idx.
size() != instance.
size()+1)
131 coerceValue(value, myGroup);
134 coerceValue(value, myOp);
137 coerceValue(value, myCrease);
140 coerceValue(value, myAddcolor);
143 coerceValue(value, myCreaseattrib);
159 { doGetParmValue(idx, instance, value); }
161 { doGetParmValue(idx, instance, value); }
163 { doGetParmValue(idx, instance, value); }
165 { doGetParmValue(idx, instance, value); }
167 { doGetParmValue(idx, instance, value); }
169 { doGetParmValue(idx, instance, value); }
171 { doGetParmValue(idx, instance, value); }
173 { doGetParmValue(idx, instance, value); }
175 { doGetParmValue(idx, instance, value); }
177 { doGetParmValue(idx, instance, value); }
179 { doGetParmValue(idx, instance, value); }
181 template <
typename T>
188 if (idx.
size() != instance.
size()+1)
193 coerceValue(myGroup, ( ( value ) ));
196 coerceValue(myOp, clampMinValue(0, clampMaxValue(2, value ) ));
199 coerceValue(myCrease, ( ( value ) ));
202 coerceValue(myAddcolor, ( ( value ) ));
205 coerceValue(myCreaseattrib, ( ( value ) ));
212 { doSetParmValue(idx, instance, value); }
214 { doSetParmValue(idx, instance, value); }
216 { doSetParmValue(idx, instance, value); }
218 { doSetParmValue(idx, instance, value); }
220 { doSetParmValue(idx, instance, value); }
222 { doSetParmValue(idx, instance, value); }
224 { doSetParmValue(idx, instance, value); }
226 { doSetParmValue(idx, instance, value); }
228 { doSetParmValue(idx, instance, value); }
230 { doSetParmValue(idx, instance, value); }
232 { doSetParmValue(idx, instance, value); }
248 if (fieldnum.
size() < 1)
261 return "creaseattrib";
269 if (fieldnum.
size() < 1)
270 return PARM_UNSUPPORTED;
285 return PARM_UNSUPPORTED;
321 loadData(is, rampdata);
339 int typelen = colon - data.
buffer();
353 {
int64 iv =
v; UTwrite(os, &iv); }
355 { UTwrite<fpreal64>(os, &
v); }
357 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
359 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
360 UTwrite<fpreal64>(os, &v.
z()); }
362 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
363 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
375 if (s) s->save(ostr);
377 saveData(os, result);
384 ostr << s->getDataTypeToken();
389 saveData(os, result);
393 void save(std::ostream &os)
const
397 saveData(os, myGroup);
399 saveData(os, myCrease);
400 saveData(os, myAddcolor);
401 saveData(os, myCreaseattrib);
414 loadData(is, myGroup);
416 loadData(is, myCrease);
417 loadData(is, myAddcolor);
418 loadData(is, myCreaseattrib);
428 if (!thissop)
return getGroup();
430 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
438 if (!thissop)
return getOp();
440 OP_Utils::evalOpParm(result, thissop,
"op", cookparms.
getCookTime(), 0);
448 if (!thissop)
return getCrease();
450 OP_Utils::evalOpParm(result, thissop,
"crease", cookparms.
getCookTime(), 0);
458 if (!thissop)
return getAddcolor();
460 OP_Utils::evalOpParm(result, thissop,
"addcolor", cookparms.
getCookTime(), 0);
468 if (!thissop)
return getCreaseattrib();
470 OP_Utils::evalOpParm(result, thissop,
"creaseattrib", cookparms.
getCookTime(), 0);
bool isParmColorRamp(exint idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool operator!=(const SOP_CreaseParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
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 PRM_DataItemHandle &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, bool &v)
void save(std::ostream &os) const
const OP_Context & context() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
SYS_FORCE_INLINE UT_StringHolder getToken(Op enum_value)
constexpr SYS_FORCE_INLINE T & z() noexcept
static void saveData(std::ostream &os, int64 v)
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
SYS_FORCE_INLINE const char * buffer() const
fpreal64 getCrease() const
An output stream object that owns its own string buffer storage.
Op opOp(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const SOP_CreaseParms &src) const
static void saveData(std::ostream &os, bool v)
**But if you need a result
const char * getNestParmName(TempIndex fieldnum) 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 loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_Matrix4D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
exint getNestNumParms(TempIndex idx) const override
static void saveData(std::ostream &os, UT_Vector4D v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool opAddcolor(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opCrease(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
UT_StringHolder opCreaseattrib(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool load(UT_IStream &is)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Vector2I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setAddcolor(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setCreaseattrib(const UT_StringHolder &val)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
void setGroup(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
const UT_StringHolder & getCreaseattrib() const
const UT_StringHolder & getGroup() const
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
const char * findChar(int c) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_Matrix3D v)
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 setCrease(fpreal64 val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
constexpr SYS_FORCE_INLINE T & x() noexcept