23 namespace SOP_TetLayerEnums
34 using namespace UT::Literal;
55 myEnableThicknessMultiplierAttribute =
false;
56 myThicknessMultiplierAttribute =
""_UTsh;
57 myCreateBoundaryTriangles =
false;
71 if (myGroup != src.myGroup)
return false;
72 if (myBuildDirection != src.myBuildDirection)
return false;
73 if (myThickness != src.myThickness)
return false;
74 if (myEnableThicknessMultiplierAttribute != src.myEnableThicknessMultiplierAttribute)
return false;
75 if (myThicknessMultiplierAttribute != src.myThicknessMultiplierAttribute)
return false;
76 if (myCreateBoundaryTriangles != src.myCreateBoundaryTriangles)
return false;
77 if (myCreateTets != src.myCreateTets)
return false;
93 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
96 graph->
evalOpParm(myBuildDirection, nodeidx,
"direction", time, 0);
99 graph->
evalOpParm(myThickness, nodeidx,
"thickness", time, 0);
100 myEnableThicknessMultiplierAttribute =
false;
102 graph->
evalOpParm(myEnableThicknessMultiplierAttribute, nodeidx,
"enablethicknessmultiplierattribute", time, 0);
103 myThicknessMultiplierAttribute =
""_UTsh;
104 if (
true && ( (
true&&!(((getEnableThicknessMultiplierAttribute()==0)))) ) )
105 graph->
evalOpParm(myThicknessMultiplierAttribute, nodeidx,
"thicknessmultiplierattribute", time, 0);
106 myCreateBoundaryTriangles =
false;
108 graph->
evalOpParm(myCreateBoundaryTriangles, nodeidx,
"createboundarytriangles", time, 0);
111 graph->
evalOpParm(myCreateTets, nodeidx,
"createtets", time, 0);
127 template <
typename T>
134 if (idx.
size() != instance.
size()+1)
139 coerceValue(value, myGroup);
142 coerceValue(value, myBuildDirection);
145 coerceValue(value, myThickness);
148 coerceValue(value, myEnableThicknessMultiplierAttribute);
151 coerceValue(value, myThicknessMultiplierAttribute);
154 coerceValue(value, myCreateBoundaryTriangles);
157 coerceValue(value, myCreateTets);
173 { doGetParmValue(idx, instance, value); }
175 { doGetParmValue(idx, instance, value); }
177 { doGetParmValue(idx, instance, value); }
179 { doGetParmValue(idx, instance, value); }
181 { doGetParmValue(idx, instance, value); }
183 { doGetParmValue(idx, instance, value); }
185 { doGetParmValue(idx, instance, value); }
187 { doGetParmValue(idx, instance, value); }
189 { doGetParmValue(idx, instance, value); }
191 { doGetParmValue(idx, instance, value); }
193 { doGetParmValue(idx, instance, value); }
195 template <
typename T>
202 if (idx.
size() != instance.
size()+1)
207 coerceValue(myGroup, ( ( value ) ));
210 coerceValue(myBuildDirection, clampMinValue(0, clampMaxValue(1, value ) ));
213 coerceValue(myThickness, clampMinValue(0, ( value ) ));
216 coerceValue(myEnableThicknessMultiplierAttribute, ( ( value ) ));
219 coerceValue(myThicknessMultiplierAttribute, ( ( value ) ));
222 coerceValue(myCreateBoundaryTriangles, ( ( value ) ));
225 coerceValue(myCreateTets, ( ( value ) ));
232 { doSetParmValue(idx, instance, value); }
234 { doSetParmValue(idx, instance, value); }
236 { doSetParmValue(idx, instance, value); }
238 { doSetParmValue(idx, instance, value); }
240 { doSetParmValue(idx, instance, value); }
242 { doSetParmValue(idx, instance, value); }
244 { doSetParmValue(idx, instance, value); }
246 { doSetParmValue(idx, instance, value); }
248 { doSetParmValue(idx, instance, value); }
250 { doSetParmValue(idx, instance, value); }
252 { doSetParmValue(idx, instance, value); }
268 if (fieldnum.
size() < 1)
279 return "enablethicknessmultiplierattribute";
281 return "thicknessmultiplierattribute";
283 return "createboundarytriangles";
293 if (fieldnum.
size() < 1)
294 return PARM_UNSUPPORTED;
313 return PARM_UNSUPPORTED;
349 loadData(is, rampdata);
367 int typelen = colon - data.
buffer();
381 {
int64 iv =
v; UTwrite(os, &iv); }
383 { UTwrite<fpreal64>(os, &
v); }
385 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
387 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
388 UTwrite<fpreal64>(os, &v.
z()); }
390 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
391 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
403 if (s) s->save(ostr);
405 saveData(os, result);
412 ostr << s->getDataTypeToken();
417 saveData(os, result);
421 void save(std::ostream &os)
const
425 saveData(os, myGroup);
426 saveData(os, myBuildDirection);
427 saveData(os, myThickness);
428 saveData(os, myEnableThicknessMultiplierAttribute);
429 saveData(os, myThicknessMultiplierAttribute);
430 saveData(os, myCreateBoundaryTriangles);
431 saveData(os, myCreateTets);
444 loadData(is, myGroup);
445 loadData(is, myBuildDirection);
446 loadData(is, myThickness);
447 loadData(is, myEnableThicknessMultiplierAttribute);
448 loadData(is, myThicknessMultiplierAttribute);
449 loadData(is, myCreateBoundaryTriangles);
450 loadData(is, myCreateTets);
460 if (!thissop)
return getGroup();
462 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
470 if (!thissop)
return getBuildDirection();
472 OP_Utils::evalOpParm(result, thissop,
"direction", cookparms.
getCookTime(), 0);
480 if (!thissop)
return getThickness();
482 OP_Utils::evalOpParm(result, thissop,
"thickness", cookparms.
getCookTime(), 0);
490 if (!thissop)
return getEnableThicknessMultiplierAttribute();
492 OP_Utils::evalOpParm(result, thissop,
"enablethicknessmultiplierattribute", cookparms.
getCookTime(), 0);
500 if (!thissop)
return getThicknessMultiplierAttribute();
502 OP_Utils::evalOpParm(result, thissop,
"thicknessmultiplierattribute", cookparms.
getCookTime(), 0);
510 if (!thissop)
return getCreateBoundaryTriangles();
512 OP_Utils::evalOpParm(result, thissop,
"createboundarytriangles", cookparms.
getCookTime(), 0);
520 if (!thissop)
return getCreateTets();
522 OP_Utils::evalOpParm(result, thissop,
"createtets", cookparms.
getCookTime(), 0);
528 int64 myBuildDirection;
530 bool myEnableThicknessMultiplierAttribute;
532 bool myCreateBoundaryTriangles;
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
const char * getNestParmName(TempIndex fieldnum) const override
UT_StringHolder opThicknessMultiplierAttribute(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
SOP_Node * getNode() const
void setThickness(fpreal64 val)
BuildDirection getBuildDirection() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setCreateTets(bool val)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
bool isParmColorRamp(exint idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
bool operator!=(const SOP_TetLayerParms &src) const
fpreal64 getThickness() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const OP_Context & context() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void setGroup(const UT_StringHolder &val)
void save(std::ostream &os) const
const UT_StringHolder & getThicknessMultiplierAttribute() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void saveData(std::ostream &os, bool v)
**But if you need a result
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
const UT_StringHolder & getGroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool opCreateTets(const SOP_NodeVerb::CookParms &cookparms) const
void setBuildDirection(BuildDirection val)
bool getCreateTets() const
BuildDirection opBuildDirection(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
SYS_FORCE_INLINE UT_StringHolder getToken(BuildDirection enum_value)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setEnableThicknessMultiplierAttribute(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void saveData(std::ostream &os, UT_Vector2D v)
bool opEnableThicknessMultiplierAttribute(const SOP_NodeVerb::CookParms &cookparms) const
void loadFromOpSubclass(const LoadParms &loadparms) override
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Matrix2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
bool getCreateBoundaryTriangles() const
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
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void loadData(UT_IStream &is, fpreal64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
bool operator==(const SOP_TetLayerParms &src) const
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, UT_Vector3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setCreateBoundaryTriangles(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opCreateBoundaryTriangles(const SOP_NodeVerb::CookParms &cookparms) const
void copyFrom(const OP_NodeParms *src) override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
static void saveData(std::ostream &os, UT_Matrix3D v)
constexpr SYS_FORCE_INLINE T & w() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
fpreal getCookTime() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
const char * findChar(int c) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
exint getNestNumParms(TempIndex idx) const override
void setThicknessMultiplierAttribute(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_StringHolder s)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
fpreal64 opThickness(const SOP_NodeVerb::CookParms &cookparms) const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Matrix3D &v)
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, bool &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool getEnableThicknessMultiplierAttribute() const
constexpr SYS_FORCE_INLINE T & x() noexcept
ParmType getNestParmType(TempIndex fieldnum) const override