GEOS: BasicPreparedGeometry.h Source File

GEOS 3.3.8

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

BasicPreparedGeometry.h
1 /**********************************************************************
2 * $Id: BasicPreparedGeometry.h 2419 2009-04-29 08:22:16Z strk $
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.refractions.net
6 *
7 * Copyright (C) 2006 Refractions Research Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 *
15 **********************************************************************
16 *
17 * Last port: geom/prep/BasicPreparedGeometry.java rev. 1.5 (JTS-1.10)
18 *
19 **********************************************************************/
20
21 #ifndef GEOS_GEOM_PREP_BASICPREPAREDGEOMETRY_H
22 #define GEOS_GEOM_PREP_BASICPREPAREDGEOMETRY_H
23
24 #include <geos/geom/prep/PreparedGeometry.h> // for inheritance
25 //#include <geos/algorithm/PointLocator.h>
26 //#include <geos/geom/util/ComponentCoordinateExtracter.h>
27 #include <geos/geom/Coordinate.h>
28 //#include <geos/geom/Location.h>
29
30 #include <vector>
31 #include <string>
32
33 namespace geos {
34 namespace geom {
35 class Geometry;
36 class Coordinate;
37 }
38 }
39
40
41 namespace geos {
42 namespace geom { // geos::geom
43 namespace prep { // geos::geom::prep
44
45 // * \class BasicPreparedGeometry
46
60 class BasicPreparedGeometry: public PreparedGeometry
61 {
62 private:
63 const geom::Geometry * baseGeom;
64 Coordinate::ConstVect representativePts;
65
66 protected:
70 void setGeometry( const geom::Geometry * geom );
71
79 bool envelopesIntersect(const geom::Geometry* g) const;
80
89 bool envelopeCovers(const geom::Geometry* g) const;
90
91 public:
92 BasicPreparedGeometry( const Geometry * geom);
93
94 ~BasicPreparedGeometry( );
95
96 const geom::Geometry & getGeometry() const
97 {
98 return *baseGeom;
99 }
100
108 const Coordinate::ConstVect * getRepresentativePoints() const
109 {
110 return &representativePts;
111 }
112
122 bool isAnyTargetComponentInTest(const geom::Geometry * testGeom) const;
123
127 bool contains(const geom::Geometry * g) const;
128
132 bool containsProperly(const geom::Geometry * g) const;
133
137 bool coveredBy(const geom::Geometry * g) const;
138
142 bool covers(const geom::Geometry * g) const;
143
147 bool crosses(const geom::Geometry * g) const;
148
153 bool disjoint(const geom::Geometry * g) const;
154
158 bool intersects(const geom::Geometry * g) const;
159
163 bool overlaps(const geom::Geometry * g) const;
164
168 bool touches(const geom::Geometry * g) const;
169
173 bool within(const geom::Geometry * g) const;
174
175 std::string toString();
176
177 };
178
179 } // namespace geos::geom::prep
180 } // namespace geos::geom
181 } // namespace geos
182
183 #endif // GEOS_GEOM_PREP_BASICPREPAREDGEOMETRY_H
184 /**********************************************************************
185 * $Log$
186 **********************************************************************/
187