2014-08-27 16:03:56 +02:00
|
|
|
#ifndef id0ADBCC15BA574485BF3267254090D99B
|
|
|
|
#define id0ADBCC15BA574485BF3267254090D99B
|
|
|
|
|
2015-01-06 16:38:52 +01:00
|
|
|
#include "doorkeeper/primitivetypes.hpp"
|
|
|
|
#include "doorkeeper/components/tileiterator.hpp"
|
|
|
|
#include "doorkeeper/components/layer.hpp"
|
2015-01-08 12:20:17 +01:00
|
|
|
#include <cstdint>
|
2014-08-27 16:03:56 +02:00
|
|
|
|
|
|
|
namespace dk {
|
2015-01-08 12:20:17 +01:00
|
|
|
template <uint32_t D>
|
2014-12-14 13:13:10 +01:00
|
|
|
class Tyler;
|
|
|
|
|
2015-01-08 12:20:17 +01:00
|
|
|
template <typename T, uint32_t D>
|
2014-12-12 20:04:48 +01:00
|
|
|
class Layer;
|
|
|
|
|
2015-01-08 12:20:17 +01:00
|
|
|
template <uint32_t D>
|
2014-08-27 16:03:56 +02:00
|
|
|
class Viewport {
|
|
|
|
public:
|
2015-06-06 13:52:48 +02:00
|
|
|
typedef Vector<D> coords;
|
2014-12-09 22:30:06 +01:00
|
|
|
|
2015-01-05 18:01:28 +01:00
|
|
|
Viewport ( const Viewport& parOther ) = default;
|
2014-12-14 13:13:10 +01:00
|
|
|
explicit Viewport ( Tyler<D>& parTyler );
|
|
|
|
Viewport ( Tyler<D>& parTyler, const coords& parSize, const coords& parPos );
|
2014-08-27 16:03:56 +02:00
|
|
|
~Viewport ( void ) noexcept = default;
|
|
|
|
|
|
|
|
Viewport& operator= ( const Viewport& ) = default;
|
|
|
|
|
2014-12-14 13:13:10 +01:00
|
|
|
void setSize ( const coords& parSize );
|
|
|
|
void setFrom ( const coords& parFrom );
|
|
|
|
void setFromSize ( const coords& parFrom, const coords& parSize );
|
2014-12-29 16:17:59 +01:00
|
|
|
const coords& count ( void ) const { return m_size; }
|
2014-12-14 13:13:10 +01:00
|
|
|
|
|
|
|
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;
|
2015-01-05 18:01:28 +01:00
|
|
|
template <typename T> inline
|
|
|
|
typename Layer<T, D>::const_iterator begin ( const Layer<T, D>& parLayer ) const a_always_inline;
|
|
|
|
template <typename T> inline
|
|
|
|
typename Layer<T, D>::const_iterator end ( const Layer<T, D>& parLayer ) const a_always_inline;
|
|
|
|
template <typename T>
|
|
|
|
typename Layer<T, D>::const_iterator cbegin ( const Layer<T, D>& parLayer ) const;
|
|
|
|
template <typename T>
|
|
|
|
typename Layer<T, D>::const_iterator cend ( const Layer<T, D>& parLayer ) const;
|
2014-12-12 20:04:48 +01:00
|
|
|
|
2014-08-27 16:03:56 +02:00
|
|
|
private:
|
2014-09-02 16:41:21 +02:00
|
|
|
coords m_size;
|
|
|
|
coords m_position;
|
2014-12-14 13:13:10 +01:00
|
|
|
Tyler<D>& m_tyler;
|
2014-08-27 16:03:56 +02:00
|
|
|
};
|
|
|
|
} //namespace dk
|
|
|
|
|
2015-01-06 16:38:52 +01:00
|
|
|
#include "doorkeeper/implem/viewport.inl"
|
2014-12-12 20:04:48 +01:00
|
|
|
|
2014-08-27 16:03:56 +02:00
|
|
|
#endif
|