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