22 #ifndef GEOS_GEOMGRAPH_EDGE_H
23 #define GEOS_GEOMGRAPH_EDGE_H
25 #include <geos/export.h>
29 #include <geos/geomgraph/GraphComponent.h>
30 #include <geos/geomgraph/Depth.h>
31 #include <geos/geomgraph/EdgeIntersectionList.h>
32 #include <geos/geom/CoordinateSequence.h>
34 #include <geos/inline.h>
38 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
45 class IntersectionMatrix;
49 class LineIntersector;
57 class MonotoneChainEdge;
67 using GraphComponent::updateIM;
74 index::MonotoneChainEdge *mce;
87 void testInvariant()
const {
89 assert(pts->size() > 1);
93 friend std::ostream& operator<< (std::ostream& os,
const Edge& el);
112 virtual int getNumPoints()
const {
113 return static_cast<int>(pts->
getSize());
116 virtual void setName(
const std::string &newName) {
125 virtual const geom::Coordinate& getCoordinate(
int i)
const {
127 return pts->
getAt(i);
130 virtual const geom::Coordinate& getCoordinate()
const {
132 return pts->
getAt(0);
136 virtual Depth &getDepth() {
151 virtual void setDepthDelta(
int newDepthDelta) {
152 depthDelta=newDepthDelta;
156 virtual int getMaximumSegmentIndex()
const {
158 return getNumPoints()-1;
161 virtual EdgeIntersectionList& getEdgeIntersectionList() {
172 virtual bool isClosed()
const {
174 return pts->
getAt(0)==pts->
getAt(getNumPoints()-1);
183 virtual Edge* getCollapsedEdge();
185 virtual void setIsolated(
bool newIsIsolated) {
186 isIsolatedVar=newIsIsolated;
190 bool isIsolated()
const override {
192 return isIsolatedVar;
208 int geomIndex,
int intIndex);
223 virtual std::string print()
const;
225 virtual std::string printReverse()
const;
236 virtual bool equals(
const Edge* e)
const {
246 inline bool operator==(
const Edge &a,
const Edge &b) {
250 std::ostream& operator<< (std::ostream& os,
const Edge& el);
264 #endif // ifndef GEOS_GEOMGRAPH_EDGE_H
Definition: geomgraph/Edge.h:66
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition: Label.h:57
virtual bool equals(const Edge &e) const
Definition: EdgeIntersectionList.h:59
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
virtual void addIntersections(algorithm::LineIntersector *li, int segmentIndex, int geomIndex)
Adds EdgeIntersections for one or both intersections found for a segment of an edge to the edge inter...
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:49
virtual void addIntersection(algorithm::LineIntersector *li, int segmentIndex, int geomIndex, int intIndex)
Add an EdgeIntersection for intersection intIndex.
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:59
A GraphComponent is the parent class for the objects' that form a graph.
Definition: geomgraph/GraphComponent.h:47
virtual bool isPointwiseEqual(const Edge *e) const
return true if the coordinate sequences of the Edges are identical
virtual int getDepthDelta() const
The depthDelta is the change in depth as an edge is crossed from R to L.
Definition: geomgraph/Edge.h:146
Edge(geom::CoordinateSequence *newPts, const Label &newLabel)
Takes ownership of CoordinateSequence.
virtual const Coordinate & getAt(std::size_t i) const =0
Returns a read-only reference to Coordinate at position i.
Edge(geom::CoordinateSequence *newPts)
Takes ownership of CoordinateSequence.
Implementation of Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix.
Definition: IntersectionMatrix.h:51
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:59
void computeIM(geom::IntersectionMatrix &im) override
Update the IM with the contribution for this component.
Definition: geomgraph/Edge.h:215
geom::CoordinateSequence * pts
Externally-set, owned by Edge. FIXME: refuse ownership.
Definition: geomgraph/Edge.h:98
virtual index::MonotoneChainEdge * getMonotoneChainEdge()
Return this Edge's index::MonotoneChainEdge, ownership is retained by this object.
virtual std::size_t getSize() const =0
Returns the number of Coordinates (actual or otherwise, as this implementation may not store its data...
virtual bool isCollapsed() const
An Edge is collapsed if it is an Area edge and it consists of two segments which are equal and opposi...