15 template <
class Cell,
class Storage, const
bool isClass=true>
18 Map(
int mapSizeX,
int mapSizeY,
double delta);
19 Map(
const Point& center,
double worldSizeX,
double worldSizeY,
double delta);
20 Map(
const Point& center,
double xmin,
double ymin,
double xmax,
double ymax,
double delta);
24 void resize(
double xmin,
double ymin,
double xmax,
double ymax);
25 void grow(
double xmin,
double ymin,
double xmax,
double ymax);
41 inline void getSize(
double & xmin,
double& ymin,
double& xmax,
double& ymax)
const {
43 xmin=min.
x, ymin=min.
y, xmax=
max.x, ymax=
max.y;
46 inline Cell&
cell(
int x,
int y) {
51 inline const Cell&
cell(
int x,
int y)
const {
56 inline Cell&
cell(
double x,
double y) {
61 inline const Cell&
cell(
double x,
double y)
const {
72 inline bool isInside(
double x,
double y)
const {
79 inline const Cell&
cell(
const Point& p)
const;
97 template <
class Cell,
class Storage, const
bool isClass>
100 template <
class Cell,
class Storage, const
bool isClass>
111 template <
class Cell,
class Storage, const
bool isClass>
113 m_storage((int)ceil(worldSizeX/delta), (int)ceil(worldSizeY/delta)){
124 template <
class Cell,
class Storage, const
bool isClass>
126 m_storage((int)ceil((xmax-xmin)/delta), (int)ceil((ymax-ymin)/delta)){
137 template <
class Cell,
class Storage, const
bool isClass>
141 int pxmin, pymin, pxmax, pymax;
142 pxmin=(int)floor((
float)imin.
x/(1<<
m_storage.getPatchMagnitude()));
143 pxmax=(int)ceil((
float)imax.
x/(1<<
m_storage.getPatchMagnitude()));
144 pymin=(int)floor((
float)imin.
y/(1<<
m_storage.getPatchMagnitude()));
145 pymax=(int)ceil((
float)imax.
y/(1<<
m_storage.getPatchMagnitude()));
146 m_storage.resize(pxmin, pymin, pxmax, pymax);
155 template <
class Cell,
class Storage, const
bool isClass>
163 int pxmin, pymin, pxmax, pymax;
164 pxmin=(int)floor((
float)imin.
x/(1<<
m_storage.getPatchMagnitude()));
165 pxmax=(int)ceil((
float)imax.
x/(1<<
m_storage.getPatchMagnitude()));
166 pymin=(int)floor((
float)imin.
y/(1<<
m_storage.getPatchMagnitude()));
167 pymax=(int)ceil((
float)imax.
y/(1<<
m_storage.getPatchMagnitude()));
168 m_storage.resize(pxmin, pymin, pxmax, pymax);
178 template <
class Cell,
class Storage, const
bool isClass>
183 template <
class Cell,
class Storage, const
bool isClass>
190 template <
class Cell,
class Storage, const
bool isClass>
202 template <
class Cell,
class Storage, const
bool isClass>
214 template <
class Cell,
class Storage, const
bool isClass>
223 template <
class Cell,
class Storage, const
bool isClass>
235 template <
class Cell,
class Storage, const
bool isClass>
247 template <
class Cell,
class Storage, const
bool isClass>
252 Point center=(pmax+pmin)*0.5;
const char *const *argv double delta
Cell & cell(double x, double y)
double getMapResolution() const
point< T > min(const point< T > &p1, const point< T > &p2)
Cell & cell(int x, int y)
double getWorldSizeX() const
Map(int mapSizeX, int mapSizeY, double delta)
const Cell & cell(double x, double y) const
const Cell & cell(int x, int y) const
bool isInside(int x, int y) const
static const Cell m_unknown
const Storage & storage() const
bool isInside(double x, double y) const
void getSize(double &xmin, double &ymin, double &xmax, double &ymax) const
Point map2world(int x, int y) const
point< T > max(const point< T > &p1, const point< T > &p2)
bool isInside(const Point &p) const
double getResolution() const
IntPoint world2map(const Point &p) const
double getWorldSizeY() const
const Cell & cell(int x, int y) const
void grow(double xmin, double ymin, double xmax, double ymax)
void resize(double xmin, double ymin, double xmax, double ymax)
Map< double, DoubleArray2D, false > * toDoubleMap() const
Map< double, DoubleArray2D, false > DoubleMap
DoubleArray2D * toDoubleArray() const
Array2D< double > DoubleArray2D
Point map2world(const IntPoint &p) const
bool isInside(const IntPoint &p) const
IntPoint world2map(double x, double y) const