Fawkes API
Fawkes Development Version
|
Constraint that blocks nodes within and edges touching a polygon. More...
#include <>>
Public Member Functions | |
NavGraphPolygonEdgeConstraint (const std::string &name) | |
Constructor. More... | |
NavGraphPolygonEdgeConstraint (const std::string &name, const Polygon &polygon) | |
Constructor. More... | |
virtual | ~NavGraphPolygonEdgeConstraint () |
Virtual empty destructor. More... | |
virtual bool | compute (void) throw () |
Perform compuations before graph search and to indicate re-planning. More... | |
virtual bool | blocks (const fawkes::NavGraphNode &from, const fawkes::NavGraphNode &to) throw () |
Check if constraint blocks an edge. More... | |
![]() | |
NavGraphEdgeConstraint (const std::string &name) | |
Constructor. More... | |
NavGraphEdgeConstraint (const char *name) | |
Constructor. More... | |
virtual | ~NavGraphEdgeConstraint () |
Virtual empty destructor. More... | |
std::string | name () |
Get name of constraint. More... | |
bool | operator== (const std::string &name) const |
Check if constraint matches name. More... | |
![]() | |
virtual | ~NavGraphPolygonConstraint () |
Virtual empty destructor. More... | |
const PolygonMap & | polygons () const |
Get reference to the map of polygons. More... | |
PolygonHandle | add_polygon (const Polygon &polygon) |
Add a polygon to constraint list. More... | |
void | remove_polygon (const PolygonHandle &handle) |
Remove a polygon from the constraint list. More... | |
void | clear_polygons () |
Remove all polygons. More... | |
Additional Inherited Members | |
![]() | |
typedef struct fawkes::NavGraphPolygonConstraint::Point_ | Point |
Simple point representation for polygon. More... | |
typedef unsigned int | PolygonHandle |
Handle for polygon for selective removal. More... | |
typedef std::vector< Point > | Polygon |
A vector of points makes a polygon. More... | |
typedef std::map< PolygonHandle, Polygon > | PolygonMap |
Map for accessing all polygons at once with their handles. More... | |
![]() | |
NavGraphPolygonConstraint () | |
Constructor. More... | |
NavGraphPolygonConstraint (const Polygon &polygon) | |
Constructor. More... | |
bool | in_poly (const Point &point, const Polygon &polygon) |
Check if given point lies inside the polygon. More... | |
bool | on_poly (const Point &p1, const Point &p2, const Polygon &polygon) |
Check if a line segments lies on a given polygon. More... | |
![]() | |
std::string | name_ |
Name of constraint. More... | |
![]() | |
PolygonMap | polygons_ |
currently registered polygons More... | |
Constraint that blocks nodes within and edges touching a polygon.
Definition at line 37 of file polygon_edge_constraint.h.
fawkes::NavGraphPolygonEdgeConstraint::NavGraphPolygonEdgeConstraint | ( | const std::string & | name | ) |
Constructor.
name | name of node constraint |
Definition at line 39 of file polygon_edge_constraint.cpp.
fawkes::NavGraphPolygonEdgeConstraint::NavGraphPolygonEdgeConstraint | ( | const std::string & | name, |
const Polygon & | polygon | ||
) |
Constructor.
name | name of node constraint |
polygon | polygon to add immediately |
Definition at line 50 of file polygon_edge_constraint.cpp.
|
virtual |
Virtual empty destructor.
Definition at line 57 of file polygon_edge_constraint.cpp.
|
virtual |
Check if constraint blocks an edge.
This method must be implemented by constraint classes. It is called to determine if an edge should be considered blocked and therefore cannot be expanded during path search.
Note that the nodes may be passed in either ordering, therefore you should not rely on a particular order, not even for directed nodes!
Further note that the method may not throw an exception. Handle this internally appropriately.
from | node from which the edge originates |
to | node to which the edge leads |
Implements fawkes::NavGraphEdgeConstraint.
Definition at line 73 of file polygon_edge_constraint.cpp.
References fawkes::NavGraphPolygonConstraint::on_poly(), and fawkes::NavGraphPolygonConstraint::polygons_.
|
virtual |
Perform compuations before graph search and to indicate re-planning.
The compute method is called on all constraints just before a path search is performed and to check if re-planning should be tried.
It can be used for example to cache results for the coming search run. The search guarantees that for each complete search run compute() is called once and only once and that no two search runs overlap, i.e., compute() will not be called while another search is still running.
Constraints must indicate whether any change has occured during computation or since the last compute() call through the return value. This is used to determine if re-planning should be attempted.
Reimplemented from fawkes::NavGraphEdgeConstraint.
Definition at line 63 of file polygon_edge_constraint.cpp.
References fawkes::NavGraphPolygonConstraint::polygons_.