GJK_nD
 All Classes Files Functions Typedefs Friends Pages
StraightLine.hpp
1 #ifndef DLL_STRAIGHTLINE_HPP
2 #define DLL_STRAIGHTLINE_HPP
3 
4 #include <iostream>
5 #include "GJK_nD.hpp"
6 
7 namespace DLL {
8 
17 {
18 private:
19  typedef std::pair<size_t, size_t> Coordinates;
20  typedef GJKnD::Vector Vector;
21  typedef GJKnD::Point Point;
22 
23 public:
27  void addInPoint (const Coordinates & xy) { addPointToSet(xy, setIn); }
28 
33  void addDownPoint(const Coordinates & xy) { addPointToSet(xy, setDown); }
34 
39  void addUpPoint (const Coordinates & xy) { addPointToSet(xy, setUp); }
40 
49 
53  friend std::ostream & operator<<(std::ostream & out,
54  const StraightLine & line);
55 
56 private:
57  void addPointToSet(const Coordinates & xy, std::vector<Point> & set);
58 
59 private:
60  std::vector<Point> setIn;
61  std::vector<Point> setDown;
62  std::vector<Point> setUp;
63 
64  double a, b, lower_bound, upper_bound;
65 };
66 
67 } // namespace DLL
68 
69 #endif // DLL_STRAIGHTLINE_HPP