21 #ifndef _NAVGRAPH_CONSTRAINTS_POLYGON_CONSTRAINT_H_
22 #define _NAVGRAPH_CONSTRAINTS_POLYGON_CONSTRAINT_H_
24 #include <navgraph/constraints/static_list_edge_constraint.h>
25 #include <navgraph/constraints/static_list_node_constraint.h>
26 #include <navgraph/navgraph.h>
74 unsigned int cur_polygon_handle_;
Constraint that blocks nodes within and edges touching a polygon.
NavGraphPolygonConstraint()
Constructor.
PolygonMap polygons_
currently registered polygons
virtual ~NavGraphPolygonConstraint()
Virtual empty destructor.
bool on_poly(const Point &p1, const Point &p2, const Polygon &polygon)
Check if a line segments lies on a given polygon.
void remove_polygon(const PolygonHandle &handle)
Remove a polygon from the constraint list.
unsigned int PolygonHandle
Handle for polygon for selective removal.
struct fawkes::NavGraphPolygonConstraint::Point_ Point
Simple point representation for polygon.
const PolygonMap & polygons() const
Get reference to the map of polygons.
std::vector< Point > Polygon
A vector of points makes a polygon.
bool in_poly(const Point &point, const Polygon &polygon)
Check if given point lies inside the polygon.
void clear_polygons()
Remove all polygons.
std::map< PolygonHandle, Polygon > PolygonMap
Map for accessing all polygons at once with their handles.
PolygonHandle add_polygon(const Polygon &polygon)
Add a polygon to constraint list.
Fawkes library namespace.
Simple point representation for polygon.
float x
X coordinate of point.
Point_(float x, float y)
Constructor.
float y
Y coordinate of point.