23 namespace SOP_KnifeEnums
47 myAbove =
"above_plane"_UTsh;
48 myBelow =
"below_plane"_UTsh;
62 if (myGroup != src.myGroup)
return false;
63 if (myKnifeop != src.myKnifeop)
return false;
64 if (myOrigin != src.myOrigin)
return false;
65 if (myDist != src.myDist)
return false;
66 if (myDir != src.myDir)
return false;
67 if (myNewg != src.myNewg)
return false;
68 if (myAbove != src.myAbove)
return false;
69 if (myBelow != src.myBelow)
return false;
70 if (myClippts != src.myClippts)
return false;
86 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
89 graph->
evalOpParm(myKnifeop, nodeidx,
"knifeop", time, 0);
92 graph->
evalOpParm(myOrigin, nodeidx,
"origin", time, 0);
95 graph->
evalOpParm(myDist, nodeidx,
"dist", time, 0);
98 graph->
evalOpParm(myDir, nodeidx,
"dir", time, 0);
100 if (
true && ( (
true&&!(((
int64(getKnifeop())!=2)))) ) )
101 graph->
evalOpParm(myNewg, nodeidx,
"newg", time, 0);
102 myAbove =
"above_plane"_UTsh;
103 if (
true && ( (
true&&!(((
int64(getKnifeop())!=2))||((getNewg()==0)))) ) )
104 graph->
evalOpParm(myAbove, nodeidx,
"above", time, 0);
105 myBelow =
"below_plane"_UTsh;
106 if (
true && ( (
true&&!(((
int64(getKnifeop())!=2))||((getNewg()==0)))) ) )
107 graph->
evalOpParm(myBelow, nodeidx,
"below", time, 0);
110 graph->
evalOpParm(myClippts, nodeidx,
"clippts", time, 0);
126 template <
typename T>
133 if (idx.
size() != instance.
size()+1)
178 { doGetParmValue(idx, instance, value); }
180 { doGetParmValue(idx, instance, value); }
182 { doGetParmValue(idx, instance, value); }
184 { doGetParmValue(idx, instance, value); }
186 { doGetParmValue(idx, instance, value); }
188 { doGetParmValue(idx, instance, value); }
190 { doGetParmValue(idx, instance, value); }
192 { doGetParmValue(idx, instance, value); }
194 { doGetParmValue(idx, instance, value); }
196 { doGetParmValue(idx, instance, value); }
198 { doGetParmValue(idx, instance, value); }
200 template <
typename T>
207 if (idx.
size() != instance.
size()+1)
243 { doSetParmValue(idx, instance, value); }
245 { doSetParmValue(idx, instance, value); }
247 { doSetParmValue(idx, instance, value); }
249 { doSetParmValue(idx, instance, value); }
251 { doSetParmValue(idx, instance, value); }
253 { doSetParmValue(idx, instance, value); }
255 { doSetParmValue(idx, instance, value); }
257 { doSetParmValue(idx, instance, value); }
259 { doSetParmValue(idx, instance, value); }
261 { doSetParmValue(idx, instance, value); }
263 { doSetParmValue(idx, instance, value); }
279 if (fieldnum.
size() < 1)
308 if (fieldnum.
size() < 1)
309 return PARM_UNSUPPORTED;
351 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
353 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
355 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
368 loadData(is, rampdata);
386 int typelen = colon - data.
buffer();
400 {
int64 iv =
v; UTwrite(os, &iv); }
402 { UTwrite<fpreal64>(os, &
v); }
404 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
406 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
407 UTwrite<fpreal64>(os, &v.
z()); }
409 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
410 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
422 if (s) s->save(ostr);
424 saveData(os, result);
431 ostr << s->getDataTypeToken();
436 saveData(os, result);
440 void save(std::ostream &os)
const
444 saveData(os, myGroup);
445 saveData(os, myKnifeop);
446 saveData(os, myOrigin);
447 saveData(os, myDist);
449 saveData(os, myNewg);
450 saveData(os, myAbove);
451 saveData(os, myBelow);
452 saveData(os, myClippts);
465 loadData(is, myGroup);
466 loadData(is, myKnifeop);
467 loadData(is, myOrigin);
468 loadData(is, myDist);
470 loadData(is, myNewg);
471 loadData(is, myAbove);
472 loadData(is, myBelow);
473 loadData(is, myClippts);
483 if (!thissop)
return getGroup();
485 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
493 if (!thissop)
return getKnifeop();
495 OP_Utils::evalOpParm(result, thissop,
"knifeop", cookparms.
getCookTime(), 0);
503 if (!thissop)
return getOrigin();
505 OP_Utils::evalOpParm(result, thissop,
"origin", cookparms.
getCookTime(), 0);
513 if (!thissop)
return getDist();
515 OP_Utils::evalOpParm(result, thissop,
"dist", cookparms.
getCookTime(), 0);
523 if (!thissop)
return getDir();
525 OP_Utils::evalOpParm(result, thissop,
"dir", cookparms.
getCookTime(), 0);
533 if (!thissop)
return getNewg();
535 OP_Utils::evalOpParm(result, thissop,
"newg", cookparms.
getCookTime(), 0);
543 if (!thissop)
return getAbove();
545 OP_Utils::evalOpParm(result, thissop,
"above", cookparms.
getCookTime(), 0);
553 if (!thissop)
return getBelow();
555 OP_Utils::evalOpParm(result, thissop,
"below", cookparms.
getCookTime(), 0);
563 if (!thissop)
return getClippts();
565 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)
T clampMaxValue(fpreal maxvalue, const T &src) const
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
T clampMinValue(fpreal minvalue, const T &src) const
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 coerceValue(T &result, const S &src) const
void setDist(fpreal64 val)
DEP_MicroNode * depnode() const
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
OP_NodeParms & operator=(const OP_NodeParms &)=default
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