Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkUnstructuredGrid.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 _MITK_UNSTRUCTURED_GRID_H_
18 #define _MITK_UNSTRUCTURED_GRID_H_
19 
21 #include "itkImageRegion.h"
22 #include "mitkBaseData.h"
23 
24 class vtkUnstructuredGrid;
25 
26 namespace mitk
27 {
28  //##Documentation
29  //## @brief Class for storing unstructured grids (vtkUnstructuredGrid)
30  //## @ingroup Data
32  {
33  public:
34  // not yet the best choice of a region-type for surfaces, but it works for the time being
35  typedef itk::ImageRegion<5> RegionType;
36 
38 
39  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
40 
41  virtual void SetVtkUnstructuredGrid(vtkUnstructuredGrid *grid, unsigned int t = 0);
42 
43  virtual vtkUnstructuredGrid *GetVtkUnstructuredGrid(unsigned int t = 0);
44 
45  virtual void UpdateOutputInformation() override;
46 
47  virtual void SetRequestedRegionToLargestPossibleRegion() override;
48 
49  virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
50 
51  virtual bool VerifyRequestedRegion() override;
52 
53  virtual void SetRequestedRegion(const itk::DataObject *data) override;
54 
55  virtual void SetRequestedRegion(UnstructuredGrid::RegionType *region);
56 
57  virtual void Graft(const DataObject *data) override;
58 
59  virtual void CopyInformation(const itk::DataObject *data) override;
60 
61  virtual void Update() override;
62 
63  // Initialize should not be called manually;
64  // The polydata vector is initialized automatically when enlarged;
65  virtual void Expand(unsigned int timeSteps = 1) override;
66 
67  const RegionType &GetLargestPossibleRegion() const
68  {
69  m_LargestPossibleRegion.SetIndex(3, 0);
70  m_LargestPossibleRegion.SetSize(3, GetTimeGeometry()->CountTimeSteps());
71  return m_LargestPossibleRegion;
72  }
73 
74  //##Documentation
75  //## Get the region object that defines the size and starting index
76  //## for the region of the image requested (i.e., the region of the
77  //## image to be operated on by a filter).
78  virtual const RegionType &GetRequestedRegion() const { return m_RequestedRegion; }
79  void CalculateBoundingBox();
80 
81  protected:
82  mitkCloneMacro(Self);
83 
84  typedef std::vector<vtkUnstructuredGrid *> VTKUnstructuredGridSeries;
85 
87 
89 
90  virtual ~UnstructuredGrid();
91 
92  virtual void ClearData() override;
93 
94  virtual void InitializeEmpty() override;
95 
96  VTKUnstructuredGridSeries m_GridSeries;
97 
98  mutable RegionType m_LargestPossibleRegion;
99 
100  RegionType m_RequestedRegion;
101 
103  };
104 
105 } // namespace mitk
106 
107 #endif /* _MITK_UNSTRUCTURED_GRID_H_ */
Base of all data objects.
Definition: mitkBaseData.h:39
#define MITKDATATYPESEXT_EXPORT
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35
DataCollection - Class to facilitate loading/accessing structured data.
VTKUnstructuredGridSeries m_GridSeries
itk::ImageRegion< 5 > RegionType
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:162
std::vector< vtkUnstructuredGrid * > VTKUnstructuredGridSeries
Class for storing unstructured grids (vtkUnstructuredGrid)
virtual const RegionType & GetRequestedRegion() const