GEOS  3.13.0dev
PreparedGeometry.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  * Last port: geom/prep/PreparedGeometry.java rev. 1.11 (JTS-1.10)
16  *
17  **********************************************************************/
18 
19 #pragma once
20 
21 #include <vector>
22 #include <memory>
23 #include <geos/export.h>
24 
25 // Forward declarations
26 namespace geos {
27  namespace geom {
28  class Geometry;
29  class Coordinate;
30  class CoordinateSequence;
31  }
32 }
33 
34 
35 namespace geos {
36 namespace geom { // geos::geom
37 namespace prep { // geos::geom::prep
38 
56 class GEOS_DLL PreparedGeometry {
57 public:
58  virtual
59  ~PreparedGeometry() {}
60 
66  virtual const geom::Geometry& getGeometry() const = 0;
67 
76  virtual bool contains(const geom::Geometry* geom) const = 0;
77 
117  virtual bool containsProperly(const geom::Geometry* geom) const = 0;
118 
127  virtual bool coveredBy(const geom::Geometry* geom) const = 0;
128 
137  virtual bool covers(const geom::Geometry* geom) const = 0;
138 
147  virtual bool crosses(const geom::Geometry* geom) const = 0;
148 
157  virtual bool disjoint(const geom::Geometry* geom) const = 0;
158 
167  virtual bool intersects(const geom::Geometry* geom) const = 0;
168 
177  virtual bool overlaps(const geom::Geometry* geom) const = 0;
178 
187  virtual bool touches(const geom::Geometry* geom) const = 0;
188 
197  virtual bool within(const geom::Geometry* geom) const = 0;
198 
207  virtual std::unique_ptr<geom::CoordinateSequence> nearestPoints(const geom::Geometry* geom) const = 0;
208 
217  virtual double distance(const geom::Geometry* geom) const = 0;
218 
229  virtual bool isWithinDistance(const geom::Geometry* geom, double dist) const = 0;
230 };
231 
232 
233 } // namespace geos::geom::prep
234 } // namespace geos::geom
235 } // namespace geos
236 
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
An interface for classes which prepare Geometrys in order to optimize the performance of repeated cal...
Definition: PreparedGeometry.h:56
virtual bool intersects(const geom::Geometry *geom) const =0
Tests whether the base Geometry intersects a given geometry.
virtual bool contains(const geom::Geometry *geom) const =0
Tests whether the base Geometry contains a given geometry.
virtual bool coveredBy(const geom::Geometry *geom) const =0
Tests whether the base Geometry is covered by a given geometry.
virtual bool overlaps(const geom::Geometry *geom) const =0
Tests whether the base Geometry overlaps a given geometry.
virtual bool containsProperly(const geom::Geometry *geom) const =0
Tests whether the base Geometry properly contains a given geometry.
virtual bool isWithinDistance(const geom::Geometry *geom, double dist) const =0
Tests whether the base Geometry is within a given distance from the given geometry.
virtual std::unique_ptr< geom::CoordinateSequence > nearestPoints(const geom::Geometry *geom) const =0
Compute the nearest locations on the base Geometry and the given geometry.
virtual bool disjoint(const geom::Geometry *geom) const =0
Tests whether the base Geometry is disjoint from a given geometry.
virtual bool crosses(const geom::Geometry *geom) const =0
Tests whether the base Geometry crosses a given geometry.
virtual bool within(const geom::Geometry *geom) const =0
Tests whether the base Geometry is within a given geometry.
virtual bool covers(const geom::Geometry *geom) const =0
Tests whether the base Geometry covers a given geometry.
virtual bool touches(const geom::Geometry *geom) const =0
Tests whether the base Geometry touches a given geometry.
virtual const geom::Geometry & getGeometry() const =0
Gets the original Geometry which has been prepared.
virtual double distance(const geom::Geometry *geom) const =0
Compute the minimum distance between the base Geometry and the given geometry.
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25