23 namespace SOP_CurveEnums
36 using namespace UT::Literal;
56 using namespace UT::Literal;
75 using namespace UT::Literal;
118 if (myType != src.myType)
return false;
119 if (myMethod != src.myMethod)
return false;
120 if (myCoords != src.myCoords)
return false;
121 if (myClose != src.myClose)
return false;
122 if (myReverse != src.myReverse)
return false;
123 if (
myOrder != src.myOrder)
return false;
124 if (myParam != src.myParam)
return false;
125 if (myTolerance != src.myTolerance)
return false;
126 if (mySmooth != src.mySmooth)
return false;
127 if (myCsharp != src.myCsharp)
return false;
128 if (myKeepgeo != src.myKeepgeo)
return false;
129 if (myNormalize != src.myNormalize)
return false;
147 graph->
evalOpParm(myType, nodeidx,
"type", time, 0);
150 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
153 graph->
evalOpParm(myCoords, nodeidx,
"coords", time, 0);
155 if (
true && ( (
true&&!(((
int64(getType())==3)))) ) )
156 graph->
evalOpParm(myClose, nodeidx,
"close", time, 0);
159 graph->
evalOpParm(myReverse, nodeidx,
"reverse", time, 0);
161 if (
true && ( (
true&&!(((
int64(getType())!=1)&&(
int64(getType())!=2)))) ) )
164 if (
true && ( (
true&&!(((
int64(getType())!=1)&&(
int64(getType())!=2))||((
int64(getMethod())!=1)))) ) )
165 graph->
evalOpParm(myParam, nodeidx,
"param", time, 0);
167 if (
true && ( (
true&&!(((
int64(getType())!=1)&&(
int64(getType())!=2))||((
int64(getMethod())!=2)))) ) )
168 graph->
evalOpParm(myTolerance, nodeidx,
"tolerance", time, 0);
170 if (
true && ( (
true&&!(((
int64(getType())!=1)&&(
int64(getType())!=2))||((
int64(getMethod())!=2)))) ) )
171 graph->
evalOpParm(mySmooth, nodeidx,
"smooth", time, 0);
173 if (
true && ( (
true&&!(((
int64(getType())!=1)&&(
int64(getType())!=2))||((
int64(getMethod())!=2)))) ) )
174 graph->
evalOpParm(myCsharp, nodeidx,
"csharp", time, 0);
177 graph->
evalOpParm(myKeepgeo, nodeidx,
"keepgeo", time, 0);
179 if (
true && ( (
true&&!(((
int64(getType())!=1)&&(
int64(getType())!=2))||((
int64(getMethod())!=1))||((
int64(getParam())!=0)))) ) )
180 graph->
evalOpParm(myNormalize, nodeidx,
"normalize", time, 0);
196 template <
typename T>
203 if (idx.
size() != instance.
size()+1)
208 coerceValue(value, myType);
211 coerceValue(value, myMethod);
214 coerceValue(value, myCoords);
217 coerceValue(value, myClose);
220 coerceValue(value, myReverse);
226 coerceValue(value, myParam);
229 coerceValue(value, myTolerance);
232 coerceValue(value, mySmooth);
235 coerceValue(value, myCsharp);
238 coerceValue(value, myKeepgeo);
241 coerceValue(value, myNormalize);
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(myType, clampMinValue(0, clampMaxValue(3, value ) ));
294 coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
297 coerceValue(myCoords, ( ( value ) ));
300 coerceValue(myClose, ( ( value ) ));
303 coerceValue(myReverse, ( ( value ) ));
306 coerceValue(
myOrder, clampMinValue(2, clampMaxValue(11, value ) ));
309 coerceValue(myParam, clampMinValue(0, clampMaxValue(2, value ) ));
312 coerceValue(myTolerance, clampMinValue(0, ( value ) ));
315 coerceValue(mySmooth, clampMinValue(0, clampMaxValue(1, value ) ));
318 coerceValue(myCsharp, ( ( value ) ));
321 coerceValue(myKeepgeo, ( ( value ) ));
324 coerceValue(myNormalize, ( ( 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); }
347 { doSetParmValue(idx, instance, value); }
349 { doSetParmValue(idx, instance, value); }
351 { doSetParmValue(idx, instance, value); }
367 if (fieldnum.
size() < 1)
402 if (fieldnum.
size() < 1)
403 return PARM_UNSUPPORTED;
432 return PARM_UNSUPPORTED;
468 loadData(is, rampdata);
486 int typelen = colon - data.
buffer();
500 {
int64 iv =
v; UTwrite(os, &iv); }
502 { UTwrite<fpreal64>(os, &
v); }
504 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
506 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
507 UTwrite<fpreal64>(os, &v.
z()); }
509 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
510 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
522 if (s) s->save(ostr);
524 saveData(os, result);
531 ostr << s->getDataTypeToken();
536 saveData(os, result);
540 void save(std::ostream &os)
const
544 saveData(os, myType);
545 saveData(os, myMethod);
546 saveData(os, myCoords);
547 saveData(os, myClose);
548 saveData(os, myReverse);
550 saveData(os, myParam);
551 saveData(os, myTolerance);
552 saveData(os, mySmooth);
553 saveData(os, myCsharp);
554 saveData(os, myKeepgeo);
555 saveData(os, myNormalize);
568 loadData(is, myType);
569 loadData(is, myMethod);
570 loadData(is, myCoords);
571 loadData(is, myClose);
572 loadData(is, myReverse);
574 loadData(is, myParam);
575 loadData(is, myTolerance);
576 loadData(is, mySmooth);
577 loadData(is, myCsharp);
578 loadData(is, myKeepgeo);
579 loadData(is, myNormalize);
589 if (!thissop)
return getType();
591 OP_Utils::evalOpParm(result, thissop,
"type", cookparms.
getCookTime(), 0);
599 if (!thissop)
return getMethod();
601 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
609 if (!thissop)
return getCoords();
611 OP_Utils::evalOpParm(result, thissop,
"coords", cookparms.
getCookTime(), 0);
619 if (!thissop)
return getClose();
621 OP_Utils::evalOpParm(result, thissop,
"close", cookparms.
getCookTime(), 0);
629 if (!thissop)
return getReverse();
631 OP_Utils::evalOpParm(result, thissop,
"reverse", cookparms.
getCookTime(), 0);
639 if (!thissop)
return getOrder();
641 OP_Utils::evalOpParm(result, thissop,
"order", cookparms.
getCookTime(), 0);
649 if (!thissop)
return getParam();
651 OP_Utils::evalOpParm(result, thissop,
"param", cookparms.
getCookTime(), 0);
652 return Param(result);
659 if (!thissop)
return getTolerance();
661 OP_Utils::evalOpParm(result, thissop,
"tolerance", cookparms.
getCookTime(), 0);
669 if (!thissop)
return getSmooth();
671 OP_Utils::evalOpParm(result, thissop,
"smooth", cookparms.
getCookTime(), 0);
679 if (!thissop)
return getCsharp();
681 OP_Utils::evalOpParm(result, thissop,
"csharp", cookparms.
getCookTime(), 0);
689 if (!thissop)
return getKeepgeo();
691 OP_Utils::evalOpParm(result, thissop,
"keepgeo", cookparms.
getCookTime(), 0);
699 if (!thissop)
return getNormalize();
701 OP_Utils::evalOpParm(result, thissop,
"normalize", cookparms.
getCookTime(), 0);
void copyFrom(const OP_NodeParms *src) override
SOP_Node * getNode() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
bool opKeepgeo(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void saveData(std::ostream &os, UT_Vector2D v)
void save(std::ostream &os) const
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const OP_Context & context() const
static void saveData(std::ostream &os, int64 v)
void setSmooth(fpreal64 val)
constexpr SYS_FORCE_INLINE T & z() noexcept
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
SYS_FORCE_INLINE const char * buffer() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
const char * getNestParmName(TempIndex fieldnum) const override
bool load(UT_IStream &is)
An output stream object that owns its own string buffer storage.
void setTolerance(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
**But if you need a result
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setReverse(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Vector3D v)
void setKeepgeo(bool val)
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
void setMethod(Method val)
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal64 getTolerance() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void loadFromOpSubclass(const LoadParms &loadparms) override
bool opReverse(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getSmooth() const
UT_StringHolder opCoords(const SOP_NodeVerb::CookParms &cookparms) 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
SYS_FORCE_INLINE UT_StringHolder getToken(Type enum_value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, bool v)
const OP_GraphProxy * graph() const
fpreal64 opTolerance(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
bool operator!=(const SOP_CurveParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_Matrix4D v)
bool opNormalize(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setCoords(const UT_StringHolder &val)
static void saveData(std::ostream &os, fpreal64 v)
exint getNestNumParms(TempIndex idx) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
bool getNormalize() const
Type opType(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
int64 opOrder(const SOP_NodeVerb::CookParms &cookparms) const
DEP_MicroNode * depnode() const
bool isParmColorRamp(exint idx) const override
LeafData & operator=(const LeafData &)=delete
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
Utility class for containing a color ramp.
const UT_StringHolder & getCoords() const
constexpr SYS_FORCE_INLINE T & w() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool opCsharp(const SOP_NodeVerb::CookParms &cookparms) const
bool opClose(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const SOP_CurveParms &src) const
fpreal getCookTime() const
static void saveData(std::ostream &os, UT_StringHolder s)
void setNormalize(bool val)
const char * findChar(int c) const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
fpreal64 opSmooth(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
Param opParam(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept