23 namespace SOP_VolumeBlurEnums
42 using namespace UT::Literal;
69 using namespace UT::Literal;
90 myUsevoxelradius =
false;
98 myEnableblending =
false;
113 if (myGroup != src.myGroup)
return false;
114 if (myUsevoxelradius != src.myUsevoxelradius)
return false;
115 if (myRadius != src.myRadius)
return false;
116 if (myVoxelradius != src.myVoxelradius)
return false;
117 if (myUseopencl != src.myUseopencl)
return false;
118 if (myReduction != src.myReduction)
return false;
119 if (myPasses != src.myPasses)
return false;
120 if (myBordertype != src.myBordertype)
return false;
121 if (myBorderval != src.myBorderval)
return false;
122 if (myEnableblending != src.myEnableblending)
return false;
123 if (myBlurblend != src.myBlurblend)
return false;
124 if (myOriginalblend != src.myOriginalblend)
return false;
141 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
142 myUsevoxelradius =
false;
144 graph->
evalOpParm(myUsevoxelradius, nodeidx,
"usevoxelradius", time, 0);
146 if (
true && ( (
true&&!(((getUsevoxelradius()==1)))) ) )
147 graph->
evalOpParm(myRadius, nodeidx,
"radius", time, 0);
149 if (
true && ( (
true&&!(((getUsevoxelradius()==0)))) ) )
150 graph->
evalOpParm(myVoxelradius, nodeidx,
"voxelradius", time, 0);
153 graph->
evalOpParm(myUseopencl, nodeidx,
"useopencl", time, 0);
156 graph->
evalOpParm(myReduction, nodeidx,
"reduction", time, 0);
159 graph->
evalOpParm(myPasses, nodeidx,
"passes", time, 0);
162 graph->
evalOpParm(myBordertype, nodeidx,
"bordertype", time, 0);
164 if (
true && ( (
true&&!(((
int64(getBordertype())==0)))) ) )
165 graph->
evalOpParm(myBorderval, nodeidx,
"borderval", time, 0);
166 myEnableblending =
false;
168 graph->
evalOpParm(myEnableblending, nodeidx,
"enableblending", time, 0);
170 if (
true && ( (
true&&!(((getEnableblending()==0)))) ) )
171 graph->
evalOpParm(myBlurblend, nodeidx,
"blurblend", time, 0);
173 if (
true && ( (
true&&!(((getEnableblending()==0)))) ) )
174 graph->
evalOpParm(myOriginalblend, nodeidx,
"originalblend", time, 0);
190 template <
typename T>
197 if (idx.
size() != instance.
size()+1)
202 coerceValue(value, myGroup);
205 coerceValue(value, myUsevoxelradius);
208 coerceValue(value, myRadius);
211 coerceValue(value, myVoxelradius);
214 coerceValue(value, myUseopencl);
217 coerceValue(value, myReduction);
220 coerceValue(value, myPasses);
223 coerceValue(value, myBordertype);
226 coerceValue(value, myBorderval);
229 coerceValue(value, myEnableblending);
232 coerceValue(value, myBlurblend);
235 coerceValue(value, myOriginalblend);
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 { doGetParmValue(idx, instance, value); }
267 { doGetParmValue(idx, instance, value); }
269 { doGetParmValue(idx, instance, value); }
271 { doGetParmValue(idx, instance, value); }
273 template <
typename T>
280 if (idx.
size() != instance.
size()+1)
285 coerceValue(myGroup, ( ( value ) ));
288 coerceValue(myUsevoxelradius, ( ( value ) ));
291 coerceValue(myRadius, clampMinValue(0, ( value ) ));
294 coerceValue(myVoxelradius, clampMinValue(0, ( value ) ));
297 coerceValue(myUseopencl, ( ( value ) ));
300 coerceValue(myReduction, clampMinValue(0, clampMaxValue(9, value ) ));
303 coerceValue(myPasses, clampMinValue(1, ( value ) ));
306 coerceValue(myBordertype, clampMinValue(0, clampMaxValue(3, value ) ));
309 coerceValue(myBorderval, ( ( value ) ));
312 coerceValue(myEnableblending, ( ( value ) ));
315 coerceValue(myBlurblend, ( ( value ) ));
318 coerceValue(myOriginalblend, ( ( value ) ));
325 { doSetParmValue(idx, instance, value); }
327 { doSetParmValue(idx, instance, value); }
329 { doSetParmValue(idx, instance, value); }
331 { doSetParmValue(idx, instance, value); }
333 { doSetParmValue(idx, instance, value); }
335 { doSetParmValue(idx, instance, value); }
337 { doSetParmValue(idx, instance, value); }
339 { doSetParmValue(idx, instance, value); }
341 { doSetParmValue(idx, instance, value); }
343 { doSetParmValue(idx, instance, value); }
345 { doSetParmValue(idx, instance, value); }
361 if (fieldnum.
size() < 1)
368 return "usevoxelradius";
372 return "voxelradius";
384 return "enableblending";
388 return "originalblend";
396 if (fieldnum.
size() < 1)
397 return PARM_UNSUPPORTED;
426 return PARM_UNSUPPORTED;
462 loadData(is, rampdata);
480 int typelen = colon - data.
buffer();
494 {
int64 iv =
v; UTwrite(os, &iv); }
496 { UTwrite<fpreal64>(os, &
v); }
498 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
500 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
501 UTwrite<fpreal64>(os, &v.
z()); }
503 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
504 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
516 if (s) s->save(ostr);
518 saveData(os, result);
525 ostr << s->getDataTypeToken();
530 saveData(os, result);
534 void save(std::ostream &os)
const
538 saveData(os, myGroup);
539 saveData(os, myUsevoxelradius);
540 saveData(os, myRadius);
541 saveData(os, myVoxelradius);
542 saveData(os, myUseopencl);
543 saveData(os, myReduction);
544 saveData(os, myPasses);
545 saveData(os, myBordertype);
546 saveData(os, myBorderval);
547 saveData(os, myEnableblending);
548 saveData(os, myBlurblend);
549 saveData(os, myOriginalblend);
562 loadData(is, myGroup);
563 loadData(is, myUsevoxelradius);
564 loadData(is, myRadius);
565 loadData(is, myVoxelradius);
566 loadData(is, myUseopencl);
567 loadData(is, myReduction);
568 loadData(is, myPasses);
569 loadData(is, myBordertype);
570 loadData(is, myBorderval);
571 loadData(is, myEnableblending);
572 loadData(is, myBlurblend);
573 loadData(is, myOriginalblend);
583 if (!thissop)
return getGroup();
585 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
593 if (!thissop)
return getUsevoxelradius();
595 OP_Utils::evalOpParm(result, thissop,
"usevoxelradius", cookparms.
getCookTime(), 0);
603 if (!thissop)
return getRadius();
605 OP_Utils::evalOpParm(result, thissop,
"radius", cookparms.
getCookTime(), 0);
613 if (!thissop)
return getVoxelradius();
615 OP_Utils::evalOpParm(result, thissop,
"voxelradius", cookparms.
getCookTime(), 0);
623 if (!thissop)
return getUseopencl();
625 OP_Utils::evalOpParm(result, thissop,
"useopencl", cookparms.
getCookTime(), 0);
633 if (!thissop)
return getReduction();
635 OP_Utils::evalOpParm(result, thissop,
"reduction", cookparms.
getCookTime(), 0);
643 if (!thissop)
return getPasses();
645 OP_Utils::evalOpParm(result, thissop,
"passes", cookparms.
getCookTime(), 0);
653 if (!thissop)
return getBordertype();
655 OP_Utils::evalOpParm(result, thissop,
"bordertype", cookparms.
getCookTime(), 0);
663 if (!thissop)
return getBorderval();
665 OP_Utils::evalOpParm(result, thissop,
"borderval", cookparms.
getCookTime(), 0);
673 if (!thissop)
return getEnableblending();
675 OP_Utils::evalOpParm(result, thissop,
"enableblending", cookparms.
getCookTime(), 0);
683 if (!thissop)
return getBlurblend();
685 OP_Utils::evalOpParm(result, thissop,
"blurblend", cookparms.
getCookTime(), 0);
693 if (!thissop)
return getOriginalblend();
695 OP_Utils::evalOpParm(result, thissop,
"originalblend", cookparms.
getCookTime(), 0);
701 bool myUsevoxelradius;
709 bool myEnableblending;
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setUsevoxelradius(bool val)
void save(std::ostream &os) const
SOP_Node * getNode() const
static void loadData(UT_IStream &is, int64 &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
Reduction getReduction() const
UT_Vector3D getVoxelradius() const
void copyFrom(const OP_NodeParms *src) override
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_Vector3D opVoxelradius(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
fpreal64 getOriginalblend() const
bool opUsevoxelradius(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getRadius() const
bool opEnableblending(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_VolumeBlurParms &src) const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
const OP_Context & context() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
void setPasses(int64 val)
An output stream object that owns its own string buffer storage.
bool operator==(const SOP_VolumeBlurParms &src) const
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Vector2D v)
**But if you need a result
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
fpreal64 opBorderval(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opOriginalblend(const SOP_NodeVerb::CookParms &cookparms) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
static void saveData(std::ostream &os, UT_Matrix2D v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool opUseopencl(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void setUseopencl(bool val)
static void loadData(UT_IStream &is, UT_Vector2I &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
exint getNestNumParms(TempIndex idx) const override
void setReduction(Reduction val)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setRadius(fpreal64 val)
void setVoxelradius(UT_Vector3D val)
void setBlurblend(fpreal64 val)
fpreal64 getBlurblend() const
void setBorderval(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
SYS_FORCE_INLINE UT_StringHolder getToken(Reduction enum_value)
fpreal64 opRadius(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
fpreal64 getBorderval() const
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
int64 opPasses(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, bool &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
UT_Vector3T< fpreal64 > UT_Vector3D
static void loadData(UT_IStream &is, UT_Matrix4D &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
fpreal64 opBlurblend(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void saveData(std::ostream &os, UT_Vector4D v)
static void saveData(std::ostream &os, fpreal64 v)
GT_API const UT_StringHolder version
void setGroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_Matrix3D v)
bool getUseopencl() const
bool getEnableblending() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
void setEnableblending(bool val)
void loadFromOpSubclass(const LoadParms &loadparms) override
DEP_MicroNode * depnode() const
Bordertype opBordertype(const SOP_NodeVerb::CookParms &cookparms) const
LeafData & operator=(const LeafData &)=delete
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
Utility class for containing a color ramp.
bool getUsevoxelradius() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
Reduction opReduction(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & w() noexcept
void setOriginalblend(fpreal64 val)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
fpreal getCookTime() const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
const char * findChar(int c) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setBordertype(Bordertype val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_StringHolder &v)
const UT_StringHolder & getGroup() const
bool isParmColorRamp(exint idx) const override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void saveData(std::ostream &os, bool v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept
Bordertype getBordertype() const