OpenWalnut  1.5.0dev
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 #include <memory>
30 
31 
32 #include "../common/WBoundingBox.h"
33 
34 
35 // forward declarations
36 class WPropertyGroup;
37 
38 /**
39  * Base class to all grid types, e.g. a regular grid.
40  * \ingroup dataHandler
41  */
42 class WGrid // NOLINT
43 {
44 public:
45  /**
46  * Constructs a new WGrid instance.
47  * \param size number of positions in grid
48  */
49  explicit WGrid( size_t size );
50 
51  /**
52  * Since WGrid is a base class and thus should be polymorphic we add
53  * virtual destructor.
54  */
55  virtual ~WGrid();
56 
57  /**
58  * The number of positions in this grid.
59  *
60  * \return \copybrief WGrid::size()
61  */
62  size_t size() const;
63 
64  /**
65  * Axis aligned Bounding Box that encloses this grid.
66  *
67  * \return \copybrief WGrid::getBoundingBox()
68  */
69  virtual WBoundingBox getBoundingBox() const = 0;
70 
71  /**
72  * Returns a pointer to the information properties object of the grid. The grid intends these properties to not be modified.
73  *
74  * \return the properties.
75  */
76  std::shared_ptr< WPropertyGroup > getInformationProperties() const;
77 
78 protected:
79  /**
80  * The property object for the grid containing only props whose purpose is "PV_PURPOSE_INFORMNATION". It is useful to define some property
81  * to only be of informational nature. The GUI does not modify them.
82  */
83  std::shared_ptr< WPropertyGroup > m_infoProperties;
84 
85 private:
86  /**
87  * Stores the number of positions.
88  */
89  size_t m_size;
90 };
91 
92 #endif // WGRID_H
Base class to all grid types, e.g.
Definition: WGrid.h:43
std::shared_ptr< WPropertyGroup > m_infoProperties
The property object for the grid containing only props whose purpose is "PV_PURPOSE_INFORMNATION".
Definition: WGrid.h:83
virtual ~WGrid()
Since WGrid is a base class and thus should be polymorphic we add virtual destructor.
Definition: WGrid.cpp:40
virtual WBoundingBox getBoundingBox() const =0
Axis aligned Bounding Box that encloses this grid.
WGrid(size_t size)
Constructs a new WGrid instance.
Definition: WGrid.cpp:32
size_t size() const
The number of positions in this grid.
Definition: WGrid.cpp:44
size_t m_size
Stores the number of positions.
Definition: WGrid.h:89
std::shared_ptr< WPropertyGroup > getInformationProperties() const
Returns a pointer to the information properties object of the grid.
Definition: WGrid.cpp:49
Class to manage properties of an object and to provide convenience methods for easy access and manipu...