19 typedef BoundingBox::PointsContainer ContainerType;
20 ContainerType::Pointer points = ContainerType::New();
45 FillVector3D(cornerpoint, bounds[0], bounds[2], bounds[4]);
48 FillVector3D(cornerpoint, bounds[0], bounds[2], bounds[5]);
51 FillVector3D(cornerpoint, bounds[0], bounds[3], bounds[4]);
54 FillVector3D(cornerpoint, bounds[0], bounds[3], bounds[5]);
57 FillVector3D(cornerpoint, bounds[1], bounds[2], bounds[4]);
60 FillVector3D(cornerpoint, bounds[1], bounds[2], bounds[5]);
63 FillVector3D(cornerpoint, bounds[1], bounds[3], bounds[4]);
66 FillVector3D(cornerpoint, bounds[1], bounds[3], bounds[5]);
70 itkExceptionMacro(<<
"A cube only has 8 corners. These are labeled 0-7.");
86 cornerpoint[0] = (xFront ? bounds[0] : bounds[1]);
87 cornerpoint[1] = (yFront ? bounds[2] : bounds[3]);
88 cornerpoint[2] = (zFront ? bounds[4] : bounds[5]);
102 return diagonalvector.GetSquaredNorm();
118 typedef BoundingBox::PointsContainer ContainerType;
120 unsigned long lastModifiedTime = 0;
121 unsigned long currentModifiedTime = 0;
123 ContainerType::Pointer points = ContainerType::New();
126 points->reserve(2*numberOfTimesteps);
127 for (
TimeStepType step = 0; step <numberOfTimesteps; ++step)
130 if (currentModifiedTime > lastModifiedTime)
131 lastModifiedTime = currentModifiedTime;
133 for (
int i = 0; i < 8; ++i)
136 points->push_back(cornerPoint);
141 if (this->GetMTime() < lastModifiedTime)
147 assert(direction < 3);
150 return bounds[direction * 2 + 1] - bounds[direction * 2];
170 os << indent <<
" TimeSteps: " << this->
CountTimeSteps() << std::endl;
173 os << indent <<
" GetGeometryForTimeStep(0): ";
175 os <<
"nullptr" << std::endl;
182 itk::LightObject::Pointer parent = Superclass::InternalClone();
186 mitkThrow() <<
" Downcast to type " << this->GetNameOfClass() <<
" failed.";
201 MITK_INFO <<
"[( TimeGeometry )] BoundingBoxInWorld differs.";
203 <<
" : leftHandSide is " << leftHandSide.
GetBoundsInWorld() <<
" and tolerance is " <<
eps;
212 MITK_INFO <<
"[( TimeGeometry )] CountTimeSteps differs.";
213 MITK_INFO <<
"rightHandSide is " << setprecision(12) << rightHandSide.
CountTimeSteps() <<
" : leftHandSide is " 223 MITK_INFO <<
"[( TimeGeometry )] MinimumTimePoint differs.";
234 MITK_INFO <<
"[( TimeGeometry )] MaximumTimePoint differs.";
250 MITK_INFO <<
"[( TimeGeometry )] TimeStepToTimePoint(" << t <<
") differs.";
260 if (leftGeometry.IsNotNull() && rightGeometry.IsNull())
262 if (leftGeometry.IsNull())
266 MITK_INFO <<
"[( TimeGeometry )] TimeStepToTimePoint(" << t <<
") differs.";
267 MITK_INFO <<
"rightHandSide is an object : leftHandSide is nullptr";
273 if (rightGeometry.IsNull())
277 MITK_INFO <<
"[( TimeGeometry )] TimeStepToTimePoint(" << t <<
") differs.";
278 MITK_INFO <<
"rightHandSide is nullptr : leftHandSide is an object";
284 if (!
mitk::Equal(*leftGeometry, *rightGeometry, eps, verbose))
288 MITK_INFO <<
"[( TimeGeometry )] GetGeometryForTimeStep(" << t <<
") differs.";
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBox
Standard 3D-BoundingBox typedef.
BoundingBox * GetBoundingBoxInWorld() const
Returns a bounding box that covers all time steps.
virtual TimeStepType CountTimeSteps() const =0
Returns the number of time steps.
Point3D GetCornerPointInWorld(int id) const
Get the position of the corner number id (in world coordinates)
void UpdateBoundingBox()
Updates the bounding box to cover the area used in all time steps.
Base class of all Operation-classes.
bool IsWorldPointInside(const mitk::Point3D &p) const
Test whether the point p (world coordinates in mm) is inside the bounding box.
virtual void Initialize()
Initializes the TimeGeometry.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
void FillVector3D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z)
Point3D GetCenterInWorld() const
Get the center of the bounding-box in mm.
void ExecuteOperation(Operation *op) override
Executes the given operation on all time steps.
virtual TimePointType TimeStepToTimePoint(TimeStepType timeStep) const =0
Converts a time step to a time point.
std::vcl_size_t TimeStepType
virtual TimePointType GetMaximumTimePoint() const =0
Returns the last time point for which the object is valid.
Point< ScalarType, 3 > Point3D
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
virtual void UpdateWithoutBoundingBox()
Updates everything except the Bounding box.
virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const =0
Returns the geometry which corresponds to the given time step.
MITKCORE_EXPORT const ScalarType eps
double GetDiagonalLengthInWorld() const
Get the length of the diagonal of the bounding-box in mm.
LightObject::Pointer InternalClone() const override
Makes a deep copy of the current object.
ScalarType GetExtentInWorld(unsigned int direction) const
Returns the Extend of the bounding in the given direction.
double GetDiagonalLength2InWorld() const
Get the squared length of the diagonal of the bounding-box in mm.
void Update()
Updates the geometry.
BoundingBox::BoundsArrayType GetBoundsInWorld() const
Returns the world bounds of the object that cover all time steps.
virtual TimePointType GetMinimumTimePoint() const =0
Returns the first time point for which the object is valid.
BoundingBox::Pointer m_BoundingBox
Contains a bounding box which includes all time steps.