2014-12-09 21:30:06 +00:00
|
|
|
#ifndef id873715F57B504CCF8227CE03EA28CAFA
|
|
|
|
#define id873715F57B504CCF8227CE03EA28CAFA
|
|
|
|
|
2014-12-11 22:58:52 +00:00
|
|
|
#include "primitivetypes.hpp"
|
2014-12-09 21:30:06 +00:00
|
|
|
#include <boost/iterator/iterator_facade.hpp>
|
|
|
|
#include <iterator>
|
2014-12-11 22:58:52 +00:00
|
|
|
#include <vector>
|
2014-12-09 21:30:06 +00:00
|
|
|
|
|
|
|
namespace dk {
|
|
|
|
template <typename T, size_t D>
|
|
|
|
class TileIterator : public boost::iterator_facade<TileIterator<T, D>, T, boost::biderectional_traversal_tag> {
|
|
|
|
friend class boost::iterator_core_access;
|
|
|
|
public:
|
|
|
|
typedef Vector<CoordinateScalarType, D> coords;
|
|
|
|
|
|
|
|
TileIterator ( void );
|
|
|
|
TileIterator ( const TileIterator& parOther ) = default;
|
|
|
|
TileIterator ( const coords& parFrom, const coords& parTo );
|
|
|
|
TileIterator ( const coords& parFrom, const coords& parTo, const coords& parAreaFrom, const coords& parAreaTo, const coords& parTotal );
|
|
|
|
~TileIterator ( void ) = default;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void increment ( void );
|
|
|
|
void decrement ( void );
|
|
|
|
void advance ( size_t parAdvance );
|
|
|
|
ptrdiff_t distance_to ( const MeshSelectionIterator& parOther );
|
|
|
|
bool equal ( const MeshSelectionIterator& parOther ) const;
|
2014-12-11 22:58:52 +00:00
|
|
|
T& dereference ( void ) const { return m_data[get_current_index()]; }
|
|
|
|
size_t get_current_index ( void ) const;
|
2014-12-09 21:30:06 +00:00
|
|
|
|
|
|
|
coords m_pos;
|
|
|
|
coords m_from;
|
|
|
|
coords m_to;
|
|
|
|
coords m_areafrom;
|
|
|
|
coords m_areato;
|
|
|
|
coords m_total;
|
2014-12-11 22:58:52 +00:00
|
|
|
std::vector<T>* m_data;
|
2014-12-09 21:30:06 +00:00
|
|
|
};
|
|
|
|
} //namespace dk
|
|
|
|
|
|
|
|
#include "implem/tileiterator.inl"
|
|
|
|
|
|
|
|
#endif
|