12 #ifndef mitkContourElement_h
13 #define mitkContourElement_h
41 itkFactorylessNewMacro(Self);
51 : IsControlPoint(other.IsControlPoint), Coordinates(other.Coordinates)
304 bool m_IsClosed =
false;
#define MITKCONTOURMODEL_EXPORT
Represents a contour in 3D space. A ContourElement is consisting of linked vertices implicitly defini...
ConstVertexIterator ConstIteratorBegin() const
Return a const iterator a the front.
VertexListType::const_iterator ConstVertexIterator
void Concatenate(const mitk::ContourElement *other, bool check)
Concatenate the contuor with a another contour. All vertices of the other contour will be cloned and ...
bool IsEmpty() const
Returns whether the contour element is empty.
const VertexType * GetVertexAt(VertexSizeType index) const
VertexListType m_Vertices
bool IsNearContour(const mitk::Point3D &point, float eps) const
Returns whether a given point is near a contour, according to eps.
ConstVertexIterator begin() const
Return a const iterator a the front. For easier support of stl functionality.
bool GetLineSegmentForPoint(const mitk::Point3D &point, float eps, mitk::ContourElement::VertexType *previousVertex, mitk::ContourElement::VertexType *nextVertex) const
VertexIterator end()
Return an iterator a the end. For easier support of stl functionality.
VertexListType::iterator VertexIterator
VertexType * GetControlVertexAt(const mitk::Point3D &point, float eps)
Returns the approximate nearest control vertex a given posoition in 3D space, if the clicked position...
std::deque< VertexType * > VertexListType
VertexType * BruteForceGetVertexAt(const mitk::Point3D &point, double eps, bool isControlPoint=false, int offset=0)
Returns the approximate nearest vertex a given position in 3D space. With the parameter 'isControlPoi...
void AddVertex(const mitk::Point3D &point, bool isControlPoint)
Add a vertex at the end of the contour.
bool RemoveVertexAt(VertexSizeType index)
Remove a vertex at given index within the container if exists.
void SetVertexAt(VertexSizeType pointId, const mitk::Point3D &point)
Set coordinates a given index.
int BruteForceGetVertexIndexAt(const mitk::Point3D &point, double eps, VertexListType verticesList)
Returns the index of the approximate nearest vertex of a given position in 3D space.
VertexSizeType GetIndex(const VertexType *vertex) const
Returns the index of the given vertex within the contour.
bool IsClosed() const
Returns if the conour is closed or not.
bool RemoveVertexAt(const mitk::Point3D &point, double eps)
Remove the approximate nearest vertex at given position in 3D space if one exists.
VertexIterator IteratorBegin()
Return an iterator a the front.
void Close()
Close the contour. Connect first with last element.
void SetVertexAt(VertexSizeType pointId, const VertexType *vertex)
Set vertex a given index (by copying the values).
mitkClassMacroItkParent(ContourElement, itk::LightObject)
void Open()
Open the contour. Disconnect first and last element.
VertexType * GetNextControlVertexAt(const mitk::Point3D &point, float eps)
Returns the next vertex to the approximate nearest vertex of a given position in 3D space.
VertexType * GetVertexAt(const mitk::Point3D &point, float eps)
Returns the approximate nearest vertex a given position in 3D space.
void RedistributeControlVertices(const VertexType *vertex, int period)
Uniformly redistribute control points with a given period (in number of vertices)
void Clear()
Clear the storage container.
VertexListType::size_type VertexSizeType
bool RemoveVertexByIterator(VertexListType::iterator &iter)
bool RemoveVertex(const VertexType *vertex)
Remove the given vertex from the container if exists.
VertexIterator IteratorEnd()
Return an iterator a the end.
ContourElement(const mitk::ContourElement &other)
void SetClosed(bool isClosed)
Set the contours IsClosed property.
VertexType * GetVertexAt(VertexSizeType index)
Returns the vertex a given index.
VertexType * GetPreviousControlVertexAt(const mitk::Point3D &point, float eps)
Returns the previous vertex to the approximate nearest vertex of a given position in 3D space.
const VertexListType * GetVertexList() const
Returns the container of the vertices.
void AddVertexAtFront(const mitk::Point3D &point, bool isControlPoint)
Add a vertex at the front of the contour.
bool GetLineSegmentForPoint(const mitk::Point3D &point, float eps, VertexSizeType &segmentStartIndex, VertexSizeType &segmentEndIndex, mitk::Point3D &closestContourPoint, bool findClosest=true) const
VertexListType GetControlVertices() const
void InsertVertexAtIndex(const mitk::Point3D &point, bool isControlPoint, VertexSizeType index)
Add a vertex at a given index of the contour.
VertexIterator begin()
Return an iterator a the front. For easier support of stl functionality.
VertexSizeType GetSize() const
Returns the number of contained vertices.
ConstVertexIterator end() const
Return a const iterator a the end. For easier support of stl functionality.
ConstVertexIterator ConstIteratorEnd() const
Return a const iterator a the end.
Find image slices visible on a given plane.
MITKCORE_EXPORT const ScalarType eps
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
Represents a single vertex of a contour.
ContourModelVertex(const mitk::Point3D &point, bool active=false)
ContourModelVertex(const ContourModelVertex &other)
bool IsControlPoint
Treat point special.
mitk::Point3D Coordinates
Coordinates in 3D space.