35template <
typename T >
45inline bool CSOWriteValueToStream<Variant>(std::ostream&
out,
const Variant& value,
bool asBinary)
62 for (
unsigned int i = 0;
i < 3; ++
i)
74template <
typename T >
92inline bool CSOReadValueFromStream<Variant>(std::istream& in,
Variant& value,
bool asBinary)
112 for (
unsigned int i = 0;
i < 3; ++
i)
114 Variant::readValue(in, pos[
i],
asBinary);
214 void sendAttributesChangedPreEvent();
216 void sendAttributesChangedPostEvent();
224 std::map < std::string, Variant > _variantMap;
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
This class comprises some attributes that are common for a CSO and a CSOGroup.
~CSOAttributes()
Destructor.
float seedPointSize
The marker's size.
void loadFrom(std::istream &inStream, short version, bool swapBytes)
Loads attributes from given file stream.
bool readFromStream(std::istream &inStream, bool asBinary, short version)
Reads the attribute values from the given stream.
void getUserDataNames(std::vector< std::string > &names) const
Fills the given vector with the keys/name under which user data are stored for this CSO.
void setUserData(const std::string &name, Variant value)
int pathPointStyle
The line style of this CSO/Group.
bool saveToASCII(std::ostream &outStream) const
Saves attributes to given stream in ASCII format. Returns whether saving was successful.
void setCSOGroup(CSOGroup *group)
Sets a pointer to the associated CSOGroup.
void reset()
Sets default values to all members.
Vector3 seedPointColor
The marker's color.
std::string label
Label string for this contour.
float voxelWriteValue
The target voxel value.
bool showState
Should this CSO / Group be shown?
int seedPointStyle
The marker mode.
void removeUserData(const std::string &name)
Removes a user data entry.
std::string description
Description string for this contour.
float pathPointWidth
The line width of this CSO/Group.
bool saveTo(std::ostream &outStream) const
Saves attributes to given stream and returns whether the saving was successful.
bool editableState
Should this CSO / Group be editable?
bool voxelizeState
Should this CSO / Group be voxelized?
Variant getUserData(const std::string &name) const
Returns the user data under the given name or an invalid value if the entry does not exist.
float seedPointAlpha
The marker's alpha value.
int timePointIndex
The time point index of this contour.
float pathPointAlpha
The alpha value of this CSO/Group.
int voxelWriteMode
The write mode for voxel values.
Vector3 pathPointColor
The color of this CSO/Group.
void setCSO(CSO *cso)
Sets a pointer to the associated CSO.
void loadFromASCII(std::istream &inStream, short version)
Loads attributes from given file stream in ASCII format.
bool writeToStream(std::ostream &outStream, bool asBinary) const
Writes the attribute values to the given stream.
A CSOGroup comprises a number of CSOs, which themselves can be in a number of different CSOGroups.
The CSOPathPoints is a list of world coordinates which are interpolated by a certain interpolation sc...
unsigned int numPathPoints() const
Returns the number of stored points.
void appendPosition(const Vector3 &pos)
Adds a new position to the internal vector.
Vector3 getPosAt(unsigned int index) const
Returns a position at a given index index.
The CSO represents a contour segmentation object.
The Variant class stores different data types.
std::ostream & write(std::ostream &out, bool asBinary, bool writeType=true) const
write variant to/read variant from stream, either as text or in binary form
MLint32 toInt(bool *ok=nullptr) const
std::istream & read(std::istream &in, bool asBinary)
bool isValid() const
check if the Variants type is not Invalid
const T & asType() const
access content of variant directly, NOTE: use with care
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
bool CSOWriteValueToStream(std::ostream &out, const T &value, bool asBinary)
bool CSOReadValueFromStream(std::istream &in, T &value, bool asBinary)