GEOS 3.14.0dev
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#pragma once
22
23#include <geos/geom/prep/BasicPreparedGeometry.h> // for inheritance
24#include <geos/noding/SegmentString.h>
25#include <geos/operation/distance/IndexedFacetDistance.h>
26
27#include <memory>
28
29namespace geos {
30namespace noding {
31class FastSegmentSetIntersectionFinder;
32}
33namespace algorithm {
34namespace locate {
35class PointOnGeometryLocator;
36}
37}
38}
39
40namespace geos {
41namespace geom { // geos::geom
42namespace prep { // geos::geom::prep
43
52private:
53 bool isRectangle;
54 mutable std::unique_ptr<noding::FastSegmentSetIntersectionFinder> segIntFinder;
55 mutable std::unique_ptr<algorithm::locate::PointOnGeometryLocator> ptOnGeomLoc;
56 mutable std::unique_ptr<algorithm::locate::PointOnGeometryLocator> indexedPtOnGeomLoc;
57 mutable noding::SegmentString::ConstVect segStrings;
58 mutable std::unique_ptr<operation::distance::IndexedFacetDistance> indexedDistance;
59
60protected:
61public:
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 bool isWithinDistance(const geom::Geometry* g, double d) const override;
75
76};
77
78} // namespace geos::geom::prep
79} // namespace geos::geom
80} // namespace geos
81
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition PointOnGeometryLocator.h:36
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
A base class for PreparedGeometry subclasses.
Definition BasicPreparedGeometry.h:56
A prepared version of Polygon or MultiPolygon geometries.
Definition PreparedPolygon.h:51
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
bool isWithinDistance(const geom::Geometry *g, double d) const override
Finds if two sets of SegmentStrings intersect.
Definition FastSegmentSetIntersectionFinder.h:50
Computes the distance between the facets (segments and vertices) of two Geometrys using a Branch-and-...
Definition IndexedFacetDistance.h:46
Basic namespace for all GEOS functionalities.
Definition geos.h:39