My Project
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 {
40 public:
42 
48  C2DBoundingBox(const C2DFVector& begin, const C2DFVector& end);
49 
54  void unite(const C2DBoundingBox& other);
55 
60  void add(const C2DFVector& point);
61 
62 
64  C2DIVector get_grid_begin() const;
65 
67  C2DIVector get_grid_end() const;
68 
70  C2DBounds get_grid_size() const;
71 
73  C2DFVector get_begin() const;
74 
76  C2DFVector get_end() const;
77 
79  C2DFVector get_size() const;
80 
81 
85  void enlarge(float boundary);
86 
87 
89  bool empty() const;
90 
91 private:
92  bool m_empty;
93  C2DFVector m_begin;
94  C2DFVector m_end;
95 };
96 
98 
99 #endif
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
C2DBoundingBox
2D axis orthothogonal bounding box.
Definition: boundingbox.hh:38
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36
T2DVector
a 2D vector
Definition: 2d/vector.hh:46
vector.hh
C2DIVector
T2DVector< int > C2DIVector
a 2D int vector
Definition: boundingbox.hh:31
EXPORT_2D
#define EXPORT_2D
Definition: defines2d.hh:37
defines2d.hh