GEOS  3.4.2
BasicPreparedGeometry.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  *
14  **********************************************************************
15  *
16  * Last port: geom/prep/BasicPreparedGeometry.java rev. 1.5 (JTS-1.10)
17  *
18  **********************************************************************/
19 
20 #ifndef GEOS_GEOM_PREP_BASICPREPAREDGEOMETRY_H
21 #define GEOS_GEOM_PREP_BASICPREPAREDGEOMETRY_H
22 
23 #include <geos/geom/prep/PreparedGeometry.h> // for inheritance
24 //#include <geos/algorithm/PointLocator.h>
25 //#include <geos/geom/util/ComponentCoordinateExtracter.h>
26 #include <geos/geom/Coordinate.h>
27 //#include <geos/geom/Location.h>
28 
29 #include <vector>
30 #include <string>
31 
32 namespace geos {
33  namespace geom {
34  class Geometry;
35  class Coordinate;
36  }
37 }
38 
39 
40 namespace geos {
41 namespace geom { // geos::geom
42 namespace prep { // geos::geom::prep
43 
44 // * \class BasicPreparedGeometry
45 
60 {
61 private:
62  const geom::Geometry * baseGeom;
63  Coordinate::ConstVect representativePts;
64 
65 protected:
69  void setGeometry( const geom::Geometry * geom );
70 
78  bool envelopesIntersect(const geom::Geometry* g) const;
79 
88  bool envelopeCovers(const geom::Geometry* g) const;
89 
90 public:
91  BasicPreparedGeometry( const Geometry * geom);
92 
94 
95  const geom::Geometry & getGeometry() const
96  {
97  return *baseGeom;
98  }
99 
108  {
109  return &representativePts;
110  }
111 
121  bool isAnyTargetComponentInTest(const geom::Geometry * testGeom) const;
122 
126  bool contains(const geom::Geometry * g) const;
127 
131  bool containsProperly(const geom::Geometry * g) const;
132 
136  bool coveredBy(const geom::Geometry * g) const;
137 
141  bool covers(const geom::Geometry * g) const;
142 
146  bool crosses(const geom::Geometry * g) const;
147 
152  bool disjoint(const geom::Geometry * g) const;
153 
157  bool intersects(const geom::Geometry * g) const;
158 
162  bool overlaps(const geom::Geometry * g) const;
163 
167  bool touches(const geom::Geometry * g) const;
168 
172  bool within(const geom::Geometry * g) const;
173 
174  std::string toString();
175 
176 };
177 
178 } // namespace geos::geom::prep
179 } // namespace geos::geom
180 } // namespace geos
181 
182 #endif // GEOS_GEOM_PREP_BASICPREPAREDGEOMETRY_H
bool covers(const geom::Geometry *g) const
bool touches(const geom::Geometry *g) const
std::vector< const Coordinate * > ConstVect
A vector of const Coordinate pointers.
Definition: Coordinate.h:71
bool containsProperly(const geom::Geometry *g) const
bool coveredBy(const geom::Geometry *g) const
bool contains(const geom::Geometry *g) const
bool within(const geom::Geometry *g) const
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:167
const Coordinate::ConstVect * getRepresentativePoints() const
Definition: BasicPreparedGeometry.h:107
bool intersects(const geom::Geometry *g) const
const geom::Geometry & getGeometry() const
Definition: BasicPreparedGeometry.h:95
An interface for classes which prepare Geometrys in order to optimize the performance of repeated cal...
Definition: PreparedGeometry.h:53
bool disjoint(const geom::Geometry *g) const
A base class for PreparedGeometry subclasses.
Definition: BasicPreparedGeometry.h:59
bool crosses(const geom::Geometry *g) const
bool overlaps(const geom::Geometry *g) const
bool envelopeCovers(const geom::Geometry *g) const
bool isAnyTargetComponentInTest(const geom::Geometry *testGeom) const
void setGeometry(const geom::Geometry *geom)
bool envelopesIntersect(const geom::Geometry *g) const