12 #ifndef mitkContourModel_h
13 #define mitkContourModel_h
52 itkFactorylessNewMacro(Self);
78 void Deselect() { this->m_SelectedVertex =
nullptr; }
83 if (this->m_SelectedVertex)
85 m_SelectedVertex->IsControlPoint = isControlPoint;
94 this->m_lineInterpolation = interpolation;
302 bool findClosest =
true)
const;
424 void Expand(
unsigned int timeSteps)
override;
#define MITKCONTOURMODEL_EXPORT
Base of all data objects.
VertexListType::const_iterator ConstVertexIterator
VertexListType::iterator VertexIterator
std::deque< VertexType * > VertexListType
VertexListType::size_type VertexSizeType
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
void InsertVertexAtIndex(const Point3D &vertex, int index, bool isControlPoint=false, TimeStepType timestep=0)
Insert a vertex at given index.
void Concatenate(ContourModel *other, TimeStepType timestep=0, bool check=false)
Concatenate two contours. The starting control point of the other will be added at the end of the con...
void UpdateContour(const ContourModel *sourceModel, TimeStepType destinationTimeStep, TimeStepType sourceTimeStep)
VertexIterator Begin(TimeStepType timestep=0) const
Returns a const VertexIterator at the start element of the contour.
bool GetLineSegmentForPoint(Point3D &point, float eps, TimeStepType timestep, mitk::ContourElement::VertexType *previousVertex=nullptr, mitk::ContourElement::VertexType *nextVertex=nullptr)
LineSegmentInterpolation GetLineSegmentInterpolation()
Get the interpolation of the line segments between control points.
void AddVertex(const Point3D &vertex, TimeStepType timestep=0)
Add a vertex to the contour at given timestep. The vertex is added at the end of contour.
int GetIndex(const VertexType *vertex, TimeStepType timestep=0)
Remove a vertex at given timestep within the container.
ContourElement::VertexType VertexType
const VertexType * GetVertexAt(mitk::Point3D &point, float eps, TimeStepType timestep) const
void AddVertexAtFront(const Point3D &vertex, TimeStepType timestep=0)
Add a vertex to the contour at given timestep AT THE FRONT of the contour. The vertex is added at the...
static void ShiftVertex(VertexType *vertex, Vector3D &vector)
void AddVertexAtFront(const Point3D &vertex, bool isControlPoint, TimeStepType timestep=0)
Add a vertex to the contour at given timestep AT THE FRONT of the contour.
virtual bool IsEmpty(TimeStepType timestep) const
Returns whether the contour model is empty at a given timestep.
LineSegmentInterpolation m_lineInterpolation
mitkClassMacro(ContourModel, BaseData)
virtual void SetClosed(bool isClosed, TimeStepType timestep=0)
Set closed property to given boolean.
VertexType * GetSelectedVertex()
Get the current selected vertex.
ContourElement::VertexIterator VertexIterator
virtual const VertexType * GetVertexAt(int index, TimeStepType timestep=0) const
Returns the vertex at the index position within the container. If the index or timestep is invalid a ...
void SetRequestedRegionToLargestPossibleRegion() override
Inherit from base data - no region support available for contourModel objects.
std::vector< ContourElement::Pointer > ContourModelSeries
ContourModelSeries m_ContourSeries
virtual void Clear(TimeStepType timestep)
Clear the storage container at given timestep.
bool IsEmpty() const override
Returns whether the contour model is empty.
virtual void Open(TimeStepType timestep=0)
Set isClosed to false contour. The link between the last control point the first point will be remove...
virtual void RedistributeControlVertices(int period, TimeStepType timestep)
Redistributes control vertices with a given period (as number of vertices)
ContourElement::VertexListType VertexListType
virtual const VertexType * GetPreviousControlVertexAt(mitk::Point3D &point, float eps, TimeStepType timestep) const
void ShiftContour(Vector3D &translate, TimeStepType timestep=0)
Shift the whole contour by a translation vector at given timestep.
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Inherit from base data - no region support available for contourModel objects.
VertexListType GetControlVertices(TimeStepType timestep)
Returns a list pointing to all vertices that are indicated to be control points.
void ShiftSelectedVertex(Vector3D &translate)
Shift the currently selected vertex by a translation vector.
void Initialize() override
Initialize all data objects.
void AddVertexAtFront(const VertexType &vertex, TimeStepType timestep=0)
Add a vertex to the contour at given timestep AT THE FRONT of the contour. The vertex is added at the...
bool SetControlVertexAt(Point3D &point, float eps, TimeStepType timestep=0)
void Deselect()
Deselect vertex.
bool RemoveVertexAt(Point3D &point, float eps, TimeStepType timestep=0)
Remove a vertex at a query position in 3D space.
void SetLineSegmentInterpolation(LineSegmentInterpolation interpolation)
Set the interpolation of the line segments between control points.
void ExecuteOperation(Operation *operation) override
overwrite if the Data can be called by an Interactor (StateMachine).
VertexIterator IteratorBegin(TimeStepType timestep=0) const
Returns a const VertexIterator at the start element of the contour.
bool IsNearContour(Point3D &point, float eps, TimeStepType timestep) const
Check if mouse cursor is near the contour.
int GetNumberOfVertices(TimeStepType timestep=0) const
Returns the number of vertices at a given timestep.
void Clear() override
Clear the storage container.
void ClearData() override
reset to non-initialized state, release memory
bool SelectControlVertexAt(const Point3D &point, float eps, TimeStepType timestep=0)
Mark a control vertex at a given position in 3D space.
void SetRequestedRegion(const itk::DataObject *data) override
Inherit from base data - no region support available for contourModel objects.
void Initialize(const ContourModel &other)
Initialize object with specs of other contour. Note: No data will be copied.
virtual const VertexType * GetNextControlVertexAt(mitk::Point3D &point, float eps, TimeStepType timestep) const
void AddVertex(const VertexType &vertex, TimeStepType timestep=0)
Add a vertex to the contour at given timestep. A copy of the passed vertex is added at the end of con...
bool IsEmptyTimeStep(unsigned int t) const override
Check if there isn't something at this timestep.
bool IsClosed(int timestep=0) const
Return if the contour is closed or not.
void AddVertex(const Point3D &vertex, bool isControlPoint, TimeStepType timestep=0)
Add a vertex to the contour.
ContourModel(const ContourModel &other)
void SetSelectedVertexAsControlPoint(bool isControlPoint=true)
Set selected vertex as control point.
VertexType * m_SelectedVertex
void UpdateOutputInformation() override
Update the OutputInformation of a ContourModel object.
bool GetLineSegmentForPoint(const mitk::Point3D &point, float eps, TimeStepType timestep, ContourElement::VertexSizeType &segmentStartIndex, ContourElement::VertexSizeType &segmentEndIndex, mitk::Point3D &closestContourPoint, bool findClosest=true) const
bool RemoveVertexAt(int index, TimeStepType timestep=0)
Remove a vertex at given index within the container.
void Expand(unsigned int timeSteps) override
Expand the contour model and its TimeGeometry to given number of timesteps.
bool SetVertexAt(int pointId, const VertexType *vertex, TimeStepType timestep=0)
Set a coordinates and control state for point at given index.
bool RemoveVertex(const VertexType *vertex, TimeStepType timestep=0)
Remove a vertex at given timestep within the container.
bool SetVertexAt(int pointId, const Point3D &point, TimeStepType timestep=0)
Set a coordinates for point at given index.
bool SelectVertexAt(const Point3D &point, float eps, TimeStepType timestep=0)
Mark a vertex at a given position in 3D space.
LineSegmentInterpolation
Possible interpolation of the line segments between control points.
VertexIterator End(TimeStepType timestep=0) const
Returns a const VertexIterator at the end element of the contour.
void InitializeEmpty() override
Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least creat...
virtual void Close(TimeStepType timestep=0)
Close the contour. The last control point will be linked with the first point.
VertexIterator IteratorEnd(TimeStepType timestep=0) const
Returns a const VertexIterator at the end element of the contour.
VertexListType GetVertexList(TimeStepType timestep)
Returns the container of the vertices.
bool VerifyRequestedRegion() override
Inherit from base data - no region support available for contourModel objects.
bool SelectVertexAt(int index, TimeStepType timestep=0)
Mark a vertex at an index in the container as selected.
ContourElement::ConstVertexIterator ConstVertexIterator
bool SetControlVertexAt(int index, TimeStepType timestep=0)
Mark a vertex at an index in the container as control point.
Base class of all Operation-classes.
Find image slices visible on a given plane.
MITKCORE_EXPORT const ScalarType eps
itkEventMacroDeclaration(BoundingShapeInteractionEvent, itk::AnyEvent)
Represents a single vertex of a contour.