IntersectionPointBuilder.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/geom/Point.h>
#include <geos/operation/overlayng/OverlayNG.h>
#include <geos/export.h>
#include <vector>
#include <memory>
// Forward declarations
namespace geos {
namespace geom {
class GeometryFactory;
}
namespace operation {
namespace overlayng {
class OverlayEdge;
class OverlayGraph;
class OverlayLabel;
}
}
}
namespace geos { // geos.
namespace operation { // geos.operation
namespace overlayng { // geos.operation.overlayng
class GEOS_DLL IntersectionPointBuilder {
private:
// Members
OverlayGraph* graph;
const geom::GeometryFactory* geometryFactory;
std::vector<std::unique_ptr<geom::Point>> points;
bool isAllowCollapseLines;
// Methods
void addResultPoints();
bool isResultPoint(OverlayEdge* nodeEdge) const;
bool isEdgeOf(const OverlayLabel* label, uint8_t i) const;
public:
IntersectionPointBuilder(OverlayGraph* p_graph, const geom::GeometryFactory* geomFact)
: graph(p_graph)
, geometryFactory(geomFact)
, isAllowCollapseLines(!OverlayNG::STRICT_MODE_DEFAULT)
{}
std::vector<std::unique_ptr<geom::Point>> getPoints();
IntersectionPointBuilder(const IntersectionPointBuilder&) = delete;
IntersectionPointBuilder& operator=(const IntersectionPointBuilder&) = delete;
void setStrictMode(bool p_isStrictMode)
{
isAllowCollapseLines = ! p_isStrictMode;
}
};
} // namespace geos.operation.overlayng
} // namespace geos.operation
} // namespace geos
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
geos::operation::overlayng::OverlayEdge
Definition OverlayEdge.h:47
geos::operation::overlayng::OverlayGraph
Definition OverlayGraph.h:52
geos::operation::overlayng::OverlayLabel
Definition OverlayLabel.h:86
geos::operation::overlayng::OverlayNG::STRICT_MODE_DEFAULT
static constexpr bool STRICT_MODE_DEFAULT
Definition OverlayNG.h:173
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