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;
146 myLeftgroup =
""_UTsh;
148 graph->
evalOpParm(myLeftgroup, nodeidx,
"leftgroup", time, graph->
isDirect()?
nullptr:depnode);
149 myRightgroup =
""_UTsh;
151 graph->
evalOpParm(myRightgroup, nodeidx,
"rightgroup", time, graph->
isDirect()?
nullptr:depnode);
154 graph->
evalOpParm(myXsect, nodeidx,
"xsect", time, graph->
isDirect()?
nullptr:depnode);
156 if (
true && ( (
true&&!(((getXsect()==0)))) ) )
157 graph->
evalOpParm(myTolerance, nodeidx,
"tolerance", time, graph->
isDirect()?
nullptr:depnode);
163 graph->
evalOpParm(myRight, nodeidx,
"right", time, graph->
isDirect()?
nullptr:depnode);
166 graph->
evalOpParm(myStdswitcher, nodeidx,
"stdswitcher", time, graph->
isDirect()?
nullptr:depnode);
169 graph->
evalOpParm(myAffect, nodeidx,
"affect", time, graph->
isDirect()?
nullptr:depnode);
172 graph->
evalOpParm(myExtractpt, nodeidx,
"extractPt", time, graph->
isDirect()?
nullptr:depnode);
173 myKeeporiginal =
false;
175 graph->
evalOpParm(myKeeporiginal, nodeidx,
"keepOriginal", time, graph->
isDirect()?
nullptr:depnode);
191 template <
typename T>
198 if (idx.
size() != instance.
size()+1)
203 coerceValue(value, myLeftgroup);
206 coerceValue(value, myRightgroup);
209 coerceValue(value, myXsect);
212 coerceValue(value, myTolerance);
215 coerceValue(value, myLeft);
218 coerceValue(value, myRight);
221 coerceValue(value, myStdswitcher);
224 coerceValue(value, myAffect);
227 coerceValue(value, myExtractpt);
230 coerceValue(value, myKeeporiginal);
246 { doGetParmValue(idx, instance, value); }
248 { doGetParmValue(idx, instance, value); }
250 { doGetParmValue(idx, instance, value); }
252 { doGetParmValue(idx, instance, value); }
254 { doGetParmValue(idx, instance, value); }
256 { doGetParmValue(idx, instance, value); }
258 { doGetParmValue(idx, instance, value); }
260 { doGetParmValue(idx, instance, value); }
262 { doGetParmValue(idx, instance, value); }
264 { doGetParmValue(idx, instance, value); }
266 { doGetParmValue(idx, instance, value); }
268 template <
typename T>
275 if (idx.
size() != instance.
size()+1)
280 coerceValue(myLeftgroup, ( ( value ) ));
283 coerceValue(myRightgroup, ( ( value ) ));
286 coerceValue(myXsect, ( ( value ) ));
289 coerceValue(myTolerance, clampMinValue(0, clampMaxValue(1, value ) ));
292 coerceValue(myLeft, clampMinValue(0, clampMaxValue(3, value ) ));
295 coerceValue(myRight, clampMinValue(0, clampMaxValue(3, value ) ));
298 coerceValue(myStdswitcher, ( ( value ) ));
301 coerceValue(myAffect, clampMinValue(0, clampMaxValue(2, value ) ));
304 coerceValue(myExtractpt, ( ( value ) ));
307 coerceValue(myKeeporiginal, ( ( value ) ));
314 { doSetParmValue(idx, instance, value); }
316 { doSetParmValue(idx, instance, value); }
318 { doSetParmValue(idx, instance, value); }
320 { doSetParmValue(idx, instance, value); }
322 { doSetParmValue(idx, instance, value); }
324 { doSetParmValue(idx, instance, value); }
326 { doSetParmValue(idx, instance, value); }
328 { doSetParmValue(idx, instance, value); }
330 { doSetParmValue(idx, instance, value); }
332 { doSetParmValue(idx, instance, value); }
334 { doSetParmValue(idx, instance, value); }
350 if (fieldnum.
size() < 1)
367 return "stdswitcher";
373 return "keepOriginal";
381 if (fieldnum.
size() < 1)
382 return PARM_UNSUPPORTED;
407 return PARM_UNSUPPORTED;
443 loadData(is, rampdata);
461 int typelen = colon - data.
buffer();
475 {
int64 iv =
v; UTwrite(os, &iv); }
477 { UTwrite<fpreal64>(os, &
v); }
479 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
481 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
482 UTwrite<fpreal64>(os, &v.
z()); }
484 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
485 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
497 if (s) s->save(ostr);
499 saveData(os, result);
506 ostr << s->getDataTypeToken();
511 saveData(os, result);
515 void save(std::ostream &os)
const
519 saveData(os, myLeftgroup);
520 saveData(os, myRightgroup);
521 saveData(os, myXsect);
522 saveData(os, myTolerance);
523 saveData(os, myLeft);
524 saveData(os, myRight);
525 saveData(os, myStdswitcher);
526 saveData(os, myAffect);
527 saveData(os, myExtractpt);
528 saveData(os, myKeeporiginal);
541 loadData(is, myLeftgroup);
542 loadData(is, myRightgroup);
543 loadData(is, myXsect);
544 loadData(is, myTolerance);
545 loadData(is, myLeft);
546 loadData(is, myRight);
547 loadData(is, myStdswitcher);
548 loadData(is, myAffect);
549 loadData(is, myExtractpt);
550 loadData(is, myKeeporiginal);
560 if (!thissop)
return getLeftgroup();
562 OP_Utils::evalOpParm(result, thissop,
"leftgroup", cookparms.
getCookTime(), 0);
570 if (!thissop)
return getRightgroup();
572 OP_Utils::evalOpParm(result, thissop,
"rightgroup", cookparms.
getCookTime(), 0);
580 if (!thissop)
return getXsect();
582 OP_Utils::evalOpParm(result, thissop,
"xsect", cookparms.
getCookTime(), 0);
590 if (!thissop)
return getTolerance();
592 OP_Utils::evalOpParm(result, thissop,
"tolerance", cookparms.
getCookTime(), 0);
600 if (!thissop)
return getLeft();
602 OP_Utils::evalOpParm(result, thissop,
"left", cookparms.
getCookTime(), 0);
610 if (!thissop)
return getRight();
612 OP_Utils::evalOpParm(result, thissop,
"right", cookparms.
getCookTime(), 0);
613 return Right(result);
620 if (!thissop)
return getStdswitcher();
622 OP_Utils::evalOpParm(result, thissop,
"stdswitcher", cookparms.
getCookTime(), 0);
630 if (!thissop)
return getAffect();
632 OP_Utils::evalOpParm(result, thissop,
"affect", cookparms.
getCookTime(), 0);
640 if (!thissop)
return getExtractpt();
642 OP_Utils::evalOpParm(result, thissop,
"extractPt", cookparms.
getCookTime(), 0);
650 if (!thissop)
return getKeeporiginal();
652 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)
GLsizei const GLfloat * 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)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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