MeVisLab Toolbox Reference
ml::CSO Class Reference

The CSO represents a contour segmentation object. More...

#include <CSO.h>

Public Member Functions

 CSO ()
 Standard constructor. The unique id is initialized with 0. More...
 
 CSO (CSOList *csoList)
 Constructor takes a pointer to the CSOList this CSO is in; in this method, the unique id is set. More...
 
 CSO (const CSO &cso, CSOList *csoList=nullptr, unsigned int csoId=INVALID_CSO_ID)
 Copy constructor; the unique id is taken from the given CSOList but if the CSOList is NULL, the unique id of the copied CSO is 0. More...
 
virtual ~CSO ()
 Standard destructor. More...
 
void reverseSeedPointOrder ()
 Reverses the order of all seed points and clears all path points in between. More...
 
void resortSeedPointsClockwise ()
 
void storeInUndoManager ()
 Stores the geometric information of the CSO in the UndoRedo manager. More...
 
void storeVisualAttributesInUndoManager ()
 
CSOManagergetManager () const
 
bool isSelected () const
 Returns whether this CSO is selected in its CSOList. If there is no enclosing CSOList, the method returns false. More...
 
void setAttributesFrom (const CSO *const cso)
 Copies all attributes from the given CSO to this one. More...
 
bool saveAttributes (std::ostream &outStream, bool useAscii=false)
 Save attributes to stream and returns whether the saving was successful. More...
 
void loadAttributes (std::istream &inStream, short version, bool swapBytes, bool useAscii=false)
 Load attributes from stream. More...
 
const CSOAttributesgetAttributes () const
 Get const access to all CSO attributes. More...
 
CSOAttributesgetWritableAttributes ()
 Get write access to all CSO attributes (NOTE: be careful, no events are emitted when changing the attributes). More...
 
Methods altering the geometry of this CSO.
void applyTransformationMatrix (const Matrix4 &matrix)
 
void moveSeedPointsAndPathPoints (const Vector3 &offset, int timepoint)
 Moves all seed points and all path points by the given coordinates offset and sets it to the given timepoint. More...
 
void moveSeedPointsAndPathPoints (double dx, double dy, double dz, int timepoint)
 Moves all seed points and all path points by the given coordinates offset and sets it to the given timepoint. More...
 
void moveSeedPointsAndPathPoints (const Vector3 &offset)
 Moves all seed points and all path points by the given coordinates offset. More...
 
void moveSeedPointsAndPathPoints (double dx, double dy, double dz)
 Moves all seed points and all path points by the given coordinates offset. More...
 
void setAbsoluteMovementCommand (double fromX, double fromY, double fromZ, double toX, double toY, double toZ, int fromTimePointIndex, int toTimePointIndex)
 Sets the absolute movement for undo/redo. More...
 
void moveSingleSeedPoint (CSOSeedPoint *sPoint, double dx, double dy, double dz)
 Moves a certain seed point by the given coordinate offset. More...
 
void setAbsoluteSeedPointMovementCommand ()
 Sets the absolute movement of a single seed point for undo/redo. More...
 
void setSeedPointsAndPathPoints (const CSO *cso)
 Sets the seed points and the path point of the given CSO. More...
 
Methods for adding / removing seed points or path point lists.
CSOSeedPointappendSeedAndPathPointNoEvent ()
 
CSOSeedPointappendSeedAndPathPointNoEvent (const Vector3 &position)
 Appends a seed point and a path point list to the end of the seed point list and returns a pointer to it. More...
 
CSOSeedPointappendSeedAndPathPoint ()
 Appends a seed point and a path point list to the end of the seed point list and returns a pointer to it. More...
 
CSOSeedPointappendSeedAndPathPoint (const Vector3 &position)
 Appends a seed point and a path point list to the end of the seed point list and returns a pointer to it. More...
 
void setSeedAndPathPoints (unsigned int numSeedPoints, bool isClosed=true)
 Generates the given number of seed points and path point lists between those. More...
 
void setInitialSeedAndPathPointsNoEvent (unsigned int numSeedPoints, bool isClosed=true)
 See setSeedAndPathPoints, but faster because no events are emitted and no checks are done, an empty CSO is expected. More...
 
CSOPathPointsinsertPathPointsEndStart ()
 Inserts a CSOPathPoint between the ending and the starting seed points and returns a pointer to it. More...
 
CSOPathPointsinsertPathPointsEndStartNoEvent ()
 Inserts a CSOPathPoint between the ending and the starting seed points and returns a pointer to it. More...
 
CSOSeedPointappendSeedPoint ()
 Appends just a seed point to the internal list and returns a pointer to it. More...
 
CSOPathPointsappendPathPoints ()
 Appends just a path point list the internal list and returns a pointer to it. More...
 
void removeSeedPoint (CSOSeedPoint *sPoint)
 Removes the given seed point from this CSO. More...
 
void removeAllSeedAndPathPoints ()
 Removes all seed points and all path point lists from this CSO. More...
 
CSOSeedPointinsertSeedPointAt (CSOPathPoints *toBeSplitPath, const Vector3 &toInsertPos)
 Inserts a seed point into the given toBeSplitPath at the given position. More...
 
void setInsertRemoveSeedPointCommand ()
 Triggers the according undo/redo command to be put on the stack. More...
 
Methods for seed point and path point lists access.
CSOSeedPointgetSeedPointAt (unsigned int index) const
 
CSOSeedPointgetFirstSeedPoint () const
 Returns a pointer to the first seed point of this CSO. More...
 
CSOSeedPointgetLastSeedPoint () const
 Returns a pointer to the last seed point of this CSO. More...
 
unsigned int numSeedPoints () const
 Returns the number of seed points. More...
 
bool getSeedPointIndex (CSOSeedPoint *sPoint, unsigned int &index) const
 Sets the sIndex to the index of the given seed point and returns whether such a seed point exists. More...
 
unsigned int numPathPointLists () const
 Returns the number of path point lists. More...
 
void fillPathPointCoordinatesFlattened (std::vector< Vector3 > &pathPointCoords) const
 Fills up the given std::vector<Vector3> with all the path point coordinates in order. More...
 
void fillPathPointCoordinatesFlattened (std::vector< Vector4 > &pathPointCoordsAndValues) const
 Fills up the given std::vector<Vector4> with all the path point coordinates and values in order. More...
 
CSOPathPointsgetPathPointsAt (unsigned int index) const
 Returns the list of path points at a given position. More...
 
unsigned int getTotalNumPathPoints () const
 Returns the total number of path points in this CSO; this number may differ from the number of path points obtained by a flattened positions vector. More...
 
unsigned int getTotalNumUniquePathPoints () const
 Returns the total number of unique path points in this CSO; this number equals the number of path points obtained by a flattened positions vector. More...
 
void swapPoints (CSO &other)
 Swaps the seed and path points of two cso. No events are emitted. More...
 
Methods for handling selected seed points.
void addSelectedSeedPoint (CSOSeedPoint *sPoint)
 
void setSelectedSeedPoint (CSOSeedPoint *sPoint)
 Sets the given seed point as being selected, and deselects all previously selected seed points. More...
 
void setSeedPointSelectedAt (unsigned int index)
 Sets the seed point at the given index selected. More...
 
bool isSelectedSeedPoint (CSOSeedPoint *sPoint) const
 Returns whether the given seed point is selected. More...
 
void clearSelectedSeedPoints ()
 Clears the list of selected seed points. More...
 
unsigned int getNumSelectedSeedPoints () const
 Returns the number of selected seed points. More...
 
CSOSeedPointgetSelectedSeedPointAt (unsigned int index) const
 Returns a pointer to a selected seed point at the given index. More...
 
Methods for handling grouping.
bool addToGroup (CSOGroup &group, bool useUndoRedo=true)
 
void removeFromGroup (CSOGroup &group, bool useUndoRedo=true)
 Removes this CSO from the given group. More...
 
bool isInGroup (const CSOGroup *group) const
 Returns whether this CSO is in the given Group. More...
 
bool isInSameGroupsAs (CSO *cso) const
 
bool isInGroup (unsigned int groupId) const
 Returns whether this CSO is in the group with the given ID. More...
 
unsigned int numGroups () const
 Returns the number of groups this CSO is in. More...
 
CSOGroupgetGroupAt (unsigned int index) const
 Returns the group at the specified index. If the index is out of bounds, NULL is returned. More...
 
unsigned int getGroupIdAt (unsigned int index) const
 Returns a group id at the specified index. More...
 
void removeFromAllGroups ()
 Removes this CSO from all its groups. More...
 
MLCSO-internal Methods for handling grouping.
void _addReferenceToGroup (const CSOGroup &group)
 
void _removeReferenceToGroup (const CSOGroup &group)
 Removes the given group from the internal list. More...
 
Methods for setting / getting type information.
void setType (const std::string &type)
 
const std::string & getType () const
 Returns the type of the CSO. This is set by the Processor, which generated this CSO. More...
 
void setSubType (const std::string &subtype)
 Sets the subtype of the CSO. This is set by the Processor, which generates this CSO. More...
 
const std::string & getSubType () const
 Returns the type of the CSO. This is set by the Processor, which generated this CSO. More...
 
void setCreatorId (int id)
 Sets the creator ID of the CSO. This is set by the Processor, which generates this CSO. More...
 
int getCreatorId () const
 Returns the creator ID of the CSO. This is set by the Processor, which generated this CSO. More...
 
Methods setting / reading out the user data values.
void setUserData (const std::string &name, Variant value)
 
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. More...
 
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. More...
 
void removeUserData (const std::string &name)
 Removes a user data entry. More...
 
Methods for handling geometric aspects of this CSO.
const CSOBoundingBoxgetWorldBoundingBox () const
 
CSOBoundingBox getVoxelBoundingBox (const Matrix4 &worldToVoxelMatrix, size_t hashKey) const
 Returns the bounding box of this contour in voxel coordinates computed by the given (image) matrix. More...
 
CSOBoundingBox getVoxelBoundingBoxSeedPoints (const Matrix4 &worldToVoxelMatrix, size_t hashKey) const
 Returns the bounding box of the seed points of this CSO in voxel coordinates computed by the given (image) matrix. More...
 
bool isInPlane () const
 Returns the plane status (do all seed points lie in a plane?). More...
 
bool isInPlane (Vector3 &planeNormal) const
 Returns the plane status and fills the argument vector with the plane normal (only valid if all seed points lie in a plane). More...
 
const Vector3getPlaneNormal () const
 Returns the plane normal. Only valid, if isInPlane returns 'true'. More...
 
void computePlaneNormal ()
 Forces to recompute the plane normal (status). More...
 
void setIsInPlane (bool status)
 Sets the plane normal status for this CSO. More...
 
void setPlaneNormal (const Vector3 &planeNormal)
 Sets the plane normal which becomes valid by this. More...
 
void invalidatePlaneNormal ()
 Invalidates the plane normal. More...
 
double getLength () const
 Returns the length of this CSO (this is sum of the the euclidean distances between all successive path points). More...
 
double getArea () const
 Returns the area of this CSO (this value is only meaningful if all points lie in a plane) More...
 
void invalidateArea ()
 Invalidates the internal area flag, so it can be recomputed. More...
 
bool isSelfIntersecting () const
 Returns whether this CSO is self-intersecting. More...
 
void setIsClosed (bool isClosed)
 Sets the closed state of this contour. More...
 
bool isClosed () const
 Returns whether the CSO is closed. More...
 
bool isPoint () const
 Returns whether the CSO is just a point. More...
 
bool isEmpty () const
 Returns whether the CSO is empty; an empty CSO has neither seed points nor path points. More...
 
void setIsFinished (bool isFinished)
 Sets the finished status of this contour. Note that the finished status is set to 'true' if the contour is set to isClosed = true. More...
 
bool getIsFinished () const
 Returns the finished status of this contour. More...
 
void setNeedsInterpolation (bool needsInterpolation)
 Sets if this CSO needs interpolation. More...
 
bool getNeedsInterpolation () const
 Returns whether this CSO needs interpolation. More...
 
void determineNeedsInterpolation ()
 Determines by investigating the CSO's seed points if this CSO needs interpolation and sets this state to the CSO's internal variable. More...
 
void setNeedInterpolationAllSeedPoints (bool needsInterpolation)
 Sets the need for interpolation to all member seed points. More...
 
void setNeedInterpolation (CSOSeedPoint *seedPoint)
 Sets the need of being interpolated to the given seed point and to the CSO's state. More...
 
void pathChanged ()
 Sets any pre-computed values depending on the exact path to invalid. More...
 
Maintenance methods.
void setCSOList (CSOList *csoList)
 
CSOListgetCSOList () const
 Returns the internal pointer to the embracing CSOList. More...
 
unsigned int getId () const
 Returns the unique ID of this CSO. More...
 
Methods for handling various states.
void setLabel (const std::string &label)
 
const std::string & getLabel () const
 Returns the label of this CSO. More...
 
void setDescription (std::string description)
 Sets the description of this CSO. More...
 
const std::string & getDescription () const
 Returns the description of this CSO. More...
 
void setTimePointIndex (MLint index)
 Sets the time point index of this CSO. More...
 
int getTimePointIndex () const
 Returns the time point index of this CSO. More...
 
void setShowState (bool state)
 Sets the 'show' status of this CSO. More...
 
bool getShowState () const
 Returns the 'show' status of this CSO. More...
 
void setVoxelizeState (bool state)
 Sets the 'voxelize' state of this CSO. More...
 
bool getVoxelizeState () const
 Returns the 'voxelize' state of this CSO. More...
 
void setEditableState (bool state)
 Sets the 'editable' state of this CSO. More...
 
bool getEditableState () const
 Returns the 'editable' state of this CSO. More...
 
void setPathPointStyle (CSOPathPointsStyle style)
 Sets the style of the path points. More...
 
void setPathPointStyle (int style)
 Sets the style of the path points as an int. More...
 
CSOPathPointsStyle getPathPointStyle () const
 Returns the style of the path points. More...
 
void setPathPointWidth (float width)
 Sets the width of the path points. More...
 
float getPathPointWidth () const
 Returns the width of the path points. More...
 
void setPathPointColor (const Vector3 &color)
 Sets the color of the path points. More...
 
Vector3 getPathPointColor () const
 Returns the color of the path points. More...
 
void setPathPointAlpha (float alpha)
 Sets the alpha value of the path points. More...
 
float getPathPointAlpha () const
 Returns the alpha value of the path points. More...
 
void setSeedPointStyle (int style)
 Sets the style of the seed points. More...
 
int getSeedPointStyle () const
 Returns the style of the seed points. More...
 
void setSeedPointSize (float size)
 Sets the size of the seed points. More...
 
float getSeedPointSize () const
 Returns the size of the seed points. More...
 
void setSeedPointColor (const Vector3 &color)
 Sets the color of the seed points. More...
 
Vector3 getSeedPointColor () const
 Returns the color of the seed points. More...
 
void setSeedPointAlpha (float alpha)
 Sets the alpha value of the seed points. More...
 
float getSeedPointAlpha () const
 Returns the alpha value of the seed points. More...
 
void setVoxelWriteMode (int mode)
 Sets the voxel write mode of this CSO. More...
 
int getVoxelWriteMode () const
 Returns the voxel write mode of this CSO. More...
 
void setVoxelWriteValue (float value)
 Sets the voxel write value of this CSO. More...
 
float getVoxelWriteValue () const
 Returns the voxel write value of this CSO. More...
 
void setAllValuesTo (float value)
 Sets all position values to the given value. More...
 
Private set / get methods handle internal states (are not overwritten by CSOGroups).
int getPrivateTimePointIndex () const
 
bool getPrivateShowState () const
 Returns the private attribute 'showState'. More...
 
bool getPrivateVoxelizeState () const
 Returns the private attribute 'voxelizeState'. More...
 
bool getPrivateEditableState () const
 Returns the private attribute 'editableState'. More...
 
int getPrivatePathPointStyle () const
 Returns the private attribute 'path point style'. More...
 
float getPrivatePathPointWidth () const
 Returns the private attribute 'path point width'. More...
 
Vector3 getPrivatePathPointColor () const
 Returns the private attribute 'path point color'. More...
 
float getPrivatePathPointAlpha () const
 Returns the private attribute 'path point alpha'. More...
 
int getPrivateSeedPointStyle () const
 Returns the private attribute 'seed point style'. More...
 
float getPrivateSeedPointSize () const
 Returns the private attribute 'seed point size'. More...
 
Vector3 getPrivateSeedPointColor () const
 Returns the private attribute 'seed point color'. More...
 
float getPrivateSeedPointAlpha () const
 Returns the private attribute 'seed point alpha'. More...
 
int getPrivateVoxelWriteMode () const
 Returns the private attribute 'voxelWriteMode'. More...
 
float getPrivateVoxelWriteValue () const
 Returns the private attribute 'voxelWriteValue'. More...
 
void setPrivateIsFinished (bool isFinished)
 Sets the 'isFinished' flag without any side effects. More...
 
void setPrivateIsClosed (bool isClosedP)
 Sets the 'isClosed' flag without any side effects. More...
 
void setPrivateIsInPlane (bool isInPlaneP)
 Sets the 'isInPlane' flag without any side effects. More...
 
void setPrivateBoundingBox (const CSOBoundingBox &bb)
 Sets the bounding box of this CSO. More...
 
void setPrivatePlaneNormal (const Vector3 &normal)
 Sets the plane normal of this CSO. More...
 
void setId (unsigned int newId)
 Sets the unique ID of this CSO. More...
 

Friends

class CSOList
 

Detailed Description

The CSO represents a contour segmentation object.

It consists of a number of seed points and a number of path point lists whose points connect the seed points. The CSO has also a pointer to its embracing CSOList, and can be in a number of CSOGroups.

Definition at line 43 of file CSO.h.

Constructor & Destructor Documentation

◆ CSO() [1/3]

ml::CSO::CSO ( )

Standard constructor. The unique id is initialized with 0.

◆ CSO() [2/3]

ml::CSO::CSO ( CSOList csoList)

Constructor takes a pointer to the CSOList this CSO is in; in this method, the unique id is set.

◆ CSO() [3/3]

ml::CSO::CSO ( const CSO cso,
CSOList csoList = nullptr,
unsigned int  csoId = INVALID_CSO_ID 
)

Copy constructor; the unique id is taken from the given CSOList but if the CSOList is NULL, the unique id of the copied CSO is 0.

If copied CSO should be in another csoList, provide a pointer to it.

◆ ~CSO()

virtual ml::CSO::~CSO ( )
virtual

Standard destructor.

Member Function Documentation

◆ _addReferenceToGroup()

void ml::CSO::_addReferenceToGroup ( const CSOGroup group)

Adds a reference to a group to this CSO.

◆ _removeReferenceToGroup()

void ml::CSO::_removeReferenceToGroup ( const CSOGroup group)

Removes the given group from the internal list.

◆ addSelectedSeedPoint()

void ml::CSO::addSelectedSeedPoint ( CSOSeedPoint sPoint)

Adds the given seed point to the list of selected seed points.

◆ addToGroup()

bool ml::CSO::addToGroup ( CSOGroup group,
bool  useUndoRedo = true 
)

Adds this CSO to the given group. Returns whether the operation was successful.

◆ appendPathPoints()

CSOPathPoints* ml::CSO::appendPathPoints ( )

Appends just a path point list the internal list and returns a pointer to it.

◆ appendSeedAndPathPoint() [1/2]

CSOSeedPoint* ml::CSO::appendSeedAndPathPoint ( )

Appends a seed point and a path point list to the end of the seed point list and returns a pointer to it.

◆ appendSeedAndPathPoint() [2/2]

CSOSeedPoint* ml::CSO::appendSeedAndPathPoint ( const Vector3 position)

Appends a seed point and a path point list to the end of the seed point list and returns a pointer to it.

◆ appendSeedAndPathPointNoEvent() [1/2]

CSOSeedPoint* ml::CSO::appendSeedAndPathPointNoEvent ( )

Appends a seed point and a path point list to the end of the seed point list and returns a pointer to it.

◆ appendSeedAndPathPointNoEvent() [2/2]

CSOSeedPoint* ml::CSO::appendSeedAndPathPointNoEvent ( const Vector3 position)

Appends a seed point and a path point list to the end of the seed point list and returns a pointer to it.

◆ appendSeedPoint()

CSOSeedPoint* ml::CSO::appendSeedPoint ( )

Appends just a seed point to the internal list and returns a pointer to it.

◆ applyTransformationMatrix()

void ml::CSO::applyTransformationMatrix ( const Matrix4 matrix)

Applies the given 4x4 matrix on all path and seed points.

◆ clearSelectedSeedPoints()

void ml::CSO::clearSelectedSeedPoints ( )

Clears the list of selected seed points.

◆ computePlaneNormal()

void ml::CSO::computePlaneNormal ( )
inline

Forces to recompute the plane normal (status).

Definition at line 283 of file CSO.h.

◆ determineNeedsInterpolation()

void ml::CSO::determineNeedsInterpolation ( )

Determines by investigating the CSO's seed points if this CSO needs interpolation and sets this state to the CSO's internal variable.

◆ fillPathPointCoordinatesFlattened() [1/2]

void ml::CSO::fillPathPointCoordinatesFlattened ( std::vector< Vector3 > &  pathPointCoords) const

Fills up the given std::vector<Vector3> with all the path point coordinates in order.

◆ fillPathPointCoordinatesFlattened() [2/2]

void ml::CSO::fillPathPointCoordinatesFlattened ( std::vector< Vector4 > &  pathPointCoordsAndValues) const

Fills up the given std::vector<Vector4> with all the path point coordinates and values in order.

◆ getArea()

double ml::CSO::getArea ( ) const
inline

Returns the area of this CSO (this value is only meaningful if all points lie in a plane)

Definition at line 294 of file CSO.h.

◆ getAttributes()

const CSOAttributes& ml::CSO::getAttributes ( ) const
inline

Get const access to all CSO attributes.

Definition at line 480 of file CSO.h.

◆ getCreatorId()

int ml::CSO::getCreatorId ( ) const
inline

Returns the creator ID of the CSO. This is set by the Processor, which generated this CSO.

Definition at line 247 of file CSO.h.

◆ getCSOList()

CSOList* ml::CSO::getCSOList ( ) const
inline

Returns the internal pointer to the embracing CSOList.

Definition at line 338 of file CSO.h.

◆ getDescription()

const std::string& ml::CSO::getDescription ( ) const
inline

Returns the description of this CSO.

Definition at line 354 of file CSO.h.

◆ getEditableState()

bool ml::CSO::getEditableState ( ) const

Returns the 'editable' state of this CSO.

◆ getFirstSeedPoint()

CSOSeedPoint* ml::CSO::getFirstSeedPoint ( ) const
inline

Returns a pointer to the first seed point of this CSO.

Definition at line 148 of file CSO.h.

◆ getGroupAt()

CSOGroup* ml::CSO::getGroupAt ( unsigned int  index) const

Returns the group at the specified index. If the index is out of bounds, NULL is returned.

◆ getGroupIdAt()

unsigned int ml::CSO::getGroupIdAt ( unsigned int  index) const
inline

Returns a group id at the specified index.

For performance reasons it is not checked whether the index is valid.

Definition at line 218 of file CSO.h.

◆ getId()

unsigned int ml::CSO::getId ( void  ) const
inline

Returns the unique ID of this CSO.

Definition at line 340 of file CSO.h.

◆ getIsFinished()

bool ml::CSO::getIsFinished ( ) const
inline

Returns the finished status of this contour.

Definition at line 314 of file CSO.h.

◆ getLabel()

const std::string& ml::CSO::getLabel ( ) const
inline

Returns the label of this CSO.

Definition at line 350 of file CSO.h.

◆ getLastSeedPoint()

CSOSeedPoint* ml::CSO::getLastSeedPoint ( ) const
inline

Returns a pointer to the last seed point of this CSO.

Definition at line 150 of file CSO.h.

◆ getLength()

double ml::CSO::getLength ( ) const

Returns the length of this CSO (this is sum of the the euclidean distances between all successive path points).

◆ getManager()

CSOManager* ml::CSO::getManager ( ) const

◆ getNeedsInterpolation()

bool ml::CSO::getNeedsInterpolation ( ) const
inline

Returns whether this CSO needs interpolation.

Definition at line 318 of file CSO.h.

◆ getNumSelectedSeedPoints()

unsigned int ml::CSO::getNumSelectedSeedPoints ( ) const

Returns the number of selected seed points.

◆ getPathPointAlpha()

float ml::CSO::getPathPointAlpha ( ) const

Returns the alpha value of the path points.

◆ getPathPointColor()

Vector3 ml::CSO::getPathPointColor ( ) const

Returns the color of the path points.

◆ getPathPointsAt()

CSOPathPoints* ml::CSO::getPathPointsAt ( unsigned int  index) const
inline

Returns the list of path points at a given position.

For performance reasons it is not checked if the index is valid.

Definition at line 163 of file CSO.h.

◆ getPathPointStyle()

CSOPathPointsStyle ml::CSO::getPathPointStyle ( ) const

Returns the style of the path points.

◆ getPathPointWidth()

float ml::CSO::getPathPointWidth ( ) const

Returns the width of the path points.

◆ getPlaneNormal()

const Vector3& ml::CSO::getPlaneNormal ( ) const
inline

Returns the plane normal. Only valid, if isInPlane returns 'true'.

Definition at line 281 of file CSO.h.

◆ getPrivateEditableState()

bool ml::CSO::getPrivateEditableState ( ) const
inline

Returns the private attribute 'editableState'.

Definition at line 431 of file CSO.h.

◆ getPrivatePathPointAlpha()

float ml::CSO::getPrivatePathPointAlpha ( ) const
inline

Returns the private attribute 'path point alpha'.

Definition at line 439 of file CSO.h.

◆ getPrivatePathPointColor()

Vector3 ml::CSO::getPrivatePathPointColor ( ) const
inline

Returns the private attribute 'path point color'.

Definition at line 437 of file CSO.h.

◆ getPrivatePathPointStyle()

int ml::CSO::getPrivatePathPointStyle ( ) const
inline

Returns the private attribute 'path point style'.

Definition at line 433 of file CSO.h.

◆ getPrivatePathPointWidth()

float ml::CSO::getPrivatePathPointWidth ( ) const
inline

Returns the private attribute 'path point width'.

Definition at line 435 of file CSO.h.

◆ getPrivateSeedPointAlpha()

float ml::CSO::getPrivateSeedPointAlpha ( ) const
inline

Returns the private attribute 'seed point alpha'.

Definition at line 447 of file CSO.h.

◆ getPrivateSeedPointColor()

Vector3 ml::CSO::getPrivateSeedPointColor ( ) const
inline

Returns the private attribute 'seed point color'.

Definition at line 445 of file CSO.h.

◆ getPrivateSeedPointSize()

float ml::CSO::getPrivateSeedPointSize ( ) const
inline

Returns the private attribute 'seed point size'.

Definition at line 443 of file CSO.h.

◆ getPrivateSeedPointStyle()

int ml::CSO::getPrivateSeedPointStyle ( ) const
inline

Returns the private attribute 'seed point style'.

Definition at line 441 of file CSO.h.

◆ getPrivateShowState()

bool ml::CSO::getPrivateShowState ( ) const
inline

Returns the private attribute 'showState'.

Definition at line 427 of file CSO.h.

◆ getPrivateTimePointIndex()

int ml::CSO::getPrivateTimePointIndex ( ) const
inline

Returns the private attribute 'timePointIndex'.

Definition at line 425 of file CSO.h.

◆ getPrivateVoxelizeState()

bool ml::CSO::getPrivateVoxelizeState ( ) const
inline

Returns the private attribute 'voxelizeState'.

Definition at line 429 of file CSO.h.

◆ getPrivateVoxelWriteMode()

int ml::CSO::getPrivateVoxelWriteMode ( ) const
inline

Returns the private attribute 'voxelWriteMode'.

Definition at line 450 of file CSO.h.

◆ getPrivateVoxelWriteValue()

float ml::CSO::getPrivateVoxelWriteValue ( ) const
inline

Returns the private attribute 'voxelWriteValue'.

Definition at line 452 of file CSO.h.

◆ getSeedPointAlpha()

float ml::CSO::getSeedPointAlpha ( ) const

Returns the alpha value of the seed points.

◆ getSeedPointAt()

CSOSeedPoint* ml::CSO::getSeedPointAt ( unsigned int  index) const

Returns a pointer to the seed point at the given index.

◆ getSeedPointColor()

Vector3 ml::CSO::getSeedPointColor ( ) const

Returns the color of the seed points.

◆ getSeedPointIndex()

bool ml::CSO::getSeedPointIndex ( CSOSeedPoint sPoint,
unsigned int &  index 
) const

Sets the sIndex to the index of the given seed point and returns whether such a seed point exists.

◆ getSeedPointSize()

float ml::CSO::getSeedPointSize ( ) const

Returns the size of the seed points.

◆ getSeedPointStyle()

int ml::CSO::getSeedPointStyle ( ) const

Returns the style of the seed points.

◆ getSelectedSeedPointAt()

CSOSeedPoint* ml::CSO::getSelectedSeedPointAt ( unsigned int  index) const

Returns a pointer to a selected seed point at the given index.

◆ getShowState()

bool ml::CSO::getShowState ( ) const

Returns the 'show' status of this CSO.

◆ getSubType()

const std::string& ml::CSO::getSubType ( ) const
inline

Returns the type of the CSO. This is set by the Processor, which generated this CSO.

Definition at line 243 of file CSO.h.

◆ getTimePointIndex()

int ml::CSO::getTimePointIndex ( ) const

Returns the time point index of this CSO.

◆ getTotalNumPathPoints()

unsigned int ml::CSO::getTotalNumPathPoints ( ) const

Returns the total number of path points in this CSO; this number may differ from the number of path points obtained by a flattened positions vector.

◆ getTotalNumUniquePathPoints()

unsigned int ml::CSO::getTotalNumUniquePathPoints ( ) const

Returns the total number of unique path points in this CSO; this number equals the number of path points obtained by a flattened positions vector.

◆ getType()

const std::string& ml::CSO::getType ( ) const
inline

Returns the type of the CSO. This is set by the Processor, which generated this CSO.

Definition at line 239 of file CSO.h.

◆ getUserData()

Variant ml::CSO::getUserData ( const std::string &  name) const
inline

Returns the user data under the given name or an invalid value if the entry does not exist.

Definition at line 257 of file CSO.h.

◆ getUserDataNames()

void ml::CSO::getUserDataNames ( std::vector< std::string > &  names) const
inline

Fills the given vector with the keys/name under which user data are stored for this CSO.

Definition at line 259 of file CSO.h.

◆ getVoxelBoundingBox()

CSOBoundingBox ml::CSO::getVoxelBoundingBox ( const Matrix4 worldToVoxelMatrix,
size_t  hashKey 
) const

Returns the bounding box of this contour in voxel coordinates computed by the given (image) matrix.

◆ getVoxelBoundingBoxSeedPoints()

CSOBoundingBox ml::CSO::getVoxelBoundingBoxSeedPoints ( const Matrix4 worldToVoxelMatrix,
size_t  hashKey 
) const

Returns the bounding box of the seed points of this CSO in voxel coordinates computed by the given (image) matrix.

◆ getVoxelizeState()

bool ml::CSO::getVoxelizeState ( ) const

Returns the 'voxelize' state of this CSO.

◆ getVoxelWriteMode()

int ml::CSO::getVoxelWriteMode ( ) const

Returns the voxel write mode of this CSO.

◆ getVoxelWriteValue()

float ml::CSO::getVoxelWriteValue ( ) const

Returns the voxel write value of this CSO.

◆ getWorldBoundingBox()

const CSOBoundingBox& ml::CSO::getWorldBoundingBox ( ) const

Returns the bounding box of this contour in world coordinates.

◆ getWritableAttributes()

CSOAttributes& ml::CSO::getWritableAttributes ( )
inline

Get write access to all CSO attributes (NOTE: be careful, no events are emitted when changing the attributes).

Definition at line 483 of file CSO.h.

◆ insertPathPointsEndStart()

CSOPathPoints* ml::CSO::insertPathPointsEndStart ( )

Inserts a CSOPathPoint between the ending and the starting seed points and returns a pointer to it.

◆ insertPathPointsEndStartNoEvent()

CSOPathPoints* ml::CSO::insertPathPointsEndStartNoEvent ( )

Inserts a CSOPathPoint between the ending and the starting seed points and returns a pointer to it.

◆ insertSeedPointAt()

CSOSeedPoint* ml::CSO::insertSeedPointAt ( CSOPathPoints toBeSplitPath,
const Vector3 toInsertPos 
)

Inserts a seed point into the given toBeSplitPath at the given position.

◆ invalidateArea()

void ml::CSO::invalidateArea ( )
inline

Invalidates the internal area flag, so it can be recomputed.

Definition at line 296 of file CSO.h.

◆ invalidatePlaneNormal()

void ml::CSO::invalidatePlaneNormal ( )
inline

Invalidates the plane normal.

Definition at line 290 of file CSO.h.

◆ isClosed()

bool ml::CSO::isClosed ( ) const
inline

Returns whether the CSO is closed.

Definition at line 306 of file CSO.h.

◆ isEmpty()

bool ml::CSO::isEmpty ( ) const

Returns whether the CSO is empty; an empty CSO has neither seed points nor path points.

◆ isInGroup() [1/2]

bool ml::CSO::isInGroup ( const CSOGroup group) const

Returns whether this CSO is in the given Group.

◆ isInGroup() [2/2]

bool ml::CSO::isInGroup ( unsigned int  groupId) const

Returns whether this CSO is in the group with the given ID.

◆ isInPlane() [1/2]

bool ml::CSO::isInPlane ( ) const
inline

Returns the plane status (do all seed points lie in a plane?).

If the method returns 'true', the plane normal is also valid. Note that a CSO forming a straight line is not considered to be 'in plane' as it lies in an infinite number of planes.

Definition at line 276 of file CSO.h.

References isInPlane().

Referenced by isInPlane().

◆ isInPlane() [2/2]

bool ml::CSO::isInPlane ( Vector3 planeNormal) const

Returns the plane status and fills the argument vector with the plane normal (only valid if all seed points lie in a plane).

Note that a CSO forming a straight line is not considered to be 'in plane' as it lies in an infinite number of planes.

◆ isInSameGroupsAs()

bool ml::CSO::isInSameGroupsAs ( CSO cso) const

◆ isPoint()

bool ml::CSO::isPoint ( ) const

Returns whether the CSO is just a point.

◆ isSelected()

bool ml::CSO::isSelected ( ) const

Returns whether this CSO is selected in its CSOList. If there is no enclosing CSOList, the method returns false.

◆ isSelectedSeedPoint()

bool ml::CSO::isSelectedSeedPoint ( CSOSeedPoint sPoint) const

Returns whether the given seed point is selected.

◆ isSelfIntersecting()

bool ml::CSO::isSelfIntersecting ( ) const

Returns whether this CSO is self-intersecting.

◆ loadAttributes()

void ml::CSO::loadAttributes ( std::istream &  inStream,
short  version,
bool  swapBytes,
bool  useAscii = false 
)

Load attributes from stream.

◆ moveSeedPointsAndPathPoints() [1/4]

void ml::CSO::moveSeedPointsAndPathPoints ( const Vector3 offset)

Moves all seed points and all path points by the given coordinates offset.

◆ moveSeedPointsAndPathPoints() [2/4]

void ml::CSO::moveSeedPointsAndPathPoints ( const Vector3 offset,
int  timepoint 
)

Moves all seed points and all path points by the given coordinates offset and sets it to the given timepoint.

◆ moveSeedPointsAndPathPoints() [3/4]

void ml::CSO::moveSeedPointsAndPathPoints ( double  dx,
double  dy,
double  dz 
)

Moves all seed points and all path points by the given coordinates offset.

◆ moveSeedPointsAndPathPoints() [4/4]

void ml::CSO::moveSeedPointsAndPathPoints ( double  dx,
double  dy,
double  dz,
int  timepoint 
)

Moves all seed points and all path points by the given coordinates offset and sets it to the given timepoint.

◆ moveSingleSeedPoint()

void ml::CSO::moveSingleSeedPoint ( CSOSeedPoint sPoint,
double  dx,
double  dy,
double  dz 
)

Moves a certain seed point by the given coordinate offset.

◆ numGroups()

unsigned int ml::CSO::numGroups ( ) const
inline

Returns the number of groups this CSO is in.

Definition at line 213 of file CSO.h.

◆ numPathPointLists()

unsigned int ml::CSO::numPathPointLists ( ) const
inline

Returns the number of path point lists.

Definition at line 156 of file CSO.h.

◆ numSeedPoints()

unsigned int ml::CSO::numSeedPoints ( ) const
inline

Returns the number of seed points.

Definition at line 152 of file CSO.h.

◆ pathChanged()

void ml::CSO::pathChanged ( )

Sets any pre-computed values depending on the exact path to invalid.

◆ removeAllSeedAndPathPoints()

void ml::CSO::removeAllSeedAndPathPoints ( )

Removes all seed points and all path point lists from this CSO.

◆ removeFromAllGroups()

void ml::CSO::removeFromAllGroups ( )

Removes this CSO from all its groups.

◆ removeFromGroup()

void ml::CSO::removeFromGroup ( CSOGroup group,
bool  useUndoRedo = true 
)

Removes this CSO from the given group.

◆ removeSeedPoint()

void ml::CSO::removeSeedPoint ( CSOSeedPoint sPoint)

Removes the given seed point from this CSO.

◆ removeUserData()

void ml::CSO::removeUserData ( const std::string &  name)
inline

Removes a user data entry.

Definition at line 261 of file CSO.h.

◆ resortSeedPointsClockwise()

void ml::CSO::resortSeedPointsClockwise ( )
Deprecated:
calls reverseSeedPointOrder

◆ reverseSeedPointOrder()

void ml::CSO::reverseSeedPointOrder ( )

Reverses the order of all seed points and clears all path points in between.

◆ saveAttributes()

bool ml::CSO::saveAttributes ( std::ostream &  outStream,
bool  useAscii = false 
)

Save attributes to stream and returns whether the saving was successful.

◆ setAbsoluteMovementCommand()

void ml::CSO::setAbsoluteMovementCommand ( double  fromX,
double  fromY,
double  fromZ,
double  toX,
double  toY,
double  toZ,
int  fromTimePointIndex,
int  toTimePointIndex 
)

Sets the absolute movement for undo/redo.

◆ setAbsoluteSeedPointMovementCommand()

void ml::CSO::setAbsoluteSeedPointMovementCommand ( )

Sets the absolute movement of a single seed point for undo/redo.

◆ setAllValuesTo()

void ml::CSO::setAllValuesTo ( float  value)

Sets all position values to the given value.

◆ setAttributesFrom()

void ml::CSO::setAttributesFrom ( const CSO *const  cso)

Copies all attributes from the given CSO to this one.

◆ setCreatorId()

void ml::CSO::setCreatorId ( int  id)
inline

Sets the creator ID of the CSO. This is set by the Processor, which generates this CSO.

Definition at line 245 of file CSO.h.

◆ setCSOList()

void ml::CSO::setCSOList ( CSOList csoList)

Sets the internal pointer to the embracing CSOList. Note that this method does not alter this CSO's unique id, so it may become invalid (not unique) in the new CSOList.

◆ setDescription()

void ml::CSO::setDescription ( std::string  description)

Sets the description of this CSO.

◆ setEditableState()

void ml::CSO::setEditableState ( bool  state)

Sets the 'editable' state of this CSO.

◆ setId()

void ml::CSO::setId ( unsigned int  newId)

Sets the unique ID of this CSO.

The internal unique id counter of the CSOList is not incremented. If the manually given id is unique, the CSO can still be retrieved by 'getCSOById' from the CSOList.

◆ setInitialSeedAndPathPointsNoEvent()

void ml::CSO::setInitialSeedAndPathPointsNoEvent ( unsigned int  numSeedPoints,
bool  isClosed = true 
)

See setSeedAndPathPoints, but faster because no events are emitted and no checks are done, an empty CSO is expected.

◆ setInsertRemoveSeedPointCommand()

void ml::CSO::setInsertRemoveSeedPointCommand ( )

Triggers the according undo/redo command to be put on the stack.

◆ setIsClosed()

void ml::CSO::setIsClosed ( bool  isClosed)

Sets the closed state of this contour.

Besides setting the closed state, the method also inserts a new CSOPathPoint list between the last and the first seed point, as well as connecting those via pointers. If you just want to set the closed state without any side effects, use the method setPrivateIsClosed().

◆ setIsFinished()

void ml::CSO::setIsFinished ( bool  isFinished)
inline

Sets the finished status of this contour. Note that the finished status is set to 'true' if the contour is set to isClosed = true.

Definition at line 312 of file CSO.h.

◆ setIsInPlane()

void ml::CSO::setIsInPlane ( bool  status)
inline

Sets the plane normal status for this CSO.

Note that a CSO forming a straight line is not considered to be 'in plane' as it lies in an infinite number of planes.

Definition at line 286 of file CSO.h.

◆ setLabel()

void ml::CSO::setLabel ( const std::string &  label)

Sets the label of this CSO.

◆ setNeedInterpolation()

void ml::CSO::setNeedInterpolation ( CSOSeedPoint seedPoint)
inline

Sets the need of being interpolated to the given seed point and to the CSO's state.

Definition at line 324 of file CSO.h.

References ml::CSOSeedPoint::setNeedsInterpolation().

◆ setNeedInterpolationAllSeedPoints()

void ml::CSO::setNeedInterpolationAllSeedPoints ( bool  needsInterpolation)

Sets the need for interpolation to all member seed points.

◆ setNeedsInterpolation()

void ml::CSO::setNeedsInterpolation ( bool  needsInterpolation)
inline

Sets if this CSO needs interpolation.

Definition at line 316 of file CSO.h.

◆ setPathPointAlpha()

void ml::CSO::setPathPointAlpha ( float  alpha)

Sets the alpha value of the path points.

◆ setPathPointColor()

void ml::CSO::setPathPointColor ( const Vector3 color)

Sets the color of the path points.

◆ setPathPointStyle() [1/2]

void ml::CSO::setPathPointStyle ( CSOPathPointsStyle  style)

Sets the style of the path points.

◆ setPathPointStyle() [2/2]

void ml::CSO::setPathPointStyle ( int  style)
inline

Sets the style of the path points as an int.

Definition at line 375 of file CSO.h.

References setPathPointStyle().

Referenced by setPathPointStyle().

◆ setPathPointWidth()

void ml::CSO::setPathPointWidth ( float  width)

Sets the width of the path points.

◆ setPlaneNormal()

void ml::CSO::setPlaneNormal ( const Vector3 planeNormal)
inline

Sets the plane normal which becomes valid by this.

Definition at line 288 of file CSO.h.

◆ setPrivateBoundingBox()

void ml::CSO::setPrivateBoundingBox ( const CSOBoundingBox bb)
inline

Sets the bounding box of this CSO.

Definition at line 462 of file CSO.h.

◆ setPrivateIsClosed()

void ml::CSO::setPrivateIsClosed ( bool  isClosedP)
inline

Sets the 'isClosed' flag without any side effects.

Definition at line 458 of file CSO.h.

◆ setPrivateIsFinished()

void ml::CSO::setPrivateIsFinished ( bool  isFinished)
inline

Sets the 'isFinished' flag without any side effects.

Definition at line 456 of file CSO.h.

◆ setPrivateIsInPlane()

void ml::CSO::setPrivateIsInPlane ( bool  isInPlaneP)
inline

Sets the 'isInPlane' flag without any side effects.

Definition at line 460 of file CSO.h.

◆ setPrivatePlaneNormal()

void ml::CSO::setPrivatePlaneNormal ( const Vector3 normal)
inline

Sets the plane normal of this CSO.

Definition at line 464 of file CSO.h.

◆ setSeedAndPathPoints()

void ml::CSO::setSeedAndPathPoints ( unsigned int  numSeedPoints,
bool  isClosed = true 
)

Generates the given number of seed points and path point lists between those.

The seed points are all set to position 0,0,0 initially. The CSO is closed by default. If there were seed and path points before, those are cleared.

◆ setSeedPointAlpha()

void ml::CSO::setSeedPointAlpha ( float  alpha)

Sets the alpha value of the seed points.

◆ setSeedPointColor()

void ml::CSO::setSeedPointColor ( const Vector3 color)

Sets the color of the seed points.

◆ setSeedPointsAndPathPoints()

void ml::CSO::setSeedPointsAndPathPoints ( const CSO cso)

Sets the seed points and the path point of the given CSO.

◆ setSeedPointSelectedAt()

void ml::CSO::setSeedPointSelectedAt ( unsigned int  index)

Sets the seed point at the given index selected.

◆ setSeedPointSize()

void ml::CSO::setSeedPointSize ( float  size)

Sets the size of the seed points.

◆ setSeedPointStyle()

void ml::CSO::setSeedPointStyle ( int  style)

Sets the style of the seed points.

◆ setSelectedSeedPoint()

void ml::CSO::setSelectedSeedPoint ( CSOSeedPoint sPoint)

Sets the given seed point as being selected, and deselects all previously selected seed points.

◆ setShowState()

void ml::CSO::setShowState ( bool  state)

Sets the 'show' status of this CSO.

◆ setSubType()

void ml::CSO::setSubType ( const std::string &  subtype)
inline

Sets the subtype of the CSO. This is set by the Processor, which generates this CSO.

Definition at line 241 of file CSO.h.

◆ setTimePointIndex()

void ml::CSO::setTimePointIndex ( MLint  index)

Sets the time point index of this CSO.

◆ setType()

void ml::CSO::setType ( const std::string &  type)
inline

Sets the type of the CSO. This is set by the Processor, which generates this CSO.

Definition at line 237 of file CSO.h.

◆ setUserData()

void ml::CSO::setUserData ( const std::string &  name,
Variant  value 
)
inline

Sets or adds a user data value under the given name.

Definition at line 255 of file CSO.h.

◆ setVoxelizeState()

void ml::CSO::setVoxelizeState ( bool  state)

Sets the 'voxelize' state of this CSO.

◆ setVoxelWriteMode()

void ml::CSO::setVoxelWriteMode ( int  mode)

Sets the voxel write mode of this CSO.

◆ setVoxelWriteValue()

void ml::CSO::setVoxelWriteValue ( float  value)

Sets the voxel write value of this CSO.

◆ storeInUndoManager()

void ml::CSO::storeInUndoManager ( )
inline

Stores the geometric information of the CSO in the UndoRedo manager.

Definition at line 73 of file CSO.h.

◆ storeVisualAttributesInUndoManager()

void ml::CSO::storeVisualAttributesInUndoManager ( )

◆ swapPoints()

void ml::CSO::swapPoints ( CSO other)

Swaps the seed and path points of two cso. No events are emitted.

Friends And Related Function Documentation

◆ CSOList

friend class CSOList
friend

Definition at line 600 of file CSO.h.


The documentation for this class was generated from the following file: