23 namespace SOP_ConvexDecompositionEnums
34 using namespace UT::Literal;
53 myUsePieceAttrib =
true;
54 myPieceAttrib =
"name"_UTsh;
56 myTreatAsSolid =
true;
57 myMergeSegments =
false;
59 myOutputSegmentAttrib =
true;
60 mySegmentAttrib =
"segment"_UTsh;
61 myOutputInteriorGroup =
true;
62 myInteriorGroupName =
"convex_decomposition_interior"_UTsh;
75 if (myGroup != src.myGroup)
return false;
76 if (myUsePieceAttrib != src.myUsePieceAttrib)
return false;
77 if (myPieceAttrib != src.myPieceAttrib)
return false;
78 if (myMaxConcavity != src.myMaxConcavity)
return false;
79 if (myTreatAsSolid != src.myTreatAsSolid)
return false;
80 if (myMergeSegments != src.myMergeSegments)
return false;
81 if (myGeometryOutput != src.myGeometryOutput)
return false;
82 if (myOutputSegmentAttrib != src.myOutputSegmentAttrib)
return false;
83 if (mySegmentAttrib != src.mySegmentAttrib)
return false;
84 if (myOutputInteriorGroup != src.myOutputInteriorGroup)
return false;
85 if (myInteriorGroupName != src.myInteriorGroupName)
return false;
101 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
102 myUsePieceAttrib =
true;
104 graph->
evalOpParm(myUsePieceAttrib, nodeidx,
"usepieceattrib", time, 0);
105 myPieceAttrib =
"name"_UTsh;
106 if (
true && ( (
true&&!(((getUsePieceAttrib()==0)))) ) )
107 graph->
evalOpParm(myPieceAttrib, nodeidx,
"pieceattrib", time, 0);
110 graph->
evalOpParm(myMaxConcavity, nodeidx,
"maxconcavity", time, 0);
111 myTreatAsSolid =
true;
113 graph->
evalOpParm(myTreatAsSolid, nodeidx,
"treatassolid", time, 0);
114 myMergeSegments =
false;
116 graph->
evalOpParm(myMergeSegments, nodeidx,
"mergesegments", time, 0);
117 myGeometryOutput = 0;
119 graph->
evalOpParm(myGeometryOutput, nodeidx,
"geometryoutput", time, 0);
120 myOutputSegmentAttrib =
true;
122 graph->
evalOpParm(myOutputSegmentAttrib, nodeidx,
"outputsegmentattrib", time, 0);
123 mySegmentAttrib =
"segment"_UTsh;
124 if (
true && ( (
true&&!(((getOutputSegmentAttrib()==0)))) ) )
125 graph->
evalOpParm(mySegmentAttrib, nodeidx,
"segmentattrib", time, 0);
126 myOutputInteriorGroup =
true;
127 if (
true && ( (
true&&!(((
int64(getGeometryOutput())!=1)))) ) )
128 graph->
evalOpParm(myOutputInteriorGroup, nodeidx,
"outputinteriorgroup", time, 0);
129 myInteriorGroupName =
"convex_decomposition_interior"_UTsh;
130 if (
true && ( (
true&&!(((
int64(getGeometryOutput())!=1))||((getOutputInteriorGroup()==0)))) ) )
131 graph->
evalOpParm(myInteriorGroupName, nodeidx,
"interiorgroupname", time, 0);
147 template <
typename T>
154 if (idx.
size() != instance.
size()+1)
159 coerceValue(value, myGroup);
162 coerceValue(value, myUsePieceAttrib);
165 coerceValue(value, myPieceAttrib);
168 coerceValue(value, myMaxConcavity);
171 coerceValue(value, myTreatAsSolid);
174 coerceValue(value, myMergeSegments);
177 coerceValue(value, myGeometryOutput);
180 coerceValue(value, myOutputSegmentAttrib);
183 coerceValue(value, mySegmentAttrib);
186 coerceValue(value, myOutputInteriorGroup);
189 coerceValue(value, myInteriorGroupName);
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 { doGetParmValue(idx, instance, value); }
211 { doGetParmValue(idx, instance, value); }
213 { doGetParmValue(idx, instance, value); }
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 template <
typename T>
234 if (idx.
size() != instance.
size()+1)
239 coerceValue(myGroup, ( ( value ) ));
242 coerceValue(myUsePieceAttrib, ( ( value ) ));
245 coerceValue(myPieceAttrib, ( ( value ) ));
248 coerceValue(myMaxConcavity, clampMinValue(0, ( value ) ));
251 coerceValue(myTreatAsSolid, ( ( value ) ));
254 coerceValue(myMergeSegments, ( ( value ) ));
257 coerceValue(myGeometryOutput, clampMinValue(0, clampMaxValue(1, value ) ));
260 coerceValue(myOutputSegmentAttrib, ( ( value ) ));
263 coerceValue(mySegmentAttrib, ( ( value ) ));
266 coerceValue(myOutputInteriorGroup, ( ( value ) ));
269 coerceValue(myInteriorGroupName, ( ( value ) ));
276 { doSetParmValue(idx, instance, value); }
278 { doSetParmValue(idx, instance, value); }
280 { doSetParmValue(idx, instance, value); }
282 { doSetParmValue(idx, instance, value); }
284 { doSetParmValue(idx, instance, value); }
286 { doSetParmValue(idx, instance, value); }
288 { doSetParmValue(idx, instance, value); }
290 { doSetParmValue(idx, instance, value); }
292 { doSetParmValue(idx, instance, value); }
294 { doSetParmValue(idx, instance, value); }
296 { doSetParmValue(idx, instance, value); }
312 if (fieldnum.
size() < 1)
319 return "usepieceattrib";
321 return "pieceattrib";
323 return "maxconcavity";
325 return "treatassolid";
327 return "mergesegments";
329 return "geometryoutput";
331 return "outputsegmentattrib";
333 return "segmentattrib";
335 return "outputinteriorgroup";
337 return "interiorgroupname";
345 if (fieldnum.
size() < 1)
346 return PARM_UNSUPPORTED;
373 return PARM_UNSUPPORTED;
409 loadData(is, rampdata);
427 int typelen = colon - data.
buffer();
441 {
int64 iv =
v; UTwrite(os, &iv); }
443 { UTwrite<fpreal64>(os, &
v); }
445 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
447 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
448 UTwrite<fpreal64>(os, &v.
z()); }
450 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
451 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
463 if (s) s->save(ostr);
465 saveData(os, result);
472 ostr << s->getDataTypeToken();
477 saveData(os, result);
481 void save(std::ostream &os)
const
485 saveData(os, myGroup);
486 saveData(os, myUsePieceAttrib);
487 saveData(os, myPieceAttrib);
488 saveData(os, myMaxConcavity);
489 saveData(os, myTreatAsSolid);
490 saveData(os, myMergeSegments);
491 saveData(os, myGeometryOutput);
492 saveData(os, myOutputSegmentAttrib);
493 saveData(os, mySegmentAttrib);
494 saveData(os, myOutputInteriorGroup);
495 saveData(os, myInteriorGroupName);
508 loadData(is, myGroup);
509 loadData(is, myUsePieceAttrib);
510 loadData(is, myPieceAttrib);
511 loadData(is, myMaxConcavity);
512 loadData(is, myTreatAsSolid);
513 loadData(is, myMergeSegments);
514 loadData(is, myGeometryOutput);
515 loadData(is, myOutputSegmentAttrib);
516 loadData(is, mySegmentAttrib);
517 loadData(is, myOutputInteriorGroup);
518 loadData(is, myInteriorGroupName);
528 if (!thissop)
return getGroup();
530 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
538 if (!thissop)
return getUsePieceAttrib();
540 OP_Utils::evalOpParm(result, thissop,
"usepieceattrib", cookparms.
getCookTime(), 0);
548 if (!thissop)
return getPieceAttrib();
550 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
558 if (!thissop)
return getMaxConcavity();
560 OP_Utils::evalOpParm(result, thissop,
"maxconcavity", cookparms.
getCookTime(), 0);
568 if (!thissop)
return getTreatAsSolid();
570 OP_Utils::evalOpParm(result, thissop,
"treatassolid", cookparms.
getCookTime(), 0);
578 if (!thissop)
return getMergeSegments();
580 OP_Utils::evalOpParm(result, thissop,
"mergesegments", cookparms.
getCookTime(), 0);
588 if (!thissop)
return getGeometryOutput();
590 OP_Utils::evalOpParm(result, thissop,
"geometryoutput", cookparms.
getCookTime(), 0);
598 if (!thissop)
return getOutputSegmentAttrib();
600 OP_Utils::evalOpParm(result, thissop,
"outputsegmentattrib", cookparms.
getCookTime(), 0);
608 if (!thissop)
return getSegmentAttrib();
610 OP_Utils::evalOpParm(result, thissop,
"segmentattrib", cookparms.
getCookTime(), 0);
618 if (!thissop)
return getOutputInteriorGroup();
620 OP_Utils::evalOpParm(result, thissop,
"outputinteriorgroup", cookparms.
getCookTime(), 0);
628 if (!thissop)
return getInteriorGroupName();
630 OP_Utils::evalOpParm(result, thissop,
"interiorgroupname", cookparms.
getCookTime(), 0);
636 bool myUsePieceAttrib;
640 bool myMergeSegments;
641 int64 myGeometryOutput;
642 bool myOutputSegmentAttrib;
644 bool myOutputInteriorGroup;
bool getTreatAsSolid() const
static void loadData(UT_IStream &is, bool &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
SOP_ConvexDecompositionParms()
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
UT_StringHolder opPieceAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setInteriorGroupName(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool opOutputInteriorGroup(const SOP_NodeVerb::CookParms &cookparms) const
bool getUsePieceAttrib() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
const char * getNestParmName(TempIndex fieldnum) const override
void setGeometryOutput(GeometryOutput val)
void setTreatAsSolid(bool val)
static void saveData(std::ostream &os, UT_Matrix3D v)
const UT_StringHolder & getInteriorGroupName() const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
bool getOutputSegmentAttrib() const
SYS_FORCE_INLINE const char * buffer() const
GeometryOutput getGeometryOutput() const
static void saveData(std::ostream &os, UT_Vector3D v)
An output stream object that owns its own string buffer storage.
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
**But if you need a result
SYS_FORCE_INLINE UT_StringHolder getToken(GeometryOutput enum_value)
fpreal64 opMaxConcavity(const SOP_NodeVerb::CookParms &cookparms) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_StringHolder & getPieceAttrib() const
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, UT_Matrix4D v)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void setMergeSegments(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, bool v)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, UT_Vector2D &v)
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setUsePieceAttrib(bool val)
void loadFromOpSubclass(const LoadParms &loadparms) override
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 & getSegmentAttrib() const
exint getNestNumParms(TempIndex idx) const override
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void save(std::ostream &os) const
void setOutputInteriorGroup(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
UT_StringHolder opSegmentAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setPieceAttrib(const UT_StringHolder &val)
void setSegmentAttrib(const UT_StringHolder &val)
bool getOutputInteriorGroup() const
static void loadData(UT_IStream &is, UT_Vector3D &v)
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void loadData(UT_IStream &is, UT_Vector4D &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, fpreal64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, int64 &v)
bool opOutputSegmentAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void setMaxConcavity(fpreal64 val)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
GeometryOutput opGeometryOutput(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getGroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool operator!=(const SOP_ConvexDecompositionParms &src) const
fpreal64 getMaxConcavity() const
bool opTreatAsSolid(const SOP_NodeVerb::CookParms &cookparms) const
bool getMergeSegments() const
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
constexpr SYS_FORCE_INLINE T & w() noexcept
bool opMergeSegments(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_Vector4I &v)
fpreal getCookTime() const
void setOutputSegmentAttrib(bool val)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
UT_StringHolder opInteriorGroupName(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
const char * findChar(int c) const
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setGroup(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix2D v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void saveData(std::ostream &os, UT_Vector2D v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
bool operator==(const SOP_ConvexDecompositionParms &src) const
bool opUsePieceAttrib(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void saveData(std::ostream &os, fpreal64 v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Matrix2D &v)