23 namespace SOP_VolumeReduceEnums
42 using namespace UT::Literal;
69 using namespace UT::Literal;
91 using namespace UT::Literal;
117 myResultattrib =
"density"_UTsh;
118 myCreateVarMap =
false;
119 myResultlvar =
""_UTsh;
132 if (myGroup != src.myGroup)
return false;
133 if (myReduction != src.myReduction)
return false;
134 if (myPercentile != src.myPercentile)
return false;
135 if (myScaleby != src.myScaleby)
return false;
136 if (myResult != src.myResult)
return false;
137 if (myResultattrib != src.myResultattrib)
return false;
138 if (myCreateVarMap != src.myCreateVarMap)
return false;
139 if (myResultlvar != src.myResultlvar)
return false;
157 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
160 graph->
evalOpParm(myReduction, nodeidx,
"reduction", time, 0);
162 if (
true && ( (
true&&!(((
int64(getReduction())!=5)))) ) )
163 graph->
evalOpParm(myPercentile, nodeidx,
"percentile", time, 0);
166 graph->
evalOpParm(myScaleby, nodeidx,
"scaleby", time, 0);
169 graph->
evalOpParm(myResult, nodeidx,
"result", time, 0);
170 myResultattrib =
"density"_UTsh;
171 if (
true && ( (
true&&!(((
int64(getResult())==0)))) ) )
172 graph->
evalOpParm(myResultattrib, nodeidx,
"resultattrib", time, 0);
173 myCreateVarMap =
false;
175 graph->
evalOpParm(myCreateVarMap, nodeidx,
"createvarmap", time, 0);
176 myResultlvar =
""_UTsh;
177 if (
true && ( (
true&&!(((getCreateVarMap()==0))||((
int64(getResult())==0)))) ) )
178 graph->
evalOpParm(myResultlvar, nodeidx,
"resultlvar", time, 0);
194 template <
typename T>
201 if (idx.
size() != instance.
size()+1)
206 coerceValue(value, myGroup);
209 coerceValue(value, myReduction);
212 coerceValue(value, myPercentile);
215 coerceValue(value, myScaleby);
218 coerceValue(value, myResult);
221 coerceValue(value, myResultattrib);
224 coerceValue(value, myCreateVarMap);
227 coerceValue(value, myResultlvar);
243 { doGetParmValue(idx, instance, value); }
245 { doGetParmValue(idx, instance, value); }
247 { doGetParmValue(idx, instance, value); }
249 { doGetParmValue(idx, instance, value); }
251 { doGetParmValue(idx, instance, value); }
253 { doGetParmValue(idx, instance, value); }
255 { doGetParmValue(idx, instance, value); }
257 { doGetParmValue(idx, instance, value); }
259 { doGetParmValue(idx, instance, value); }
261 { doGetParmValue(idx, instance, value); }
263 { doGetParmValue(idx, instance, value); }
265 template <
typename T>
272 if (idx.
size() != instance.
size()+1)
277 coerceValue(myGroup, ( ( value ) ));
280 coerceValue(myReduction, clampMinValue(0, clampMaxValue(9, value ) ));
283 coerceValue(myPercentile, clampMinValue(0, clampMaxValue(100, value ) ));
286 coerceValue(myScaleby, clampMinValue(0, clampMaxValue(3, value ) ));
289 coerceValue(myResult, clampMinValue(0, clampMaxValue(4, value ) ));
292 coerceValue(myResultattrib, ( ( value ) ));
295 coerceValue(myCreateVarMap, ( ( value ) ));
298 coerceValue(myResultlvar, ( ( value ) ));
305 { doSetParmValue(idx, instance, value); }
307 { doSetParmValue(idx, instance, value); }
309 { doSetParmValue(idx, instance, value); }
311 { doSetParmValue(idx, instance, value); }
313 { doSetParmValue(idx, instance, value); }
315 { doSetParmValue(idx, instance, value); }
317 { doSetParmValue(idx, instance, value); }
319 { doSetParmValue(idx, instance, value); }
321 { doSetParmValue(idx, instance, value); }
323 { doSetParmValue(idx, instance, value); }
325 { doSetParmValue(idx, instance, value); }
341 if (fieldnum.
size() < 1)
356 return "resultattrib";
358 return "createvarmap";
368 if (fieldnum.
size() < 1)
369 return PARM_UNSUPPORTED;
390 return PARM_UNSUPPORTED;
426 loadData(is, rampdata);
444 int typelen = colon - data.
buffer();
458 {
int64 iv =
v; UTwrite(os, &iv); }
460 { UTwrite<fpreal64>(os, &
v); }
462 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
464 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
465 UTwrite<fpreal64>(os, &v.
z()); }
467 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
468 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
480 if (s) s->save(ostr);
482 saveData(os, result);
489 ostr << s->getDataTypeToken();
494 saveData(os, result);
498 void save(std::ostream &os)
const
502 saveData(os, myGroup);
503 saveData(os, myReduction);
504 saveData(os, myPercentile);
505 saveData(os, myScaleby);
506 saveData(os, myResult);
507 saveData(os, myResultattrib);
508 saveData(os, myCreateVarMap);
509 saveData(os, myResultlvar);
522 loadData(is, myGroup);
523 loadData(is, myReduction);
524 loadData(is, myPercentile);
525 loadData(is, myScaleby);
526 loadData(is, myResult);
527 loadData(is, myResultattrib);
528 loadData(is, myCreateVarMap);
529 loadData(is, myResultlvar);
539 if (!thissop)
return getGroup();
541 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
549 if (!thissop)
return getReduction();
551 OP_Utils::evalOpParm(result, thissop,
"reduction", cookparms.
getCookTime(), 0);
559 if (!thissop)
return getPercentile();
561 OP_Utils::evalOpParm(result, thissop,
"percentile", cookparms.
getCookTime(), 0);
569 if (!thissop)
return getScaleby();
571 OP_Utils::evalOpParm(result, thissop,
"scaleby", cookparms.
getCookTime(), 0);
579 if (!thissop)
return getResult();
581 OP_Utils::evalOpParm(result, thissop,
"result", cookparms.
getCookTime(), 0);
589 if (!thissop)
return getResultattrib();
591 OP_Utils::evalOpParm(result, thissop,
"resultattrib", cookparms.
getCookTime(), 0);
599 if (!thissop)
return getCreateVarMap();
601 OP_Utils::evalOpParm(result, thissop,
"createvarmap", cookparms.
getCookTime(), 0);
609 if (!thissop)
return getResultlvar();
611 OP_Utils::evalOpParm(result, thissop,
"resultlvar", cookparms.
getCookTime(), 0);
static void loadData(UT_IStream &is, UT_StringHolder &v)
bool operator==(const SOP_VolumeReduceParms &src) const
static void saveData(std::ostream &os, UT_Vector2D v)
SOP_Node * getNode() const
bool getCreateVarMap() const
static void loadData(UT_IStream &is, UT_Vector3I &v)
const char * getNestParmName(TempIndex fieldnum) const override
const UT_StringHolder & getGroup() const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
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_SharedPtr< UT_Ramp > &v)
void setReduction(Reduction val)
const UT_StringHolder & getResultattrib() const
UT_StringHolder opResultattrib(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
static void loadData(UT_IStream &is, UT_Vector2I &v)
static void saveData(std::ostream &os, bool v)
SYS_FORCE_INLINE const char * buffer() const
const UT_StringHolder & getResultlvar() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
An output stream object that owns its own string buffer storage.
void copyFrom(const OP_NodeParms *src) override
**But if you need a result
static void saveData(std::ostream &os, UT_StringHolder s)
void setResult(Result val)
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
bool opCreateVarMap(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
bool load(UT_IStream &is)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool operator!=(const SOP_VolumeReduceParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
SYS_FORCE_INLINE UT_StringHolder getToken(Reduction enum_value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void saveData(std::ostream &os, UT_Matrix3D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
UT_StringHolder opResultlvar(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
constexpr SYS_FORCE_INLINE T & z() noexcept
fpreal64 opPercentile(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
Scaleby getScaleby() const
Reduction getReduction() const
ParmType getNestParmType(TempIndex fieldnum) const override
Reduction opReduction(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void saveBinary(std::ostream &os) const
Save string to binary stream.
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_Vector4D v)
Scaleby opScaleby(const SOP_NodeVerb::CookParms &cookparms) const
void setPercentile(fpreal64 val)
static void saveData(std::ostream &os, UT_Vector3D v)
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
DEP_MicroNode * depnode() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setCreateVarMap(bool val)
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
fpreal getCookTime() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void setResultlvar(const UT_StringHolder &val)
const char * findChar(int c) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
fpreal64 getPercentile() const
void setGroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, fpreal64 v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix2D v)
void loadFromOpSubclass(const LoadParms &loadparms) override
void setResultattrib(const UT_StringHolder &val)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
static void loadData(UT_IStream &is, bool &v)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setScaleby(Scaleby val)
constexpr SYS_FORCE_INLINE T & x() noexcept
Result opResult(const SOP_NodeVerb::CookParms &cookparms) const