Fawkes API
Fawkes Development Version
|
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>
33 class NavGraphPolygonConstraint
52 typedef std::vector<Point>
Polygon;
74 unsigned int cur_polygon_handle_;
unsigned int PolygonHandle
Handle for polygon for selective removal.
std::vector< Point > Polygon
A vector of points makes a polygon.
Point_(float x, float y)
Constructor.
Simple point representation for polygon.
std::map< PolygonHandle, Polygon > PolygonMap
Map for accessing all polygons at once with their handles.
const PolygonMap & polygons() const
Get reference to the map of polygons.
void remove_polygon(const PolygonHandle &handle)
Remove a polygon from the constraint list.
float y
Y coordinate of point.
float x
X coordinate of point.
PolygonMap polygons_
currently registered polygons
bool on_poly(const Point &p1, const Point &p2, const Polygon &polygon)
Check if a line segments lies on a given polygon.
struct fawkes::NavGraphPolygonConstraint::Point_ Point
Simple point representation for polygon.
NavGraphPolygonConstraint()
Constructor.
void clear_polygons()
Remove all polygons.
bool in_poly(const Point &point, const Polygon &polygon)
Check if given point lies inside the polygon.
PolygonHandle add_polygon(const Polygon &polygon)
Add a polygon to constraint list.
virtual ~NavGraphPolygonConstraint()
Virtual empty destructor.