Class DynamicVoronoi
Defined in File dynamicvoronoi.h
Nested Relationships
Nested Types
Class Documentation
-
class DynamicVoronoi
A DynamicVoronoi object computes and updates a distance map and Voronoi diagram.
Public Functions
-
DynamicVoronoi()
-
~DynamicVoronoi()
-
void initializeEmpty(int _sizeX, int _sizeY, bool initGridMap = true)
Initialization with an empty map.
-
void initializeMap(int _sizeX, int _sizeY, bool **_gridMap)
Initialization with a given binary map (false==free, true==occupied)
-
void occupyCell(int x, int y)
add an obstacle at the specified cell coordinate
-
void clearCell(int x, int y)
remove an obstacle at the specified cell coordinate
-
void exchangeObstacles(std::vector<INTPOINT> &newObstacles)
remove old dynamic obstacles and add the new ones
-
void update(bool updateRealDist = true)
update distance map and Voronoi diagram to reflect the changes
-
void prune()
prune the Voronoi diagram
-
void updateAlternativePrunedDiagram()
prune the Voronoi diagram by globally revisiting all Voronoi nodes. Takes more time but gives a more sparsely pruned Voronoi graph. You need to call this after every call to udpate()
-
inline int **alternativePrunedDiagram()
retrieve the alternatively pruned diagram. see updateAlternativePrunedDiagram()
-
int getNumVoronoiNeighborsAlternative(int x, int y)
retrieve the number of neighbors that are Voronoi nodes (4-connected)
-
bool isVoronoiAlternative(int x, int y)
returns whether the specified cell is part of the alternatively pruned diagram. See updateAlternativePrunedDiagram.
-
float getDistance(int x, int y)
returns the obstacle distance at the specified location
-
bool isVoronoi(int x, int y)
returns whether the specified cell is part of the (pruned) Voronoi graph
-
bool isOccupied(int x, int y)
checks whether the specficied location is occupied
-
void visualize(const char *filename = "result.ppm")
write the current distance map and voronoi diagram as ppm file
-
inline unsigned int getSizeX()
returns the horizontal size of the workspace/map
-
inline unsigned int getSizeY()
returns the vertical size of the workspace/map
-
DynamicVoronoi()