46 this->InvokeEvent(ContourModelSizeChangeEvent());
57 this->InvokeEvent(ContourModelSizeChangeEvent());
65 if (vertex !=
nullptr)
67 this->
m_ContourSeries[timestep]->AddVertex(*const_cast<VertexType *>(vertex));
83 this->
m_ContourSeries[timestep]->AddVertexAtFront(vertex, isControlPoint);
84 this->InvokeEvent(ContourModelSizeChangeEvent());
95 this->InvokeEvent(ContourModelSizeChangeEvent());
105 if (pointId >= 0 && this->
m_ContourSeries[timestep]->GetSize() > pointId)
119 if (vertex ==
nullptr)
124 if (pointId >= 0 && this->
m_ContourSeries[timestep]->GetSize() > pointId)
142 this->
m_ContourSeries[timestep]->InsertVertexAtIndex(vertex, isControlPoint, index);
143 this->InvokeEvent(ContourModelSizeChangeEvent());
196 this->InvokeEvent(ContourModelClosedEvent());
207 this->InvokeEvent(ContourModelClosedEvent());
218 this->InvokeEvent(ContourModelClosedEvent());
245 this->InvokeEvent(ContourModelSizeChangeEvent());
265 mitkThrow() <<
"No iterator at invalid timestep " << timestep <<
". There are only " << this->
GetTimeSteps()
266 <<
" timesteps available.";
283 mitkThrow() <<
"No iterator at invalid timestep " << timestep <<
". There are only " << this->
GetTimeSteps()
284 <<
" timesteps available.";
320 if (vertex !=
nullptr)
334 if (vertex !=
nullptr)
351 this->InvokeEvent(ContourModelSizeChangeEvent());
366 this->InvokeEvent(ContourModelSizeChangeEvent());
381 this->InvokeEvent(ContourModelSizeChangeEvent());
403 auto it = vList->begin();
404 auto end = vList->end();
415 this->InvokeEvent(ContourModelShiftEvent());
442 if (static_cast<std::size_t>(timeSteps) > oldSize)
444 Superclass::Expand(timeSteps);
447 for (std::size_t i = oldSize; i < static_cast<std::size_t>(timeSteps); i++)
452 this->InvokeEvent(ContourModelExpandTimeBoundsEvent());
475 return Superclass::GetUpdatedGeometry(t);
480 return Superclass::GetGeometry(t);
502 this->InvokeEvent(ContourModelClosedEvent());
511 Superclass::ClearData();
529 for (
mitk::TimeStepType currentTimestep = 0; currentTimestep < numberOfTimesteps; currentTimestep++)
558 this->
GetSource()->UpdateOutputInformation();
567 typedef itk::BoundingBox<unsigned long, 3, ScalarType>
BoundingBoxType;
568 typedef BoundingBoxType::PointsContainer PointsContainer;
573 for (
int currenTimeStep = 0; currenTimeStep < timesteps; currenTimeStep++)
575 if (dynamic_cast<mitk::PlaneGeometry *>(this->
GetGeometry(currenTimeStep)))
592 BoundingBoxType::Pointer boundingBox = BoundingBoxType::New();
594 PointsContainer::Pointer points = PointsContainer::New();
602 Point3D currentP = (*it)->Coordinates;
603 BoundingBoxType::PointType p;
604 p.CastFrom(currentP);
605 points->InsertElement(points->Size(), p);
611 boundingBox->SetPoints(points);
612 boundingBox->ComputeBoundingBox();
614 mitkBounds[0] = tmp[0];
615 mitkBounds[1] = tmp[1];
616 mitkBounds[2] = tmp[2];
617 mitkBounds[3] = tmp[3];
618 mitkBounds[4] = tmp[4];
619 mitkBounds[5] = tmp[5];
int GetNumberOfVertices(int timestep=0) const
Returns the number of vertices at a given timestep.
bool RemoveVertexAt(int index, int timestep=0)
Remove a vertex at given index within the container.
itk::SmartPointer< mitk::BaseDataSource > GetSource() const
Get the process object that generated this data object.
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
virtual TimeStepType CountTimeSteps() const =0
Returns the number of time steps.
void UpdateOutputInformation() override
Update the OutputInformation of a ContourModel object.
virtual const VertexType * GetVertexAt(int index, int timestep=0) const
Returns the vertex at the index position within the container.
void Concatenate(mitk::ContourModel *other, int timestep=0, bool check=false)
Concatenate two contours. The starting control point of the other will be added at the end of the con...
virtual void SetClosed(bool isClosed, int timestep=0)
Set closed property to given boolean.
mitk::Point3D Coordinates
Coordinates in 3D space.
void ShiftVertex(VertexType *vertex, mitk::Vector3D &vector)
void Initialize() override
Initialize all data objects.
Base of all data objects.
bool VerifyRequestedRegion() override
Inherit from base data - no region support available for contourModel objects.
Base class of all Operation-classes.
mitk::ContourElement::VertexIterator VertexIterator
DataCollection - Class to facilitate loading/accessing structured data.
bool IsControlPoint
Treat point special.
bool SelectVertexAt(int index, int timestep=0)
Mark a vertex at an index in the container as selected.
VertexIterator Begin(int timestep=0) const
Returns a const VertexIterator at the start element of the contour.
void SetRequestedRegionToLargestPossibleRegion() override
Inherit from base data - no region support available for contourModel objects.
void AddVertex(mitk::Point3D &vertex, int timestep=0)
Add a vertex to the contour at given timestep. The vertex is added at the end of contour.
virtual bool IsNearContour(mitk::Point3D &point, float eps, int timestep)
Check if mouse cursor is near the contour.
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
VertexType * GetSelectedVertex()
Get the current selected vertex.
virtual void Close(int timestep=0)
Close the contour. The last control point will be linked with the first point.
virtual const mitk::BaseGeometry * GetUpdatedGeometry(int t=0)
Get the updated geometry with recomputed bounds.
virtual mitk::BaseGeometry * GetGeometry(int t=0) const
Get the BaseGeometry for timestep t.
int GetIndex(const VertexType *vertex, int timestep=0)
Remove a vertex at given timestep within the container.
ContourModelSeries m_ContourSeries
bool IsEmptyTimeStep(unsigned int t) const override
Check if there isn't something at this timestep.
void Expand(unsigned int timeSteps) override
Expand the timebounds of the TimeGeometry to given number of timesteps.
bool IsEmpty() const override
Returns whether the contour model is empty.
void ClearData() override
reset to non-initialized state, release memory
itk::BoundingBox< unsigned long, 3, mitk::ScalarType > BoundingBoxType
void SetRequestedRegion(const itk::DataObject *data) override
Inherit from base data - no region support available for contourModel objects.
void ShiftSelectedVertex(mitk::Vector3D &translate)
Shift the currently selected vertex by a translation vector.
VertexIterator IteratorEnd(int timestep=0) const
Returns a const VertexIterator at the end element of the contour.
std::vcl_size_t TimeStepType
bool IsClosed(int timestep=0) const
Return if the contour is closed or not.
unsigned long GetMTime() const override
Get the modified time of the last change of the contents this data object or its geometry.
void ShiftContour(mitk::Vector3D &translate, int timestep=0)
Shift the whole contour by a translation vector at given timestep.
void Clear() override
Clear the storage container.
VertexIterator End(int timestep=0) const
Returns a const VertexIterator at the end element of the contour.
virtual void RedistributeControlVertices(int period, int timestep)
Redistributes ontrol vertices with a given period (as number of vertices)
void ExecuteOperation(Operation *operation) override
overwrite if the Data can be called by an Interactor (StateMachine).
void SetBounds(const BoundsArrayType &bounds)
Set the bounding box (in index/unit coordinates)
VertexType * m_SelectedVertex
LineSegmentInterpolation m_lineInterpolation
void InitializeEmpty() override
Pure virtual; Must be used in subclasses to get a data object to a valid state. Should at least creat...
bool RequestedRegionIsOutsideOfTheBufferedRegion() override
Inherit from base data - no region support available for contourModel objects.
MITKCORE_EXPORT const ScalarType eps
unsigned int GetTimeSteps() const
Get the number of time steps from the TimeGeometry As the base data has not a data vector given by it...
mitk::ContourElement::VertexListType VertexListType
void AddVertexAtFront(mitk::Point3D &vertex, int timestep=0)
Add a vertex to the contour at given timestep AT THE FRONT of the contour. The vertex is added at the...
VertexIterator IteratorBegin(int timestep=0) const
Returns a const VertexIterator at the start element of the contour.
void InsertVertexAtIndex(mitk::Point3D &vertex, int index, bool isControlPoint=false, int timestep=0)
Insert a vertex at given index.
bool RemoveVertex(const VertexType *vertex, int timestep=0)
Remove a vertex at given timestep within the container.
void Update()
Updates the geometry.
bool SetControlVertexAt(int index, int timestep=0)
Mark a vertex at an index in the container as control point.
Represents a single vertex of contour.
virtual void InitializeTimeGeometry(unsigned int timeSteps=1)
Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and eve...
bool SetVertexAt(int pointId, const mitk::Point3D &point, unsigned int timestep=0)
Set a coordinates for point at given index.
BaseGeometry Describes the geometry of a data object.
virtual void Open(int timestep=0)
Set isClosed to false contour. The link between the last control point the first point will be remove...
BoundingBoxType::BoundsArrayType BoundsArrayType