00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_OP_PREDICATE_RECTANGLECONTAINS_H
00021 #define GEOS_OP_PREDICATE_RECTANGLECONTAINS_H
00022
00023 #include <geos/export.h>
00024
00025 #include <geos/geom/Polygon.h>
00026
00027
00028 namespace geos {
00029 namespace geom {
00030 class Envelope;
00031 class Geometry;
00032 class Point;
00033 class Coordinate;
00034 class LineString;
00035
00036 }
00037 }
00038
00039 namespace geos {
00040 namespace operation {
00041 namespace predicate {
00042
00052 class GEOS_DLL RectangleContains {
00053
00054 private:
00055
00056 const geom::Polygon& rectangle;
00057 const geom::Envelope& rectEnv;
00058
00059 bool isContainedInBoundary(const geom::Geometry& geom);
00060
00061 bool isPointContainedInBoundary(const geom::Point& geom);
00062
00070 bool isPointContainedInBoundary(const geom::Coordinate &pt);
00071
00079 bool isLineStringContainedInBoundary(const geom::LineString &line);
00080
00089 bool isLineSegmentContainedInBoundary(const geom::Coordinate& p0,
00090 const geom::Coordinate& p1);
00091
00092 public:
00093
00094 static bool contains(const geom::Polygon& rect, const geom::Geometry& b)
00095 {
00096 RectangleContains rc(rect);
00097 return rc.contains(b);
00098 }
00099
00105 RectangleContains(const geom::Polygon& rect)
00106 :
00107 rectangle(rect),
00108 rectEnv(*(rect.getEnvelopeInternal()))
00109 {}
00110
00111 bool contains(const geom::Geometry& geom);
00112
00113
00114 RectangleContains(const RectangleContains& other);
00115 RectangleContains& operator=(const RectangleContains& rhs);
00116 };
00117
00118
00119
00120 }
00121 }
00122 }
00123
00124 #endif // ifndef GEOS_OP_PREDICATE_RECTANGLECONTAINS_H