00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_GEOM_PREP_BASICPREPAREDGEOMETRY_H
00022 #define GEOS_GEOM_PREP_BASICPREPAREDGEOMETRY_H
00023
00024 #include <geos/geom/prep/PreparedGeometry.h>
00025
00026
00027 #include <geos/geom/Coordinate.h>
00028
00029
00030 #include <vector>
00031 #include <string>
00032
00033 namespace geos {
00034 namespace geom {
00035 class Geometry;
00036 class Coordinate;
00037 }
00038 }
00039
00040
00041 namespace geos {
00042 namespace geom {
00043 namespace prep {
00044
00045
00046
00060 class BasicPreparedGeometry: public PreparedGeometry
00061 {
00062 private:
00063 const geom::Geometry * baseGeom;
00064 Coordinate::ConstVect representativePts;
00065
00066 protected:
00070 void setGeometry( const geom::Geometry * geom );
00071
00079 bool envelopesIntersect(const geom::Geometry* g) const;
00080
00089 bool envelopeCovers(const geom::Geometry* g) const;
00090
00091 public:
00092 BasicPreparedGeometry( const Geometry * geom);
00093
00094 ~BasicPreparedGeometry( );
00095
00096 const geom::Geometry & getGeometry() const
00097 {
00098 return *baseGeom;
00099 }
00100
00108 const Coordinate::ConstVect * getRepresentativePoints() const
00109 {
00110 return &representativePts;
00111 }
00112
00122 bool isAnyTargetComponentInTest(const geom::Geometry * testGeom) const;
00123
00127 bool contains(const geom::Geometry * g) const;
00128
00132 bool containsProperly(const geom::Geometry * g) const;
00133
00137 bool coveredBy(const geom::Geometry * g) const;
00138
00142 bool covers(const geom::Geometry * g) const;
00143
00147 bool crosses(const geom::Geometry * g) const;
00148
00153 bool disjoint(const geom::Geometry * g) const;
00154
00158 bool intersects(const geom::Geometry * g) const;
00159
00163 bool overlaps(const geom::Geometry * g) const;
00164
00168 bool touches(const geom::Geometry * g) const;
00169
00173 bool within(const geom::Geometry * g) const;
00174
00175 std::string toString();
00176
00177 };
00178
00179 }
00180 }
00181 }
00182
00183 #endif // GEOS_GEOM_PREP_BASICPREPAREDGEOMETRY_H
00184
00185
00186
00187