23 namespace SOP_KnifeEnums
35 using namespace UT::Literal;
60 myAbove =
"above_plane"_UTsh;
61 myBelow =
"below_plane"_UTsh;
75 if (myGroup != src.myGroup)
return false;
76 if (myKnifeop != src.myKnifeop)
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;
99 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
102 graph->
evalOpParm(myKnifeop, nodeidx,
"knifeop", time, 0);
105 graph->
evalOpParm(myOrigin, nodeidx,
"origin", time, 0);
108 graph->
evalOpParm(myDist, nodeidx,
"dist", time, 0);
111 graph->
evalOpParm(myDir, nodeidx,
"dir", time, 0);
113 if (
true && ( (
true&&!(((
int64(getKnifeop())!=2)))) ) )
114 graph->
evalOpParm(myNewg, nodeidx,
"newg", time, 0);
115 myAbove =
"above_plane"_UTsh;
116 if (
true && ( (
true&&!(((
int64(getKnifeop())!=2))||((getNewg()==0)))) ) )
117 graph->
evalOpParm(myAbove, nodeidx,
"above", time, 0);
118 myBelow =
"below_plane"_UTsh;
119 if (
true && ( (
true&&!(((
int64(getKnifeop())!=2))||((getNewg()==0)))) ) )
120 graph->
evalOpParm(myBelow, nodeidx,
"below", time, 0);
123 graph->
evalOpParm(myClippts, nodeidx,
"clippts", time, 0);
139 template <
typename T>
146 if (idx.
size() != instance.
size()+1)
151 coerceValue(value, myGroup);
154 coerceValue(value, myKnifeop);
157 coerceValue(value, myOrigin);
160 coerceValue(value, myDist);
163 coerceValue(value, myDir);
166 coerceValue(value, myNewg);
169 coerceValue(value, myAbove);
172 coerceValue(value, myBelow);
175 coerceValue(value, myClippts);
191 { doGetParmValue(idx, instance, value); }
193 { doGetParmValue(idx, instance, value); }
195 { doGetParmValue(idx, instance, value); }
197 { doGetParmValue(idx, instance, value); }
199 { doGetParmValue(idx, instance, value); }
201 { doGetParmValue(idx, instance, value); }
203 { doGetParmValue(idx, instance, value); }
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 { doGetParmValue(idx, instance, value); }
211 { doGetParmValue(idx, instance, value); }
213 template <
typename T>
220 if (idx.
size() != instance.
size()+1)
225 coerceValue(myGroup, ( ( value ) ));
228 coerceValue(myKnifeop, clampMinValue(0, clampMaxValue(2, value ) ));
231 coerceValue(myOrigin, ( ( value ) ));
234 coerceValue(myDist, ( ( value ) ));
237 coerceValue(myDir, ( ( value ) ));
240 coerceValue(myNewg, ( ( value ) ));
243 coerceValue(myAbove, ( ( value ) ));
246 coerceValue(myBelow, ( ( value ) ));
249 coerceValue(myClippts, ( ( value ) ));
256 { doSetParmValue(idx, instance, value); }
258 { doSetParmValue(idx, instance, value); }
260 { doSetParmValue(idx, instance, value); }
262 { doSetParmValue(idx, instance, value); }
264 { doSetParmValue(idx, instance, value); }
266 { doSetParmValue(idx, instance, value); }
268 { doSetParmValue(idx, instance, value); }
270 { doSetParmValue(idx, instance, value); }
272 { doSetParmValue(idx, instance, value); }
274 { doSetParmValue(idx, instance, value); }
276 { doSetParmValue(idx, instance, value); }
292 if (fieldnum.
size() < 1)
321 if (fieldnum.
size() < 1)
322 return PARM_UNSUPPORTED;
345 return PARM_UNSUPPORTED;
381 loadData(is, rampdata);
399 int typelen = colon - data.
buffer();
413 {
int64 iv =
v; UTwrite(os, &iv); }
415 { UTwrite<fpreal64>(os, &
v); }
417 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
419 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
420 UTwrite<fpreal64>(os, &v.
z()); }
422 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
423 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
435 if (s) s->save(ostr);
437 saveData(os, result);
444 ostr << s->getDataTypeToken();
449 saveData(os, result);
453 void save(std::ostream &os)
const
457 saveData(os, myGroup);
458 saveData(os, myKnifeop);
459 saveData(os, myOrigin);
460 saveData(os, myDist);
462 saveData(os, myNewg);
463 saveData(os, myAbove);
464 saveData(os, myBelow);
465 saveData(os, myClippts);
478 loadData(is, myGroup);
479 loadData(is, myKnifeop);
480 loadData(is, myOrigin);
481 loadData(is, myDist);
483 loadData(is, myNewg);
484 loadData(is, myAbove);
485 loadData(is, myBelow);
486 loadData(is, myClippts);
496 if (!thissop)
return getGroup();
498 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
506 if (!thissop)
return getKnifeop();
508 OP_Utils::evalOpParm(result, thissop,
"knifeop", cookparms.
getCookTime(), 0);
516 if (!thissop)
return getOrigin();
518 OP_Utils::evalOpParm(result, thissop,
"origin", cookparms.
getCookTime(), 0);
526 if (!thissop)
return getDist();
528 OP_Utils::evalOpParm(result, thissop,
"dist", cookparms.
getCookTime(), 0);
536 if (!thissop)
return getDir();
538 OP_Utils::evalOpParm(result, thissop,
"dir", cookparms.
getCookTime(), 0);
546 if (!thissop)
return getNewg();
548 OP_Utils::evalOpParm(result, thissop,
"newg", cookparms.
getCookTime(), 0);
556 if (!thissop)
return getAbove();
558 OP_Utils::evalOpParm(result, thissop,
"above", cookparms.
getCookTime(), 0);
566 if (!thissop)
return getBelow();
568 OP_Utils::evalOpParm(result, thissop,
"below", cookparms.
getCookTime(), 0);
576 if (!thissop)
return getClippts();
578 OP_Utils::evalOpParm(result, thissop,
"clippts", cookparms.
getCookTime(), 0);
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Matrix3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
SOP_Node * getNode() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setKnifeop(Knifeop val)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, UT_StringHolder s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void loadData(UT_IStream &is, int64 &v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix4D v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool operator==(const SOP_KnifeParms &src) const
static void saveData(std::ostream &os, UT_Vector2D v)
const OP_Context & context() const
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & z() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
SYS_FORCE_INLINE const char * buffer() const
UT_Vector3D getOrigin() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, fpreal64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
**But if you need a result
const char * getNestParmName(TempIndex fieldnum) const override
SYS_FORCE_INLINE UT_StringHolder getToken(Knifeop enum_value)
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 setOrigin(UT_Vector3D val)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
fpreal64 opDist(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool operator!=(const SOP_KnifeParms &src) const
static void saveData(std::ostream &os, bool v)
void setBelow(const UT_StringHolder &val)
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
const UT_StringHolder & getGroup() const
Knifeop getKnifeop() const
static void loadData(UT_IStream &is, bool &v)
UT_Vector3D opDir(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, UT_StringHolder &v)
UT_Vector3T< fpreal64 > UT_Vector3D
void setAbove(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void loadData(UT_IStream &is, UT_Vector4I &v)
GT_API const UT_StringHolder version
void save(std::ostream &os) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void saveData(std::ostream &os, UT_Vector4D v)
exint getNestNumParms(TempIndex idx) const override
UT_StringHolder opAbove(const SOP_NodeVerb::CookParms &cookparms) const
void setDist(fpreal64 val)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
bool opNewg(const SOP_NodeVerb::CookParms &cookparms) const
bool opClippts(const SOP_NodeVerb::CookParms &cookparms) const
void setDir(UT_Vector3D val)
Knifeop opKnifeop(const SOP_NodeVerb::CookParms &cookparms) const
UT_Vector3D getDir() const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
fpreal getCookTime() const
const UT_StringHolder & getAbove() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
UT_Vector3D opOrigin(const SOP_NodeVerb::CookParms &cookparms) const
ParmType getNestParmType(TempIndex fieldnum) const override
const char * findChar(int c) const
void setClippts(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_StringHolder opBelow(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setGroup(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void saveData(std::ostream &os, PRM_DataItemHandle s)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
const UT_StringHolder & getBelow() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool isParmColorRamp(exint idx) const override
constexpr SYS_FORCE_INLINE T & x() noexcept