23 namespace SOP_VolumeSliceEnums
35 using namespace UT::Literal;
54 using namespace UT::Literal;
77 using namespace UT::Literal;
104 myAttrib =
"density"_UTsh;
105 myCreatevarmap =
false;
124 if (myGroup != src.myGroup)
return false;
125 if (myMethod != src.myMethod)
return false;
126 if (myPlane != src.myPlane)
return false;
127 if (myPlaneoffset != src.myPlaneoffset)
return false;
128 if (myAttrib != src.myAttrib)
return false;
129 if (myCreatevarmap != src.myCreatevarmap)
return false;
130 if (myLvar != src.myLvar)
return false;
131 if (myVisualize != src.myVisualize)
return false;
132 if (myVismode != src.myVismode)
return false;
133 if (myVisrange != src.myVisrange)
return false;
134 if (myCdramp != src.myCdramp)
135 {
if (!myCdramp || !src.myCdramp || !(*myCdramp == *src.myCdramp))
return false; }
136 if (myKeep != src.myKeep)
return false;
154 graph->
evalOpParm(myGroup, nodeidx,
"group", time, 0);
157 graph->
evalOpParm(myMethod, nodeidx,
"method", time, 0);
160 graph->
evalOpParm(myPlane, nodeidx,
"plane", time, 0);
163 graph->
evalOpParm(myPlaneoffset, nodeidx,
"planeoffset", time, 0);
164 myAttrib =
"density"_UTsh;
165 if (
true && ( (
true&&!(((
int64(getMethod())==0)))) ) )
166 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, 0);
167 myCreatevarmap =
false;
168 if (
true && ( (
true&&!(((
int64(getMethod())==0)))) ) )
169 graph->
evalOpParm(myCreatevarmap, nodeidx,
"createvarmap", time, 0);
171 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((getCreatevarmap()==0)))) ) )
172 graph->
evalOpParm(myLvar, nodeidx,
"lvar", time, 0);
174 if (
true && ( (
true&&!(((
int64(getMethod())==0)))) ) )
175 graph->
evalOpParm(myVisualize, nodeidx,
"visualize", time, 0);
177 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((getVisualize()==0)))) ) )
178 graph->
evalOpParm(myVismode, nodeidx,
"vismode", time, 0);
180 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((getVisualize()==0)))) ) )
181 graph->
evalOpParm(myVisrange, nodeidx,
"visrange", time, 0);
183 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((getVisualize()==0))||((
int64(getVismode())!=6)))) ) )
184 graph->
evalOpParm(myCdramp, nodeidx,
"cdramp", time, 0);
187 graph->
evalOpParm(myKeep, nodeidx,
"keep", time, 0);
203 template <
typename T>
210 if (idx.
size() != instance.
size()+1)
215 coerceValue(value, myGroup);
218 coerceValue(value, myMethod);
221 coerceValue(value, myPlane);
224 coerceValue(value, myPlaneoffset);
227 coerceValue(value, myAttrib);
230 coerceValue(value, myCreatevarmap);
233 coerceValue(value, myLvar);
236 coerceValue(value, myVisualize);
239 coerceValue(value, myVismode);
242 coerceValue(value, myVisrange);
245 coerceValue(value, myCdramp);
248 coerceValue(value, myKeep);
265 { doGetParmValue(idx, instance, value); }
267 { doGetParmValue(idx, instance, value); }
269 { doGetParmValue(idx, instance, value); }
271 { doGetParmValue(idx, instance, value); }
273 { doGetParmValue(idx, instance, value); }
275 { doGetParmValue(idx, instance, value); }
277 { doGetParmValue(idx, instance, value); }
279 { doGetParmValue(idx, instance, value); }
281 { doGetParmValue(idx, instance, value); }
283 { doGetParmValue(idx, instance, value); }
285 { doGetParmValue(idx, instance, value); }
287 template <
typename T>
294 if (idx.
size() != instance.
size()+1)
299 coerceValue(myGroup, ( ( value ) ));
302 coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
305 coerceValue(myPlane, clampMinValue(0, clampMaxValue(2, value ) ));
308 coerceValue(myPlaneoffset, clampMinValue(-1, clampMaxValue(1, value ) ));
311 coerceValue(myAttrib, ( ( value ) ));
314 coerceValue(myCreatevarmap, ( ( value ) ));
317 coerceValue(myLvar, ( ( value ) ));
320 coerceValue(myVisualize, ( ( value ) ));
323 coerceValue(myVismode, clampMinValue(0, clampMaxValue(6, value ) ));
326 coerceValue(myVisrange, ( ( value ) ));
329 coerceValue(myCdramp, ( ( value ) ));
332 coerceValue(myKeep, ( ( value ) ));
339 { doSetParmValue(idx, instance, value); }
341 { doSetParmValue(idx, instance, value); }
343 { doSetParmValue(idx, instance, value); }
345 { doSetParmValue(idx, instance, value); }
347 { doSetParmValue(idx, instance, value); }
349 { doSetParmValue(idx, instance, value); }
351 { doSetParmValue(idx, instance, value); }
353 { doSetParmValue(idx, instance, value); }
355 { doSetParmValue(idx, instance, value); }
357 { doSetParmValue(idx, instance, value); }
359 { doSetParmValue(idx, instance, value); }
375 if (fieldnum.
size() < 1)
386 return "planeoffset";
390 return "createvarmap";
410 if (fieldnum.
size() < 1)
411 return PARM_UNSUPPORTED;
440 return PARM_UNSUPPORTED;
476 loadData(is, rampdata);
494 int typelen = colon - data.
buffer();
508 {
int64 iv =
v; UTwrite(os, &iv); }
510 { UTwrite<fpreal64>(os, &
v); }
512 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
514 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
515 UTwrite<fpreal64>(os, &v.
z()); }
517 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
518 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
530 if (s) s->save(ostr);
532 saveData(os, result);
539 ostr << s->getDataTypeToken();
544 saveData(os, result);
548 void save(std::ostream &os)
const
552 saveData(os, myGroup);
553 saveData(os, myMethod);
554 saveData(os, myPlane);
555 saveData(os, myPlaneoffset);
556 saveData(os, myAttrib);
557 saveData(os, myCreatevarmap);
558 saveData(os, myLvar);
559 saveData(os, myVisualize);
560 saveData(os, myVismode);
561 saveData(os, myVisrange);
562 saveData(os, myCdramp);
563 saveData(os, myKeep);
576 loadData(is, myGroup);
577 loadData(is, myMethod);
578 loadData(is, myPlane);
579 loadData(is, myPlaneoffset);
580 loadData(is, myAttrib);
581 loadData(is, myCreatevarmap);
582 loadData(is, myLvar);
583 loadData(is, myVisualize);
584 loadData(is, myVismode);
585 loadData(is, myVisrange);
586 loadData(is, myCdramp);
587 loadData(is, myKeep);
597 if (!thissop)
return getGroup();
599 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
607 if (!thissop)
return getMethod();
609 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
617 if (!thissop)
return getPlane();
619 OP_Utils::evalOpParm(result, thissop,
"plane", cookparms.
getCookTime(), 0);
620 return Plane(result);
627 if (!thissop)
return getPlaneoffset();
629 OP_Utils::evalOpParm(result, thissop,
"planeoffset", cookparms.
getCookTime(), 0);
637 if (!thissop)
return getAttrib();
639 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
647 if (!thissop)
return getCreatevarmap();
649 OP_Utils::evalOpParm(result, thissop,
"createvarmap", cookparms.
getCookTime(), 0);
657 if (!thissop)
return getLvar();
659 OP_Utils::evalOpParm(result, thissop,
"lvar", cookparms.
getCookTime(), 0);
667 if (!thissop)
return getVisualize();
669 OP_Utils::evalOpParm(result, thissop,
"visualize", cookparms.
getCookTime(), 0);
677 if (!thissop)
return getVismode();
679 OP_Utils::evalOpParm(result, thissop,
"vismode", cookparms.
getCookTime(), 0);
687 if (!thissop)
return getVisrange();
689 OP_Utils::evalOpParm(result, thissop,
"visrange", cookparms.
getCookTime(), 0);
697 if (!thissop)
return getCdramp();
699 OP_Utils::evalOpParm(result, thissop,
"cdramp", cookparms.
getCookTime(), 0);
707 if (!thissop)
return getKeep();
709 OP_Utils::evalOpParm(result, thissop,
"keep", cookparms.
getCookTime(), 0);
Plane opPlane(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, fpreal &value) const override
bool getVisualize() const
void setNestParmValue(TempIndex idx, TempIndex instance, const exint &value) override
bool operator!=(const SOP_VolumeSliceParms &src) const
SOP_Node * getNode() const
static void saveData(std::ostream &os, UT_Matrix3D v)
exint bread(int32 *buffer, exint asize=1)
GT_API const UT_StringHolder time
constexpr SYS_FORCE_INLINE T & y() noexcept
static void saveData(std::ostream &os, UT_Vector2D v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector3D &value) override
UT_Vector2T< fpreal64 > UT_Vector2D
bool opCreatevarmap(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opAttrib(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, PRM_DataItemHandle &value) const override
Vismode opVismode(const SOP_NodeVerb::CookParms &cookparms) const
const OP_Context & context() const
constexpr SYS_FORCE_INLINE T & z() noexcept
SYS_FORCE_INLINE const char * buffer() const
static void saveData(std::ostream &os, fpreal64 v)
ParmType getNestParmType(TempIndex fieldnum) const override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_SharedPtr< UT_Ramp > &value) const override
UT_StringHolder opGroup(const SOP_NodeVerb::CookParms &cookparms) const
An output stream object that owns its own string buffer storage.
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_SharedPtr< UT_Ramp > &value) override
bool opVisualize(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, exint &value) const override
const UT_StringHolder & getAttrib() const
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector2D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const PRM_DataItemHandle &value) override
**But if you need a result
void setLvar(const UT_StringHolder &val)
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 save(std::ostream &os) const
static void loadData(UT_IStream &is, UT_Vector4I &v)
constexpr SYS_FORCE_INLINE T & x() noexcept
void setPlaneoffset(fpreal64 val)
static void saveData(std::ostream &os, UT_Matrix2D v)
bool load(UT_IStream &is)
static void saveData(std::ostream &os, UT_Vector3D v)
constexpr SYS_FORCE_INLINE T & x() noexcept
static void loadData(UT_IStream &is, UT_Vector3I &v)
static void loadData(UT_IStream &is, UT_Vector2I &v)
void setMethod(Method val)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
static void saveData(std::ostream &os, UT_Vector4D v)
bool opKeep(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, PRM_DataItemHandle &v)
UT_Vector2D opVisrange(const SOP_NodeVerb::CookParms &cookparms) const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix3D &value) const override
static void loadData(UT_IStream &is, bool &v)
static void loadData(UT_IStream &is, UT_Matrix3D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Vector4D &value) override
void setAttrib(const UT_StringHolder &val)
static void loadData(UT_IStream &is, UT_Matrix4D &v)
bool operator==(const SOP_VolumeSliceParms &src) const
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 loadFromOpSubclass(const LoadParms &loadparms) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector2D &value) const override
const OP_GraphProxy * graph() const
static void saveData(std::ostream &os, UT_StringHolder s)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix4D &value) const override
static void loadData(UT_IStream &is, UT_SharedPtr< UT_Ramp > &v)
void setVismode(Vismode val)
static void saveData(std::ostream &os, UT_Matrix4D v)
static void loadData(UT_IStream &is, UT_StringHolder &v)
static void loadData(UT_IStream &is, UT_Vector2D &v)
void setGroup(const UT_StringHolder &val)
void setCdramp(UT_SharedPtr< UT_Ramp > val)
virtual void evalOpParm(int64 &v, NodeIdx node, const char *parmname, fpreal time, DEP_MicroNode *depnode) const =0
static void saveData(std::ostream &os, UT_SharedPtr< UT_Ramp > s)
void saveBinary(std::ostream &os) const
Save string to binary stream.
fpreal64 getPlaneoffset() const
GT_API const UT_StringHolder version
bool isParmColorRamp(exint idx) const override
static void saveData(std::ostream &os, PRM_DataItemHandle s)
Method opMethod(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Vector4D &v)
void buildFromOp(const OP_GraphProxy *graph, exint nodeidx, fpreal time, DEP_MicroNode *depnode)
void getNestParmValue(TempIndex idx, TempIndex instance, UT_StringHolder &value) const override
static void loadData(UT_IStream &is, int64 &v)
void setVisrange(UT_Vector2D val)
UT_SharedPtr< UT_Ramp > opCdramp(const SOP_NodeVerb::CookParms &cookparms) const
UT_StringHolder opLvar(const SOP_NodeVerb::CookParms &cookparms) const
static void loadData(UT_IStream &is, UT_Matrix2D &v)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix2D &value) override
DEP_MicroNode * depnode() const
SYS_FORCE_INLINE UT_StringHolder getToken(Method enum_value)
static void loadData(UT_IStream &is, UT_Vector3D &v)
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
void doSetParmValue(TempIndex idx, TempIndex instance, const T &value)
constexpr SYS_FORCE_INLINE T & w() noexcept
UT_Vector2D getVisrange() const
static void saveData(std::ostream &os, int64 v)
fpreal getCookTime() const
void doGetParmValue(TempIndex idx, TempIndex instance, T &value) const
static void saveData(std::ostream &os, bool v)
void copyFrom(const OP_NodeParms *src) override
const char * findChar(int c) const
const char * getNestParmName(TempIndex fieldnum) const override
const UT_StringHolder & getGroup() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Matrix2D &value) const override
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix3D &value) override
void setNestParmValue(TempIndex idx, TempIndex instance, const fpreal &value) override
exint getNestNumParms(TempIndex idx) const override
constexpr SYS_FORCE_INLINE T & y() noexcept
Vismode getVismode() const
const UT_StringHolder & getLvar() const
void setCreatevarmap(bool val)
bool getCreatevarmap() const
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_Matrix4D &value) override
static void loadData(UT_IStream &is, fpreal64 &v)
constexpr SYS_FORCE_INLINE T & y() noexcept
UT_SharedPtr< UT_Ramp > getCdramp() const
SYS_FORCE_INLINE bool isstring() const
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector3D &value) const override
SYS_FORCE_INLINE void strncpy(const char *src, exint maxlen)
void setVisualize(bool val)
void setNestParmValue(TempIndex idx, TempIndex instance, const UT_StringHolder &value) override
void getNestParmValue(TempIndex idx, TempIndex instance, UT_Vector4D &value) const override
fpreal64 opPlaneoffset(const SOP_NodeVerb::CookParms &cookparms) const
constexpr SYS_FORCE_INLINE T & x() noexcept