45 typedef std::pair<double, double> Point;
48 bool cmpDouble(
double a,
double b,
const double eps = 1e-12);
51 bool equalPoints(Point p0, Point p1);
62 size_t numPoints()
const
64 return coordinates_.size();
67 Point operator[](
size_t i)
const
69 return coordinates_[i];
73 bool inside(Point point)
const;
76 std::vector<Point> coordinates_;
83 PolyWorld(
const std::string &worldName,
const std::pair<double, double> &xBounds,
84 const std::pair<double, double> &yBounds);
86 const std::string &worldName()
const;
87 std::pair<double, double> xBounds()
const;
88 std::pair<double, double> yBounds()
const;
90 size_t numObstacles()
const;
91 const std::vector<ConvexPolygon> &obstacles()
const;
99 bool outOfBounds(Point p)
const;
102 bool pointCollisionFree(Point p)
const;
105 void writeWorld(
const char *filename)
const;
108 std::string worldName_;
109 std::vector<std::pair<double, double>> bounds_;
111 std::vector<ConvexPolygon> obstacles_;