22 using namespace UT::Literal;
25 namespace SOP_CreaseEnums
47 myCreaseattrib =
"creaseweight"_sh;
57 if (myGroup != src.myGroup)
return false;
58 if (myOp != src.myOp)
return false;
59 if (myCrease != src.myCrease)
return false;
60 if (myAddcolor != src.myAddcolor)
return false;
61 if (myCreaseattrib != src.myCreaseattrib)
return false;
77 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
80 graph->
evalOpParm(myOp, nodeidx,
"op", time, 0);
82 if (
true && ( (
true&&!(((
int64(getOp())==2)))) ) )
83 graph->
evalOpParm(myCrease, nodeidx,
"crease", time, 0);
85 if (
true && ( (
true&&!(((
int64(getOp())==2)))) ) )
86 graph->
evalOpParm(myAddcolor, nodeidx,
"addcolor", time, 0);
87 myCreaseattrib =
"creaseweight"_sh;
89 graph->
evalOpParm(myCreaseattrib, nodeidx,
"creaseattrib", time, 0);
105 template <
typename T>
112 if (idx.
size() != instance.
size()+1)
117 coerceValue(value, myGroup);
120 coerceValue(value, myOp);
123 coerceValue(value, myCrease);
126 coerceValue(value, myAddcolor);
129 coerceValue(value, myCreaseattrib);
136 { doGetParmValue(idx, instance, value); }
138 { doGetParmValue(idx, instance, value); }
140 { doGetParmValue(idx, instance, value); }
142 { doGetParmValue(idx, instance, value); }
144 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
165 if (idx.
size() != instance.
size()+1)
170 coerceValue(myGroup, ( ( value ) ));
173 coerceValue(myOp, clampMinValue(0, clampMaxValue(2, value ) ));
176 coerceValue(myCrease, ( ( value ) ));
179 coerceValue(myAddcolor, ( ( value ) ));
182 coerceValue(myCreaseattrib, ( ( value ) ));
189 { doSetParmValue(idx, instance, value); }
191 { doSetParmValue(idx, instance, value); }
193 { doSetParmValue(idx, instance, value); }
195 { doSetParmValue(idx, instance, value); }
197 { doSetParmValue(idx, instance, value); }
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); }
225 if (fieldnum.
size() < 1)
238 return "creaseattrib";
246 if (fieldnum.
size() < 1)
247 return PARM_UNSUPPORTED;
262 return PARM_UNSUPPORTED;
298 loadData(is, rampdata);
316 int typelen = colon - data.
buffer();
330 {
int64 iv =
v; UTwrite(os, &iv); }
332 { UTwrite<fpreal64>(os, &
v); }
334 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
336 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
337 UTwrite<fpreal64>(os, &v.
z()); }
339 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
340 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
352 if (s) s->save(ostr);
354 saveData(os, result);
361 ostr << s->getDataTypeToken();
366 saveData(os, result);
370 void save(std::ostream &os)
const
374 saveData(os, myGroup);
376 saveData(os, myCrease);
377 saveData(os, myAddcolor);
378 saveData(os, myCreaseattrib);
391 loadData(is, myGroup);
393 loadData(is, myCrease);
394 loadData(is, myAddcolor);
395 loadData(is, myCreaseattrib);
405 if (!thissop)
return getGroup();
407 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
415 if (!thissop)
return getOp();
417 OP_Utils::evalOpParm(result, thissop,
"op", cookparms.
getCookTime(), 0);
425 if (!thissop)
return getCrease();
427 OP_Utils::evalOpParm(result, thissop,
"crease", cookparms.
getCookTime(), 0);
435 if (!thissop)
return getAddcolor();
437 OP_Utils::evalOpParm(result, thissop,
"addcolor", cookparms.
getCookTime(), 0);
445 if (!thissop)
return getCreaseattrib();
447 OP_Utils::evalOpParm(result, thissop,
"creaseattrib", cookparms.
getCookTime(), 0);
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 copyFrom(const SOP_NodeParms *src) override
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
~SOP_CreaseParms() override
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
static void loadData(UT_IStream &is, UT_Vector2D &v)
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
const SOP_GraphProxy * graph() 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)
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)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
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 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
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
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)
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
DEP_MicroNode * depnode() const
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)
Utility class for containing a color ramp.
void setGroup(const UT_StringHolder &val)
GLsizei const GLfloat * value
static void loadData(UT_IStream &is, UT_Matrix3D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
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
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)
const OP_Context & context() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)