Clipper
|
Map reference with index-like behaviour. More...
#include <xmap.h>
Public Member Functions | |
Map_reference_index () | |
Null constructor. | |
Map_reference_index (const Xmap_base &map) | |
Constructor: takes parent map. | |
Map_reference_index (const Xmap_base &map, const Coord_grid &pos) | |
Constructor: takes parent map and coord. | |
Coord_grid | coord () const |
Get current grid coordinate. | |
const Coord_orth | coord_orth () const |
Get current value of orthogonal coordinate. | |
Map_reference_index & | set_coord (const Coord_grid &pos) |
Set current value of coordinate - optimised for nearby coords. | |
Map_reference_index & | next () |
Simple increment. | |
int | index_offset (const int &du, const int &dv, const int &dw) const |
Index of neighbouring point. | |
const Xmap_base & | base_xmap () const |
return the parent Xmap | |
const int & | index () const |
Get the index into the map data array. | |
bool | last () const |
Check for end of map. |
Map reference with index-like behaviour.
This is a reference to a map coordinate. It behaves like a simple index into the map, but can be easily converted into a coordinate as and when required. It also implements methods for iterating through the unique portion of a map. It is very compact, but coord() involves some overhead and loses any information concerning symmetry equivelents.