23 namespace SOP_VolumeReduceEnums
68 myResultattrib =
"density"_UTsh;
69 myCreateVarMap =
false;
70 myResultlvar =
""_UTsh;
83 if (myGroup != src.myGroup)
return false;
84 if (myReduction != src.myReduction)
return false;
85 if (myPercentile != src.myPercentile)
return false;
86 if (myScaleby != src.myScaleby)
return false;
87 if (myResult != src.myResult)
return false;
88 if (myResultattrib != src.myResultattrib)
return false;
89 if (myCreateVarMap != src.myCreateVarMap)
return false;
90 if (myResultlvar != src.myResultlvar)
return false;
108 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
111 graph->
evalOpParm(myReduction, nodeidx,
"reduction", time, 0);
113 if (
true && ( (
true&&!(((
int64(getReduction())!=5)))) ) )
114 graph->
evalOpParm(myPercentile, nodeidx,
"percentile", time, 0);
117 graph->
evalOpParm(myScaleby, nodeidx,
"scaleby", time, 0);
120 graph->
evalOpParm(myResult, nodeidx,
"result", time, 0);
121 myResultattrib =
"density"_UTsh;
122 if (
true && ( (
true&&!(((
int64(getResult())==0)))) ) )
123 graph->
evalOpParm(myResultattrib, nodeidx,
"resultattrib", time, 0);
124 myCreateVarMap =
false;
126 graph->
evalOpParm(myCreateVarMap, nodeidx,
"createvarmap", time, 0);
127 myResultlvar =
""_UTsh;
128 if (
true && ( (
true&&!(((getCreateVarMap()==0))||((
int64(getResult())==0)))) ) )
129 graph->
evalOpParm(myResultlvar, nodeidx,
"resultlvar", time, 0);
145 template <
typename T>
152 if (idx.
size() != instance.
size()+1)
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 { doGetParmValue(idx, instance, value); }
208 { doGetParmValue(idx, instance, value); }
210 { doGetParmValue(idx, instance, value); }
212 { doGetParmValue(idx, instance, value); }
214 { doGetParmValue(idx, instance, value); }
216 template <
typename T>
223 if (idx.
size() != instance.
size()+1)
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); }
276 { doSetParmValue(idx, instance, value); }
292 if (fieldnum.
size() < 1)
307 return "resultattrib";
309 return "createvarmap";
319 if (fieldnum.
size() < 1)
320 return PARM_UNSUPPORTED;
360 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
362 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
364 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
377 loadData(is, rampdata);
395 int typelen = colon - data.
buffer();
409 {
int64 iv =
v; UTwrite(os, &iv); }
411 { UTwrite<fpreal64>(os, &
v); }
413 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
415 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
416 UTwrite<fpreal64>(os, &v.
z()); }
418 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
419 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
431 if (s) s->save(ostr);
433 saveData(os, result);
440 ostr << s->getDataTypeToken();
445 saveData(os, result);
449 void save(std::ostream &os)
const
453 saveData(os, myGroup);
454 saveData(os, myReduction);
455 saveData(os, myPercentile);
456 saveData(os, myScaleby);
457 saveData(os, myResult);
458 saveData(os, myResultattrib);
459 saveData(os, myCreateVarMap);
460 saveData(os, myResultlvar);
473 loadData(is, myGroup);
474 loadData(is, myReduction);
475 loadData(is, myPercentile);
476 loadData(is, myScaleby);
477 loadData(is, myResult);
478 loadData(is, myResultattrib);
479 loadData(is, myCreateVarMap);
480 loadData(is, myResultlvar);
490 if (!thissop)
return getGroup();
492 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
500 if (!thissop)
return getReduction();
502 OP_Utils::evalOpParm(result, thissop,
"reduction", cookparms.
getCookTime(), 0);
510 if (!thissop)
return getPercentile();
512 OP_Utils::evalOpParm(result, thissop,
"percentile", cookparms.
getCookTime(), 0);
520 if (!thissop)
return getScaleby();
522 OP_Utils::evalOpParm(result, thissop,
"scaleby", cookparms.
getCookTime(), 0);
530 if (!thissop)
return getResult();
532 OP_Utils::evalOpParm(result, thissop,
"result", cookparms.
getCookTime(), 0);
540 if (!thissop)
return getResultattrib();
542 OP_Utils::evalOpParm(result, thissop,
"resultattrib", cookparms.
getCookTime(), 0);
550 if (!thissop)
return getCreateVarMap();
552 OP_Utils::evalOpParm(result, thissop,
"createvarmap", cookparms.
getCookTime(), 0);
560 if (!thissop)
return getResultlvar();
562 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
T clampMaxValue(fpreal maxvalue, const T &src) const
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)
T clampMinValue(fpreal minvalue, const T &src) const
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)
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)
void coerceValue(T &result, const S &src) const
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
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)
OP_NodeParms & operator=(const OP_NodeParms &)=default
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