OpenWalnut  1.4.0
WGrid.h
00001 //---------------------------------------------------------------------------
00002 //
00003 // Project: OpenWalnut ( http://www.openwalnut.org )
00004 //
00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
00006 // For more information see http://www.openwalnut.org/copying
00007 //
00008 // This file is part of OpenWalnut.
00009 //
00010 // OpenWalnut is free software: you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as published by
00012 // the Free Software Foundation, either version 3 of the License, or
00013 // (at your option) any later version.
00014 //
00015 // OpenWalnut is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 // GNU Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public License
00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
00022 //
00023 //---------------------------------------------------------------------------
00024 
00025 #ifndef WGRID_H
00026 #define WGRID_H
00027 
00028 #include <cstddef>
00029 
00030 #include <boost/shared_ptr.hpp>
00031 
00032 #include "../common/WBoundingBox.h"
00033 
00034 
00035 // forward declarations
00036 class WPropertyGroup;
00037 
00038 /**
00039  * Base class to all grid types, e.g. a regular grid.
00040  * \ingroup dataHandler
00041  */
00042 class WGrid // NOLINT
00043 {
00044 public:
00045     /**
00046      * Constructs a new WGrid instance.
00047      * \param size number of positions in grid
00048      */
00049     explicit WGrid( size_t size );
00050 
00051     /**
00052      * Since WGrid is a base class and thus should be polymorphic we add
00053      * virtual destructor.
00054      */
00055     virtual ~WGrid();
00056 
00057     /**
00058      * The number of positions in this grid.
00059      *
00060      * \return \copybrief WGrid::size()
00061      */
00062     size_t size() const;
00063 
00064     /**
00065      * Axis aligned Bounding Box that encloses this grid.
00066      *
00067      * \return \copybrief WGrid::getBoundingBox()
00068      */
00069     virtual WBoundingBox getBoundingBox() const = 0;
00070 
00071     /**
00072      * Returns a pointer to the information properties object of the grid. The grid intends these properties to not be modified.
00073      *
00074      * \return the properties.
00075      */
00076     boost::shared_ptr< WPropertyGroup > getInformationProperties() const;
00077 
00078 protected:
00079     /**
00080      * The property object for the grid containing only props whose purpose is "PV_PURPOSE_INFORMNATION". It is useful to define some property
00081      * to only be of informational nature. The GUI does not modify them.
00082      */
00083     boost::shared_ptr< WPropertyGroup > m_infoProperties;
00084 
00085 private:
00086     /**
00087      * Stores the number of positions.
00088      */
00089     size_t m_size;
00090 };
00091 
00092 #endif  // WGRID_H