23 namespace SOP_VolumeBinEnums
34 using namespace UT::Literal;
52 myVolume =
"density"_UTsh;
53 myStencil =
"active"_UTsh;
73 if (myVolume != src.myVolume)
return false;
74 if (myStencil != src.myStencil)
return false;
75 if (myDoignore != src.myDoignore)
return false;
76 if (myIgnore != src.myIgnore)
return false;
77 if (myBins != src.myBins)
return false;
78 if (myRangemode != src.myRangemode)
return false;
79 if (myMinmax != src.myMinmax)
return false;
80 if (myKeepall != src.myKeepall)
return false;
81 if (myKeeprange != src.myKeeprange)
return false;
95 myVolume =
"density"_UTsh;
97 graph->
evalOpParm(myVolume, nodeidx,
"volume", time, 0);
98 myStencil =
"active"_UTsh;
100 graph->
evalOpParm(myStencil, nodeidx,
"stencil", time, 0);
103 graph->
evalOpParm(myDoignore, nodeidx,
"doignore", time, 0);
105 if (
true && ( (
true&&!(((getDoignore()==0)))) ) )
106 graph->
evalOpParm(myIgnore, nodeidx,
"ignore", time, 0);
109 graph->
evalOpParm(myBins, nodeidx,
"bins", time, 0);
112 graph->
evalOpParm(myRangemode, nodeidx,
"rangemode", time, 0);
114 if (
true && ( (
true&&!(((
int64(getRangemode())==0)))) ) )
115 graph->
evalOpParm(myMinmax, nodeidx,
"minmax", time, 0);
118 graph->
evalOpParm(myKeepall, nodeidx,
"keepall", time, 0);
120 if (
true && ( (
true&&!(((getKeepall()==1)))) ) )
121 graph->
evalOpParm(myKeeprange, nodeidx,
"keeprange", time, 0);
137 template <
typename T>
144 if (idx.
size() != instance.
size()+1)
149 coerceValue(value, myVolume);
152 coerceValue(value, myStencil);
155 coerceValue(value, myDoignore);
158 coerceValue(value, myIgnore);
161 coerceValue(value, myBins);
164 coerceValue(value, myRangemode);
167 coerceValue(value, myMinmax);
170 coerceValue(value, myKeepall);
173 coerceValue(value, myKeeprange);
189 { doGetParmValue(idx, instance, value); }
191 { doGetParmValue(idx, instance, value); }
193 { doGetParmValue(idx, instance, value); }
195 { doGetParmValue(idx, instance, value); }
197 { doGetParmValue(idx, instance, value); }
199 { doGetParmValue(idx, instance, value); }
201 { doGetParmValue(idx, instance, value); }
203 { doGetParmValue(idx, instance, value); }
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 { doGetParmValue(idx, instance, value); }
211 template <
typename T>
218 if (idx.
size() != instance.
size()+1)
223 coerceValue(myVolume, ( ( value ) ));
226 coerceValue(myStencil, ( ( value ) ));
229 coerceValue(myDoignore, ( ( value ) ));
232 coerceValue(myIgnore, ( ( value ) ));
235 coerceValue(myBins, clampMinValue(1, ( value ) ));
238 coerceValue(myRangemode, clampMinValue(0, clampMaxValue(1, value ) ));
241 coerceValue(myMinmax, ( ( value ) ));
244 coerceValue(myKeepall, ( ( value ) ));
247 coerceValue(myKeeprange, clampMinValue(0, clampMaxValue(1, value ) ));
254 { doSetParmValue(idx, instance, value); }
256 { doSetParmValue(idx, instance, value); }
258 { doSetParmValue(idx, instance, value); }
260 { doSetParmValue(idx, instance, value); }
262 { doSetParmValue(idx, instance, value); }
264 { doSetParmValue(idx, instance, value); }
266 { doSetParmValue(idx, instance, value); }
268 { doSetParmValue(idx, instance, value); }
270 { doSetParmValue(idx, instance, value); }
272 { doSetParmValue(idx, instance, value); }
274 { doSetParmValue(idx, instance, value); }
290 if (fieldnum.
size() < 1)
319 if (fieldnum.
size() < 1)
320 return PARM_UNSUPPORTED;
343 return PARM_UNSUPPORTED;
379 loadData(is, rampdata);
397 int typelen = colon - data.
buffer();
411 {
int64 iv =
v; UTwrite(os, &iv); }
413 { UTwrite<fpreal64>(os, &
v); }
415 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
417 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
418 UTwrite<fpreal64>(os, &v.
z()); }
420 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
421 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
433 if (s) s->save(ostr);
435 saveData(os, result);
442 ostr << s->getDataTypeToken();
447 saveData(os, result);
451 void save(std::ostream &os)
const
455 saveData(os, myVolume);
456 saveData(os, myStencil);
457 saveData(os, myDoignore);
458 saveData(os, myIgnore);
459 saveData(os, myBins);
460 saveData(os, myRangemode);
461 saveData(os, myMinmax);
462 saveData(os, myKeepall);
463 saveData(os, myKeeprange);
476 loadData(is, myVolume);
477 loadData(is, myStencil);
478 loadData(is, myDoignore);
479 loadData(is, myIgnore);
480 loadData(is, myBins);
481 loadData(is, myRangemode);
482 loadData(is, myMinmax);
483 loadData(is, myKeepall);
484 loadData(is, myKeeprange);
496 OP_Utils::evalOpParm(result, thissop,
"volume", cookparms.
getCookTime(), 0);
504 if (!thissop)
return getStencil();
506 OP_Utils::evalOpParm(result, thissop,
"stencil", cookparms.
getCookTime(), 0);
514 if (!thissop)
return getDoignore();
516 OP_Utils::evalOpParm(result, thissop,
"doignore", cookparms.
getCookTime(), 0);
524 if (!thissop)
return getIgnore();
526 OP_Utils::evalOpParm(result, thissop,
"ignore", cookparms.
getCookTime(), 0);
534 if (!thissop)
return getBins();
536 OP_Utils::evalOpParm(result, thissop,
"bins", cookparms.
getCookTime(), 0);
544 if (!thissop)
return getRangemode();
546 OP_Utils::evalOpParm(result, thissop,
"rangemode", cookparms.
getCookTime(), 0);
554 if (!thissop)
return getMinmax();
556 OP_Utils::evalOpParm(result, thissop,
"minmax", cookparms.
getCookTime(), 0);
564 if (!thissop)
return getKeepall();
566 OP_Utils::evalOpParm(result, thissop,
"keepall", cookparms.
getCookTime(), 0);
574 if (!thissop)
return getKeeprange();
576 OP_Utils::evalOpParm(result, thissop,
"keeprange", cookparms.
getCookTime(), 0);
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
UT_Vector2D opKeeprange(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Vector2D &v)
UT_Vector2T< fpreal64 > UT_Vector2D
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
Rangemode opRangemode(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const OP_Context & context() const
UT_StringHolder opVolume(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
An output stream object that owns its own string buffer storage.
**But if you need a result
static void saveData(std::ostream &os, fpreal64 v)
const UT_StringHolder & getStencil() const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void setStencil(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setRangemode(Rangemode val)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, fpreal64 &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
Rangemode getRangemode() const
static void saveData(std::ostream &os, UT_Vector2D v)
bool opDoignore(const SOP_NodeVerb::CookParms &cookparms) 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
void copyFrom(const OP_NodeParms *src) override
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
const OP_GraphProxy * graph() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void loadData(UT_IStream &is, bool &v)
bool operator!=(const SOP_VolumeBinParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
UT_Vector2D getKeeprange() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
static void saveData(std::ostream &os, UT_Vector4D v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void saveData(std::ostream &os, PRM_DataItemHandle s)
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
fpreal64 opIgnore(const SOP_NodeVerb::CookParms &cookparms) const
void setDoignore(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
int64 opBins(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, int64 v)
static void loadData(UT_IStream &is, int64 &v)
void save(std::ostream &os) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
UT_Vector2D opMinmax(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setMinmax(UT_Vector2D val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
SYS_FORCE_INLINE UT_StringHolder getToken(Rangemode enum_value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
Utility class for containing a color ramp.
void setKeepall(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setIgnore(fpreal64 val)
static void saveData(std::ostream &os, UT_Vector3D v)
UT_StringHolder opStencil(const SOP_NodeVerb::CookParms &cookparms) const
fpreal getCookTime() const
const UT_StringHolder & getVolume() const
const char * findChar(int c) const
void loadFromOpSubclass(const LoadParms &loadparms) override
void setVolume(const UT_StringHolder &val)
const char * getNestParmName(TempIndex fieldnum) const override
static void saveData(std::ostream &os, UT_Matrix4D v)
void setKeeprange(UT_Vector2D val)
static void saveData(std::ostream &os, bool v)
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
bool operator==(const SOP_VolumeBinParms &src) const
bool load(UT_IStream &is)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
bool opKeepall(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
bool isParmColorRamp(exint idx) const override
SYS_FORCE_INLINE bool isstring() const
UT_Vector2D getMinmax() const
exint getNestNumParms(TempIndex idx) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
static void loadData(UT_IStream &is, UT_StringHolder &v)
fpreal64 getIgnore() const
constexpr SYS_FORCE_INLINE T & x() noexcept