2014-08-27 14:03:56 +00:00
|
|
|
#ifndef id0ADBCC15BA574485BF3267254090D99B
|
|
|
|
#define id0ADBCC15BA574485BF3267254090D99B
|
|
|
|
|
2014-12-09 21:30:06 +00:00
|
|
|
#include "primitivetypes.hpp"
|
2014-12-12 19:04:48 +00:00
|
|
|
#include "components/tileiterator.hpp"
|
|
|
|
#include "components/layer.hpp"
|
2014-08-27 14:03:56 +00:00
|
|
|
|
|
|
|
namespace dk {
|
2014-12-14 12:13:10 +00:00
|
|
|
template <size_t D>
|
|
|
|
class Tyler;
|
|
|
|
|
2014-12-12 19:04:48 +00:00
|
|
|
template <typename T, size_t D>
|
|
|
|
class Layer;
|
|
|
|
|
2014-12-14 12:13:10 +00:00
|
|
|
template <size_t D>
|
2014-08-27 14:03:56 +00:00
|
|
|
class Viewport {
|
|
|
|
public:
|
2014-12-09 21:30:06 +00:00
|
|
|
typedef Vector<CoordinateScalarType, D> coords;
|
|
|
|
|
2014-12-14 12:13:10 +00:00
|
|
|
explicit Viewport ( Tyler<D>& parTyler );
|
|
|
|
Viewport ( Tyler<D>& parTyler, const coords& parSize, const coords& parPos );
|
2014-08-27 14:03:56 +00:00
|
|
|
~Viewport ( void ) noexcept = default;
|
|
|
|
|
|
|
|
Viewport& operator= ( const Viewport& ) = default;
|
|
|
|
|
2014-12-14 12:13:10 +00:00
|
|
|
void setSize ( const coords& parSize );
|
|
|
|
void setFrom ( const coords& parFrom );
|
|
|
|
void setFromSize ( const coords& parFrom, const coords& parSize );
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
typename Layer<T, D>::iterator begin ( Layer<T, D>& parLayer ) const;
|
|
|
|
template <typename T>
|
|
|
|
typename Layer<T, D>::iterator end ( Layer<T, D>& parLayer ) const;
|
2014-12-12 19:04:48 +00:00
|
|
|
|
2014-08-27 14:03:56 +00:00
|
|
|
private:
|
2014-09-02 14:41:21 +00:00
|
|
|
coords m_size;
|
|
|
|
coords m_position;
|
2014-12-14 12:13:10 +00:00
|
|
|
Tyler<D>& m_tyler;
|
2014-08-27 14:03:56 +00:00
|
|
|
};
|
|
|
|
} //namespace dk
|
|
|
|
|
2014-12-12 19:04:48 +00:00
|
|
|
#include "implem/viewport.inl"
|
|
|
|
|
2014-08-27 14:03:56 +00:00
|
|
|
#endif
|