OverlayLabeller.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/export.h>
#include <geos/geom/Location.h>
#include <geos/operation/overlayng/OverlayGraph.h>
#include <vector>
#include <deque>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
}
namespace operation {
namespace overlayng {
class OverlayLabel;
class OverlayGraph;
class OverlayEdge;
class InputGeometry;
}
}
}
namespace geos { // geos.
namespace operation { // geos.operation
namespace overlayng { // geos.operation.overlayng
class GEOS_DLL OverlayLabeller {
private:
// Members
OverlayGraph* graph;
InputGeometry* inputGeometry;
std::vector<OverlayEdge*>& edges;
static OverlayEdge* findPropagationStartEdge(OverlayEdge* nodeEdge, uint8_t geomIndex);
void labelCollapsedEdges();
static void labelCollapsedEdge(OverlayEdge* edge, uint8_t geomIndex);
void labelConnectedLinearEdges();
void propagateLinearLocations(uint8_t geomIndex);
static void propagateLinearLocationAtNode(OverlayEdge* eNode, uint8_t geomIndex, bool isInputLine, std::deque<OverlayEdge*>& edgeStack);
static std::vector<OverlayEdge*> findLinearEdgesWithLocation(const std::vector<OverlayEdge *> &edges, uint8_t geomIndex);
void labelDisconnectedEdges();
void labelDisconnectedEdge(OverlayEdge* edge, uint8_t geomIndex);
geom::Location locateEdge(uint8_t geomIndex, OverlayEdge* edge);
geom::Location locateEdgeBothEnds(uint8_t geomIndex, OverlayEdge* edge);
void labelAreaNodeEdges(std::vector<OverlayEdge*>& nodes);
public:
OverlayLabeller(OverlayGraph* p_graph, InputGeometry* p_inputGeometry)
: graph(p_graph)
, inputGeometry(p_inputGeometry)
, edges(p_graph->getEdges())
{}
void computeLabelling();
void propagateAreaLocations(OverlayEdge* nodeEdge, uint8_t geomIndex);
void markResultAreaEdges(int overlayOpCode);
static void markInResultArea(OverlayEdge* e, int overlayOpCode);
void unmarkDuplicateEdgesFromResultArea();
};
} // namespace geos.operation.overlayng
} // namespace geos.operation
} // namespace geos
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::operation::overlayng::InputGeometry
Definition InputGeometry.h:41
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::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