GEOS 3.9.1
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
32namespace geos {
33namespace geom {
34class Geometry;
35class Coordinate;
36}
37}
38
39
40namespace geos {
41namespace geom { // geos::geom
42namespace prep { // geos::geom::prep
43
44// * \class BasicPreparedGeometry
45
60private:
61 const geom::Geometry* baseGeom;
62 Coordinate::ConstVect representativePts;
63
64protected:
68 void setGeometry(const geom::Geometry* geom);
69
77 bool envelopesIntersect(const geom::Geometry* g) const;
78
87 bool envelopeCovers(const geom::Geometry* g) const;
88
89public:
91
92 ~BasicPreparedGeometry() override = default;
93
94 const geom::Geometry&
95 getGeometry() const override
96 {
97 return *baseGeom;
98 }
99
109 {
110 return &representativePts;
111 }
112
121 bool isAnyTargetComponentInTest(const geom::Geometry* testGeom) const;
122
126 bool contains(const geom::Geometry* g) const override;
127
131 bool containsProperly(const geom::Geometry* g) const override;
132
136 bool coveredBy(const geom::Geometry* g) const override;
137
141 bool covers(const geom::Geometry* g) const override;
142
146 bool crosses(const geom::Geometry* g) const override;
147
152 bool disjoint(const geom::Geometry* g) const override;
153
157 bool intersects(const geom::Geometry* g) const override;
158
162 bool overlaps(const geom::Geometry* g) const override;
163
167 bool touches(const geom::Geometry* g) const override;
168
172 bool within(const geom::Geometry* g) const override;
173
177 std::unique_ptr<geom::CoordinateSequence> nearestPoints(const geom::Geometry* g) const override;
178
182 double distance(const geom::Geometry* g) const override;
183
184 std::string toString();
185
186};
187
188} // namespace geos::geom::prep
189} // namespace geos::geom
190} // namespace geos
191
192#endif // GEOS_GEOM_PREP_BASICPREPAREDGEOMETRY_H
std::vector< const Coordinate * > ConstVect
A vector of const Coordinate pointers.
Definition Coordinate.h:71
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:188
A base class for PreparedGeometry subclasses.
Definition BasicPreparedGeometry.h:59
bool covers(const geom::Geometry *g) const override
bool envelopeCovers(const geom::Geometry *g) const
bool coveredBy(const geom::Geometry *g) const override
bool intersects(const geom::Geometry *g) const override
bool contains(const geom::Geometry *g) const override
const geom::Geometry & getGeometry() const override
Gets the original Geometry which has been prepared.
Definition BasicPreparedGeometry.h:95
double distance(const geom::Geometry *g) const override
bool isAnyTargetComponentInTest(const geom::Geometry *testGeom) const
bool envelopesIntersect(const geom::Geometry *g) const
bool touches(const geom::Geometry *g) const override
bool crosses(const geom::Geometry *g) const override
const Coordinate::ConstVect * getRepresentativePoints() const
Definition BasicPreparedGeometry.h:108
bool overlaps(const geom::Geometry *g) const override
void setGeometry(const geom::Geometry *geom)
bool within(const geom::Geometry *g) const override
bool disjoint(const geom::Geometry *g) const override
std::unique_ptr< geom::CoordinateSequence > nearestPoints(const geom::Geometry *g) const override
bool containsProperly(const geom::Geometry *g) const override
An interface for classes which prepare Geometrys in order to optimize the performance of repeated cal...
Definition PreparedGeometry.h:57
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26