GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
geos::geomgraph::index::SimpleSweepLineIntersector Class Reference

Finds all intersections in one or two sets of edges, using a simple x-axis sweepline algorithm. More...

#include <SimpleSweepLineIntersector.h>

Inheritance diagram for geos::geomgraph::index::SimpleSweepLineIntersector:
[legend]
Collaboration diagram for geos::geomgraph::index::SimpleSweepLineIntersector:
[legend]

Public Member Functions

 SimpleSweepLineIntersector ()
 
 ~SimpleSweepLineIntersector () override
 
void computeIntersections (std::vector< Edge * > *edges, SegmentIntersector *si, bool testAllSegments) override
 Computes all self-intersections between edges in a set of edges, allowing client to choose whether self-intersections are computed. More...
 
void computeIntersections (std::vector< Edge * > *edges0, std::vector< Edge * > *edges1, SegmentIntersector *si) override
 Computes all mutual intersections between two sets of edges. More...
 
- Public Member Functions inherited from geos::geomgraph::index::EdgeSetIntersector
virtual ~EdgeSetIntersector ()
 

Private Member Functions

void add (std::vector< Edge * > *edges)
 
void add (std::vector< Edge * > *edges, void *edgeSet)
 
void add (Edge *edge, void *edgeSet)
 
void prepareEvents ()
 
void computeIntersections (SegmentIntersector *si)
 
void processOverlaps (size_t start, size_t end, SweepLineEvent *ev0, SegmentIntersector *si)
 

Private Attributes

std::vector< SweepLineEvent * > events
 
int nOverlaps
 

Detailed Description

Finds all intersections in one or two sets of edges, using a simple x-axis sweepline algorithm.

While still O(n^2) in the worst case, this algorithm drastically improves the average-case time.

Definition at line 51 of file SimpleSweepLineIntersector.h.

Constructor & Destructor Documentation

geos::geomgraph::index::SimpleSweepLineIntersector::SimpleSweepLineIntersector ( )
geos::geomgraph::index::SimpleSweepLineIntersector::~SimpleSweepLineIntersector ( )
override

Member Function Documentation

void geos::geomgraph::index::SimpleSweepLineIntersector::add ( std::vector< Edge * > *  edges)
private
void geos::geomgraph::index::SimpleSweepLineIntersector::add ( std::vector< Edge * > *  edges,
void *  edgeSet 
)
private
void geos::geomgraph::index::SimpleSweepLineIntersector::add ( Edge edge,
void *  edgeSet 
)
private
void geos::geomgraph::index::SimpleSweepLineIntersector::computeIntersections ( std::vector< Edge * > *  edges,
SegmentIntersector si,
bool  testAllSegments 
)
overridevirtual

Computes all self-intersections between edges in a set of edges, allowing client to choose whether self-intersections are computed.

Parameters
edgesa list of edges to test for intersections
sithe SegmentIntersector to use
testAllSegmentstrue if self-intersections are to be tested as well

Implements geos::geomgraph::index::EdgeSetIntersector.

void geos::geomgraph::index::SimpleSweepLineIntersector::computeIntersections ( std::vector< Edge * > *  edges0,
std::vector< Edge * > *  edges1,
SegmentIntersector si 
)
overridevirtual

Computes all mutual intersections between two sets of edges.

Implements geos::geomgraph::index::EdgeSetIntersector.

void geos::geomgraph::index::SimpleSweepLineIntersector::computeIntersections ( SegmentIntersector si)
private
void geos::geomgraph::index::SimpleSweepLineIntersector::prepareEvents ( )
private
void geos::geomgraph::index::SimpleSweepLineIntersector::processOverlaps ( size_t  start,
size_t  end,
SweepLineEvent ev0,
SegmentIntersector si 
)
private

Member Data Documentation

std::vector<SweepLineEvent*> geos::geomgraph::index::SimpleSweepLineIntersector::events
private

Definition at line 71 of file SimpleSweepLineIntersector.h.

int geos::geomgraph::index::SimpleSweepLineIntersector::nOverlaps
private

Definition at line 74 of file SimpleSweepLineIntersector.h.


The documentation for this class was generated from the following file: