OverlayEdgeRing.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
*
* 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.
*
**********************************************************************/
#pragma once
#include <geos/algorithm/locate/IndexedPointInAreaLocator.h>
#include <geos/geom/CoordinateSequence.h>
#include <geos/geom/LinearRing.h>
#include <geos/export.h>
// Forward declarations
namespace geos {
namespace algorithm {
namespace locate {
class PointOnGeometryLocator;
}
}
namespace geom {
class Coordinate;
class CoordinateSequence;
class GeometryFactory;
class LinearRing;
class Polygon;
}
namespace operation {
namespace overlayng {
class OverlayEdge;
}
}
}
namespace geos { // geos.
namespace operation { // geos.operation
namespace overlayng { // geos.operation.overlayng
class GEOS_DLL OverlayEdgeRing {
using Coordinate = geos::geom::Coordinate;
using CoordinateSequence = geos::geom::CoordinateSequence;
using GeometryFactory = geos::geom::GeometryFactory;
using LinearRing = geos::geom::LinearRing;
using Polygon = geos::geom::Polygon;
using PointOnGeometryLocator = algorithm::locate::PointOnGeometryLocator;
using IndexedPointInAreaLocator = algorithm::locate::IndexedPointInAreaLocator;
private:
// Members
OverlayEdge* startEdge;
std::unique_ptr<LinearRing> ring;
bool m_isHole;
std::unique_ptr<IndexedPointInAreaLocator> locator;
OverlayEdgeRing* shell;
// a list of EdgeRings which are holes in this EdgeRing
std::vector<OverlayEdgeRing*> holes;
// Methods
void computeRingPts(OverlayEdge* start, CoordinateSequence& pts);
void computeRing(std::unique_ptr<CoordinateSequence> && ringPts, const GeometryFactory* geometryFactory);
const CoordinateSequence& getCoordinates();
PointOnGeometryLocator* getLocator();
static void closeRing(CoordinateSequence& pts);
public:
OverlayEdgeRing(OverlayEdge* start, const GeometryFactory* geometryFactory);
std::unique_ptr<LinearRing> getRing();
const LinearRing* getRingPtr() const;
bool isHole() const;
void setShell(OverlayEdgeRing* p_shell);
bool hasShell() const;
const OverlayEdgeRing* getShell() const;
void addHole(OverlayEdgeRing* ring);
bool isInRing(const Coordinate& pt);
const Coordinate& getCoordinate();
std::unique_ptr<Polygon> toPolygon(const GeometryFactory* factory);
OverlayEdge* getEdge();
OverlayEdgeRing* findEdgeRingContaining(const std::vector<OverlayEdgeRing*>& erList);
};
} // namespace geos.operation.overlayng
} // namespace geos.operation
} // 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::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
geos::geom::LinearRing
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
geos::geom::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
geos::operation::overlayng::OverlayEdge
Definition OverlayEdge.h:47
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
Definition Angle.h:26
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38