23 namespace SOP_VolumeMergeEnums
38 using namespace UT::Literal;
86 if (myGroup != src.myGroup)
return false;
87 if (myMergegrp != src.myMergegrp)
return false;
88 if (myMergemethod != src.myMergemethod)
return false;
89 if (myClampvolume != src.myClampvolume)
return false;
90 if (myDstpreadd != src.myDstpreadd)
return false;
91 if (myDstpremul != src.myDstpremul)
return false;
92 if (mySrcpreadd != src.mySrcpreadd)
return false;
93 if (mySrcpremul != src.mySrcpremul)
return false;
94 if (myPostadd != src.myPostadd)
return false;
95 if (myPostmul != src.myPostmul)
return false;
96 if (myDoclampmin != src.myDoclampmin)
return false;
97 if (myClampmin != src.myClampmin)
return false;
98 if (myDoclampmax != src.myDoclampmax)
return false;
99 if (myClampmax != src.myClampmax)
return false;
115 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
116 myMergegrp =
""_UTsh;
118 graph->
evalOpParm(myMergegrp, nodeidx,
"mergegrp", time, 0);
121 graph->
evalOpParm(myMergemethod, nodeidx,
"mergemethod", time, 0);
122 myClampvolume =
true;
124 graph->
evalOpParm(myClampvolume, nodeidx,
"clampvolume", time, 0);
127 graph->
evalOpParm(myDstpreadd, nodeidx,
"dstpreadd", time, 0);
130 graph->
evalOpParm(myDstpremul, nodeidx,
"dstpremul", time, 0);
133 graph->
evalOpParm(mySrcpreadd, nodeidx,
"srcpreadd", time, 0);
136 graph->
evalOpParm(mySrcpremul, nodeidx,
"srcpremul", time, 0);
139 graph->
evalOpParm(myPostadd, nodeidx,
"postadd", time, 0);
142 graph->
evalOpParm(myPostmul, nodeidx,
"postmul", time, 0);
143 myDoclampmin =
false;
145 graph->
evalOpParm(myDoclampmin, nodeidx,
"doclampmin", time, 0);
147 if (
true && ( (
true&&!(((getDoclampmin()==0)))) ) )
148 graph->
evalOpParm(myClampmin, nodeidx,
"clampmin", time, 0);
149 myDoclampmax =
false;
151 graph->
evalOpParm(myDoclampmax, nodeidx,
"doclampmax", time, 0);
153 if (
true && ( (
true&&!(((getDoclampmax()==0)))) ) )
154 graph->
evalOpParm(myClampmax, nodeidx,
"clampmax", time, 0);
170 template <
typename T>
177 if (idx.
size() != instance.
size()+1)
182 coerceValue(value, myGroup);
185 coerceValue(value, myMergegrp);
188 coerceValue(value, myMergemethod);
191 coerceValue(value, myClampvolume);
194 coerceValue(value, myDstpreadd);
197 coerceValue(value, myDstpremul);
200 coerceValue(value, mySrcpreadd);
203 coerceValue(value, mySrcpremul);
206 coerceValue(value, myPostadd);
209 coerceValue(value, myPostmul);
212 coerceValue(value, myDoclampmin);
215 coerceValue(value, myClampmin);
218 coerceValue(value, myDoclampmax);
221 coerceValue(value, myClampmax);
237 { doGetParmValue(idx, instance, value); }
239 { doGetParmValue(idx, instance, value); }
241 { doGetParmValue(idx, instance, value); }
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 template <
typename T>
266 if (idx.
size() != instance.
size()+1)
271 coerceValue(myGroup, ( ( value ) ));
274 coerceValue(myMergegrp, ( ( value ) ));
277 coerceValue(myMergemethod, clampMinValue(0, clampMaxValue(5, value ) ));
280 coerceValue(myClampvolume, ( ( value ) ));
283 coerceValue(myDstpreadd, ( ( value ) ));
286 coerceValue(myDstpremul, ( ( value ) ));
289 coerceValue(mySrcpreadd, ( ( value ) ));
292 coerceValue(mySrcpremul, ( ( value ) ));
295 coerceValue(myPostadd, ( ( value ) ));
298 coerceValue(myPostmul, ( ( value ) ));
301 coerceValue(myDoclampmin, ( ( value ) ));
304 coerceValue(myClampmin, ( ( value ) ));
307 coerceValue(myDoclampmax, ( ( value ) ));
310 coerceValue(myClampmax, ( ( 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); }
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); }
353 if (fieldnum.
size() < 1)
362 return "mergemethod";
364 return "clampvolume";
392 if (fieldnum.
size() < 1)
393 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, myMergegrp);
540 saveData(os, myMergemethod);
541 saveData(os, myClampvolume);
542 saveData(os, myDstpreadd);
543 saveData(os, myDstpremul);
544 saveData(os, mySrcpreadd);
545 saveData(os, mySrcpremul);
546 saveData(os, myPostadd);
547 saveData(os, myPostmul);
548 saveData(os, myDoclampmin);
549 saveData(os, myClampmin);
550 saveData(os, myDoclampmax);
551 saveData(os, myClampmax);
564 loadData(is, myGroup);
565 loadData(is, myMergegrp);
566 loadData(is, myMergemethod);
567 loadData(is, myClampvolume);
568 loadData(is, myDstpreadd);
569 loadData(is, myDstpremul);
570 loadData(is, mySrcpreadd);
571 loadData(is, mySrcpremul);
572 loadData(is, myPostadd);
573 loadData(is, myPostmul);
574 loadData(is, myDoclampmin);
575 loadData(is, myClampmin);
576 loadData(is, myDoclampmax);
577 loadData(is, myClampmax);
587 if (!thissop)
return getGroup();
589 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
597 if (!thissop)
return getMergegrp();
599 OP_Utils::evalOpParm(result, thissop,
"mergegrp", cookparms.
getCookTime(), 0);
607 if (!thissop)
return getMergemethod();
609 OP_Utils::evalOpParm(result, thissop,
"mergemethod", cookparms.
getCookTime(), 0);
617 if (!thissop)
return getClampvolume();
619 OP_Utils::evalOpParm(result, thissop,
"clampvolume", cookparms.
getCookTime(), 0);
627 if (!thissop)
return getDstpreadd();
629 OP_Utils::evalOpParm(result, thissop,
"dstpreadd", cookparms.
getCookTime(), 0);
637 if (!thissop)
return getDstpremul();
639 OP_Utils::evalOpParm(result, thissop,
"dstpremul", cookparms.
getCookTime(), 0);
647 if (!thissop)
return getSrcpreadd();
649 OP_Utils::evalOpParm(result, thissop,
"srcpreadd", cookparms.
getCookTime(), 0);
657 if (!thissop)
return getSrcpremul();
659 OP_Utils::evalOpParm(result, thissop,
"srcpremul", cookparms.
getCookTime(), 0);
667 if (!thissop)
return getPostadd();
669 OP_Utils::evalOpParm(result, thissop,
"postadd", cookparms.
getCookTime(), 0);
677 if (!thissop)
return getPostmul();
679 OP_Utils::evalOpParm(result, thissop,
"postmul", cookparms.
getCookTime(), 0);
687 if (!thissop)
return getDoclampmin();
689 OP_Utils::evalOpParm(result, thissop,
"doclampmin", cookparms.
getCookTime(), 0);
697 if (!thissop)
return getClampmin();
699 OP_Utils::evalOpParm(result, thissop,
"clampmin", cookparms.
getCookTime(), 0);
707 if (!thissop)
return getDoclampmax();
709 OP_Utils::evalOpParm(result, thissop,
"doclampmax", cookparms.
getCookTime(), 0);
717 if (!thissop)
return getClampmax();
719 OP_Utils::evalOpParm(result, thissop,
"clampmax", cookparms.
getCookTime(), 0);
fpreal64 getClampmax() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
fpreal64 opSrcpremul(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Vector3D v)
bool opClampvolume(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setPostadd(fpreal64 val)
fpreal64 getClampmin() const
SOP_Node * getNode() const
bool opDoclampmin(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
fpreal64 opSrcpreadd(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
Mergemethod getMergemethod() const
exint getNestNumParms(TempIndex idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const 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_Vector4D &v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void save(std::ostream &os) const
static void saveData(std::ostream &os, UT_Vector4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
An output stream object that owns its own string buffer storage.
static void saveData(std::ostream &os, UT_Matrix3D v)
static void saveData(std::ostream &os, UT_StringHolder s)
void loadFromOpSubclass(const LoadParms &loadparms) override
void setSrcpreadd(fpreal64 val)
**But if you need a result
const UT_StringHolder & getMergegrp() const
void setDstpremul(fpreal64 val)
bool operator==(const SOP_VolumeMergeParms &src) const
fpreal64 getPostadd() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
UT_StringHolder opMergegrp(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
fpreal64 getSrcpremul() const
const UT_StringHolder & getGroup() const
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 setDstpreadd(fpreal64 val)
fpreal64 getPostmul() const
void setDoclampmax(bool val)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
fpreal64 opClampmax(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
SYS_FORCE_INLINE UT_StringHolder getToken(Mergemethod enum_value)
Mergemethod opMergemethod(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept
void setPostmul(fpreal64 val)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void setMergemethod(Mergemethod val)
bool getDoclampmax() const
const char * getNestParmName(TempIndex fieldnum) const override
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
constexpr SYS_FORCE_INLINE T & z() noexcept
static void saveData(std::ostream &os, int64 v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const OP_GraphProxy * graph() const
fpreal64 getDstpreadd() const
fpreal64 getDstpremul() const
static void loadData(UT_IStream &is, UT_Vector2I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
ParmType getNestParmType(TempIndex fieldnum) const override
static void loadData(UT_IStream &is, UT_Matrix2D &v)
bool opDoclampmax(const SOP_NodeVerb::CookParms &cookparms) const
bool isParmColorRamp(exint idx) const override
fpreal64 opDstpremul(const SOP_NodeVerb::CookParms &cookparms) const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
void setClampmin(fpreal64 val)
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void loadData(UT_IStream &is, int64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
fpreal64 getSrcpreadd() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
fpreal64 opPostadd(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, fpreal64 v)
void setClampvolume(bool val)
void setClampmax(fpreal64 val)
static void saveData(std::ostream &os, UT_Matrix4D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setDoclampmin(bool val)
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
void setGroup(const UT_StringHolder &val)
Utility class for containing a color ramp.
static void loadData(UT_IStream &is, fpreal64 &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void saveData(std::ostream &os, bool v)
bool getClampvolume() const
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
fpreal getCookTime() const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
const char * findChar(int c) const
bool load(UT_IStream &is)
void setSrcpremul(fpreal64 val)
static void saveData(std::ostream &os, UT_Matrix2D v)
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, bool &v)
bool operator!=(const SOP_VolumeMergeParms &src) const
void setMergegrp(const UT_StringHolder &val)
fpreal64 opDstpreadd(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
fpreal64 opClampmin(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
bool getDoclampmin() const
SYS_FORCE_INLINE bool isstring() const
static void saveData(std::ostream &os, UT_Vector2D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
constexpr SYS_FORCE_INLINE T & x() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
fpreal64 opPostmul(const SOP_NodeVerb::CookParms &cookparms) const