22 using namespace UT::Literal;
25 namespace SOP_VolumeReduceEnums
70 myResultattrib =
"density"_sh;
71 myCreateVarMap =
false;
82 if (myGroup != src.myGroup)
return false;
83 if (myReduction != src.myReduction)
return false;
84 if (myPercentile != src.myPercentile)
return false;
85 if (myScaleby != src.myScaleby)
return false;
86 if (myResult != src.myResult)
return false;
87 if (myResultattrib != src.myResultattrib)
return false;
88 if (myCreateVarMap != src.myCreateVarMap)
return false;
89 if (myResultlvar != src.myResultlvar)
return false;
107 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
110 graph->
evalOpParm(myReduction, nodeidx,
"reduction", time, 0);
112 if (
true && ( (
true&&!(((
int64(getReduction())!=5)))) ) )
113 graph->
evalOpParm(myPercentile, nodeidx,
"percentile", time, 0);
116 graph->
evalOpParm(myScaleby, nodeidx,
"scaleby", time, 0);
119 graph->
evalOpParm(myResult, nodeidx,
"result", time, 0);
120 myResultattrib =
"density"_sh;
121 if (
true && ( (
true&&!(((
int64(getResult())==0)))) ) )
122 graph->
evalOpParm(myResultattrib, nodeidx,
"resultattrib", time, 0);
123 myCreateVarMap =
false;
125 graph->
evalOpParm(myCreateVarMap, nodeidx,
"createvarmap", time, 0);
126 myResultlvar =
""_sh;
127 if (
true && ( (
true&&!(((getCreateVarMap()==0))||((
int64(getResult())==0)))) ) )
128 graph->
evalOpParm(myResultlvar, nodeidx,
"resultlvar", time, 0);
144 template <
typename T>
151 if (idx.
size() != instance.
size()+1)
156 coerceValue(value, myGroup);
159 coerceValue(value, myReduction);
162 coerceValue(value, myPercentile);
165 coerceValue(value, myScaleby);
168 coerceValue(value, myResult);
171 coerceValue(value, myResultattrib);
174 coerceValue(value, myCreateVarMap);
177 coerceValue(value, myResultlvar);
184 { doGetParmValue(idx, instance, value); }
186 { doGetParmValue(idx, instance, value); }
188 { doGetParmValue(idx, instance, value); }
190 { doGetParmValue(idx, instance, value); }
192 { doGetParmValue(idx, instance, value); }
194 { doGetParmValue(idx, instance, value); }
196 { doGetParmValue(idx, instance, value); }
198 { doGetParmValue(idx, instance, value); }
200 { doGetParmValue(idx, instance, value); }
202 { doGetParmValue(idx, instance, value); }
204 { doGetParmValue(idx, instance, value); }
206 template <
typename T>
213 if (idx.
size() != instance.
size()+1)
218 coerceValue(myGroup, ( ( value ) ));
221 coerceValue(myReduction, clampMinValue(0, clampMaxValue(9, value ) ));
224 coerceValue(myPercentile, clampMinValue(0, clampMaxValue(100, value ) ));
227 coerceValue(myScaleby, clampMinValue(0, clampMaxValue(3, value ) ));
230 coerceValue(myResult, clampMinValue(0, clampMaxValue(4, value ) ));
233 coerceValue(myResultattrib, ( ( value ) ));
236 coerceValue(myCreateVarMap, ( ( value ) ));
239 coerceValue(myResultlvar, ( ( value ) ));
246 { doSetParmValue(idx, instance, value); }
248 { doSetParmValue(idx, instance, value); }
250 { doSetParmValue(idx, instance, value); }
252 { doSetParmValue(idx, instance, 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); }
282 if (fieldnum.
size() < 1)
297 return "resultattrib";
299 return "createvarmap";
309 if (fieldnum.
size() < 1)
310 return PARM_UNSUPPORTED;
331 return PARM_UNSUPPORTED;
367 loadData(is, rampdata);
385 int typelen = colon - data.
buffer();
399 {
int64 iv =
v; UTwrite(os, &iv); }
401 { UTwrite<fpreal64>(os, &
v); }
403 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
405 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
406 UTwrite<fpreal64>(os, &v.
z()); }
408 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
409 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
421 if (s) s->save(ostr);
423 saveData(os, result);
430 ostr << s->getDataTypeToken();
435 saveData(os, result);
439 void save(std::ostream &os)
const
443 saveData(os, myGroup);
444 saveData(os, myReduction);
445 saveData(os, myPercentile);
446 saveData(os, myScaleby);
447 saveData(os, myResult);
448 saveData(os, myResultattrib);
449 saveData(os, myCreateVarMap);
450 saveData(os, myResultlvar);
463 loadData(is, myGroup);
464 loadData(is, myReduction);
465 loadData(is, myPercentile);
466 loadData(is, myScaleby);
467 loadData(is, myResult);
468 loadData(is, myResultattrib);
469 loadData(is, myCreateVarMap);
470 loadData(is, myResultlvar);
480 if (!thissop)
return getGroup();
482 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
490 if (!thissop)
return getReduction();
492 OP_Utils::evalOpParm(result, thissop,
"reduction", cookparms.
getCookTime(), 0);
500 if (!thissop)
return getPercentile();
502 OP_Utils::evalOpParm(result, thissop,
"percentile", cookparms.
getCookTime(), 0);
510 if (!thissop)
return getScaleby();
512 OP_Utils::evalOpParm(result, thissop,
"scaleby", cookparms.
getCookTime(), 0);
520 if (!thissop)
return getResult();
522 OP_Utils::evalOpParm(result, thissop,
"result", cookparms.
getCookTime(), 0);
530 if (!thissop)
return getResultattrib();
532 OP_Utils::evalOpParm(result, thissop,
"resultattrib", cookparms.
getCookTime(), 0);
540 if (!thissop)
return getCreateVarMap();
542 OP_Utils::evalOpParm(result, thissop,
"createvarmap", cookparms.
getCookTime(), 0);
550 if (!thissop)
return getResultlvar();
552 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
void buildFromOp(const SOP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
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
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 SOP_GraphProxy * graph() const
const UT_StringHolder & getResultlvar() const
void copyFrom(const SOP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
An output stream object that owns its own string buffer storage.
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
bool operator!=(const SOP_VolumeReduceParms &src) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
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)
fpreal64 opPercentile(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
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
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)
DEP_MicroNode * depnode() const
Scaleby opScaleby(const SOP_NodeVerb::CookParms &cookparms) const
void setPercentile(fpreal64 val)
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
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)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
Utility class for containing a color ramp.
void setCreateVarMap(bool val)
~SOP_VolumeReduceParms() override
exint getNestNumParms(TempIndex idx) const override
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
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)
const OP_Context & context() const
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)
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