23 namespace SOP_TetCraftEnums
34 using namespace UT::Literal;
67 if (myGroup != src.myGroup)
return false;
68 if (myBuildDirection != src.myBuildDirection)
return false;
69 if (myCreateTets != src.myCreateTets)
return false;
85 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
88 graph->
evalOpParm(myBuildDirection, nodeidx,
"direction", time, 0);
91 graph->
evalOpParm(myCreateTets, nodeidx,
"createtets", time, 0);
107 template <
typename T>
114 if (idx.
size() != instance.
size()+1)
119 coerceValue(value, myGroup);
122 coerceValue(value, myBuildDirection);
125 coerceValue(value, myCreateTets);
141 { doGetParmValue(idx, instance, value); }
143 { doGetParmValue(idx, instance, value); }
145 { doGetParmValue(idx, instance, value); }
147 { doGetParmValue(idx, instance, value); }
149 { doGetParmValue(idx, instance, value); }
151 { doGetParmValue(idx, instance, value); }
153 { doGetParmValue(idx, instance, value); }
155 { doGetParmValue(idx, instance, value); }
157 { doGetParmValue(idx, instance, value); }
159 { doGetParmValue(idx, instance, value); }
161 { doGetParmValue(idx, instance, value); }
163 template <
typename T>
170 if (idx.
size() != instance.
size()+1)
175 coerceValue(myGroup, ( ( value ) ));
178 coerceValue(myBuildDirection, clampMinValue(0, clampMaxValue(1, value ) ));
181 coerceValue(myCreateTets, ( ( value ) ));
188 { doSetParmValue(idx, instance, value); }
190 { doSetParmValue(idx, instance, value); }
192 { doSetParmValue(idx, instance, value); }
194 { doSetParmValue(idx, instance, value); }
196 { doSetParmValue(idx, instance, value); }
198 { doSetParmValue(idx, instance, value); }
200 { doSetParmValue(idx, instance, value); }
202 { doSetParmValue(idx, instance, value); }
204 { doSetParmValue(idx, instance, value); }
206 { doSetParmValue(idx, instance, value); }
208 { doSetParmValue(idx, instance, value); }
224 if (fieldnum.
size() < 1)
241 if (fieldnum.
size() < 1)
242 return PARM_UNSUPPORTED;
253 return PARM_UNSUPPORTED;
289 loadData(is, rampdata);
307 int typelen = colon - data.
buffer();
321 {
int64 iv =
v; UTwrite(os, &iv); }
323 { UTwrite<fpreal64>(os, &
v); }
325 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
327 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
328 UTwrite<fpreal64>(os, &v.
z()); }
330 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
331 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
343 if (s) s->save(ostr);
345 saveData(os, result);
352 ostr << s->getDataTypeToken();
357 saveData(os, result);
361 void save(std::ostream &os)
const
365 saveData(os, myGroup);
366 saveData(os, myBuildDirection);
367 saveData(os, myCreateTets);
380 loadData(is, myGroup);
381 loadData(is, myBuildDirection);
382 loadData(is, myCreateTets);
392 if (!thissop)
return getGroup();
394 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
402 if (!thissop)
return getBuildDirection();
404 OP_Utils::evalOpParm(result, thissop,
"direction", cookparms.
getCookTime(), 0);
412 if (!thissop)
return getCreateTets();
414 OP_Utils::evalOpParm(result, thissop,
"createtets", cookparms.
getCookTime(), 0);
420 int64 myBuildDirection;
const UT_StringHolder & getGroup() const
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
SOP_Node * getNode() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
BuildDirection getBuildDirection() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setCreateTets(bool val)
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
SYS_FORCE_INLINE const char * buffer() const
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, UT_Matrix3D v)
**But if you need a result
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &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 setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
void copyFrom(const OP_NodeParms *src) override
constexpr SYS_FORCE_INLINE T & x() noexcept
void setBuildDirection(BuildDirection val)
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
BuildDirection opBuildDirection(const SOP_NodeVerb::CookParms &cookparms) const
void save(std::ostream &os) const
bool isParmColorRamp(exint idx) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
const OP_GraphProxy * graph() const
SYS_FORCE_INLINE UT_StringHolder getToken(BuildDirection enum_value)
static void saveData(std::ostream &os, fpreal64 v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void saveData(std::ostream &os, bool v)
void loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setGroup(const UT_StringHolder &val)
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.
GT_API const UT_StringHolder version
bool load(UT_IStream &is)
bool operator!=(const SOP_TetCraftParms &src) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
DEP_MicroNode * depnode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
LeafData & operator=(const LeafData &)=delete
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
const char * getNestParmName(TempIndex fieldnum) const override
ParmType getNestParmType(TempIndex fieldnum) const override
fpreal getCookTime() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, UT_Vector4D &v)
bool opCreateTets(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const char * findChar(int c) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
bool operator==(const SOP_TetCraftParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
exint getNestNumParms(TempIndex idx) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
bool getCreateTets() const
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override