45template <>
inline bool CSOWriteValueToStream<Variant>(std::ostream&
out,
const Variant& value,
bool asBinary)
65 for (
unsigned int i = 0;
i < 3; ++
i) {
96template <>
inline bool CSOReadValueFromStream<Variant>(std::istream& in,
Variant& value,
bool asBinary)
109 if (!numPathPoints.
isValid()) {
115 for (
unsigned int i = 0;
i < 3; ++
i) {
116 Variant::readValue(in, pos[
i],
asBinary);
216 void sendAttributesChangedPreEvent();
218 void sendAttributesChangedPostEvent();
226 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 specified file stream.
bool readFromStream(std::istream &inStream, bool asBinary, short version)
Reads the attribute values from the specified stream.
void getUserDataNames(std::vector< std::string > &names) const
Fills the specified 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 or CSOGroup.
bool saveToASCII(std::ostream &outStream) const
Saves attributes to specified 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 or CSOGroup 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 or CSOGroup.
bool saveTo(std::ostream &outStream) const
Saves attributes to specified stream and returns whether the saving was successful.
bool editableState
Should this CSO or CSOGroup be editable?
bool voxelizeState
Should this CSO or CSOGroup be voxelized?
Variant getUserData(const std::string &name) const
Returns the user data under the specified 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 or CSOGroup.
int voxelWriteMode
The write mode for voxel values.
Vector3 pathPointColor
The color of this CSO or CSOGroup.
void setCSO(CSO *cso)
Sets a pointer to the associated CSO.
void loadFromASCII(std::istream &inStream, short version)
Loads attributes from specified file stream in ASCII format.
bool writeToStream(std::ostream &outStream, bool asBinary) const
Writes the attribute values to the specified 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 that are interpolated by a certain interpolation sch...
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 specified 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)