1 #ifndef _DYNAMICVORONOI_H_ 
    2 #define _DYNAMICVORONOI_H_ 
   10 #include "bucketedqueue.h" 
   12 namespace HybridAStar {
 
   34   void update(
bool updateRealDist = 
true);
 
   45   void visualize(
const char* filename = 
"result.ppm");
 
   64   typedef enum {voronoiKeep = -4, freeQueued = -3, voronoiRetry = -2, voronoiPrune = -1, free = 0, occupied = 1} State;
 
   65   typedef enum {fwNotQueued = 1, fwQueued = 2, fwProcessed = 3, bwQueued = 4, bwProcessed = 1} QueueingState;
 
   66   typedef enum {invalidObstData = SHRT_MAX / 2} ObstDataState;
 
   67   typedef enum {pruned, keep, retry} markerMatchResult;
 
   72   void setObstacle(
int x, 
int y);
 
   73   void removeObstacle(
int x, 
int y);
 
   74   inline void checkVoro(
int x, 
int y, 
int nx, 
int ny, dataCell& c, dataCell& nc);
 
   76   void commitAndColorize(
bool updateRealDist = 
true);
 
   77   inline void reviveVoroNeighbors(
int& x, 
int& y);
 
   79   inline bool isOccupied(
int& x, 
int& y, dataCell& c);
 
   80   inline markerMatchResult markerMatch(
int x, 
int y);
 
   85   std::queue<INTPOINT> pruneQueue;
 
   87   std::vector<INTPOINT> removeList;
 
   88   std::vector<INTPOINT> addList;
 
   89   std::vector<INTPOINT> lastObstacles;
 
   99   double doubleThreshold;
 
void initializeEmpty(int _sizeX, int _sizeY, bool initGridMap=true)
Initialization with an empty map. 
Definition: dynamicvoronoi.cpp:25
 
void occupyCell(int x, int y)
add an obstacle at the specified cell coordinate 
Definition: dynamicvoronoi.cpp:102
 
bool isVoronoi(int x, int y)
returns whether the specified cell is part of the (pruned) Voronoi graph 
Definition: dynamicvoronoi.cpp:249
 
unsigned int getSizeY()
returns the vertical size of the workspace/map 
Definition: dynamicvoronoi.h:50
 
bool isOccupied(int x, int y)
checks whether the specficied location is occupied 
Definition: dynamicvoronoi.cpp:351
 
void initializeMap(int _sizeX, int _sizeY, bool **_gridMap)
Initialization with a given binary map (false==free, true==occupied) 
Definition: dynamicvoronoi.cpp:62
 
Definition: dynamicvoronoi.h:54
 
void visualize(const char *filename="result.ppm")
write the current distance map and voronoi diagram as ppm file 
Definition: dynamicvoronoi.cpp:360
 
void prune()
prune the Voronoi diagram 
Definition: dynamicvoronoi.cpp:397
 
float getDistance(int x, int y)
returns the obstacle distance at the specified location 
Definition: dynamicvoronoi.cpp:244
 
unsigned int getSizeX()
returns the horizontal size of the workspace/map 
Definition: dynamicvoronoi.h:48
 
void clearCell(int x, int y)
remove an obstacle at the specified cell coordinate 
Definition: dynamicvoronoi.cpp:106
 
A DynamicVoronoi object computes and updates a distance map and Voronoi diagram. 
Definition: dynamicvoronoi.h:14
 
void exchangeObstacles(std::vector< INTPOINT > newObstacles)
remove old dynamic obstacles and add the new ones 
Definition: dynamicvoronoi.cpp:132
 
void update(bool updateRealDist=true)
update distance map and Voronoi diagram to reflect the changes 
Definition: dynamicvoronoi.cpp:155