PreparedPolygon.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2020 Sandro Santilli <strk@kbt.io>
* Copyright (C) 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
*
**********************************************************************
*
* Last port: geom/prep/PreparedPolygon.java rev 1.7 (JTS-1.10)
*
**********************************************************************/
#pragma once
#include <geos/geom/prep/BasicPreparedGeometry.h> // for inheritance
#include <geos/noding/SegmentString.h>
#include <geos/operation/distance/IndexedFacetDistance.h>
#include <memory>
namespace geos {
namespace noding {
class FastSegmentSetIntersectionFinder;
}
namespace algorithm {
namespace locate {
class PointOnGeometryLocator;
}
}
}
namespace geos {
namespace geom { // geos::geom
namespace prep { // geos::geom::prep
class PreparedPolygon : public BasicPreparedGeometry {
private:
bool isRectangle;
mutable std::unique_ptr<noding::FastSegmentSetIntersectionFinder> segIntFinder;
mutable std::unique_ptr<algorithm::locate::PointOnGeometryLocator> ptOnGeomLoc;
mutable std::unique_ptr<algorithm::locate::PointOnGeometryLocator> indexedPtOnGeomLoc;
mutable noding::SegmentString::ConstVect segStrings;
mutable std::unique_ptr<operation::distance::IndexedFacetDistance> indexedDistance;
protected:
public:
PreparedPolygon(const geom::Geometry* geom);
~PreparedPolygon() override;
noding::FastSegmentSetIntersectionFinder* getIntersectionFinder() const;
algorithm::locate::PointOnGeometryLocator* getPointLocator() const;
operation::distance::IndexedFacetDistance* getIndexedFacetDistance() const;
bool contains(const geom::Geometry* g) const override;
bool containsProperly(const geom::Geometry* g) const override;
bool covers(const geom::Geometry* g) const override;
bool intersects(const geom::Geometry* g) const override;
double distance(const geom::Geometry* g) const override;
bool isWithinDistance(const geom::Geometry* g, double d) const override;
};
} // namespace geos::geom::prep
} // namespace geos::geom
} // namespace geos
geos::algorithm::locate::PointOnGeometryLocator
An interface for classes which determine the Location of points in Polygon or MultiPolygon geometries...
Definition PointOnGeometryLocator.h:36
geos::geom::Geometry
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:196
geos::geom::prep::PreparedPolygon::distance
double distance(const geom::Geometry *g) const override
geos::geom::prep::PreparedPolygon::intersects
bool intersects(const geom::Geometry *g) const override
geos::geom::prep::PreparedPolygon::contains
bool contains(const geom::Geometry *g) const override
geos::geom::prep::PreparedPolygon::covers
bool covers(const geom::Geometry *g) const override
geos::geom::prep::PreparedPolygon::containsProperly
bool containsProperly(const geom::Geometry *g) const override
geos::geom::prep::PreparedPolygon::isWithinDistance
bool isWithinDistance(const geom::Geometry *g, double d) const override
geos::noding::FastSegmentSetIntersectionFinder
Finds if two sets of SegmentStrings intersect.
Definition FastSegmentSetIntersectionFinder.h:50
geos::operation::distance::IndexedFacetDistance
Computes the distance between the facets (segments and vertices) of two Geometrys using a Branch-and-...
Definition IndexedFacetDistance.h:46
geos::algorithm::locate
Classes which determine the Location of points in geometries.
Definition IndexedPointInAreaLocator.h:40
geos::algorithm
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:32
geos::geom::prep
Contains classes and interfaces implementing algorithms that optimize the performance of repeated cal...
Definition AbstractPreparedPolygonContains.h:30
geos::geom
Definition Angle.h:26
geos::noding
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition CoverageCleaner.h:42
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38