boundingbox.hh
Go to the documentation of this file.
1 /* -*- mia-c++ -*-
2  *
3  * This file is part of MIA - a toolbox for medical image analysis
4  * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5  *
6  * MIA is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifndef __mia_2d_boundingbox_hh
22 #define __mia_2d_boundingbox_hh
23 
24 #include <mia/2d/vector.hh>
25 #include <mia/2d/defines2d.hh>
26 
27 
29 
32 
33 
39 public:
41 
47  C2DBoundingBox(const C2DFVector& begin, const C2DFVector& end);
48 
53  void unite(const C2DBoundingBox& other);
54 
59  void add(const C2DFVector& point);
60 
61 
63  C2DIVector get_grid_begin() const;
64 
66  C2DIVector get_grid_end() const;
67 
69  C2DBounds get_grid_size() const;
70 
72  C2DFVector get_begin() const;
73 
75  C2DFVector get_end() const;
76 
78  C2DFVector get_size() const;
79 
80 
84  void enlarge(float boundary);
85 
86 
88  bool empty() const;
89 
90 private:
91  bool m_empty;
92  C2DFVector m_begin;
93  C2DFVector m_end;
94 };
95 
97 
98 #endif
T2DVector< int > C2DIVector
a 2D int vector
Definition: boundingbox.hh:31
a 2D vector
Definition: 2d/vector.hh:46
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define EXPORT_2D
Definition: defines2d.hh:37
2D axis orthothogonal bounding box.
Definition: boundingbox.hh:38
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36