Fawkes API  Fawkes Development Version
fawkes::NavGraphPolygonEdgeConstraint Class Reference

Constraint that blocks nodes within and edges touching a polygon. More...

#include <>>

Inheritance diagram for fawkes::NavGraphPolygonEdgeConstraint:

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...
 
- Public Member Functions inherited from fawkes::NavGraphEdgeConstraint
 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...
 
- Public Member Functions inherited from fawkes::NavGraphPolygonConstraint
virtual ~NavGraphPolygonConstraint ()
 Virtual empty destructor. More...
 
const PolygonMappolygons () 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

- Public Types inherited from fawkes::NavGraphPolygonConstraint
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< PointPolygon
 A vector of points makes a polygon. More...
 
typedef std::map< PolygonHandle, PolygonPolygonMap
 Map for accessing all polygons at once with their handles. More...
 
- Protected Member Functions inherited from fawkes::NavGraphPolygonConstraint
 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...
 
- Protected Attributes inherited from fawkes::NavGraphEdgeConstraint
std::string name_
 Name of constraint. More...
 
- Protected Attributes inherited from fawkes::NavGraphPolygonConstraint
PolygonMap polygons_
 currently registered polygons More...
 

Detailed Description

Constraint that blocks nodes within and edges touching a polygon.

Author
Tim Niemueller

Definition at line 37 of file polygon_edge_constraint.h.

Constructor & Destructor Documentation

◆ NavGraphPolygonEdgeConstraint() [1/2]

fawkes::NavGraphPolygonEdgeConstraint::NavGraphPolygonEdgeConstraint ( const std::string &  name)

Constructor.

Parameters
namename of node constraint

Definition at line 39 of file polygon_edge_constraint.cpp.

◆ NavGraphPolygonEdgeConstraint() [2/2]

fawkes::NavGraphPolygonEdgeConstraint::NavGraphPolygonEdgeConstraint ( const std::string &  name,
const Polygon polygon 
)

Constructor.

Parameters
namename of node constraint
polygonpolygon to add immediately

Definition at line 50 of file polygon_edge_constraint.cpp.

◆ ~NavGraphPolygonEdgeConstraint()

fawkes::NavGraphPolygonEdgeConstraint::~NavGraphPolygonEdgeConstraint ( )
virtual

Virtual empty destructor.

Definition at line 57 of file polygon_edge_constraint.cpp.

Member Function Documentation

◆ blocks()

bool fawkes::NavGraphPolygonEdgeConstraint::blocks ( const fawkes::NavGraphNode from,
const fawkes::NavGraphNode to 
)
throw (
)
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.

Parameters
fromnode from which the edge originates
tonode to which the edge leads
Returns
true if the edge should be considered blocked, false otherwise

Implements fawkes::NavGraphEdgeConstraint.

Definition at line 73 of file polygon_edge_constraint.cpp.

References fawkes::NavGraphPolygonConstraint::on_poly(), and fawkes::NavGraphPolygonConstraint::polygons_.

◆ compute()

bool fawkes::NavGraphPolygonEdgeConstraint::compute ( void  )
throw (
)
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.

Returns
true if a change has occured during computation or since the last call, false otherwise

Reimplemented from fawkes::NavGraphEdgeConstraint.

Definition at line 63 of file polygon_edge_constraint.cpp.

References fawkes::NavGraphPolygonConstraint::polygons_.


The documentation for this class was generated from the following files: