OpenWalnut  1.4.0
WGrid.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WGRID_H
26 #define WGRID_H
27 
28 #include <cstddef>
29 
30 #ifndef Q_MOC_RUN
31 #include <boost/shared_ptr.hpp>
32 #endif
33 
34 #include "../common/WBoundingBox.h"
35 
36 
37 // forward declarations
38 class WPropertyGroup;
39 
40 /**
41  * Base class to all grid types, e.g. a regular grid.
42  * \ingroup dataHandler
43  */
44 class WGrid // NOLINT
45 {
46 public:
47  /**
48  * Constructs a new WGrid instance.
49  * \param size number of positions in grid
50  */
51  explicit WGrid( size_t size );
52 
53  /**
54  * Since WGrid is a base class and thus should be polymorphic we add
55  * virtual destructor.
56  */
57  virtual ~WGrid();
58 
59  /**
60  * The number of positions in this grid.
61  *
62  * \return \copybrief WGrid::size()
63  */
64  size_t size() const;
65 
66  /**
67  * Axis aligned Bounding Box that encloses this grid.
68  *
69  * \return \copybrief WGrid::getBoundingBox()
70  */
71  virtual WBoundingBox getBoundingBox() const = 0;
72 
73  /**
74  * Returns a pointer to the information properties object of the grid. The grid intends these properties to not be modified.
75  *
76  * \return the properties.
77  */
78  boost::shared_ptr< WPropertyGroup > getInformationProperties() const;
79 
80 protected:
81  /**
82  * The property object for the grid containing only props whose purpose is "PV_PURPOSE_INFORMNATION". It is useful to define some property
83  * to only be of informational nature. The GUI does not modify them.
84  */
85  boost::shared_ptr< WPropertyGroup > m_infoProperties;
86 
87 private:
88  /**
89  * Stores the number of positions.
90  */
91  size_t m_size;
92 };
93 
94 #endif // WGRID_H
virtual ~WGrid()
Since WGrid is a base class and thus should be polymorphic we add virtual destructor.
Definition: WGrid.cpp:41
Base class to all grid types, e.g.
Definition: WGrid.h:44
WGrid(size_t size)
Constructs a new WGrid instance.
Definition: WGrid.cpp:33
Class to manage properties of an object and to provide convenience methods for easy access and manipu...
boost::shared_ptr< WPropertyGroup > getInformationProperties() const
Returns a pointer to the information properties object of the grid.
Definition: WGrid.cpp:50
size_t m_size
Stores the number of positions.
Definition: WGrid.h:91
virtual WBoundingBox getBoundingBox() const =0
Axis aligned Bounding Box that encloses this grid.
size_t size() const
The number of positions in this grid.
Definition: WGrid.cpp:45
boost::shared_ptr< WPropertyGroup > m_infoProperties
The property object for the grid containing only props whose purpose is "PV_PURPOSE_INFORMNATION".
Definition: WGrid.h:85