00001
00002
00003
00004
00005 #ifndef MERCATOR_AREA_H
00006 #define MERCATOR_AREA_H
00007
00008 #include <wfmath/axisbox.h>
00009 #include <wfmath/polygon.h>
00010
00011 namespace Mercator
00012 {
00013
00014 class Segment;
00015
00025 class Area
00026 {
00027 public:
00032 Area(int layer, bool hole);
00033
00038 void setLayer(int layer, bool hole);
00039
00041 void setShape(const WFMath::Polygon<2>& p);
00042
00044 bool contains(double x, double y) const;
00045
00047 int getLayer() const
00048 {
00049 return m_layer;
00050 }
00051
00053 bool isHole() const
00054 {
00055 return m_hole;
00056 }
00057
00059 const WFMath::AxisBox<2> & bbox() const
00060 {
00061 return m_box;
00062 }
00063
00065 const WFMath::Polygon<2> & shape() const
00066 {
00067 return m_shape;
00068 }
00069
00073 bool checkIntersects(const Segment& s) const;
00074
00082 WFMath::Polygon<2> clipToSegment(const Segment& s) const;
00083 private:
00084
00086 int m_layer;
00088 bool m_hole;
00090 WFMath::Polygon<2> m_shape;
00092 WFMath::AxisBox<2> m_box;
00093 };
00094
00095 }
00096
00097 #endif // of MERCATOR_AREA_H