33 this->m_Contours.clear();
38 this->InitializeTimeGeometry(1);
44 this->m_Contours.push_back(&contourModel);
45 m_UpdateBoundingBox =
true;
50 this->m_Contours.push_back(contourModel);
51 m_UpdateBoundingBox =
true;
56 if (index >= 0 && static_cast<ContourModelListType::size_type>(index) < this->m_Contours.size())
58 return this->m_Contours.at(index).GetPointer();
68 return this->m_Contours.empty();
73 return &(this->m_Contours);
78 auto it = this->m_Contours.begin();
80 auto end = this->m_Contours.end();
85 if ((*it) == contourModel)
87 this->m_Contours.erase(it);
88 m_UpdateBoundingBox =
true;
100 if (index >= 0 && static_cast<ContourModelListType::size_type>(index) < this->m_Contours.size())
102 this->m_Contours.erase(this->m_Contours.begin() + index);
103 m_UpdateBoundingBox =
true;
114 this->m_Contours.clear();
115 m_UpdateBoundingBox =
true;
120 if (this->GetSource())
122 this->GetSource()->UpdateOutputInformation();
125 if (this->m_UpdateBoundingBox)
131 typedef itk::BoundingBox<unsigned long, 3, ScalarType>
BoundingBoxType;
132 typedef BoundingBoxType::PointsContainer PointsContainer;
134 int timesteps = this->GetTimeSteps();
137 for (
int currenTimeStep = 0; currenTimeStep < timesteps; currenTimeStep++)
140 if (this->GetMTime() > this->GetGeometry(currenTimeStep)->GetBoundingBox()->GetMTime())
153 auto contoursIt = this->Begin();
154 auto contoursEnd = this->End();
156 while (contoursIt != contoursEnd)
158 auto it = contoursIt->GetPointer()->Begin(currenTimeStep);
159 auto end = contoursIt->GetPointer()->End(currenTimeStep);
164 Point3D currentP = (*it)->Coordinates;
166 p.CastFrom(currentP);
167 points->InsertElement(points->Size(), p);
176 boundingBox->SetPoints(points);
177 boundingBox->ComputeBoundingBox();
179 mitkBounds[0] = tmp[0];
180 mitkBounds[1] = tmp[1];
181 mitkBounds[2] = tmp[2];
182 mitkBounds[3] = tmp[3];
183 mitkBounds[4] = tmp[4];
184 mitkBounds[5] = tmp[5];
187 BaseGeometry *geometry3d = this->GetGeometry(currenTimeStep);
192 this->m_UpdateBoundingBox =
false;
194 GetTimeGeometry()->Update();
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
itk::SmartPointer< Self > Pointer
Base of all data objects.
virtual void UpdateOutputInformation() override
Update the OutputInformation of a ContourModel object.
virtual bool RemoveContourModel(mitk::ContourModel *contourModel)
Remove the given ContourModel from the container if exists.
std::deque< mitk::ContourModel::Pointer > ContourModelListType
DataCollection - Class to facilitate loading/accessing structured data.
virtual 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 AddContourModel(mitk::ContourModel &contourModel)
Add a ContourModel to the container.
virtual bool RemoveContourModelAt(int index)
Remove a ContourModel at given index within the container if exists.
ContourModelListType * GetContourModelList()
Returns the container of the contours.
itk::BoundingBox< unsigned long, 3, mitk::ScalarType > BoundingBoxType
virtual ~ContourModelSet()
void SetBounds(const BoundsArrayType &bounds)
Set the bounding box (in index/unit coordinates)
bool IsEmpty() const override
Returns a bool whether the container is empty or not.
itk::SmartPointer< Self > Pointer
virtual void Clear() override
Clear the storage container.
virtual mitk::ContourModel * GetContourModelAt(int index) const
Returns the ContourModel a given index.
virtual void InitializeTimeGeometry(unsigned int timeSteps=1)
Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and eve...
BaseGeometry Describes the geometry of a data object.
BoundingBoxType::BoundsArrayType BoundsArrayType
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.