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;
99 graph->
evalOpParm(myBuildDirection, nodeidx,
"direction", time, graph->
isDirect()?
nullptr:depnode);
102 graph->
evalOpParm(myThickness, nodeidx,
"thickness", time, graph->
isDirect()?
nullptr:depnode);
103 myEnableThicknessMultiplierAttribute =
false;
105 graph->
evalOpParm(myEnableThicknessMultiplierAttribute, nodeidx,
"enablethicknessmultiplierattribute", time, graph->
isDirect()?
nullptr:depnode);
106 myThicknessMultiplierAttribute =
""_UTsh;
107 if (
true && ( (
true&&!(((getEnableThicknessMultiplierAttribute()==0)))) ) )
108 graph->
evalOpParm(myThicknessMultiplierAttribute, nodeidx,
"thicknessmultiplierattribute", time, graph->
isDirect()?
nullptr:depnode);
109 myCreateBoundaryTriangles =
false;
111 graph->
evalOpParm(myCreateBoundaryTriangles, nodeidx,
"createboundarytriangles", time, graph->
isDirect()?
nullptr:depnode);
114 graph->
evalOpParm(myCreateTets, nodeidx,
"createtets", time, graph->
isDirect()?
nullptr:depnode);
130 template <
typename T>
137 if (idx.
size() != instance.
size()+1)
142 coerceValue(value, myGroup);
145 coerceValue(value, myBuildDirection);
148 coerceValue(value, myThickness);
151 coerceValue(value, myEnableThicknessMultiplierAttribute);
154 coerceValue(value, myThicknessMultiplierAttribute);
157 coerceValue(value, myCreateBoundaryTriangles);
160 coerceValue(value, myCreateTets);
176 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
205 if (idx.
size() != instance.
size()+1)
210 coerceValue(myGroup, ( ( value ) ));
213 coerceValue(myBuildDirection, clampMinValue(0, clampMaxValue(1, value ) ));
216 coerceValue(myThickness, clampMinValue(0, ( value ) ));
219 coerceValue(myEnableThicknessMultiplierAttribute, ( ( value ) ));
222 coerceValue(myThicknessMultiplierAttribute, ( ( value ) ));
225 coerceValue(myCreateBoundaryTriangles, ( ( value ) ));
228 coerceValue(myCreateTets, ( ( value ) ));
235 { doSetParmValue(idx, instance, value); }
237 { doSetParmValue(idx, instance, value); }
239 { doSetParmValue(idx, instance, value); }
241 { doSetParmValue(idx, instance, value); }
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); }
271 if (fieldnum.
size() < 1)
282 return "enablethicknessmultiplierattribute";
284 return "thicknessmultiplierattribute";
286 return "createboundarytriangles";
296 if (fieldnum.
size() < 1)
297 return PARM_UNSUPPORTED;
316 return PARM_UNSUPPORTED;
352 loadData(is, rampdata);
370 int typelen = colon - data.
buffer();
384 {
int64 iv =
v; UTwrite(os, &iv); }
386 { UTwrite<fpreal64>(os, &
v); }
388 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
390 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
391 UTwrite<fpreal64>(os, &v.
z()); }
393 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
394 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
406 if (s) s->save(ostr);
408 saveData(os, result);
415 ostr << s->getDataTypeToken();
420 saveData(os, result);
424 void save(std::ostream &os)
const
428 saveData(os, myGroup);
429 saveData(os, myBuildDirection);
430 saveData(os, myThickness);
431 saveData(os, myEnableThicknessMultiplierAttribute);
432 saveData(os, myThicknessMultiplierAttribute);
433 saveData(os, myCreateBoundaryTriangles);
434 saveData(os, myCreateTets);
447 loadData(is, myGroup);
448 loadData(is, myBuildDirection);
449 loadData(is, myThickness);
450 loadData(is, myEnableThicknessMultiplierAttribute);
451 loadData(is, myThicknessMultiplierAttribute);
452 loadData(is, myCreateBoundaryTriangles);
453 loadData(is, myCreateTets);
463 if (!thissop)
return getGroup();
465 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
473 if (!thissop)
return getBuildDirection();
475 OP_Utils::evalOpParm(result, thissop,
"direction", cookparms.
getCookTime(), 0);
483 if (!thissop)
return getThickness();
485 OP_Utils::evalOpParm(result, thissop,
"thickness", cookparms.
getCookTime(), 0);
493 if (!thissop)
return getEnableThicknessMultiplierAttribute();
495 OP_Utils::evalOpParm(result, thissop,
"enablethicknessmultiplierattribute", cookparms.
getCookTime(), 0);
503 if (!thissop)
return getThicknessMultiplierAttribute();
505 OP_Utils::evalOpParm(result, thissop,
"thicknessmultiplierattribute", cookparms.
getCookTime(), 0);
513 if (!thissop)
return getCreateBoundaryTriangles();
515 OP_Utils::evalOpParm(result, thissop,
"createboundarytriangles", cookparms.
getCookTime(), 0);
523 if (!thissop)
return getCreateTets();
525 OP_Utils::evalOpParm(result, thissop,
"createtets", cookparms.
getCookTime(), 0);
531 int64 myBuildDirection;
533 bool myEnableThicknessMultiplierAttribute;
535 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
GLsizei const GLfloat * value
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
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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
virtual UT_StringHolder baseGetSignature() const
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)
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
fpreal64 opThickness(const SOP_NodeVerb::CookParms &cookparms) const
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