GEOS  3.9.1
PreparedPolygon.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2020 Sandro Santilli <strk@kbt.io>
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/PreparedPolygon.java rev 1.7 (JTS-1.10)
18  *
19  **********************************************************************/
20 
21 #ifndef GEOS_GEOM_PREP_PREPAREDPOLYGON_H
22 #define GEOS_GEOM_PREP_PREPAREDPOLYGON_H
23 
24 #include <geos/geom/prep/BasicPreparedGeometry.h> // for inheritance
25 #include <geos/noding/SegmentString.h>
26 #include <geos/operation/distance/IndexedFacetDistance.h>
27 
28 #include <memory>
29 
30 namespace geos {
31 namespace noding {
33 }
34 namespace algorithm {
35 namespace locate {
36 class PointOnGeometryLocator;
37 }
38 }
39 }
40 
41 namespace geos {
42 namespace geom { // geos::geom
43 namespace prep { // geos::geom::prep
44 
53 private:
54  bool isRectangle;
55  mutable std::unique_ptr<noding::FastSegmentSetIntersectionFinder> segIntFinder;
56  mutable std::unique_ptr<algorithm::locate::PointOnGeometryLocator> ptOnGeomLoc;
57  mutable noding::SegmentString::ConstVect segStrings;
58  mutable std::unique_ptr<operation::distance::IndexedFacetDistance> indexedDistance;
59 
60 protected:
61 public:
62  PreparedPolygon(const geom::Geometry* geom);
63  ~PreparedPolygon() override;
64 
65  noding::FastSegmentSetIntersectionFinder* getIntersectionFinder() const;
66  algorithm::locate::PointOnGeometryLocator* getPointLocator() const;
67  operation::distance::IndexedFacetDistance* getIndexedFacetDistance() const;
68 
69  bool contains(const geom::Geometry* g) const override;
70  bool containsProperly(const geom::Geometry* g) const override;
71  bool covers(const geom::Geometry* g) const override;
72  bool intersects(const geom::Geometry* g) const override;
73  double distance(const geom::Geometry* g) const override;
74 
75 };
76 
77 } // namespace geos::geom::prep
78 } // namespace geos::geom
79 } // namespace geos
80 
81 #endif // GEOS_GEOM_PREP_PREPAREDPOLYGON_H
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition: PointOnGeometryLocator.h:37
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
A base class for PreparedGeometry subclasses.
Definition: BasicPreparedGeometry.h:59
A prepared version of Polygon or MultiPolygon geometries.
Definition: PreparedPolygon.h:52
double distance(const geom::Geometry *g) const override
bool intersects(const geom::Geometry *g) const override
bool contains(const geom::Geometry *g) const override
bool covers(const geom::Geometry *g) const override
bool containsProperly(const geom::Geometry *g) const override
Finds if two sets of SegmentStrings intersect.
Definition: FastSegmentSetIntersectionFinder.h:51
Computes the distance between the facets (segments and vertices) of two Geometrys using a Branch-and-...
Definition: IndexedFacetDistance.h:47
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26