GEOS  3.14.0dev
PreparedLineString.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/PreparedLineString.java rev 1.3 (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/noding/FastSegmentSetIntersectionFinder.h>
26 #include <geos/operation/distance/IndexedFacetDistance.h>
27 
28 #include <memory>
29 
30 namespace geos {
31 namespace geom { // geos::geom
32 namespace prep { // geos::geom::prep
33 
42 private:
43  std::unique_ptr<noding::FastSegmentSetIntersectionFinder> segIntFinder;
44  mutable noding::SegmentString::ConstVect segStrings;
45  mutable std::unique_ptr<operation::distance::IndexedFacetDistance> indexedDistance;
46 
47 protected:
48 public:
49  PreparedLineString(const Geometry* geom)
50  :
52  segIntFinder(nullptr)
53  { }
54 
55  ~PreparedLineString() override;
56 
57  noding::FastSegmentSetIntersectionFinder* getIntersectionFinder();
58 
59  bool intersects(const geom::Geometry* g) const override;
60  std::unique_ptr<geom::CoordinateSequence> nearestPoints(const geom::Geometry* g) const override;
61  double distance(const geom::Geometry* g) const override;
62  bool isWithinDistance(const geom::Geometry* g, double d) const override;
63  operation::distance::IndexedFacetDistance* getIndexedFacetDistance() const;
64 
65 };
66 
67 } // namespace geos::geom::prep
68 } // namespace geos::geom
69 } // namespace geos
70 
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 LinearRing, LineString or MultiLineString geometries.
Definition: PreparedLineString.h:41
std::unique_ptr< geom::CoordinateSequence > nearestPoints(const geom::Geometry *g) const override
bool intersects(const geom::Geometry *g) const override
bool isWithinDistance(const geom::Geometry *g, double d) const override
double distance(const geom::Geometry *g) 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: Angle.h:25