DoorKeeper/include/doorkeeper/components/layeredviewport.hpp
2015-09-01 17:39:39 +02:00

72 lines
2.5 KiB
C++

/* Copyright 2015, Michele Santullo
* This file is part of DoorKeeper.
*
* DoorKeeper is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DoorKeeper is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DoorKeeper. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef id83407244096746CDBFF64D23F0B1701A
#define id83407244096746CDBFF64D23F0B1701A
#include "doorkeeper/primitivetypes.hpp"
#include "doorkeeper/components/viewport.hpp"
#include "doorkeeper/components/tyler.hpp"
#include "doorkeeper/components/layer.hpp"
#include "doorkeeper/implem/iterableviewport.hpp"
#include <vector>
#include <boost/iterator/transform_iterator.hpp>
#include <utility>
#include <boost/function.hpp>
#include <boost/bind.hpp>
namespace dk {
template <uint32_t D>
class Tyler;
template <uint32_t D>
class LayeredViewport {
struct ViewportItem;
typedef std::vector<ViewportItem> ViewportList;
public:
typedef VectorT<CoordinateAccumType, D> coords_f;
typedef boost::transform_iterator<boost::function<IterableViewport<D>(const LayerBase<D>&)>, typename Tyler<D>::iterator> iterator;
typedef boost::transform_iterator<boost::function<const IterableViewport<D>(const LayerBase<D>&)>, typename Tyler<D>::const_iterator> const_iterator;
LayeredViewport ( const LayeredViewport<D>& ) = delete;
LayeredViewport ( LayeredViewport<D>&& parOther );
explicit LayeredViewport ( Tyler<D>& parTyler );
~LayeredViewport ( void ) noexcept;
LayeredViewport<D>& operator+= ( const coords_f& parValue );
LayeredViewport<D>& operator-= ( const coords_f& parValue );
void on_layer ( const LayerBase<D>& parLayer, bool parAdded );
iterator begin ( void );
const_iterator begin ( void ) const;
iterator end ( void );
const_iterator end ( void ) const;
IterableViewport<D> viewport ( const LayerBase<D>& parLayer );
const IterableViewport<D> viewport ( const LayerBase<D>& parLayer ) const;
LayeredViewport<D>& operator= ( const LayeredViewport<D>& ) = delete;
private:
ViewportList m_views;
Tyler<D>& m_tyler;
typename Tyler<D>::LayerObsID m_tyler_id;
};
} //namespace dk
#include "doorkeeper/implem/layeredviewport.inl"
#endif