20 using namespace UT::Literal;
23 namespace SOP_VolumeReduceEnums
68 myResultattrib =
"density"_sh;
79 if (myGroup != src.myGroup)
return false;
80 if (myReduction != src.myReduction)
return false;
81 if (myPercentile != src.myPercentile)
return false;
82 if (myScaleby != src.myScaleby)
return false;
83 if (myResult != src.myResult)
return false;
84 if (myResultattrib != src.myResultattrib)
return false;
85 if (myResultlvar != src.myResultlvar)
return false;
103 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
106 graph->
evalOpParm(myReduction, nodeidx,
"reduction", time, 0);
108 if (
true && ( (!(((
int64(getReduction())!=5)))) ) )
109 graph->
evalOpParm(myPercentile, nodeidx,
"percentile", time, 0);
112 graph->
evalOpParm(myScaleby, nodeidx,
"scaleby", time, 0);
115 graph->
evalOpParm(myResult, nodeidx,
"result", time, 0);
116 myResultattrib =
"density"_sh;
117 if (
true && ( (!(((
int64(getResult())==0)))) ) )
118 graph->
evalOpParm(myResultattrib, nodeidx,
"resultattrib", time, 0);
119 myResultlvar =
""_sh;
120 if (
true && ( (!(((
int64(getResult())==0)))) ) )
121 graph->
evalOpParm(myResultlvar, nodeidx,
"resultlvar", time, 0);
137 template <
typename T>
144 if (idx.
size() != instance.
size()+1)
149 coerceValue(value, myGroup);
152 coerceValue(value, myReduction);
155 coerceValue(value, myPercentile);
158 coerceValue(value, myScaleby);
161 coerceValue(value, myResult);
164 coerceValue(value, myResultattrib);
167 coerceValue(value, myResultlvar);
174 { doGetParmValue(idx, instance, value); }
176 { doGetParmValue(idx, instance, value); }
178 { doGetParmValue(idx, instance, value); }
180 { doGetParmValue(idx, instance, value); }
182 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
203 if (idx.
size() != instance.
size()+1)
208 coerceValue(myGroup, value);
211 coerceValue(myReduction, value);
214 coerceValue(myPercentile, value);
217 coerceValue(myScaleby, value);
220 coerceValue(myResult, value);
223 coerceValue(myResultattrib, value);
226 coerceValue(myResultlvar, value);
233 { doSetParmValue(idx, instance, value); }
235 { doSetParmValue(idx, instance, value); }
237 { doSetParmValue(idx, instance, value); }
239 { doSetParmValue(idx, instance, value); }
241 { doSetParmValue(idx, instance, value); }
243 { doSetParmValue(idx, instance, value); }
245 { doSetParmValue(idx, instance, value); }
247 { doSetParmValue(idx, instance, value); }
249 { doSetParmValue(idx, instance, value); }
251 { doSetParmValue(idx, instance, value); }
253 { doSetParmValue(idx, instance, value); }
269 if (fieldnum.
size() < 1)
284 return "resultattrib";
294 if (fieldnum.
size() < 1)
295 return PARM_UNSUPPORTED;
314 return PARM_UNSUPPORTED;
350 loadData(is, rampdata);
368 int typelen = colon - data.
buffer();
382 {
int64 iv =
v; UTwrite(os, &iv); }
384 { UTwrite<fpreal64>(os, &
v); }
386 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
388 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
389 UTwrite<fpreal64>(os, &v.
z()); }
391 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
392 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
404 if (s) s->save(ostr);
406 saveData(os, result);
413 ostr << s->getDataTypeToken();
418 saveData(os, result);
422 void save(std::ostream &os)
const
426 saveData(os, myGroup);
427 saveData(os, myReduction);
428 saveData(os, myPercentile);
429 saveData(os, myScaleby);
430 saveData(os, myResult);
431 saveData(os, myResultattrib);
432 saveData(os, myResultlvar);
445 loadData(is, myGroup);
446 loadData(is, myReduction);
447 loadData(is, myPercentile);
448 loadData(is, myScaleby);
449 loadData(is, myResult);
450 loadData(is, myResultattrib);
451 loadData(is, myResultlvar);
461 if (!thissop)
return getGroup();
463 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
471 if (!thissop)
return getReduction();
473 OP_Utils::evalOpParm(result, thissop,
"reduction", cookparms.
getCookTime(), 0);
481 if (!thissop)
return getPercentile();
483 OP_Utils::evalOpParm(result, thissop,
"percentile", cookparms.
getCookTime(), 0);
491 if (!thissop)
return getScaleby();
493 OP_Utils::evalOpParm(result, thissop,
"scaleby", cookparms.
getCookTime(), 0);
501 if (!thissop)
return getResult();
503 OP_Utils::evalOpParm(result, thissop,
"result", cookparms.
getCookTime(), 0);
511 if (!thissop)
return getResultattrib();
513 OP_Utils::evalOpParm(result, thissop,
"resultattrib", cookparms.
getCookTime(), 0);
521 if (!thissop)
return getResultlvar();
523 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
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)
GLuint const GLfloat * val
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
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.
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)
GLint GLenum GLsizei GLint GLsizei const void * data
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.
~SOP_VolumeReduceParms() override
exint getNestNumParms(TempIndex idx) const override
GLdouble GLdouble GLdouble r
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
static void saveData(std::ostream &os, UT_Matrix2D v)
void loadFromOpSubclass(const LoadParms &loadparms) override
GLsizei const GLfloat * value
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)
Result opResult(const SOP_NodeVerb::CookParms &cookparms) const