geomgraph/DirectedEdgeStar.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
* Copyright (C) 2005-2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions 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: geomgraph/DirectedEdgeStar.java r428 (JTS-1.12+)
*
**********************************************************************/
#pragma once
#include <memory>
#include <geos/export.h>
#include <set>
#include <string>
#include <vector>
#include <geos/geomgraph/EdgeEndStar.h> // for inheritance
#include <geos/geomgraph/Label.h> // for private member
#include <geos/geom/Coordinate.h> // for p0,p1
// Forward declarations
namespace geos {
namespace geomgraph {
class DirectedEdge;
class EdgeRing;
}
}
namespace geos {
namespace geomgraph { // geos.geomgraph
class GEOS_DLL DirectedEdgeStar: public EdgeEndStar {
public:
DirectedEdgeStar()
:
EdgeEndStar(),
label(),
resultAreaEdgesComputed(false)
{}
~DirectedEdgeStar() override = default;
void insert(EdgeEnd* ee) override;
Label&
getLabel()
{
return label;
}
int getOutgoingDegree();
int getOutgoingDegree(EdgeRing* er);
DirectedEdge* getRightmostEdge();
void computeLabelling(const std::vector<std::unique_ptr<GeometryGraph>>&geom) override; // throw(TopologyException *);
void mergeSymLabels();
void updateLabelling(const Label& nodeLabel);
void linkResultDirectedEdges(); // throw(TopologyException *);
void linkMinimalDirectedEdges(EdgeRing* er);
void linkAllDirectedEdges();
void findCoveredLineEdges();
void computeDepths(DirectedEdge* de);
std::string print() const override;
private:
std::vector<DirectedEdge*> resultAreaEdgeList;
Label label;
bool resultAreaEdgesComputed;
const std::vector<DirectedEdge*>& getResultAreaEdges();
enum {
SCANNING_FOR_INCOMING = 1,
LINKING_TO_OUTGOING
};
int computeDepths(EdgeEndStar::iterator startIt,
EdgeEndStar::iterator endIt, int startDepth);
};
} // namespace geos.geomgraph
} // namespace geos
geos::geomgraph::DirectedEdgeStar::computeDepths
void computeDepths(DirectedEdge *de)
Compute the DirectedEdge depths for a subsequence of the edge array.
geos::geomgraph::DirectedEdgeStar::updateLabelling
void updateLabelling(const Label &nodeLabel)
Update incomplete dirEdge labels from the labelling for the node.
geos::geomgraph::DirectedEdgeStar::linkResultDirectedEdges
void linkResultDirectedEdges()
Traverse the star of DirectedEdges, linking the included edges together.
geos::geomgraph::DirectedEdgeStar::findCoveredLineEdges
void findCoveredLineEdges()
Traverse the star of edges, maintaining the current location in the result area at this node (if any)...
geos::geomgraph::DirectedEdgeStar::insert
void insert(EdgeEnd *ee) override
Insert a directed edge in the list.
geos::geomgraph::DirectedEdgeStar::mergeSymLabels
void mergeSymLabels()
For each dirEdge in the star, merge the label from the sym dirEdge into the label.
geos::geomgraph::DirectedEdgeStar::computeLabelling
void computeLabelling(const std::vector< std::unique_ptr< GeometryGraph > > &geom) override
Compute the labelling for all dirEdges in this star, as well as the overall labelling.
geos::geomgraph::DirectedEdge
A directed EdgeEnd.
Definition geomgraph/DirectedEdge.h:42
geos::geomgraph::EdgeEnd
Models the end of an edge incident on a node.
Definition EdgeEnd.h:54
geos::geomgraph::EdgeRing
Definition geomgraph/EdgeRing.h:57
geos::geomgraph::Label
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition Label.h:57
geos::geom
Definition Angle.h:26
geos::geomgraph
Contains classes that implement topology graphs.
Definition Depth.h:31
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38