codac  1.5.7
codac_ThickPoint.h
1 
11 #ifndef __CODAC_THICKPOINT_H__
12 #define __CODAC_THICKPOINT_H__
13 
14 #ifdef _MSC_VER
15 // Enable additional features in math.h.
16 #ifndef _USE_MATH_DEFINES
17 #define _USE_MATH_DEFINES
18 #endif // _USE_MATH_DEFINES
19 #include <math.h>
20 #endif // _MSC_VER
21 
22 #include <vector>
23 #include "codac_Vector.h"
24 #include "codac_Interval.h"
25 #include "codac_IntervalVector.h"
26 #include "codac_BoolInterval.h"
27 
28 // todo: remove this (polygons in unbounded case)
29 #include <limits>
30 #define BOUNDED_INFINITY numeric_limits<float>::max()
31 
32 namespace codac
33 {
34  class ThickPoint // todo: derive from IntervalVector?
35  {
36  public:
37 
40 
41  ThickPoint(); // undefined point
42  explicit ThickPoint(const Vector& p);
43  explicit ThickPoint(const IntervalVector& p);
44  ThickPoint(const Interval& x, const Interval& y);
45  const ThickPoint& operator=(const ThickPoint& p);
46 
50 
51  const Interval& x() const;
52  const Interval& y() const;
53  const Interval& operator[](size_t id) const;
54  const IntervalVector& box() const;
55  const Vector mid() const;
56  double max_diam() const;
57  const std::vector<Vector> bounds_pts() const;
58 
62 
63  bool is_unbounded() const;
64  bool does_not_exist() const;
65  bool operator==(const ThickPoint& p) const;
66  bool operator!=(const ThickPoint& p) const;
67 
71 
72  const ThickPoint& inflate(double rad);
73 
77 
78  friend std::ostream& operator<<(std::ostream& str, const ThickPoint& p);
79 
83 
84  static const BoolInterval aligned(const ThickPoint& a, const ThickPoint& b, const ThickPoint& c);
85  static const ThickPoint center(const std::vector<ThickPoint> v_pts);
86  static void push(const IntervalVector& box, std::vector<ThickPoint>& v_pts);
87  static void push(const IntervalVector& box, std::vector<Vector>& v_pts);
88  static std::vector<ThickPoint> to_ThickPoints(const std::vector<Vector>& v_pts);
89  static std::vector<ThickPoint> remove_identical_pts(const std::vector<ThickPoint>& v_pts);
90  static std::vector<Vector> remove_identical_pts(const std::vector<Vector>& v_pts);
91 
93 
94 
95  protected:
96 
97  // Reliable representation of points:
98  IntervalVector m_pt = IntervalVector(2, Interval::EMPTY_SET);
99  };
100 }
101 
102 #endif
FixPoint of a separator The fixpoint of a separator is computed by calling the "::"separate function ...
Definition: codac_capd_helpers.h:9