|
Fawkes API
Fawkes Development Version
|
Generate navgraph using a Voronoi diagram. More...
#include <>>
Public Member Functions | |
| NavGraphGeneratorVoronoi () | |
| Default constructor. More... | |
| NavGraphGeneratorVoronoi (float bbox_p1_x, float bbox_p1_y, float bbox_p2_x, float bbox_p2_y, float near_threshold) | |
| Constructor with bounding box. More... | |
| virtual | ~NavGraphGeneratorVoronoi () |
| Destructor. More... | |
| virtual void | compute (fawkes::LockPtr< fawkes::NavGraph > graph) |
| Compute graph. More... | |
| void | set_bounding_box (float bbox_p1_x, float bbox_p1_y, float bbox_p2_x, float bbox_p2_y) |
| Set bounding box. More... | |
| void | set_near_threshold (float near_threshold) |
| Set distance threshold for considering nodes to be the same. More... | |
| void | add_obstacle (float x, float y) |
| Add an obstacle point. More... | |
| void | clear () |
| Clear all obstacle points. More... | |
| const std::list< Polygon2D > & | face_polygons () const |
| Get list of polygons. More... | |
| fawkes::NavGraphGeneratorVoronoi::NavGraphGeneratorVoronoi | ( | ) |
Default constructor.
Definition at line 67 of file voronoi.cpp.
| fawkes::NavGraphGeneratorVoronoi::NavGraphGeneratorVoronoi | ( | float | bbox_p1_x, |
| float | bbox_p1_y, | ||
| float | bbox_p2_x, | ||
| float | bbox_p2_y, | ||
| float | near_threshold | ||
| ) |
Constructor with bounding box.
This constructor will cause compute() to ignore any edge with a vertex out of the given bounding box area.
| bbox_p1_x | X coordinate of first (lower) bounding box point |
| bbox_p1_y | y coordinate of first (lower) bounding box point |
| bbox_p2_x | X coordinate of second (upper) bounding box point |
| bbox_p2_y | y coordinate of second (upper) bounding box point |
| near_threshold | distance threshold for which to consider nodes to be the same if the distance is smaller than this threshold. |
Definition at line 85 of file voronoi.cpp.
|
virtual |
Destructor.
Definition at line 97 of file voronoi.cpp.
| void fawkes::NavGraphGeneratorVoronoi::add_obstacle | ( | float | x, |
| float | y | ||
| ) |
Add an obstacle point.
An obstacle point will be the representative for a Voronoi face in the newly generated graph.
| x | X coordinate of point |
| y | Y coordinate of point |
Definition at line 181 of file voronoi.cpp.
Referenced by NavGraphGeneratorThread::loop().
| void fawkes::NavGraphGeneratorVoronoi::clear | ( | void | ) |
Clear all obstacle points.
Definition at line 189 of file voronoi.cpp.
|
virtual |
Compute graph.
| graph | the resulting nodes and edges will be added to this graph. The graph will not be cleared automatically. The graph will be locked while adding nodes. |
Definition at line 202 of file voronoi.cpp.
References fawkes::NavGraph::add_edge(), fawkes::NavGraph::add_node(), fawkes::NavGraph::calc_reachability(), fawkes::contains(), fawkes::genname(), fawkes::LockPtr< T_CppObject >::lock(), fawkes::NavGraph::nodes(), fawkes::polygon_area(), fawkes::polygon_contains(), and fawkes::LockPtr< T_CppObject >::unlock().
Referenced by NavGraphGeneratorThread::loop().
|
inline |
| void fawkes::NavGraphGeneratorVoronoi::set_bounding_box | ( | float | bbox_p1_x, |
| float | bbox_p1_y, | ||
| float | bbox_p2_x, | ||
| float | bbox_p2_y | ||
| ) |
Set bounding box.
Setting a bounding box will cause compute() to ignore any edge with a vertex out of the given bounding box area.
| bbox_p1_x | X coordinate of first (lower) bounding box point |
| bbox_p1_y | y coordinate of first (lower) bounding box point |
| bbox_p2_x | X coordinate of second (upper) bounding box point |
| bbox_p2_y | y coordinate of second (upper) bounding box point |
Definition at line 153 of file voronoi.cpp.
Referenced by NavGraphGeneratorThread::loop().
| void fawkes::NavGraphGeneratorVoronoi::set_near_threshold | ( | float | near_threshold | ) |
Set distance threshold for considering nodes to be the same.
| near_threshold | distance threshold for which to consider nodes to be the same if the distance is smaller than this threshold. |
Definition at line 169 of file voronoi.cpp.