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>
33 #include <geos/geom/Envelope.h>
35 #include <geos/inline.h>
39 #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;
72 std::unique_ptr<index::MonotoneChainEdge> mce;
88 assert(pts->size() > 1);
91 friend std::ostream& operator<< (std::ostream& os,
const Edge& el);
96 std::unique_ptr<geom::CoordinateSequence>
pts;
111 return pts->getSize();
115 getCoordinates()
const
122 getCoordinate(
size_t i)
const
125 return pts->getAt(i);
128 virtual const geom::Coordinate&
129 getCoordinate()
const
132 return pts->getAt(0);
156 setDepthDelta(
int newDepthDelta)
158 depthDelta = newDepthDelta;
163 getMaximumSegmentIndex()
const
166 return getNumPoints() - 1;
169 virtual EdgeIntersectionList&
170 getEdgeIntersectionList()
186 return pts->getAt(0) == pts->getAt(getNumPoints() - 1);
195 virtual Edge* getCollapsedEdge();
198 setIsolated(
bool newIsIsolated)
200 isIsolatedVar = newIsIsolated;
205 isIsolated()
const override
208 return isIsolatedVar;
224 size_t geomIndex,
size_t intIndex);
241 virtual std::string print()
const;
243 virtual std::string printReverse()
const;
255 equals(
const Edge* e)
const
267 operator==(
const Edge& a,
const Edge& b)
272 std::ostream& operator<< (std::ostream& os,
const Edge& el);
286 #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:92
virtual bool equals(const Edge &e) const
Definition: EdgeIntersectionList.h:59
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
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, size_t segmentIndex, size_t geomIndex, size_t intIndex)
Add an EdgeIntersection for intersection intIndex.
virtual void addIntersections(algorithm::LineIntersector *li, size_t segmentIndex, size_t geomIndex)
Adds EdgeIntersections for one or both intersections found for a segment of an edge to the edge inter...
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:84
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
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:149
std::unique_ptr< geom::CoordinateSequence > pts
Externally-set, owned by Edge. FIXME: refuse ownership.
Definition: geomgraph/Edge.h:96
Edge(geom::CoordinateSequence *newPts, const Label &newLabel)
Takes ownership of CoordinateSequence.
Edge(geom::CoordinateSequence *newPts)
Takes ownership of CoordinateSequence.
Implementation of Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix.
Definition: IntersectionMatrix.h:86
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:90
void computeIM(geom::IntersectionMatrix &im) override
Update the IM with the contribution for this component.
Definition: geomgraph/Edge.h:232
virtual index::MonotoneChainEdge * getMonotoneChainEdge()
Return this Edge's index::MonotoneChainEdge, ownership is retained by this object.
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...