23 namespace SOP_VoronoiSplitEnums
34 using namespace UT::Literal;
53 myClipptsgrp =
""_UTsh;
56 myTransferAttribs =
true;
57 myStamppieces =
false;
58 myPieceattrib =
"piece"_UTsh;
59 myClipptattrib =
"clippt"_UTsh;
60 myUseweightattrib =
false;
61 myWeightattrib =
"pscale"_UTsh;
75 if (myGroup != src.myGroup)
return false;
76 if (myClipptsgrp != src.myClipptsgrp)
return false;
77 if (myOffset != src.myOffset)
return false;
78 if (myInterior != src.myInterior)
return false;
79 if (myTransferAttribs != src.myTransferAttribs)
return false;
80 if (myStamppieces != src.myStamppieces)
return false;
81 if (myPieceattrib != src.myPieceattrib)
return false;
82 if (myClipptattrib != src.myClipptattrib)
return false;
83 if (myUseweightattrib != src.myUseweightattrib)
return false;
84 if (myWeightattrib != src.myWeightattrib)
return false;
85 if (myWeightMethod != src.myWeightMethod)
return false;
101 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
102 myClipptsgrp =
""_UTsh;
104 graph->
evalOpParm(myClipptsgrp, nodeidx,
"clipptsgrp", time, 0);
107 graph->
evalOpParm(myOffset, nodeidx,
"offset", time, 0);
110 graph->
evalOpParm(myInterior, nodeidx,
"interior", time, 0);
111 myTransferAttribs =
true;
112 if (
true && ( (
true&&!(((getInterior()==0))||((getInterior()==0)))) ) )
113 graph->
evalOpParm(myTransferAttribs, nodeidx,
"transferattribs", time, 0);
114 myStamppieces =
false;
116 graph->
evalOpParm(myStamppieces, nodeidx,
"stamppieces", time, 0);
117 myPieceattrib =
"piece"_UTsh;
118 if (
true && ( (
true&&!(((getStamppieces()==0)))) ) )
119 graph->
evalOpParm(myPieceattrib, nodeidx,
"pieceattrib", time, 0);
120 myClipptattrib =
"clippt"_UTsh;
121 if (
true && ( (
true&&!(((getStamppieces()==0))||((getInterior()==0)))) ) )
122 graph->
evalOpParm(myClipptattrib, nodeidx,
"clipptattrib", time, 0);
123 myUseweightattrib =
false;
125 graph->
evalOpParm(myUseweightattrib, nodeidx,
"useweightattrib", time, 0);
126 myWeightattrib =
"pscale"_UTsh;
127 if (
true && ( (
true&&!(((getUseweightattrib()==0)))) ) )
128 graph->
evalOpParm(myWeightattrib, nodeidx,
"weightattrib", time, 0);
130 if (
true && ( (
true&&!(((getUseweightattrib()==0)))) ) )
131 graph->
evalOpParm(myWeightMethod, nodeidx,
"weightmethod", time, 0);
147 template <
typename T>
154 if (idx.
size() != instance.
size()+1)
159 coerceValue(value, myGroup);
162 coerceValue(value, myClipptsgrp);
165 coerceValue(value, myOffset);
168 coerceValue(value, myInterior);
171 coerceValue(value, myTransferAttribs);
174 coerceValue(value, myStamppieces);
177 coerceValue(value, myPieceattrib);
180 coerceValue(value, myClipptattrib);
183 coerceValue(value, myUseweightattrib);
186 coerceValue(value, myWeightattrib);
189 coerceValue(value, myWeightMethod);
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(myClipptsgrp, ( ( value ) ));
245 coerceValue(myOffset, ( ( value ) ));
248 coerceValue(myInterior, ( ( value ) ));
251 coerceValue(myTransferAttribs, ( ( value ) ));
254 coerceValue(myStamppieces, ( ( value ) ));
257 coerceValue(myPieceattrib, ( ( value ) ));
260 coerceValue(myClipptattrib, ( ( value ) ));
263 coerceValue(myUseweightattrib, ( ( value ) ));
266 coerceValue(myWeightattrib, ( ( value ) ));
269 coerceValue(myWeightMethod, clampMinValue(0, clampMaxValue(1, 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)
325 return "transferattribs";
327 return "stamppieces";
329 return "pieceattrib";
331 return "clipptattrib";
333 return "useweightattrib";
335 return "weightattrib";
337 return "weightmethod";
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, myClipptsgrp);
487 saveData(os, myOffset);
488 saveData(os, myInterior);
489 saveData(os, myTransferAttribs);
490 saveData(os, myStamppieces);
491 saveData(os, myPieceattrib);
492 saveData(os, myClipptattrib);
493 saveData(os, myUseweightattrib);
494 saveData(os, myWeightattrib);
495 saveData(os, myWeightMethod);
508 loadData(is, myGroup);
509 loadData(is, myClipptsgrp);
510 loadData(is, myOffset);
511 loadData(is, myInterior);
512 loadData(is, myTransferAttribs);
513 loadData(is, myStamppieces);
514 loadData(is, myPieceattrib);
515 loadData(is, myClipptattrib);
516 loadData(is, myUseweightattrib);
517 loadData(is, myWeightattrib);
518 loadData(is, myWeightMethod);
528 if (!thissop)
return getGroup();
530 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
538 if (!thissop)
return getClipptsgrp();
540 OP_Utils::evalOpParm(result, thissop,
"clipptsgrp", cookparms.
getCookTime(), 0);
548 if (!thissop)
return getOffset();
550 OP_Utils::evalOpParm(result, thissop,
"offset", cookparms.
getCookTime(), 0);
558 if (!thissop)
return getInterior();
560 OP_Utils::evalOpParm(result, thissop,
"interior", cookparms.
getCookTime(), 0);
568 if (!thissop)
return getTransferAttribs();
570 OP_Utils::evalOpParm(result, thissop,
"transferattribs", cookparms.
getCookTime(), 0);
578 if (!thissop)
return getStamppieces();
580 OP_Utils::evalOpParm(result, thissop,
"stamppieces", cookparms.
getCookTime(), 0);
588 if (!thissop)
return getPieceattrib();
590 OP_Utils::evalOpParm(result, thissop,
"pieceattrib", cookparms.
getCookTime(), 0);
598 if (!thissop)
return getClipptattrib();
600 OP_Utils::evalOpParm(result, thissop,
"clipptattrib", cookparms.
getCookTime(), 0);
608 if (!thissop)
return getUseweightattrib();
610 OP_Utils::evalOpParm(result, thissop,
"useweightattrib", cookparms.
getCookTime(), 0);
618 if (!thissop)
return getWeightattrib();
620 OP_Utils::evalOpParm(result, thissop,
"weightattrib", cookparms.
getCookTime(), 0);
628 if (!thissop)
return getWeightMethod();
630 OP_Utils::evalOpParm(result, thissop,
"weightmethod", cookparms.
getCookTime(), 0);
639 bool myTransferAttribs;
643 bool myUseweightattrib;
645 int64 myWeightMethod;
static void saveData(std::ostream &os, fpreal64 v)
WeightMethod opWeightMethod(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opPieceattrib(const SOP_NodeVerb::CookParms &cookparms) const
void setClipptsgrp(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opUseweightattrib(const SOP_NodeVerb::CookParms &cookparms) const
SOP_Node * getNode() const
const UT_StringHolder & getClipptsgrp() const
void loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setOffset(fpreal64 val)
void setInterior(bool val)
static void loadData(UT_IStream &is, UT_StringHolder &v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
exint getNestNumParms(TempIndex idx) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
fpreal64 opOffset(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
static void saveData(std::ostream &os, UT_Matrix4D v)
constexpr SYS_FORCE_INLINE T & z() noexcept
void copyFrom(const OP_NodeParms *src) override
void setUseweightattrib(bool val)
SYS_FORCE_INLINE const char * buffer() const
const UT_StringHolder & getWeightattrib() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
**But if you need a result
static void saveData(std::ostream &os, UT_Vector3D 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.
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
const UT_StringHolder & getPieceattrib() const
void setTransferAttribs(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector3D &v)
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setPieceattrib(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Vector4I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void saveData(std::ostream &os, UT_StringHolder s)
static void saveData(std::ostream &os, UT_Vector4D v)
void setClipptattrib(const UT_StringHolder &val)
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_Matrix3D &value) override
bool getTransferAttribs() const
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, bool &v)
UT_StringHolder opClipptattrib(const SOP_NodeVerb::CookParms &cookparms) const
bool opTransferAttribs(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
WeightMethod getWeightMethod() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool isParmColorRamp(exint idx) const override
bool opInterior(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
SYS_FORCE_INLINE UT_StringHolder getToken(WeightMethod enum_value)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
bool getStamppieces() const
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 loadData(UT_IStream &is, UT_Matrix4D &v)
bool operator==(const SOP_VoronoiSplitParms &src) const
void setWeightattrib(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void saveBinary(std::ostream &os) const
Save string to binary stream.
GT_API const UT_StringHolder version
bool operator!=(const SOP_VoronoiSplitParms &src) const
static void loadData(UT_IStream &is, fpreal64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const UT_StringHolder & getClipptattrib() const
void setWeightMethod(WeightMethod val)
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, bool v)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
bool load(UT_IStream &is)
Utility class for containing a color ramp.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setStamppieces(bool val)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
bool getUseweightattrib() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
UT_StringHolder opWeightattrib(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
const UT_StringHolder & getGroup() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
fpreal getCookTime() const
const char * getNestParmName(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
const char * findChar(int c) const
bool opStamppieces(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getOffset() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
static void saveData(std::ostream &os, UT_Matrix2D v)
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void loadData(UT_IStream &is, UT_Vector3I &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void loadData(UT_IStream &is, UT_Vector2D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix3D v)
SYS_FORCE_INLINE bool isstring() const
void setGroup(const UT_StringHolder &val)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
UT_StringHolder opClipptsgrp(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector2D v)
constexpr SYS_FORCE_INLINE T & x() noexcept