23 namespace SOP_CreaseEnums
45 myCreaseattrib =
"creaseweight"_UTsh;
58 if (myGroup != src.myGroup)
return false;
59 if (myOp != src.myOp)
return false;
60 if (myCrease != src.myCrease)
return false;
61 if (myAddcolor != src.myAddcolor)
return false;
62 if (myCreaseattrib != src.myCreaseattrib)
return false;
78 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
81 graph->
evalOpParm(myOp, nodeidx,
"op", time, 0);
83 if (
true && ( (
true&&!(((
int64(getOp())==2)))) ) )
84 graph->
evalOpParm(myCrease, nodeidx,
"crease", time, 0);
86 if (
true && ( (
true&&!(((
int64(getOp())==2)))) ) )
87 graph->
evalOpParm(myAddcolor, nodeidx,
"addcolor", time, 0);
88 myCreaseattrib =
"creaseweight"_UTsh;
90 graph->
evalOpParm(myCreaseattrib, nodeidx,
"creaseattrib", time, 0);
106 template <
typename T>
113 if (idx.
size() != instance.
size()+1)
146 { doGetParmValue(idx, instance, value); }
148 { doGetParmValue(idx, instance, value); }
150 { doGetParmValue(idx, instance, value); }
152 { doGetParmValue(idx, instance, value); }
154 { doGetParmValue(idx, instance, value); }
156 { doGetParmValue(idx, instance, value); }
158 { doGetParmValue(idx, instance, value); }
160 { doGetParmValue(idx, instance, value); }
162 { doGetParmValue(idx, instance, value); }
164 { doGetParmValue(idx, instance, value); }
166 { doGetParmValue(idx, instance, value); }
168 template <
typename T>
175 if (idx.
size() != instance.
size()+1)
199 { doSetParmValue(idx, instance, value); }
201 { doSetParmValue(idx, instance, value); }
203 { doSetParmValue(idx, instance, value); }
205 { doSetParmValue(idx, instance, value); }
207 { doSetParmValue(idx, instance, value); }
209 { doSetParmValue(idx, instance, value); }
211 { doSetParmValue(idx, instance, value); }
213 { doSetParmValue(idx, instance, value); }
215 { doSetParmValue(idx, instance, value); }
217 { doSetParmValue(idx, instance, value); }
219 { doSetParmValue(idx, instance, value); }
235 if (fieldnum.
size() < 1)
248 return "creaseattrib";
256 if (fieldnum.
size() < 1)
257 return PARM_UNSUPPORTED;
291 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
293 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
295 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
308 loadData(is, rampdata);
326 int typelen = colon - data.
buffer();
340 {
int64 iv =
v; UTwrite(os, &iv); }
342 { UTwrite<fpreal64>(os, &
v); }
344 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
346 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
347 UTwrite<fpreal64>(os, &v.
z()); }
349 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
350 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
362 if (s) s->save(ostr);
364 saveData(os, result);
371 ostr << s->getDataTypeToken();
376 saveData(os, result);
380 void save(std::ostream &os)
const
384 saveData(os, myGroup);
386 saveData(os, myCrease);
387 saveData(os, myAddcolor);
388 saveData(os, myCreaseattrib);
401 loadData(is, myGroup);
403 loadData(is, myCrease);
404 loadData(is, myAddcolor);
405 loadData(is, myCreaseattrib);
415 if (!thissop)
return getGroup();
417 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
425 if (!thissop)
return getOp();
427 OP_Utils::evalOpParm(result, thissop,
"op", cookparms.
getCookTime(), 0);
435 if (!thissop)
return getCrease();
437 OP_Utils::evalOpParm(result, thissop,
"crease", cookparms.
getCookTime(), 0);
445 if (!thissop)
return getAddcolor();
447 OP_Utils::evalOpParm(result, thissop,
"addcolor", cookparms.
getCookTime(), 0);
455 if (!thissop)
return getCreaseattrib();
457 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)
T clampMaxValue(fpreal maxvalue, const T &src) const
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)
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
T clampMinValue(fpreal minvalue, const T &src) const
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)
void coerceValue(T &result, const S &src) const
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
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)
OP_NodeParms & operator=(const OP_NodeParms &)=default
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