23 namespace SOP_VolumeSliceEnums
35 using namespace UT::Literal;
54 using namespace UT::Literal;
77 using namespace UT::Literal;
107 myAttrib =
"density"_UTsh;
108 myCreatevarmap =
false;
127 if (myGroup != src.myGroup)
return false;
128 if (myMethod != src.myMethod)
return false;
129 if (myPlane != src.myPlane)
return false;
130 if (myRelative != src.myRelative)
return false;
131 if (myPlanepos != src.myPlanepos)
return false;
132 if (myPlaneoffset != src.myPlaneoffset)
return false;
133 if (myVoxelsnap != src.myVoxelsnap)
return false;
134 if (myAttrib != src.myAttrib)
return false;
135 if (myCreatevarmap != src.myCreatevarmap)
return false;
136 if (myLvar != src.myLvar)
return false;
137 if (myVisualize != src.myVisualize)
return false;
138 if (myVismode != src.myVismode)
return false;
139 if (myVisrange != src.myVisrange)
return false;
140 if (myCdramp != src.myCdramp)
141 {
if (!myCdramp || !src.myCdramp || !(*myCdramp == *src.myCdramp))
return false; }
142 if (myKeep != src.myKeep)
return false;
163 graph->
evalOpParm(myGroup, nodeidx,
"group", time, graph->
isDirect()?
nullptr:depnode);
166 graph->
evalOpParm(myMethod, nodeidx,
"method", time, graph->
isDirect()?
nullptr:depnode);
169 graph->
evalOpParm(myPlane, nodeidx,
"plane", time, graph->
isDirect()?
nullptr:depnode);
172 graph->
evalOpParm(myRelative, nodeidx,
"relative", time, graph->
isDirect()?
nullptr:depnode);
174 if (
true && ( (
true&&!(((getRelative()==1)))) ) )
175 graph->
evalOpParm(myPlanepos, nodeidx,
"planepos", time, graph->
isDirect()?
nullptr:depnode);
178 graph->
evalOpParm(myPlaneoffset, nodeidx,
"planeoffset", time, graph->
isDirect()?
nullptr:depnode);
181 graph->
evalOpParm(myVoxelsnap, nodeidx,
"voxelsnap", time, graph->
isDirect()?
nullptr:depnode);
182 myAttrib =
"density"_UTsh;
183 if (
true && ( (
true&&!(((
int64(getMethod())==0)))) ) )
184 graph->
evalOpParm(myAttrib, nodeidx,
"attrib", time, graph->
isDirect()?
nullptr:depnode);
185 myCreatevarmap =
false;
186 if (
true && ( (
true&&!(((
int64(getMethod())==0)))) ) )
187 graph->
evalOpParm(myCreatevarmap, nodeidx,
"createvarmap", time, graph->
isDirect()?
nullptr:depnode);
189 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((getCreatevarmap()==0)))) ) )
192 if (
true && ( (
true&&!(((
int64(getMethod())==0)))) ) )
193 graph->
evalOpParm(myVisualize, nodeidx,
"visualize", time, graph->
isDirect()?
nullptr:depnode);
195 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((getVisualize()==0)))) ) )
196 graph->
evalOpParm(myVismode, nodeidx,
"vismode", time, graph->
isDirect()?
nullptr:depnode);
198 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((getVisualize()==0)))) ) )
199 graph->
evalOpParm(myVisrange, nodeidx,
"visrange", time, graph->
isDirect()?
nullptr:depnode);
201 if (
true && ( (
true&&!(((
int64(getMethod())==0))||((getVisualize()==0))||((
int64(getVismode())!=6)))) ) )
202 graph->
evalOpParm(myCdramp, nodeidx,
"cdramp", time, graph->
isDirect()?
nullptr:depnode);
221 template <
typename T>
228 if (idx.
size() != instance.
size()+1)
233 coerceValue(value, myGroup);
236 coerceValue(value, myMethod);
239 coerceValue(value, myPlane);
242 coerceValue(value, myRelative);
245 coerceValue(value, myPlanepos);
248 coerceValue(value, myPlaneoffset);
251 coerceValue(value, myVoxelsnap);
254 coerceValue(value, myAttrib);
257 coerceValue(value, myCreatevarmap);
260 coerceValue(value, myLvar);
263 coerceValue(value, myVisualize);
266 coerceValue(value, myVismode);
269 coerceValue(value, myVisrange);
272 coerceValue(value, myCdramp);
275 coerceValue(value, myKeep);
292 { doGetParmValue(idx, instance, value); }
294 { doGetParmValue(idx, instance, value); }
296 { doGetParmValue(idx, instance, value); }
298 { doGetParmValue(idx, instance, value); }
300 { doGetParmValue(idx, instance, value); }
302 { doGetParmValue(idx, instance, value); }
304 { doGetParmValue(idx, instance, value); }
306 { doGetParmValue(idx, instance, value); }
308 { doGetParmValue(idx, instance, value); }
310 { doGetParmValue(idx, instance, value); }
312 { doGetParmValue(idx, instance, value); }
314 template <
typename T>
321 if (idx.
size() != instance.
size()+1)
326 coerceValue(myGroup, ( ( value ) ));
329 coerceValue(myMethod, clampMinValue(0, clampMaxValue(2, value ) ));
332 coerceValue(myPlane, clampMinValue(0, clampMaxValue(2, value ) ));
335 coerceValue(myRelative, ( ( value ) ));
338 coerceValue(myPlanepos, ( ( value ) ));
341 coerceValue(myPlaneoffset, ( ( value ) ));
344 coerceValue(myVoxelsnap, ( ( value ) ));
347 coerceValue(myAttrib, ( ( value ) ));
350 coerceValue(myCreatevarmap, ( ( value ) ));
353 coerceValue(myLvar, ( ( value ) ));
356 coerceValue(myVisualize, ( ( value ) ));
359 coerceValue(myVismode, clampMinValue(0, clampMaxValue(6, value ) ));
362 coerceValue(myVisrange, ( ( value ) ));
365 coerceValue(myCdramp, ( ( value ) ));
368 coerceValue(myKeep, ( ( value ) ));
375 { doSetParmValue(idx, instance, value); }
377 { doSetParmValue(idx, instance, value); }
379 { doSetParmValue(idx, instance, value); }
381 { doSetParmValue(idx, instance, value); }
383 { doSetParmValue(idx, instance, value); }
385 { doSetParmValue(idx, instance, value); }
387 { doSetParmValue(idx, instance, value); }
389 { doSetParmValue(idx, instance, value); }
391 { doSetParmValue(idx, instance, value); }
393 { doSetParmValue(idx, instance, value); }
395 { doSetParmValue(idx, instance, value); }
411 if (fieldnum.
size() < 1)
426 return "planeoffset";
432 return "createvarmap";
452 if (fieldnum.
size() < 1)
453 return PARM_UNSUPPORTED;
488 return PARM_UNSUPPORTED;
524 loadData(is, rampdata);
542 int typelen = colon - data.
buffer();
556 {
int64 iv =
v; UTwrite(os, &iv); }
558 { UTwrite<fpreal64>(os, &
v); }
560 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y()); }
562 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
563 UTwrite<fpreal64>(os, &v.
z()); }
565 { UTwrite<fpreal64>(os, &v.
x()); UTwrite<fpreal64>(os, &v.
y());
566 UTwrite<fpreal64>(os, &v.
z()); UTwrite<fpreal64>(os, &v.
w()); }
578 if (s) s->save(ostr);
580 saveData(os, result);
587 ostr << s->getDataTypeToken();
592 saveData(os, result);
596 void save(std::ostream &os)
const
600 saveData(os, myGroup);
601 saveData(os, myMethod);
602 saveData(os, myPlane);
603 saveData(os, myRelative);
604 saveData(os, myPlanepos);
605 saveData(os, myPlaneoffset);
606 saveData(os, myVoxelsnap);
607 saveData(os, myAttrib);
608 saveData(os, myCreatevarmap);
609 saveData(os, myLvar);
610 saveData(os, myVisualize);
611 saveData(os, myVismode);
612 saveData(os, myVisrange);
613 saveData(os, myCdramp);
614 saveData(os, myKeep);
627 loadData(is, myGroup);
628 loadData(is, myMethod);
629 loadData(is, myPlane);
630 loadData(is, myRelative);
631 loadData(is, myPlanepos);
632 loadData(is, myPlaneoffset);
633 loadData(is, myVoxelsnap);
634 loadData(is, myAttrib);
635 loadData(is, myCreatevarmap);
636 loadData(is, myLvar);
637 loadData(is, myVisualize);
638 loadData(is, myVismode);
639 loadData(is, myVisrange);
640 loadData(is, myCdramp);
641 loadData(is, myKeep);
651 if (!thissop)
return getGroup();
653 OP_Utils::evalOpParm(result, thissop,
"group", cookparms.
getCookTime(), 0);
661 if (!thissop)
return getMethod();
663 OP_Utils::evalOpParm(result, thissop,
"method", cookparms.
getCookTime(), 0);
671 if (!thissop)
return getPlane();
673 OP_Utils::evalOpParm(result, thissop,
"plane", cookparms.
getCookTime(), 0);
674 return Plane(result);
681 if (!thissop)
return getRelative();
683 OP_Utils::evalOpParm(result, thissop,
"relative", cookparms.
getCookTime(), 0);
691 if (!thissop)
return getPlanepos();
693 OP_Utils::evalOpParm(result, thissop,
"planepos", cookparms.
getCookTime(), 0);
701 if (!thissop)
return getPlaneoffset();
703 OP_Utils::evalOpParm(result, thissop,
"planeoffset", cookparms.
getCookTime(), 0);
711 if (!thissop)
return getVoxelsnap();
713 OP_Utils::evalOpParm(result, thissop,
"voxelsnap", cookparms.
getCookTime(), 0);
721 if (!thissop)
return getAttrib();
723 OP_Utils::evalOpParm(result, thissop,
"attrib", cookparms.
getCookTime(), 0);
731 if (!thissop)
return getCreatevarmap();
733 OP_Utils::evalOpParm(result, thissop,
"createvarmap", cookparms.
getCookTime(), 0);
741 if (!thissop)
return getLvar();
743 OP_Utils::evalOpParm(result, thissop,
"lvar", cookparms.
getCookTime(), 0);
751 if (!thissop)
return getVisualize();
753 OP_Utils::evalOpParm(result, thissop,
"visualize", cookparms.
getCookTime(), 0);
761 if (!thissop)
return getVismode();
763 OP_Utils::evalOpParm(result, thissop,
"vismode", cookparms.
getCookTime(), 0);
771 if (!thissop)
return getVisrange();
773 OP_Utils::evalOpParm(result, thissop,
"visrange", cookparms.
getCookTime(), 0);
781 if (!thissop)
return getCdramp();
783 OP_Utils::evalOpParm(result, thissop,
"cdramp", cookparms.
getCookTime(), 0);
791 if (!thissop)
return getKeep();
793 OP_Utils::evalOpParm(result, thissop,
"keep", cookparms.
getCookTime(), 0);
Plane opPlane(const SOP_NodeVerb::CookParms &cookparms) const
bool getVoxelsnap() 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
UT_Vector3D opPlanepos(const SOP_NodeVerb::CookParms &cookparms) const
bool opRelative(const SOP_NodeVerb::CookParms &cookparms) 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
UT_Vector3D getPlanepos() const
GLsizei const GLfloat * value
void setPlanepos(UT_Vector3D val)
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)
void setVoxelsnap(bool val)
static void saveData(std::ostream &os, UT_Vector3D v)
UT_SharedPtr< const PRM_DataItem > PRM_DataItemHandle
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)
void setRelative(bool 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)
UT_Vector3T< fpreal64 > UT_Vector3D
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
bool opVoxelsnap(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
virtual UT_StringHolder baseGetSignature() const
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
virtual bool isDirect() const =0
Direct proxies mirror actual nodes:
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