23 namespace SOP_VolumeBreakEnums
35 using namespace UT::Literal;
54 using namespace UT::Literal;
77 mySnapdistance = 0.01;
78 myCreategroups =
false;
79 myInsidegroup =
"inside"_UTsh;
80 myInsideclosuregroup =
"insideClosure"_UTsh;
81 myOutsidegroup =
"outside"_UTsh;
82 myOutsideclosuregroup =
"outsideClosure"_UTsh;
95 if (myGroup != src.myGroup)
return false;
96 if (myBreaktype != src.myBreaktype)
return false;
97 if (myCloseholes != src.myCloseholes)
return false;
98 if (myClosegeo != src.myClosegeo)
return false;
99 if (mySnapdistance != src.mySnapdistance)
return false;
100 if (myCreategroups != src.myCreategroups)
return false;
101 if (myInsidegroup != src.myInsidegroup)
return false;
102 if (myInsideclosuregroup != src.myInsideclosuregroup)
return false;
103 if (myOutsidegroup != src.myOutsidegroup)
return false;
104 if (myOutsideclosuregroup != src.myOutsideclosuregroup)
return false;
121 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
124 graph->
evalOpParm(myBreaktype, nodeidx,
"breaktype", time, 0);
127 graph->
evalOpParm(myCloseholes, nodeidx,
"closeholes", time, 0);
129 if (
true && ( (
true&&!(((
int64(getCloseholes())!=0)))) ) )
130 graph->
evalOpParm(myClosegeo, nodeidx,
"closegeo", time, 0);
131 mySnapdistance = 0.01;
133 graph->
evalOpParm(mySnapdistance, nodeidx,
"snapdistance", time, 0);
134 myCreategroups =
false;
136 graph->
evalOpParm(myCreategroups, nodeidx,
"creategroups", time, 0);
137 myInsidegroup =
"inside"_UTsh;
138 if (
true && ( (
true&&!(((getCreategroups()==0))||((
int64(getBreaktype())==1)))) ) )
139 graph->
evalOpParm(myInsidegroup, nodeidx,
"insidegroup", time, 0);
140 myInsideclosuregroup =
"insideClosure"_UTsh;
141 if (
true && ( (
true&&!(((getCreategroups()==0))||((
int64(getBreaktype())==1))||((
int64(getCloseholes())==0)))) ) )
142 graph->
evalOpParm(myInsideclosuregroup, nodeidx,
"insideclosuregroup", time, 0);
143 myOutsidegroup =
"outside"_UTsh;
144 if (
true && ( (
true&&!(((getCreategroups()==0))||((
int64(getBreaktype())==2)))) ) )
145 graph->
evalOpParm(myOutsidegroup, nodeidx,
"outsidegroup", time, 0);
146 myOutsideclosuregroup =
"outsideClosure"_UTsh;
147 if (
true && ( (
true&&!(((getCreategroups()==0))||((
int64(getBreaktype())==2))||((
int64(getCloseholes())==0)))) ) )
148 graph->
evalOpParm(myOutsideclosuregroup, nodeidx,
"outsideclosuregroup", time, 0);
164 template <
typename T>
171 if (idx.
size() != instance.
size()+1)
176 coerceValue(value, myGroup);
179 coerceValue(value, myBreaktype);
182 coerceValue(value, myCloseholes);
185 coerceValue(value, myClosegeo);
188 coerceValue(value, mySnapdistance);
191 coerceValue(value, myCreategroups);
194 coerceValue(value, myInsidegroup);
197 coerceValue(value, myInsideclosuregroup);
200 coerceValue(value, myOutsidegroup);
203 coerceValue(value, myOutsideclosuregroup);
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 { doGetParmValue(idx, instance, value); }
229 { doGetParmValue(idx, instance, value); }
231 { doGetParmValue(idx, instance, value); }
233 { doGetParmValue(idx, instance, value); }
235 { doGetParmValue(idx, instance, value); }
237 { doGetParmValue(idx, instance, value); }
239 { doGetParmValue(idx, instance, value); }
241 template <
typename T>
248 if (idx.
size() != instance.
size()+1)
253 coerceValue(myGroup, ( ( value ) ));
256 coerceValue(myBreaktype, clampMinValue(0, clampMaxValue(2, value ) ));
259 coerceValue(myCloseholes, clampMinValue(0, clampMaxValue(2, value ) ));
262 coerceValue(myClosegeo, ( ( value ) ));
265 coerceValue(mySnapdistance, clampMinValue(0, ( value ) ));
268 coerceValue(myCreategroups, ( ( value ) ));
271 coerceValue(myInsidegroup, ( ( value ) ));
274 coerceValue(myInsideclosuregroup, ( ( value ) ));
277 coerceValue(myOutsidegroup, ( ( value ) ));
280 coerceValue(myOutsideclosuregroup, ( ( value ) ));
287 { doSetParmValue(idx, instance, value); }
289 { doSetParmValue(idx, instance, value); }
291 { doSetParmValue(idx, instance, value); }
293 { doSetParmValue(idx, instance, value); }
295 { doSetParmValue(idx, instance, value); }
297 { doSetParmValue(idx, instance, value); }
299 { doSetParmValue(idx, instance, value); }
301 { doSetParmValue(idx, instance, value); }
303 { doSetParmValue(idx, instance, value); }
305 { doSetParmValue(idx, instance, value); }
307 { doSetParmValue(idx, instance, value); }
323 if (fieldnum.
size() < 1)
336 return "snapdistance";
338 return "creategroups";
340 return "insidegroup";
342 return "insideclosuregroup";
344 return "outsidegroup";
346 return "outsideclosuregroup";
354 if (fieldnum.
size() < 1)
355 return PARM_UNSUPPORTED;
380 return PARM_UNSUPPORTED;
416 loadData(is, rampdata);
434 int typelen = colon - data.
buffer();
448 {
int64 iv =
v; UTwrite(os, &iv); }
450 { UTwrite<fpreal64>(os, &
v); }
452 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
454 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
455 UTwrite<fpreal64>(os, &v.
z()); }
457 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
458 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
470 if (s) s->save(ostr);
472 saveData(os, result);
479 ostr << s->getDataTypeToken();
484 saveData(os, result);
488 void save(std::ostream &os)
const
492 saveData(os, myGroup);
493 saveData(os, myBreaktype);
494 saveData(os, myCloseholes);
495 saveData(os, myClosegeo);
496 saveData(os, mySnapdistance);
497 saveData(os, myCreategroups);
498 saveData(os, myInsidegroup);
499 saveData(os, myInsideclosuregroup);
500 saveData(os, myOutsidegroup);
501 saveData(os, myOutsideclosuregroup);
514 loadData(is, myGroup);
515 loadData(is, myBreaktype);
516 loadData(is, myCloseholes);
517 loadData(is, myClosegeo);
518 loadData(is, mySnapdistance);
519 loadData(is, myCreategroups);
520 loadData(is, myInsidegroup);
521 loadData(is, myInsideclosuregroup);
522 loadData(is, myOutsidegroup);
523 loadData(is, myOutsideclosuregroup);
533 if (!thissop)
return getGroup();
535 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
543 if (!thissop)
return getBreaktype();
545 OP_Utils::evalOpParm(result, thissop,
"breaktype", cookparms.
getCookTime(), 0);
553 if (!thissop)
return getCloseholes();
555 OP_Utils::evalOpParm(result, thissop,
"closeholes", cookparms.
getCookTime(), 0);
563 if (!thissop)
return getClosegeo();
565 OP_Utils::evalOpParm(result, thissop,
"closegeo", cookparms.
getCookTime(), 0);
573 if (!thissop)
return getSnapdistance();
575 OP_Utils::evalOpParm(result, thissop,
"snapdistance", cookparms.
getCookTime(), 0);
583 if (!thissop)
return getCreategroups();
585 OP_Utils::evalOpParm(result, thissop,
"creategroups", cookparms.
getCookTime(), 0);
593 if (!thissop)
return getInsidegroup();
595 OP_Utils::evalOpParm(result, thissop,
"insidegroup", cookparms.
getCookTime(), 0);
603 if (!thissop)
return getInsideclosuregroup();
605 OP_Utils::evalOpParm(result, thissop,
"insideclosuregroup", cookparms.
getCookTime(), 0);
613 if (!thissop)
return getOutsidegroup();
615 OP_Utils::evalOpParm(result, thissop,
"outsidegroup", cookparms.
getCookTime(), 0);
623 if (!thissop)
return getOutsideclosuregroup();
625 OP_Utils::evalOpParm(result, thissop,
"outsideclosuregroup", cookparms.
getCookTime(), 0);
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
SOP_Node * getNode() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool opCreategroups(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_StringHolder s)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
Closeholes getCloseholes() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
bool getCreategroups() const
void setSnapdistance(fpreal64 val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setOutsidegroup(const UT_StringHolder &val)
Breaktype getBreaktype() const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
An output stream object that owns its own string buffer storage.
void setGroup(const UT_StringHolder &val)
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, bool &v)
**But if you need a result
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
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, int64 v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Matrix3D &v)
fpreal64 opSnapdistance(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
UT_StringHolder opOutsidegroup(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setInsidegroup(const UT_StringHolder &val)
UT_StringHolder opOutsideclosuregroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setCreategroups(bool val)
Closeholes opCloseholes(const SOP_NodeVerb::CookParms &cookparms) const
void save(std::ostream &os) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
constexpr SYS_FORCE_INLINE T & z() noexcept
void setOutsideclosuregroup(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
const UT_StringHolder & getGroup() const
static void saveData(std::ostream &os, UT_Vector4D v)
Breaktype opBreaktype(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_Matrix3D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
const UT_StringHolder & getInsidegroup() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
fpreal64 getSnapdistance() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setCloseholes(Closeholes val)
void loadFromOpSubclass(const LoadParms &loadparms) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
UT_StringHolder opInsidegroup(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
void setClosegeo(bool val)
void setInsideclosuregroup(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, fpreal64 &v)
const UT_StringHolder & getOutsidegroup() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setBreaktype(Breaktype val)
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Vector2D v)
SYS_FORCE_INLINE UT_StringHolder getToken(Breaktype enum_value)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
exint getNestNumParms(TempIndex idx) const override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
static void loadData(UT_IStream &is, int64 &v)
Utility class for containing a color ramp.
const UT_StringHolder & getOutsideclosuregroup() const
constexpr SYS_FORCE_INLINE T & w() noexcept
const UT_StringHolder & getInsideclosuregroup() const
static void saveData(std::ostream &os, bool v)
bool isParmColorRamp(exint idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void saveData(std::ostream &os, fpreal64 v)
fpreal getCookTime() const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
const char * findChar(int c) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool operator!=(const SOP_VolumeBreakParms &src) const
static void saveData(std::ostream &os, UT_Vector3D v)
bool operator==(const SOP_VolumeBreakParms &src) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
UT_StringHolder opInsideclosuregroup(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
ParmType getNestParmType(TempIndex fieldnum) const override
bool opClosegeo(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
constexpr SYS_FORCE_INLINE T & x() noexcept