71 inline unsigned int numCSOs()
const {
return static_cast<unsigned int>(_memberCSOIds.size()); }
75 inline unsigned int getCSOIdAt(
unsigned int index)
const {
return _memberCSOIds[index]; }
93 inline unsigned int getId()
const {
return _uniqueId; }
95 inline void setId(
unsigned int id) { _uniqueId = id; }
115 inline const std::string&
getLabel()
const {
return _attributes.label; }
119 inline const std::string&
getDescription()
const {
return _attributes.description; }
192 void removeUserData(
const std::string& name) { _attributes.removeUserData(name); }
279#define ML_DEPRECATED_TMP ML_DEPRECATED
288 inline ML_DEPRECATED unsigned int numCSO()
const {
return numCSOs(); }
294 inline ML_DEPRECATED void setLineStyle(CSOPathPointsStyle lineStyle) { setPathPointStyle(lineStyle); }
300 inline ML_DEPRECATED void setColor(
const Vector3& color) { setPathPointColor(color); }
303 inline ML_DEPRECATED float getAlpha()
const {
return getPathPointAlpha(); }
306 inline ML_DEPRECATED void setAlpha(
float alpha) { setPathPointAlpha(alpha); }
309 inline ML_DEPRECATED float getLineWidth()
const {
return getPathPointWidth(); }
312 inline ML_DEPRECATED void setLineWidth(
float lineWidth) { setPathPointWidth(lineWidth); }
315 inline ML_DEPRECATED int getMarkerMode()
const {
return getSeedPointStyle(); }
318 inline ML_DEPRECATED void setMarkerMode(
int markerMode) { setSeedPointStyle(markerMode); }
327 inline ML_DEPRECATED float getMarkerAlpha()
const {
return getSeedPointAlpha(); }
333 inline ML_DEPRECATED float getMarkerSize()
const {
return getSeedPointSize(); }
336 inline ML_DEPRECATED void setMarkerSize(
float markerSize) { setSeedPointSize(markerSize);}
340 return _usePathPointStyle || _usePathPointWidth || _usePathPointColor || _usePathPointAlpha;
345 _usePathPointAlpha = _usePathPointColor = _usePathPointStyle = _usePathPointWidth = state;
350 return _useVoxelWriteValue || _useVoxelWriteMode;
355 _useVoxelWriteMode = _useVoxelWriteValue = state;
360 return _useSeedPointAlpha || _useSeedPointColor || _useSeedPointSize || _useSeedPointStyle;
365 _useSeedPointAlpha = _useSeedPointColor = _useSeedPointSize = _useSeedPointStyle = state;
368#ifdef ML_DEPRECATED_TMP
369#define ML_DEPRECATED ML_DEPRECATED_TMP
370#undef ML_DEPRECATED_TMP
375 unsigned int _uniqueId;
378 std::vector<unsigned int>_memberCSOIds;
384 CSOAttributes _attributes;
387 CSOGroupRules _rules;
390 bool _useTimePointIndex;
394 bool _useVoxelizeState;
396 bool _useEditableState;
398 bool _useSeedPointStyle;
399 bool _useSeedPointSize;
400 bool _useSeedPointColor;
401 bool _useSeedPointAlpha;
403 bool _usePathPointStyle;
404 bool _usePathPointWidth;
405 bool _usePathPointColor;
406 bool _usePathPointAlpha;
408 bool _useVoxelWriteMode;
409 bool _useVoxelWriteValue;
412 bool _hasValidWorldBoundingBox;
414 CSOBoundingBox _worldBoundingBox;
416 boost::unordered_map < size_t, CSOBoundingBox > _voxelBoundingBoxCache;
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
The CSOBoundingBox defines an axis parallel bounding box with double precision.
This handles rules like the maximum number of CSOs in a group and applies them.
A CSOGroup comprises a number of CSOs, which themselves can be in a number of different CSOGroups.
CSOGroup(const CSOGroup &group, int groupId=-1, CSOList *csoList=nullptr)
Copy constructor.
CSOGroup(CSOList *csoList)
Constructor, takes a pointer to the embracing CSOList as an argument.
void setPathPointWidth(float width)
Sets the width of the path points.
void _addReferenceToCSO(const CSO &cso)
void setSeedPointColor(const Vector3 &color)
Sets the color of the seed points.
void setSeedPointSize(float size)
Sets the size of the seed points.
void setUseSeedPointStyle(bool state)
Sets whether this Group overrides the seed point style of its CSOs.
bool getUseSeedPointColor() const
Returns whether this Group overrides the seed point color of its CSOs.
void setSeedPointAlpha(float alpha)
Sets the alpha value of the seed points.
bool getUseVoxelWriteMode() const
Returns whether this Group overrides the voxel write mode of its CSOs.
float getSeedPointAlpha() const
Returns the alpha value of the seed points.
void setUsePathPointStyle(bool state)
Sets whether this Group overrides the path point style of its CSOs.
void setId(unsigned int id)
Sets the Id of this group.
void setUseVoxelizeState(bool state)
Sets whether this Group overrides the voxelize state of its CSOs.
void setShowState(bool state)
Sets the 'show' status of this Group.
void setTimePointIndex(MLint timePointIndex)
Sets the time point index of this group.
void setVoxelWriteMode(int mode)
Sets the voxel write mode of this Group.
bool getEditableState() const
Returns the 'editable' status of this Group.
void setPathPointAlpha(float alpha)
Sets the alpha value of the path points.
void loadAttributes(std::istream &inStream, short version, bool swapBytes, bool useAscii=false)
Load attributes from stream.
bool getUseSeedPointStyle() const
Returns whether this Group overrides the seed point style of its CSOs.
bool getUseEditableState() const
Returns whether this Group overrides the editable state of its CSOs.
void setUseSeedPointColor(bool state)
Sets whether this Group overrides the seed point color of its CSOs.
void _removeReferenceToCSO(const CSO &cso)
Removes a reference to a CSO from this group.
float getSeedPointSize() const
Returns the size of the seed points.
int getSeedPointStyle() const
Returns the style of the seed points.
CSO * getCSOAt(unsigned int index) const
Returns a pointer to the CSO at the given index. Beware: no index check.
bool isSelected() const
Returns whether this group is selected in its enclosing CSOList.
void setPathPointColor(const Vector3 &color)
Sets the color of the path points.
unsigned int numCSOs() const
Returns the number of CSOs in this group.
bool contains(const CSO *cso) const
Returns if this group contains the given CSO.
float getPathPointAlpha() const
Returns the alpha value of the path points.
bool getUseShowState() const
Returns if this Group overrides the show state of its CSOs.
void setUserData(const std::string &name, Variant value)
void setUsePathPointAlpha(bool state)
Sets whether this Group overrides the path point alpha of its CSOs.
unsigned int getId() const
void setUseVoxelWriteMode(bool state)
Sets whether this Group overrides the voxel write mode of its CSOs.
unsigned int getCSOIdAt(unsigned int index) const
Returns the id of an associated CSO at the given index. Beware: no index check.
void setUseSeedPointSize(bool state)
Sets whether this Group overrides the seed point size of its CSOs.
void setPathPointStyle(int style)
Sets the path point style as an int.
const std::string & getDescription() const
Returns the group description.
bool getUsePathPointStyle() const
Returns whether this Group overrides the path point style of its CSOs.
bool addCSO(CSO &cso, bool useUndoRedo=true)
bool getUseTimePointIndex() const
void setUseShowState(bool state)
Sets whether this Group overrides the show state of its CSOs.
void removeCSO(CSO &cso, bool useUndoRedo=true)
removes given CSO from this group
void setUseSeedPointAlpha(bool state)
Sets whether this Group overrides the seed point alpha of its CSOs.
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.
void setDescription(const std::string &description)
Sets the group description.
bool getShowState() const
Returns the 'show' status of this Group.
bool getUsePathPointAlpha() const
Returns whether this Group overrides the path point alpha of its CSOs.
void setUsePathPointColor(bool state)
Sets whether this Group overrides the path point color of its CSOs.
bool getVoxelizeState() const
Returns the 'voxelize' status of this Group.
void setUseEditableState(bool state)
Sets whether this Group overrides the editable state of its CSOs.
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.
const CSOBoundingBox & getBoundingBox()
bool saveAttributes(std::ostream &outStream, bool useAscii=false)
Save attributes to stream and returns whether the saving was successful.
bool getUsePathPointColor() const
Returns whether this Group overrides the path point color of its CSOs.
float getVoxelWriteValue() const
Returns the voxel write value of this Group.
void setEditableState(bool state)
Sets the 'editable' status of this Group.
int getVoxelWriteMode() const
Returns the voxel write mode of this Group.
const Vector3 & getPathPointColor() const
Returns the color of the path points.
void removeAllCSO(bool useUndoRedo=true, bool shouldApplyRemoveFromGroupRule=true)
Removes all CSOs from this group.
int getTimePointIndex() const
Returns the time point index of this group.
void setSeedPointStyle(int seedPointStyle)
Sets the style of the seed points.
bool getUsePathPointWidth() const
Returns whether this Group overrides the path point width of its CSOs.
void setVoxelizeState(bool state)
Sets the 'voxelize' status of this Group.
CSOGroupRules & getRules()
Return the rules for this CSOGroup.
void setUsePathPointWidth(bool state)
Sets whether this Group overrides the path point width of its CSOs.
bool getUseVoxelWriteValue() const
Returns whether this Group overrides the voxel write value of its CSOs.
const Vector3 & getSeedPointColor() const
Returns the color of the seed points.
CSOList * getCSOList() const
Returns a pointer to the embracing CSOList of this Group.
CSOPathPointsStyle getPathPointStyle() const
Returns the path point style.
const std::string & getLabel() const
Returns the group label.
bool getUseSeedPointAlpha() const
Returns whether this Group overrides the seed point alpha of its CSOs.
float getPathPointWidth() const
Returns the width of the path points.
void setCSOList(CSOList *csoList)
Sets the embracing CSOList for this Group.
void setUseVoxelWriteValue(bool state)
Sets whether this Group overrides the voxel write value of its CSOs.
void setLabel(const std::string &label)
bool getUseVoxelizeState() const
Returns whether this Group overrides the voxelize state of its CSOs.
bool getUseSeedPointSize() const
Returns whether this Group overrides the seed point size of its CSOs.
void removeUserData(const std::string &name)
Removes a user data entry.
void setPathPointStyle(CSOPathPointsStyle style)
Sets the path point style.
CSOBoundingBox getVoxelBoundingBox(const Matrix4 &worldToVoxelMatrix, size_t hashKey)
Returns the unified voxel bounding box of all contained CSOs.
void setUseTimePointIndex(bool state)
Sets whether the time point index of this Group should be used.
void groupChanged()
Marks this Group as changed (e.g. if a CSO has been added, removed or changed).
void setVoxelWriteValue(float value)
Sets the voxel write value of this Group.
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
The CSO represents a contour segmentation object.
The Variant class stores different data types.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
CSOPathPointsStyle
Enumeration of line styles (order as StylePalette::LineStyle).
Tvec3< MLdouble > Vector3
A vector with 3 components of type double.