23 namespace SOP_CurvesectEnums
36 using namespace UT::Literal;
57 using namespace UT::Literal;
77 using namespace UT::Literal;
96 myLeftgroup =
""_UTsh;
97 myRightgroup =
""_UTsh;
105 myKeeporiginal =
false;
118 if (myLeftgroup != src.myLeftgroup)
return false;
119 if (myRightgroup != src.myRightgroup)
return false;
120 if (myXsect != src.myXsect)
return false;
121 if (myTolerance != src.myTolerance)
return false;
122 if (myLeft != src.myLeft)
return false;
123 if (myRight != src.myRight)
return false;
124 if (myStdswitcher != src.myStdswitcher)
return false;
125 if (myAffect != src.myAffect)
return false;
126 if (myExtractpt != src.myExtractpt)
return false;
127 if (myKeeporiginal != src.myKeeporiginal)
return false;
143 myLeftgroup =
""_UTsh;
145 graph->
evalOpParm(myLeftgroup, nodeidx,
"leftgroup", time, 0);
146 myRightgroup =
""_UTsh;
148 graph->
evalOpParm(myRightgroup, nodeidx,
"rightgroup", time, 0);
151 graph->
evalOpParm(myXsect, nodeidx,
"xsect", time, 0);
153 if (
true && ( (
true&&!(((getXsect()==0)))) ) )
154 graph->
evalOpParm(myTolerance, nodeidx,
"tolerance", time, 0);
157 graph->
evalOpParm(myLeft, nodeidx,
"left", time, 0);
160 graph->
evalOpParm(myRight, nodeidx,
"right", time, 0);
163 graph->
evalOpParm(myStdswitcher, nodeidx,
"stdswitcher", time, 0);
166 graph->
evalOpParm(myAffect, nodeidx,
"affect", time, 0);
169 graph->
evalOpParm(myExtractpt, nodeidx,
"extractPt", time, 0);
170 myKeeporiginal =
false;
172 graph->
evalOpParm(myKeeporiginal, nodeidx,
"keepOriginal", time, 0);
188 template <
typename T>
195 if (idx.
size() != instance.
size()+1)
200 coerceValue(value, myLeftgroup);
203 coerceValue(value, myRightgroup);
206 coerceValue(value, myXsect);
209 coerceValue(value, myTolerance);
212 coerceValue(value, myLeft);
215 coerceValue(value, myRight);
218 coerceValue(value, myStdswitcher);
221 coerceValue(value, myAffect);
224 coerceValue(value, myExtractpt);
227 coerceValue(value, myKeeporiginal);
243 { doGetParmValue(idx, instance, value); }
245 { doGetParmValue(idx, instance, value); }
247 { doGetParmValue(idx, instance, value); }
249 { doGetParmValue(idx, instance, value); }
251 { doGetParmValue(idx, instance, value); }
253 { doGetParmValue(idx, instance, value); }
255 { doGetParmValue(idx, instance, value); }
257 { doGetParmValue(idx, instance, value); }
259 { doGetParmValue(idx, instance, value); }
261 { doGetParmValue(idx, instance, value); }
263 { doGetParmValue(idx, instance, value); }
265 template <
typename T>
272 if (idx.
size() != instance.
size()+1)
277 coerceValue(myLeftgroup, ( ( value ) ));
280 coerceValue(myRightgroup, ( ( value ) ));
283 coerceValue(myXsect, ( ( value ) ));
286 coerceValue(myTolerance, clampMinValue(0, clampMaxValue(1, value ) ));
289 coerceValue(myLeft, clampMinValue(0, clampMaxValue(3, value ) ));
292 coerceValue(myRight, clampMinValue(0, clampMaxValue(3, value ) ));
295 coerceValue(myStdswitcher, ( ( value ) ));
298 coerceValue(myAffect, clampMinValue(0, clampMaxValue(2, value ) ));
301 coerceValue(myExtractpt, ( ( value ) ));
304 coerceValue(myKeeporiginal, ( ( value ) ));
311 { doSetParmValue(idx, instance, value); }
313 { doSetParmValue(idx, instance, value); }
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
323 { doSetParmValue(idx, instance, value); }
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
331 { doSetParmValue(idx, instance, value); }
347 if (fieldnum.
size() < 1)
364 return "stdswitcher";
370 return "keepOriginal";
378 if (fieldnum.
size() < 1)
379 return PARM_UNSUPPORTED;
404 return PARM_UNSUPPORTED;
440 loadData(is, rampdata);
458 int typelen = colon - data.
buffer();
472 {
int64 iv =
v; UTwrite(os, &iv); }
474 { UTwrite<fpreal64>(os, &
v); }
476 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
478 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
479 UTwrite<fpreal64>(os, &v.
z()); }
481 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
482 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
494 if (s) s->save(ostr);
496 saveData(os, result);
503 ostr << s->getDataTypeToken();
508 saveData(os, result);
512 void save(std::ostream &os)
const
516 saveData(os, myLeftgroup);
517 saveData(os, myRightgroup);
518 saveData(os, myXsect);
519 saveData(os, myTolerance);
520 saveData(os, myLeft);
521 saveData(os, myRight);
522 saveData(os, myStdswitcher);
523 saveData(os, myAffect);
524 saveData(os, myExtractpt);
525 saveData(os, myKeeporiginal);
538 loadData(is, myLeftgroup);
539 loadData(is, myRightgroup);
540 loadData(is, myXsect);
541 loadData(is, myTolerance);
542 loadData(is, myLeft);
543 loadData(is, myRight);
544 loadData(is, myStdswitcher);
545 loadData(is, myAffect);
546 loadData(is, myExtractpt);
547 loadData(is, myKeeporiginal);
557 if (!thissop)
return getLeftgroup();
559 OP_Utils::evalOpParm(result, thissop,
"leftgroup", cookparms.
getCookTime(), 0);
567 if (!thissop)
return getRightgroup();
569 OP_Utils::evalOpParm(result, thissop,
"rightgroup", cookparms.
getCookTime(), 0);
577 if (!thissop)
return getXsect();
579 OP_Utils::evalOpParm(result, thissop,
"xsect", cookparms.
getCookTime(), 0);
587 if (!thissop)
return getTolerance();
589 OP_Utils::evalOpParm(result, thissop,
"tolerance", cookparms.
getCookTime(), 0);
597 if (!thissop)
return getLeft();
599 OP_Utils::evalOpParm(result, thissop,
"left", cookparms.
getCookTime(), 0);
607 if (!thissop)
return getRight();
609 OP_Utils::evalOpParm(result, thissop,
"right", cookparms.
getCookTime(), 0);
610 return Right(result);
617 if (!thissop)
return getStdswitcher();
619 OP_Utils::evalOpParm(result, thissop,
"stdswitcher", cookparms.
getCookTime(), 0);
627 if (!thissop)
return getAffect();
629 OP_Utils::evalOpParm(result, thissop,
"affect", cookparms.
getCookTime(), 0);
637 if (!thissop)
return getExtractpt();
639 OP_Utils::evalOpParm(result, thissop,
"extractPt", cookparms.
getCookTime(), 0);
647 if (!thissop)
return getKeeporiginal();
649 OP_Utils::evalOpParm(result, thissop,
"keepOriginal", cookparms.
getCookTime(), 0);
void save(std::ostream &os) const
bool operator!=(const SOP_CurvesectParms &src) const
bool operator==(const SOP_CurvesectParms &src) const
fpreal64 opTolerance(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2I &v)
SOP_Node * getNode() const
Right opRight(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
int64 opStdswitcher(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE UT_StringHolder getToken(Left enum_value)
static void saveData(std::ostream &os, UT_Matrix3D v)
void setKeeporiginal(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setExtractpt(bool val)
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, fpreal64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, bool v)
**But if you need a result
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setRightgroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, bool &v)
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 getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, int64 v)
UT_StringHolder opLeftgroup(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
exint getNestNumParms(TempIndex idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setStdswitcher(int64 val)
void setAffect(Affect val)
Affect opAffect(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getRightgroup() const
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, UT_Vector4D v)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
bool opKeeporiginal(const SOP_NodeVerb::CookParms &cookparms) const
const char * getNestParmName(TempIndex fieldnum) const override
void copyFrom(const OP_NodeParms *src) override
fpreal64 getTolerance() const
const OP_GraphProxy * graph() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool getKeeporiginal() const
bool load(UT_IStream &is)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
ParmType getNestParmType(TempIndex fieldnum) const override
bool getExtractpt() const
GT_API const UT_StringHolder version
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
bool opExtractpt(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getLeftgroup() const
void setLeftgroup(const UT_StringHolder &val)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Left opLeft(const SOP_NodeVerb::CookParms &cookparms) const
Utility class for containing a color ramp.
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setTolerance(fpreal64 val)
fpreal getCookTime() const
const char * findChar(int c) const
bool opXsect(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_StringHolder opRightgroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
int64 getStdswitcher() const
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void loadFromOpSubclass(const LoadParms &loadparms) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept