00001 #ifndef RIDE_GEOM_HPP
00002 #define RIDE_GEOM_HPP
00003
00004 #include <list>
00005 #include "ride/globalConst.hpp"
00006 #include "ride/mathVect.hpp"
00007
00008
00009
00010
00011 namespace jafar {
00012
00013 namespace ride {
00014
00022 enum areaType{
00023 AREA_MIN,AREA_MAX
00024 };
00025
00032 class AreaBase {
00033 private :
00034 areaType type;
00035 Vect center;
00036 double radius;
00037 public :
00038 AreaBase(areaType type_, double x, double y, double z, double r);
00039 AreaBase(areaType type_, Vect c, double r);
00040 ~AreaBase();
00041 areaType getType() const;
00042 Vect getCenter() const;
00043 double getRadius() const;
00044 bool isPointValid(Vect const& point) const;
00045 };
00046
00054 class VoronoiBase {
00055 private :
00056 Vect center;
00057 std::list<Vect> others;
00058 public :
00059 VoronoiBase(Vect center_, std::list<Vect> others_);
00060 ~VoronoiBase();
00061 Vect getCenter() const;
00062 bool isPointValid(Vect const& point) const;
00063 };
00064
00069 class Area {
00070 private :
00071 std::list<AreaBase> area;
00072 std::list<VoronoiBase> voronoi;
00073 public :
00074 Area();
00075 ~Area();
00076 bool isPointValid(Vect const& point) const;
00077 Vect getClosestPoint(Vect point, double corridor) const;
00078 void add(AreaBase const& a);
00079 void add(VoronoiBase const& v);
00080 void clearArea();
00081 };
00082
00083 }
00084
00085 }
00086
00087 #endif