23 namespace SOP_VolumeResampleEnums
38 using namespace UT::Literal;
61 myFilter =
"box"_UTsh;
63 myFixedresample =
false;
82 if (myGroup != src.myGroup)
return false;
83 if (myFilter != src.myFilter)
return false;
84 if (myFilterscale != src.myFilterscale)
return false;
85 if (myFixedresample != src.myFixedresample)
return false;
86 if (myUniformsamples != src.myUniformsamples)
return false;
87 if (mySamplediv != src.mySamplediv)
return false;
88 if (myDivs != src.myDivs)
return false;
89 if (myDivsize != src.myDivsize)
return false;
90 if (myScale != src.myScale)
return false;
91 if (myDetect2d != src.myDetect2d)
return false;
107 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
108 myFilter =
"box"_UTsh;
110 graph->
evalOpParm(myFilter, nodeidx,
"filter", time, 0);
113 graph->
evalOpParm(myFilterscale, nodeidx,
"filterscale", time, 0);
114 myFixedresample =
false;
116 graph->
evalOpParm(myFixedresample, nodeidx,
"fixedresample", time, 0);
117 myUniformsamples = 4;
118 if (
true && ( (
true&&!(((getFixedresample()==0)))) ) )
119 graph->
evalOpParm(myUniformsamples, nodeidx,
"uniformsamples", time, 0);
121 if (
true && ( (
true&&!(((getFixedresample()==0))||((
int64(getUniformsamples())==0))||((
int64(getUniformsamples())==5)))) ) )
122 graph->
evalOpParm(mySamplediv, nodeidx,
"samplediv", time, 0);
124 if (
true && ( (
true&&!(((getFixedresample()==0))||((
int64(getUniformsamples())!=0)))) ) )
125 graph->
evalOpParm(myDivs, nodeidx,
"divs", time, 0);
127 if (
true && ( (
true&&!(((getFixedresample()==0))||((
int64(getUniformsamples())!=5)))) ) )
128 graph->
evalOpParm(myDivsize, nodeidx,
"divsize", time, 0);
130 if (
true && ( (
true&&!(((getFixedresample()==1)))) ) )
131 graph->
evalOpParm(myScale, nodeidx,
"scale", time, 0);
134 graph->
evalOpParm(myDetect2d, nodeidx,
"detect2d", time, 0);
150 template <
typename T>
157 if (idx.
size() != instance.
size()+1)
162 coerceValue(value, myGroup);
165 coerceValue(value, myFilter);
168 coerceValue(value, myFilterscale);
171 coerceValue(value, myFixedresample);
174 coerceValue(value, myUniformsamples);
177 coerceValue(value, mySamplediv);
180 coerceValue(value, myDivs);
183 coerceValue(value, myDivsize);
186 coerceValue(value, myScale);
189 coerceValue(value, myDetect2d);
205 { doGetParmValue(idx, instance, value); }
207 { doGetParmValue(idx, instance, value); }
209 { doGetParmValue(idx, instance, value); }
211 { doGetParmValue(idx, instance, value); }
213 { doGetParmValue(idx, instance, value); }
215 { doGetParmValue(idx, instance, value); }
217 { doGetParmValue(idx, instance, value); }
219 { doGetParmValue(idx, instance, value); }
221 { doGetParmValue(idx, instance, value); }
223 { doGetParmValue(idx, instance, value); }
225 { doGetParmValue(idx, instance, value); }
227 template <
typename T>
234 if (idx.
size() != instance.
size()+1)
239 coerceValue(myGroup, ( ( value ) ));
242 coerceValue(myFilter, ( ( value ) ));
245 coerceValue(myFilterscale, clampMinValue(0, ( value ) ));
248 coerceValue(myFixedresample, ( ( value ) ));
251 coerceValue(myUniformsamples, clampMinValue(0, clampMaxValue(5, value ) ));
254 coerceValue(mySamplediv, clampMinValue(1, ( value ) ));
257 coerceValue(myDivs, clampMinValue(1, ( value ) ));
260 coerceValue(myDivsize, clampMinValue(0, ( value ) ));
263 coerceValue(myScale, clampMinValue(0, ( value ) ));
266 coerceValue(myDetect2d, ( ( value ) ));
273 { doSetParmValue(idx, instance, value); }
275 { doSetParmValue(idx, instance, value); }
277 { doSetParmValue(idx, instance, value); }
279 { doSetParmValue(idx, instance, value); }
281 { doSetParmValue(idx, instance, value); }
283 { doSetParmValue(idx, instance, value); }
285 { doSetParmValue(idx, instance, value); }
287 { doSetParmValue(idx, instance, value); }
289 { doSetParmValue(idx, instance, value); }
291 { doSetParmValue(idx, instance, value); }
293 { doSetParmValue(idx, instance, value); }
309 if (fieldnum.
size() < 1)
318 return "filterscale";
320 return "fixedresample";
322 return "uniformsamples";
340 if (fieldnum.
size() < 1)
341 return PARM_UNSUPPORTED;
366 return PARM_UNSUPPORTED;
402 loadData(is, rampdata);
420 int typelen = colon - data.
buffer();
434 {
int64 iv =
v; UTwrite(os, &iv); }
436 { UTwrite<fpreal64>(os, &
v); }
438 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
440 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
441 UTwrite<fpreal64>(os, &v.
z()); }
443 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
444 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
456 if (s) s->save(ostr);
458 saveData(os, result);
465 ostr << s->getDataTypeToken();
470 saveData(os, result);
474 void save(std::ostream &os)
const
478 saveData(os, myGroup);
479 saveData(os, myFilter);
480 saveData(os, myFilterscale);
481 saveData(os, myFixedresample);
482 saveData(os, myUniformsamples);
483 saveData(os, mySamplediv);
484 saveData(os, myDivs);
485 saveData(os, myDivsize);
486 saveData(os, myScale);
487 saveData(os, myDetect2d);
500 loadData(is, myGroup);
501 loadData(is, myFilter);
502 loadData(is, myFilterscale);
503 loadData(is, myFixedresample);
504 loadData(is, myUniformsamples);
505 loadData(is, mySamplediv);
506 loadData(is, myDivs);
507 loadData(is, myDivsize);
508 loadData(is, myScale);
509 loadData(is, myDetect2d);
519 if (!thissop)
return getGroup();
521 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
529 if (!thissop)
return getFilter();
531 OP_Utils::evalOpParm(result, thissop,
"filter", cookparms.
getCookTime(), 0);
539 if (!thissop)
return getFilterscale();
541 OP_Utils::evalOpParm(result, thissop,
"filterscale", cookparms.
getCookTime(), 0);
549 if (!thissop)
return getFixedresample();
551 OP_Utils::evalOpParm(result, thissop,
"fixedresample", cookparms.
getCookTime(), 0);
559 if (!thissop)
return getUniformsamples();
561 OP_Utils::evalOpParm(result, thissop,
"uniformsamples", cookparms.
getCookTime(), 0);
569 if (!thissop)
return getSamplediv();
571 OP_Utils::evalOpParm(result, thissop,
"samplediv", cookparms.
getCookTime(), 0);
579 if (!thissop)
return getDivs();
581 OP_Utils::evalOpParm(result, thissop,
"divs", cookparms.
getCookTime(), 0);
589 if (!thissop)
return getDivsize();
591 OP_Utils::evalOpParm(result, thissop,
"divsize", cookparms.
getCookTime(), 0);
601 OP_Utils::evalOpParm(result, thissop,
"scale", cookparms.
getCookTime(), 0);
609 if (!thissop)
return getDetect2d();
611 OP_Utils::evalOpParm(result, thissop,
"detect2d", cookparms.
getCookTime(), 0);
619 bool myFixedresample;
620 int64 myUniformsamples;
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void saveData(std::ostream &os, UT_Vector3D v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void copyFrom(const OP_NodeParms *src) override
static void loadData(UT_IStream &is, bool &v)
SOP_Node * getNode() const
ParmType getNestParmType(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
bool opFixedresample(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
bool isParmColorRamp(exint idx) const override
bool getFixedresample() const
Uniformsamples opUniformsamples(const SOP_NodeVerb::CookParms &cookparms) const
SYS_FORCE_INLINE UT_StringHolder getToken(Uniformsamples enum_value)
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
void loadFromOpSubclass(const LoadParms &loadparms) override
SYS_FORCE_INLINE const char * buffer() const
UT_StringHolder opFilter(const SOP_NodeVerb::CookParms &cookparms) const
const UT_StringHolder & getGroup() const
void setDivsize(fpreal64 val)
An output stream object that owns its own string buffer storage.
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
static void loadData(UT_IStream &is, UT_Vector3D &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
**But if you need a result
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
UT_Vector3T< int64 > UT_Vector3I
bool operator!=(const SOP_VolumeResampleParms &src) const
static PRM_DataItemHandle parseBinary(const char *type, UT_IStream &is)
void setFilterscale(fpreal64 val)
const UT_WorkBuffer & str()
Returns a read-only reference to the underlying UT_WorkBuffer.
static void loadData(UT_IStream &is, UT_Vector4I &v)
fpreal64 getFilterscale() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
Uniformsamples getUniformsamples() const
bool operator==(const SOP_VolumeResampleParms &src) const
constexpr SYS_FORCE_INLINE T & x() noexcept
constexpr SYS_FORCE_INLINE T & x() noexcept
static void saveData(std::ostream &os, bool v)
void setUniformsamples(Uniformsamples val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
const UT_StringHolder & getFilter() const
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
bool load(UT_IStream &is)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
fpreal64 opDivsize(const SOP_NodeVerb::CookParms &cookparms) const
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
void save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Vector2D &v)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
static void saveData(std::ostream &os, fpreal64 v)
void setGroup(const UT_StringHolder &val)
static void saveData(std::ostream &os, UT_StringHolder s)
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
const char * getNestParmName(TempIndex fieldnum) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) 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
UT_Vector3I opDivs(const SOP_NodeVerb::CookParms &cookparms) const
static void saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_Vector4D v)
void setFixedresample(bool val)
fpreal64 opFilterscale(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 getScale() const
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_Vector2D v)
bool opDetect2d(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
fpreal64 getDivsize() const
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
int64 getSamplediv() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
UT_Vector3I getDivs() const
void saveBinary(std::ostream &os) const
Save string to binary stream.
static void loadData(UT_IStream &is, UT_Matrix4D &v)
GT_API const UT_StringHolder version
static void loadData(UT_IStream &is, UT_StringHolder &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void saveData(std::ostream &os, UT_Matrix3D v)
static void loadData(UT_IStream &is, UT_Vector3I &v)
exint getNestNumParms(TempIndex idx) const override
void setSamplediv(int64 val)
static void loadData(UT_IStream &is, int64 &v)
int64 opSamplediv(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
DEP_MicroNode * depnode() const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & w() noexcept
Vec3< typename MatType::value_type > getScale(const MatType &mat)
Return a Vec3 representing the lengths of the passed matrix's upper 3×3's rows.
static void saveData(std::ostream &os, int64 v)
SOP_VolumeResampleParms()
static void saveData(std::ostream &os, PRM_DataItemHandle s)
fpreal getCookTime() const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
const char * findChar(int c) const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
constexpr SYS_FORCE_INLINE T & y() noexcept
void setDetect2d(bool val)
static void saveData(std::ostream &os, UT_Matrix2D v)
void setDivs(UT_Vector3I val)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
fpreal64 opScale(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE bool isstring() const
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setScale(fpreal64 val)
void setFilter(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & x() noexcept