Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkTimeGeometry.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef TimeGeometry_h
18 #define TimeGeometry_h
19 
20 // ITK
21 #include <itkObject.h>
22 // MITK
23 #include "mitkOperationActor.h"
24 #include <MitkCoreExports.h>
25 #include <mitkBaseGeometry.h>
26 #include <mitkCommon.h>
27 
28 namespace mitk
29 {
31  typedef std::size_t TimeStepType;
32 
47  class MITKCORE_EXPORT TimeGeometry : public itk::Object, public OperationActor
48  {
49  protected:
50  TimeGeometry();
51  virtual ~TimeGeometry();
52 
57 
61  virtual LightObject::Pointer InternalClone() const override;
62 
63  public:
64  mitkClassMacroItkParent(TimeGeometry, itk::Object) itkCloneMacro(Self) itkCreateAnotherMacro(Self)
65 
74  virtual TimeStepType CountTimeSteps() const = 0;
82  virtual TimePointType GetMinimumTimePoint() const = 0;
89  virtual TimePointType GetMaximumTimePoint() const = 0;
90 
97  virtual TimePointType GetMinimumTimePoint(TimeStepType step) const = 0;
103  virtual TimePointType GetMaximumTimePoint(TimeStepType step) const = 0;
104 
108  virtual TimeBounds GetTimeBounds() const = 0;
109 
113  virtual TimeBounds GetTimeBounds(TimeStepType step) const = 0;
120  virtual bool IsValidTimePoint(TimePointType timePoint) const = 0;
128  virtual bool IsValidTimeStep(TimeStepType timeStep) const = 0;
129 
139  virtual TimePointType TimeStepToTimePoint(TimeStepType timeStep) const = 0;
149  virtual TimeStepType TimePointToTimeStep(TimePointType timePoint) const = 0;
150 
163  virtual BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const = 0;
176  virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const = 0;
177 
184  virtual BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const = 0;
185 
192  virtual void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) = 0;
193 
201  virtual void Expand(TimeStepType size) = 0;
202 
213  virtual void ReplaceTimeStepGeometries(const BaseGeometry *geometry) = 0;
214 
218  virtual bool IsValid() const = 0;
224  Point3D GetCornerPointInWorld(int id) const;
225 
231  Point3D GetCornerPointInWorld(bool xFront = true, bool yFront = true, bool zFront = true) const;
232 
236  Point3D GetCenterInWorld() const;
237 
241  double GetDiagonalLength2InWorld() const;
242 
246  double GetDiagonalLengthInWorld() const;
247 
251  bool IsWorldPointInside(const mitk::Point3D &p) const;
252 
260  void UpdateBoundingBox();
261 
265  BoundingBox *GetBoundingBoxInWorld() const { return m_BoundingBox; }
269  BoundingBox::BoundsArrayType GetBoundsInWorld() const { return m_BoundingBox->GetBounds(); }
273  ScalarType GetExtentInWorld(unsigned int direction) const;
274 
278  virtual void Initialize();
279 
283  void Update();
284 
291  virtual void UpdateWithoutBoundingBox(){};
292 
296  virtual void ExecuteOperation(Operation *op) override;
297 
298  virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override;
299  }; // end class TimeGeometry
300 
319  MITKCORE_EXPORT bool Equal(const mitk::TimeGeometry &leftHandSide,
320  const mitk::TimeGeometry &rightHandSide,
321  ScalarType eps,
322  bool verbose);
323 
324 } // end namespace MITK
325 #endif // TimeGeometry_h
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBox
Standard 3D-BoundingBox typedef.
itk::SmartPointer< Self > Pointer
#define MITKCORE_EXPORT
itk::FixedArray< ScalarType, 2 > TimeBounds
Standard typedef for time-bounds.
Base class of all Operation-classes.
Definition: mitkOperation.h:33
double ScalarType
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35
DataCollection - Class to facilitate loading/accessing structured data.
abstract class, that can be used by Undo to undo an operation.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
mitk::ScalarType TimePointType
std::vcl_size_t TimeStepType
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.
BoundingBox::BoundsArrayType GetBoundsInWorld() const
Returns the world bounds of the object that cover all time steps.
MITKCORE_EXPORT const ScalarType eps
BoundingBox::Pointer m_BoundingBox
Contains a bounding box which includes all time steps.
BaseGeometry Describes the geometry of a data object.
BoundingBoxType::BoundsArrayType BoundsArrayType