23 namespace SOP_VolumeFromAttribEnums
50 myDisableonmissing =
false;
53 myUsemaxextrapolate =
true;
55 myUsemaxextrapolatedist =
false;
56 myMaxextrapolatedist = 0;
59 myCalculationtype = 0;
62 myScalebyvolume =
false;
79 if (myGroup != src.myGroup)
return false;
80 if (myPointgrp != src.myPointgrp)
return false;
81 if (myUseattrib != src.myUseattrib)
return false;
82 if (myAttrib != src.myAttrib)
return false;
83 if (myDisableonmissing != src.myDisableonmissing)
return false;
84 if (myAccumulate != src.myAccumulate)
return false;
85 if (myExtrapolate != src.myExtrapolate)
return false;
86 if (myUsemaxextrapolate != src.myUsemaxextrapolate)
return false;
87 if (myMaxextrapolate != src.myMaxextrapolate)
return false;
88 if (myUsemaxextrapolatedist != src.myUsemaxextrapolatedist)
return false;
89 if (myMaxextrapolatedist != src.myMaxextrapolatedist)
return false;
90 if (myThreshold != src.myThreshold)
return false;
91 if (myBandwidth != src.myBandwidth)
return false;
92 if (myCalculationtype != src.myCalculationtype)
return false;
93 if (myDstpreadd != src.myDstpreadd)
return false;
94 if (myDstpremul != src.myDstpremul)
return false;
95 if (myScalebyvolume != src.myScalebyvolume)
return false;
96 if (mySrcpreadd != src.mySrcpreadd)
return false;
97 if (mySrcpremul != src.mySrcpremul)
return false;
98 if (myPostadd != src.myPostadd)
return false;
99 if (myPostmul != src.myPostmul)
return false;
115 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
116 myPointgrp =
""_UTsh;
118 graph->
evalOpParm(myPointgrp, nodeidx,
"pointgrp", time, 0);
121 graph->
evalOpParm(myUseattrib, nodeidx,
"useattrib", time, 0);
123 if (
true && ( (
true&&!(((getUseattrib()==0)))) ) )
124 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, 0);
125 myDisableonmissing =
false;
126 if (
true && ( (
true&&!(((getUseattrib()==0)))) ) )
127 graph->
evalOpParm(myDisableonmissing, nodeidx,
"disableonmissing", time, 0);
128 myAccumulate =
false;
130 graph->
evalOpParm(myAccumulate, nodeidx,
"accumulate", time, 0);
131 myExtrapolate =
true;
132 if (
true && ( (
true&&!(((getAccumulate()==1)))) ) )
133 graph->
evalOpParm(myExtrapolate, nodeidx,
"extrapolate", time, 0);
134 myUsemaxextrapolate =
true;
135 if (
true && ( (
true&&!(((getAccumulate()==1))||((getExtrapolate()==0)))) ) )
136 graph->
evalOpParm(myUsemaxextrapolate, nodeidx,
"usemaxextrapolate", time, 0);
137 myMaxextrapolate = 2;
138 if (
true && ( (
true&&!(((getAccumulate()==1))||((getExtrapolate()==0))||((getUsemaxextrapolate()==0)))) ) )
139 graph->
evalOpParm(myMaxextrapolate, nodeidx,
"maxextrapolate", time, 0);
140 myUsemaxextrapolatedist =
false;
141 if (
true && ( (
true&&!(((getAccumulate()==1))||((getExtrapolate()==0)))) ) )
142 graph->
evalOpParm(myUsemaxextrapolatedist, nodeidx,
"usemaxextrapolatedist", time, 0);
143 myMaxextrapolatedist = 0;
144 if (
true && ( (
true&&!(((getAccumulate()==1))||((getExtrapolate()==0))||((getUsemaxextrapolatedist()==0)))) ) )
145 graph->
evalOpParm(myMaxextrapolatedist, nodeidx,
"maxextrapolatedist", time, 0);
147 if (
true && ( (
true&&!(((getAccumulate()==1))||((getExtrapolate()==1)))) ) )
148 graph->
evalOpParm(myThreshold, nodeidx,
"threshold", time, 0);
150 if (
true && ( (
true&&!(((getAccumulate()==1))||((getExtrapolate()==1)))) ) )
151 graph->
evalOpParm(myBandwidth, nodeidx,
"bandwidth", time, 0);
152 myCalculationtype = 0;
154 graph->
evalOpParm(myCalculationtype, nodeidx,
"calculationtype", time, 0);
157 graph->
evalOpParm(myDstpreadd, nodeidx,
"dstpreadd", time, 0);
160 graph->
evalOpParm(myDstpremul, nodeidx,
"dstpremul", time, 0);
161 myScalebyvolume =
false;
163 graph->
evalOpParm(myScalebyvolume, nodeidx,
"scalebyvolume", time, 0);
166 graph->
evalOpParm(mySrcpreadd, nodeidx,
"srcpreadd", time, 0);
169 graph->
evalOpParm(mySrcpremul, nodeidx,
"srcpremul", time, 0);
172 graph->
evalOpParm(myPostadd, nodeidx,
"postadd", time, 0);
175 graph->
evalOpParm(myPostmul, nodeidx,
"postmul", time, 0);
191 template <
typename T>
198 if (idx.
size() != instance.
size()+1)
279 { doGetParmValue(idx, instance, value); }
281 { doGetParmValue(idx, instance, value); }
283 { doGetParmValue(idx, instance, value); }
285 { doGetParmValue(idx, instance, value); }
287 { doGetParmValue(idx, instance, value); }
289 { doGetParmValue(idx, instance, value); }
291 { doGetParmValue(idx, instance, value); }
293 { doGetParmValue(idx, instance, value); }
295 { doGetParmValue(idx, instance, value); }
297 { doGetParmValue(idx, instance, value); }
299 { doGetParmValue(idx, instance, value); }
301 template <
typename T>
308 if (idx.
size() != instance.
size()+1)
340 coerceValue(myUsemaxextrapolatedist, ( ( value ) ));
380 { doSetParmValue(idx, instance, value); }
382 { doSetParmValue(idx, instance, value); }
384 { doSetParmValue(idx, instance, value); }
386 { doSetParmValue(idx, instance, value); }
388 { doSetParmValue(idx, instance, value); }
390 { doSetParmValue(idx, instance, value); }
392 { doSetParmValue(idx, instance, value); }
394 { doSetParmValue(idx, instance, value); }
396 { doSetParmValue(idx, instance, value); }
398 { doSetParmValue(idx, instance, value); }
400 { doSetParmValue(idx, instance, value); }
416 if (fieldnum.
size() < 1)
429 return "disableonmissing";
433 return "extrapolate";
435 return "usemaxextrapolate";
437 return "maxextrapolate";
439 return "usemaxextrapolatedist";
441 return "maxextrapolatedist";
447 return "calculationtype";
453 return "scalebyvolume";
469 if (fieldnum.
size() < 1)
470 return PARM_UNSUPPORTED;
536 {
for (
int r = 0;
r < 2;
r++)
for (
int c = 0; c < 2; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
538 {
for (
int r = 0;
r < 3;
r++)
for (
int c = 0; c < 3; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
540 {
for (
int r = 0;
r < 4;
r++)
for (
int c = 0; c < 4; c++) is.
bread<
fpreal64>(&v(
r, c), 1); }
553 loadData(is, rampdata);
571 int typelen = colon - data.
buffer();
585 {
int64 iv =
v; UTwrite(os, &iv); }
587 { UTwrite<fpreal64>(os, &
v); }
589 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
591 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
592 UTwrite<fpreal64>(os, &v.
z()); }
594 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
595 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
607 if (s) s->save(ostr);
609 saveData(os, result);
616 ostr << s->getDataTypeToken();
621 saveData(os, result);
625 void save(std::ostream &os)
const
629 saveData(os, myGroup);
630 saveData(os, myPointgrp);
631 saveData(os, myUseattrib);
632 saveData(os, myAttrib);
633 saveData(os, myDisableonmissing);
634 saveData(os, myAccumulate);
635 saveData(os, myExtrapolate);
636 saveData(os, myUsemaxextrapolate);
637 saveData(os, myMaxextrapolate);
638 saveData(os, myUsemaxextrapolatedist);
639 saveData(os, myMaxextrapolatedist);
640 saveData(os, myThreshold);
641 saveData(os, myBandwidth);
642 saveData(os, myCalculationtype);
643 saveData(os, myDstpreadd);
644 saveData(os, myDstpremul);
645 saveData(os, myScalebyvolume);
646 saveData(os, mySrcpreadd);
647 saveData(os, mySrcpremul);
648 saveData(os, myPostadd);
649 saveData(os, myPostmul);
662 loadData(is, myGroup);
663 loadData(is, myPointgrp);
664 loadData(is, myUseattrib);
665 loadData(is, myAttrib);
666 loadData(is, myDisableonmissing);
667 loadData(is, myAccumulate);
668 loadData(is, myExtrapolate);
669 loadData(is, myUsemaxextrapolate);
670 loadData(is, myMaxextrapolate);
671 loadData(is, myUsemaxextrapolatedist);
672 loadData(is, myMaxextrapolatedist);
673 loadData(is, myThreshold);
674 loadData(is, myBandwidth);
675 loadData(is, myCalculationtype);
676 loadData(is, myDstpreadd);
677 loadData(is, myDstpremul);
678 loadData(is, myScalebyvolume);
679 loadData(is, mySrcpreadd);
680 loadData(is, mySrcpremul);
681 loadData(is, myPostadd);
682 loadData(is, myPostmul);
692 if (!thissop)
return getGroup();
694 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
702 if (!thissop)
return getPointgrp();
704 OP_Utils::evalOpParm(result, thissop,
"pointgrp", cookparms.
getCookTime(), 0);
712 if (!thissop)
return getUseattrib();
714 OP_Utils::evalOpParm(result, thissop,
"useattrib", cookparms.
getCookTime(), 0);
722 if (!thissop)
return getAttrib();
724 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
732 if (!thissop)
return getDisableonmissing();
734 OP_Utils::evalOpParm(result, thissop,
"disableonmissing", cookparms.
getCookTime(), 0);
742 if (!thissop)
return getAccumulate();
744 OP_Utils::evalOpParm(result, thissop,
"accumulate", cookparms.
getCookTime(), 0);
752 if (!thissop)
return getExtrapolate();
754 OP_Utils::evalOpParm(result, thissop,
"extrapolate", cookparms.
getCookTime(), 0);
762 if (!thissop)
return getUsemaxextrapolate();
764 OP_Utils::evalOpParm(result, thissop,
"usemaxextrapolate", cookparms.
getCookTime(), 0);
772 if (!thissop)
return getMaxextrapolate();
774 OP_Utils::evalOpParm(result, thissop,
"maxextrapolate", cookparms.
getCookTime(), 0);
782 if (!thissop)
return getUsemaxextrapolatedist();
784 OP_Utils::evalOpParm(result, thissop,
"usemaxextrapolatedist", cookparms.
getCookTime(), 0);
792 if (!thissop)
return getMaxextrapolatedist();
794 OP_Utils::evalOpParm(result, thissop,
"maxextrapolatedist", cookparms.
getCookTime(), 0);
802 if (!thissop)
return getThreshold();
804 OP_Utils::evalOpParm(result, thissop,
"threshold", cookparms.
getCookTime(), 0);
812 if (!thissop)
return getBandwidth();
814 OP_Utils::evalOpParm(result, thissop,
"bandwidth", cookparms.
getCookTime(), 0);
822 if (!thissop)
return getCalculationtype();
824 OP_Utils::evalOpParm(result, thissop,
"calculationtype", cookparms.
getCookTime(), 0);
832 if (!thissop)
return getDstpreadd();
834 OP_Utils::evalOpParm(result, thissop,
"dstpreadd", cookparms.
getCookTime(), 0);
842 if (!thissop)
return getDstpremul();
844 OP_Utils::evalOpParm(result, thissop,
"dstpremul", cookparms.
getCookTime(), 0);
852 if (!thissop)
return getScalebyvolume();
854 OP_Utils::evalOpParm(result, thissop,
"scalebyvolume", cookparms.
getCookTime(), 0);
862 if (!thissop)
return getSrcpreadd();
864 OP_Utils::evalOpParm(result, thissop,
"srcpreadd", cookparms.
getCookTime(), 0);
872 if (!thissop)
return getSrcpremul();
874 OP_Utils::evalOpParm(result, thissop,
"srcpremul", cookparms.
getCookTime(), 0);
882 if (!thissop)
return getPostadd();
884 OP_Utils::evalOpParm(result, thissop,
"postadd", cookparms.
getCookTime(), 0);
892 if (!thissop)
return getPostmul();
894 OP_Utils::evalOpParm(result, thissop,
"postmul", cookparms.
getCookTime(), 0);
903 bool myDisableonmissing;
906 bool myUsemaxextrapolate;
908 bool myUsemaxextrapolatedist;
912 int64 myCalculationtype;
915 bool myScalebyvolume;
bool getUsemaxextrapolate() const
fpreal64 getMaxextrapolatedist() const
fpreal64 getBandwidth() const
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, int64 v)
const UT_StringHolder & getPointgrp() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
fpreal64 opMaxextrapolatedist(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix3D v)
void setMaxextrapolatedist(fpreal64 val)
void setBandwidth(fpreal64 val)
T clampMaxValue(fpreal maxvalue, const T &src) const
fpreal64 getDstpreadd() const
static void loadData(UT_IStream &is, bool &v)
fpreal64 getPostmul() const
bool getAccumulate() const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
void setCalculationtype(Calculationtype val)
void setSrcpreadd(fpreal64 val)
static void loadData(UT_IStream &is, UT_Vector3D &v)
const UT_StringHolder & getGroup() const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const OP_Context & context() const
bool getScalebyvolume() const
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
SYS_FORCE_INLINE const char * buffer() const
bool opDisableonmissing(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
**But if you need a result
const UT_StringHolder & getAttrib() const
void setPointgrp(const UT_StringHolder &val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
T clampMinValue(fpreal minvalue, const T &src) 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.
static void loadData(UT_IStream &is, UT_Vector3I &v)
ParmType getNestParmType(TempIndex fieldnum) const override
void setGroup(const UT_StringHolder &val)
const char * getNestParmName(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, UT_Vector2I &v)
bool operator==(const SOP_VolumeFromAttribParms &src) const
void loadFromOpSubclass(const LoadParms &loadparms) override
constexpr SYS_FORCE_INLINE T & x() noexcept
bool opScalebyvolume(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opBandwidth(const SOP_NodeVerb::CookParms &cookparms) const
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_StringHolder opPointgrp(const SOP_NodeVerb::CookParms &cookparms) const
void setUsemaxextrapolate(bool val)
void setDstpremul(fpreal64 val)
bool getUseattrib() const
void setPostadd(fpreal64 val)
static void saveData(std::ostream &os, PRM_DataItemHandle s)
bool isParmColorRamp(exint idx) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
Calculationtype getCalculationtype() const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void setUsemaxextrapolatedist(bool val)
fpreal64 getSrcpreadd() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) 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
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
fpreal64 opSrcpremul(const SOP_NodeVerb::CookParms &cookparms) const
const OP_GraphProxy * graph() const
bool opUsemaxextrapolatedist(const SOP_NodeVerb::CookParms &cookparms) const
void setUseattrib(bool val)
bool opUseattrib(const SOP_NodeVerb::CookParms &cookparms) const
void setDisableonmissing(bool val)
static void saveData(std::ostream &os, UT_Vector4D v)
void setExtrapolate(bool val)
void setDstpreadd(fpreal64 val)
bool getDisableonmissing() const
bool opExtrapolate(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
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, UT_Matrix3D &value) const override
void setScalebyvolume(bool val)
Calculationtype opCalculationtype(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
bool getExtrapolate() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, int64 &v)
static void saveData(std::ostream &os, UT_Matrix2D v)
GT_API const UT_StringHolder version
void setSrcpremul(fpreal64 val)
fpreal64 opPostadd(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opDstpremul(const SOP_NodeVerb::CookParms &cookparms) const
void setMaxextrapolate(fpreal64 val)
static void saveData(std::ostream &os, fpreal64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void coerceValue(T &result, const S &src) const
fpreal64 opMaxextrapolate(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opDstpreadd(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_VolumeFromAttribParms &src) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
fpreal64 opThreshold(const SOP_NodeVerb::CookParms &cookparms) const
DEP_MicroNode * depnode() const
Utility class for containing a color ramp.
SOP_VolumeFromAttribParms()
void setThreshold(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & w() noexcept
fpreal64 getDstpremul() const
static void saveData(std::ostream &os, UT_Vector3D v)
void setAttrib(const UT_StringHolder &val)
fpreal64 getPostadd() const
fpreal64 opSrcpreadd(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
fpreal64 getSrcpremul() const
fpreal getCookTime() const
UT_StringHolder opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
const char * findChar(int c) const
bool opUsemaxextrapolate(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
bool getUsemaxextrapolatedist() const
static void saveData(std::ostream &os, UT_StringHolder s)
fpreal64 getThreshold() const
constexpr SYS_FORCE_INLINE T & y() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
fpreal64 opPostmul(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
void setAccumulate(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool opAccumulate(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, bool v)
void setPostmul(fpreal64 val)
exint getNestNumParms(TempIndex idx) const override
static void saveData(std::ostream &os, UT_Vector2D v)
static void loadData(UT_IStream &is, UT_Vector4I &v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
OP_NodeParms & operator=(const OP_NodeParms &)=default
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
fpreal64 getMaxextrapolate() const
constexpr SYS_FORCE_INLINE T & x() noexcept