23 namespace SOP_ClipEnums
35 using namespace UT::Literal;
60 myAbove =
"above_plane"_UTsh;
61 myBelow =
"below_plane"_UTsh;
75 if (myGroup != src.myGroup)
return false;
76 if (myClipop != src.myClipop)
return false;
77 if (myOrigin != src.myOrigin)
return false;
78 if (myDist != src.myDist)
return false;
79 if (myDir != src.myDir)
return false;
80 if (myNewg != src.myNewg)
return false;
81 if (myAbove != src.myAbove)
return false;
82 if (myBelow != src.myBelow)
return false;
83 if (myClippts != src.myClippts)
return false;
102 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
105 graph->
evalOpParm(myClipop, nodeidx,
"clipop", time, graph->
isDirect()?
nullptr:depnode);
108 graph->
evalOpParm(myOrigin, nodeidx,
"origin", time, graph->
isDirect()?
nullptr:depnode);
116 if (
true && ( (
true&&!(((
int64(getClipop())!=2)))) ) )
118 myAbove =
"above_plane"_UTsh;
119 if (
true && ( (
true&&!(((
int64(getClipop())!=2))||((getNewg()==0)))) ) )
120 graph->
evalOpParm(myAbove, nodeidx,
"above", time, graph->
isDirect()?
nullptr:depnode);
121 myBelow =
"below_plane"_UTsh;
122 if (
true && ( (
true&&!(((
int64(getClipop())!=2))||((getNewg()==0)))) ) )
123 graph->
evalOpParm(myBelow, nodeidx,
"below", time, graph->
isDirect()?
nullptr:depnode);
126 graph->
evalOpParm(myClippts, nodeidx,
"clippts", time, graph->
isDirect()?
nullptr:depnode);
142 template <
typename T>
149 if (idx.
size() != instance.
size()+1)
154 coerceValue(value, myGroup);
157 coerceValue(value, myClipop);
160 coerceValue(value, myOrigin);
163 coerceValue(value, myDist);
166 coerceValue(value, myDir);
169 coerceValue(value, myNewg);
172 coerceValue(value, myAbove);
175 coerceValue(value, myBelow);
178 coerceValue(value, myClippts);
194 { doGetParmValue(idx, instance, value); }
196 { doGetParmValue(idx, instance, value); }
198 { doGetParmValue(idx, instance, value); }
200 { doGetParmValue(idx, instance, value); }
202 { doGetParmValue(idx, instance, value); }
204 { doGetParmValue(idx, instance, value); }
206 { doGetParmValue(idx, instance, value); }
208 { doGetParmValue(idx, instance, value); }
210 { doGetParmValue(idx, instance, value); }
212 { doGetParmValue(idx, instance, value); }
214 { doGetParmValue(idx, instance, value); }
216 template <
typename T>
223 if (idx.
size() != instance.
size()+1)
228 coerceValue(myGroup, ( ( value ) ));
231 coerceValue(myClipop, clampMinValue(0, clampMaxValue(2, value ) ));
234 coerceValue(myOrigin, ( ( value ) ));
237 coerceValue(myDist, ( ( value ) ));
240 coerceValue(myDir, ( ( value ) ));
243 coerceValue(myNewg, ( ( value ) ));
246 coerceValue(myAbove, ( ( value ) ));
249 coerceValue(myBelow, ( ( value ) ));
252 coerceValue(myClippts, ( ( value ) ));
259 { doSetParmValue(idx, instance, value); }
261 { doSetParmValue(idx, instance, value); }
263 { doSetParmValue(idx, instance, value); }
265 { doSetParmValue(idx, instance, value); }
267 { doSetParmValue(idx, instance, value); }
269 { doSetParmValue(idx, instance, value); }
271 { doSetParmValue(idx, instance, value); }
273 { doSetParmValue(idx, instance, value); }
275 { doSetParmValue(idx, instance, value); }
277 { doSetParmValue(idx, instance, value); }
279 { doSetParmValue(idx, instance, value); }
295 if (fieldnum.
size() < 1)
324 if (fieldnum.
size() < 1)
325 return PARM_UNSUPPORTED;
348 return PARM_UNSUPPORTED;
384 loadData(is, rampdata);
402 int typelen = colon - data.
buffer();
416 {
int64 iv =
v; UTwrite(os, &iv); }
418 { UTwrite<fpreal64>(os, &
v); }
420 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
422 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
423 UTwrite<fpreal64>(os, &v.
z()); }
425 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
426 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
438 if (s) s->save(ostr);
440 saveData(os, result);
447 ostr << s->getDataTypeToken();
452 saveData(os, result);
456 void save(std::ostream &os)
const
460 saveData(os, myGroup);
461 saveData(os, myClipop);
462 saveData(os, myOrigin);
463 saveData(os, myDist);
465 saveData(os, myNewg);
466 saveData(os, myAbove);
467 saveData(os, myBelow);
468 saveData(os, myClippts);
481 loadData(is, myGroup);
482 loadData(is, myClipop);
483 loadData(is, myOrigin);
484 loadData(is, myDist);
486 loadData(is, myNewg);
487 loadData(is, myAbove);
488 loadData(is, myBelow);
489 loadData(is, myClippts);
499 if (!thissop)
return getGroup();
501 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
509 if (!thissop)
return getClipop();
511 OP_Utils::evalOpParm(result, thissop,
"clipop", cookparms.
getCookTime(), 0);
519 if (!thissop)
return getOrigin();
521 OP_Utils::evalOpParm(result, thissop,
"origin", cookparms.
getCookTime(), 0);
529 if (!thissop)
return getDist();
531 OP_Utils::evalOpParm(result, thissop,
"dist", cookparms.
getCookTime(), 0);
539 if (!thissop)
return getDir();
541 OP_Utils::evalOpParm(result, thissop,
"dir", cookparms.
getCookTime(), 0);
549 if (!thissop)
return getNewg();
551 OP_Utils::evalOpParm(result, thissop,
"newg", cookparms.
getCookTime(), 0);
559 if (!thissop)
return getAbove();
561 OP_Utils::evalOpParm(result, thissop,
"above", cookparms.
getCookTime(), 0);
569 if (!thissop)
return getBelow();
571 OP_Utils::evalOpParm(result, thissop,
"below", cookparms.
getCookTime(), 0);
579 if (!thissop)
return getClippts();
581 OP_Utils::evalOpParm(result, thissop,
"clippts", cookparms.
getCookTime(), 0);
bool operator!=(const SOP_ClipParms &src) const
static void loadData(UT_IStream &is, int64 &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
const UT_StringHolder & getAbove() const
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
UT_StringHolder opBelow(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
UT_Vector3D opDir(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_Vector3D getOrigin() const
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 fpreal &value) override
GLsizei const GLfloat * value
fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, fpreal64 v)
void setDist(fpreal64 val)
bool opClippts(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
static void saveData(std::ostream &os, UT_Vector2D v)
const char * getNestParmName(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
SYS_FORCE_INLINE const char * buffer() const
static void loadData(UT_IStream &is, UT_Vector2D &v)
An output stream object that owns its own string buffer storage.
**But if you need a result
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setClippts(bool val)
static void saveData(std::ostream &os, UT_Vector3D 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.
static void saveData(std::ostream &os, UT_Vector4D v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
SYS_FORCE_INLINE UT_StringHolder getToken(Clipop enum_value)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
bool load(UT_IStream &is)
constexpr SYS_FORCE_INLINE T & z() noexcept
UT_StringHolder opAbove(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool operator==(const SOP_ClipParms &src) const
const OP_GraphProxy * graph() const
void setClipop(Clipop val)
void setDir(UT_Vector3D val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, UT_StringHolder s)
void loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_Vector3T< fpreal64 > UT_Vector3D
bool isParmColorRamp(exint idx) const override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void save(std::ostream &os) const
void setOrigin(UT_Vector3D val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
UT_Vector3D opOrigin(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
DEP_MicroNode * depnode() const
void setGroup(const UT_StringHolder &val)
Clipop opClipop(const SOP_NodeVerb::CookParms &cookparms) const
LeafData & operator=(const LeafData &)=delete
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
Utility class for containing a color ramp.
bool opNewg(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Vector3I &v)
virtual UT_StringHolder baseGetSignature() const
UT_Vector3D getDir() const
void setAbove(const UT_StringHolder &val)
fpreal getCookTime() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const char * findChar(int c) const
const UT_StringHolder & getGroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void copyFrom(const OP_NodeParms *src) override
constexpr SYS_FORCE_INLINE T & y() noexcept
const UT_StringHolder & getBelow() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, bool v)
void setBelow(const UT_StringHolder &val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept