23 namespace SOP_VolumeCompressEnums
36 using namespace UT::Literal;
55 using namespace UT::Literal;
75 myUpdateSettings =
false;
80 myMaskGroup =
""_UTsh;
98 if (myGroup != src.myGroup)
return false;
99 if (myCompression != src.myCompression)
return false;
100 if (myUpdateSettings != src.myUpdateSettings)
return false;
101 if (myConstantTol != src.myConstantTol)
return false;
102 if (myQuantizeTol != src.myQuantizeTol)
return false;
103 if (myDither != src.myDither)
return false;
104 if (myUseFP16 != src.myUseFP16)
return false;
105 if (myMaskGroup != src.myMaskGroup)
return false;
106 if (myDoMaskMin != src.myDoMaskMin)
return false;
107 if (myMaskMin != src.myMaskMin)
return false;
108 if (myDoMaskMax != src.myDoMaskMax)
return false;
109 if (myMaskMax != src.myMaskMax)
return false;
110 if (myInvertMask != src.myInvertMask)
return false;
127 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
130 graph->
evalOpParm(myCompression, nodeidx,
"compression", time, 0);
131 myUpdateSettings =
false;
133 graph->
evalOpParm(myUpdateSettings, nodeidx,
"updatesettings", time, 0);
135 if (
true && ( (
true&&!(((getUpdateSettings()==0)))) ) )
136 graph->
evalOpParm(myConstantTol, nodeidx,
"constanttol", time, 0);
138 if (
true && ( (
true&&!(((getUpdateSettings()==0)))) ) )
139 graph->
evalOpParm(myQuantizeTol, nodeidx,
"quantizetol", time, 0);
141 if (
true && ( (
true&&!(((getUpdateSettings()==0)))) ) )
142 graph->
evalOpParm(myDither, nodeidx,
"dither", time, 0);
144 if (
true && ( (
true&&!(((getUpdateSettings()==0)))) ) )
145 graph->
evalOpParm(myUseFP16, nodeidx,
"usefp16", time, 0);
146 myMaskGroup =
""_UTsh;
148 graph->
evalOpParm(myMaskGroup, nodeidx,
"maskgrp", time, 0);
151 graph->
evalOpParm(myDoMaskMin, nodeidx,
"domaskmin", time, 0);
153 if (
true && ( (
true&&!(((getDoMaskMin()==0)))) ) )
154 graph->
evalOpParm(myMaskMin, nodeidx,
"maskmin", time, 0);
157 graph->
evalOpParm(myDoMaskMax, nodeidx,
"domaskmax", time, 0);
159 if (
true && ( (
true&&!(((getDoMaskMax()==0)))) ) )
160 graph->
evalOpParm(myMaskMax, nodeidx,
"maskmax", time, 0);
161 myInvertMask =
false;
163 graph->
evalOpParm(myInvertMask, nodeidx,
"invertmask", time, 0);
179 template <
typename T>
186 if (idx.
size() != instance.
size()+1)
191 coerceValue(value, myGroup);
194 coerceValue(value, myCompression);
197 coerceValue(value, myUpdateSettings);
200 coerceValue(value, myConstantTol);
203 coerceValue(value, myQuantizeTol);
206 coerceValue(value, myDither);
209 coerceValue(value, myUseFP16);
212 coerceValue(value, myMaskGroup);
215 coerceValue(value, myDoMaskMin);
218 coerceValue(value, myMaskMin);
221 coerceValue(value, myDoMaskMax);
224 coerceValue(value, myMaskMax);
227 coerceValue(value, myInvertMask);
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 { doGetParmValue(idx, instance, value); }
261 { doGetParmValue(idx, instance, value); }
263 { doGetParmValue(idx, instance, value); }
265 template <
typename T>
272 if (idx.
size() != instance.
size()+1)
277 coerceValue(myGroup, ( ( value ) ));
280 coerceValue(myCompression, clampMinValue(0, clampMaxValue(3, value ) ));
283 coerceValue(myUpdateSettings, ( ( value ) ));
286 coerceValue(myConstantTol, clampMinValue(0, ( value ) ));
289 coerceValue(myQuantizeTol, clampMinValue(0, ( value ) ));
292 coerceValue(myDither, clampMinValue(0, clampMaxValue(1, value ) ));
295 coerceValue(myUseFP16, ( ( value ) ));
298 coerceValue(myMaskGroup, ( ( value ) ));
301 coerceValue(myDoMaskMin, ( ( value ) ));
304 coerceValue(myMaskMin, ( ( value ) ));
307 coerceValue(myDoMaskMax, ( ( value ) ));
310 coerceValue(myMaskMax, ( ( value ) ));
313 coerceValue(myInvertMask, ( ( value ) ));
320 { doSetParmValue(idx, instance, value); }
322 { doSetParmValue(idx, instance, value); }
324 { doSetParmValue(idx, instance, value); }
326 { doSetParmValue(idx, instance, value); }
328 { doSetParmValue(idx, instance, value); }
330 { doSetParmValue(idx, instance, value); }
332 { doSetParmValue(idx, instance, value); }
334 { doSetParmValue(idx, instance, value); }
336 { doSetParmValue(idx, instance, value); }
338 { doSetParmValue(idx, instance, value); }
340 { doSetParmValue(idx, instance, value); }
356 if (fieldnum.
size() < 1)
363 return "compression";
365 return "updatesettings";
367 return "constanttol";
369 return "quantizetol";
393 if (fieldnum.
size() < 1)
394 return PARM_UNSUPPORTED;
425 return PARM_UNSUPPORTED;
461 loadData(is, rampdata);
479 int typelen = colon - data.
buffer();
493 {
int64 iv =
v; UTwrite(os, &iv); }
495 { UTwrite<fpreal64>(os, &
v); }
497 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
499 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
500 UTwrite<fpreal64>(os, &v.
z()); }
502 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
503 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
515 if (s) s->save(ostr);
517 saveData(os, result);
524 ostr << s->getDataTypeToken();
529 saveData(os, result);
533 void save(std::ostream &os)
const
537 saveData(os, myGroup);
538 saveData(os, myCompression);
539 saveData(os, myUpdateSettings);
540 saveData(os, myConstantTol);
541 saveData(os, myQuantizeTol);
542 saveData(os, myDither);
543 saveData(os, myUseFP16);
544 saveData(os, myMaskGroup);
545 saveData(os, myDoMaskMin);
546 saveData(os, myMaskMin);
547 saveData(os, myDoMaskMax);
548 saveData(os, myMaskMax);
549 saveData(os, myInvertMask);
562 loadData(is, myGroup);
563 loadData(is, myCompression);
564 loadData(is, myUpdateSettings);
565 loadData(is, myConstantTol);
566 loadData(is, myQuantizeTol);
567 loadData(is, myDither);
568 loadData(is, myUseFP16);
569 loadData(is, myMaskGroup);
570 loadData(is, myDoMaskMin);
571 loadData(is, myMaskMin);
572 loadData(is, myDoMaskMax);
573 loadData(is, myMaskMax);
574 loadData(is, myInvertMask);
584 if (!thissop)
return getGroup();
586 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
594 if (!thissop)
return getCompression();
596 OP_Utils::evalOpParm(result, thissop,
"compression", cookparms.
getCookTime(), 0);
604 if (!thissop)
return getUpdateSettings();
606 OP_Utils::evalOpParm(result, thissop,
"updatesettings", cookparms.
getCookTime(), 0);
614 if (!thissop)
return getConstantTol();
616 OP_Utils::evalOpParm(result, thissop,
"constanttol", cookparms.
getCookTime(), 0);
624 if (!thissop)
return getQuantizeTol();
626 OP_Utils::evalOpParm(result, thissop,
"quantizetol", cookparms.
getCookTime(), 0);
634 if (!thissop)
return getDither();
636 OP_Utils::evalOpParm(result, thissop,
"dither", cookparms.
getCookTime(), 0);
644 if (!thissop)
return getUseFP16();
646 OP_Utils::evalOpParm(result, thissop,
"usefp16", cookparms.
getCookTime(), 0);
654 if (!thissop)
return getMaskGroup();
656 OP_Utils::evalOpParm(result, thissop,
"maskgrp", cookparms.
getCookTime(), 0);
664 if (!thissop)
return getDoMaskMin();
666 OP_Utils::evalOpParm(result, thissop,
"domaskmin", cookparms.
getCookTime(), 0);
674 if (!thissop)
return getMaskMin();
676 OP_Utils::evalOpParm(result, thissop,
"maskmin", cookparms.
getCookTime(), 0);
684 if (!thissop)
return getDoMaskMax();
686 OP_Utils::evalOpParm(result, thissop,
"domaskmax", cookparms.
getCookTime(), 0);
694 if (!thissop)
return getMaskMax();
696 OP_Utils::evalOpParm(result, thissop,
"maskmax", cookparms.
getCookTime(), 0);
704 if (!thissop)
return getInvertMask();
706 OP_Utils::evalOpParm(result, thissop,
"invertmask", cookparms.
getCookTime(), 0);
713 bool myUpdateSettings;
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
void copyFrom(const OP_NodeParms *src) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
void loadFromOpSubclass(const LoadParms &loadparms) override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
Dither opDither(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector3D &v)
void setCompression(Compression val)
const UT_StringHolder & getMaskGroup() const
Compression getCompression() const
SOP_Node * getNode() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
void setInvertMask(bool val)
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setConstantTol(fpreal64 val)
static void saveData(std::ostream &os, UT_Vector3D v)
static void saveData(std::ostream &os, int64 v)
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
exint bread(int32 *buffer, exint asize=1)
static void loadData(UT_IStream &is, UT_Matrix2D &v)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
static void loadData(UT_IStream &is, bool &v)
static void saveData(std::ostream &os, bool v)
fpreal64 getMaskMax() const
void setMaskMax(fpreal64 val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
const OP_Context & context() const
void setGroup(const UT_StringHolder &val)
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
fpreal64 getQuantizeTol() const
An output stream object that owns its own string buffer storage.
static void loadData(UT_IStream &is, UT_Vector3I &v)
bool opDoMaskMax(const SOP_NodeVerb::CookParms &cookparms) const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
**But if you need a result
bool getDoMaskMin() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
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 saveData(std::ostream &os, UT_Matrix4D v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
constexpr SYS_FORCE_INLINE T & x() noexcept
SYS_FORCE_INLINE UT_StringHolder getToken(Compression enum_value)
static void saveData(std::ostream &os, UT_Vector4D v)
ParmType getNestParmType(TempIndex fieldnum) const override
bool getUpdateSettings() const
constexpr SYS_FORCE_INLINE T & x() noexcept
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void loadData(UT_IStream &is, UT_StringHolder &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
exint getNestNumParms(TempIndex idx) const override
fpreal64 opConstantTol(const SOP_NodeVerb::CookParms &cookparms) const
void save(std::ostream &os) const
SYS_FORCE_INLINE const char * buffer() const
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & z() noexcept
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
void setQuantizeTol(fpreal64 val)
static void saveData(std::ostream &os, fpreal64 v)
const OP_GraphProxy * graph() const
fpreal64 opMaskMin(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
static void loadData(UT_IStream &is, int64 &v)
void setMaskMin(fpreal64 val)
fpreal64 getConstantTol() const
bool opUseFP16(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix4D &v)
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
static void saveData(std::ostream &os, UT_Vector2D v)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
bool opInvertMask(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opQuantizeTol(const SOP_NodeVerb::CookParms &cookparms) const
bool opUpdateSettings(const SOP_NodeVerb::CookParms &cookparms) const
void saveBinary(std::ostream &os) const
Save string to binary stream.
bool opDoMaskMin(const SOP_NodeVerb::CookParms &cookparms) const
fpreal64 opMaskMax(const SOP_NodeVerb::CookParms &cookparms) const
GT_API const UT_StringHolder version
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setUpdateSettings(bool val)
bool getInvertMask() const
bool getDoMaskMax() const
static void loadData(UT_IStream &is, fpreal64 &v)
void setDoMaskMin(bool val)
DEP_MicroNode * depnode() const
bool operator==(const SOP_VolumeCompressParms &src) const
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void setMaskGroup(const UT_StringHolder &val)
const char * getNestParmName(TempIndex fieldnum) const override
constexpr SYS_FORCE_INLINE T & w() noexcept
static void loadData(UT_IStream &is, UT_Vector4I &v)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, UT_Vector4D &v)
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
const UT_StringHolder & getGroup() const
void setUseFP16(bool val)
fpreal getCookTime() const
Compression opCompression(const SOP_NodeVerb::CookParms &cookparms) const
const char * findChar(int c) const
static void saveData(std::ostream &os, PRM_DataItemHandle s)
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
void setDoMaskMax(bool val)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
UT_StringHolder opMaskGroup(const SOP_NodeVerb::CookParms &cookparms) const
bool operator!=(const SOP_VolumeCompressParms &src) const
constexpr SYS_FORCE_INLINE T & y() noexcept
static void loadData(UT_IStream &is, UT_Matrix3D &v)
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
bool load(UT_IStream &is)
static void loadData(UT_IStream &is, UT_Vector2I &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Matrix3D v)
SYS_FORCE_INLINE bool isstring() const
fpreal64 getMaskMin() const
void setDither(Dither val)
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, UT_Matrix2D v)
SOP_VolumeCompressParms()
constexpr SYS_FORCE_INLINE T & x() noexcept