00001
00002
00003
00004 #ifndef CAJUN_GOAL_MARKER_H
00005 #define CAJUN_GOAL_MARKER_H
00006
00007
00008 #include "map_grid.H"
00009 #include "rect_filler.H"
00010
00011 namespace cajun
00012 {
00013
00014
00015 class goal_marker_t
00016 {
00017 public:
00018 goal_marker_t (map_grid_t *map_grid_, double cell_size_);
00019
00020 void mark_line (bool is_goal, double cx_, double cy_,
00021 double orient_, double asize_, double xsize_);
00022
00023 void mark_circle (bool is_goal_,
00024 double cx_, double cy_, double radius_);
00025
00026 private:
00027 class filler_t
00028 {
00029 public:
00030 filler_t (map_grid_t *map_grid_) :
00031 m_map_grid (map_grid_), m_is_goal (false) {}
00032 void set_is_goal (bool is_goal_) { m_is_goal = is_goal_; }
00033
00034 void fill (int x_, int y_, unsigned w_)
00035 {
00036 map_grid_t::iterator_t iter =
00037 m_map_grid->find (x_, y_);
00038
00039 while (w_--)
00040 {
00041 iter->goal = m_is_goal;
00042 iter.neighbor (1, 0);
00043 }
00044 }
00045
00046 protected:
00047 map_grid_t * const m_map_grid;
00048
00049 bool m_is_goal;
00050 };
00051
00052 double m_cell_size;
00053
00054 filler_t m_filler;
00055 rect_filler_t m_rect_filler;
00056 };
00057
00058
00059 };
00060
00061
00062 #endif