GEOS 3.11.1
Public Member Functions | List of all members
geos::noding::SegmentIntersectionDetector Class Reference

Detects and records an intersection between two SegmentStrings, if one exists. More...

#include <SegmentIntersectionDetector.h>

Inheritance diagram for geos::noding::SegmentIntersectionDetector:
geos::noding::SegmentIntersector

Public Member Functions

 SegmentIntersectionDetector (algorithm::LineIntersector *p_li)
 
void setFindProper (bool p_findProper)
 
void setFindAllIntersectionTypes (bool p_findAllTypes)
 
bool hasIntersection () const
 Tests whether an intersection was found. More...
 
bool hasProperIntersection () const
 Tests whether a proper intersection was found. More...
 
bool hasNonProperIntersection () const
 Tests whether a non-proper intersection was found. More...
 
const geom::CoordinategetIntersection () const
 Gets the computed location of the intersection. Due to round-off, the location may not be exact. More...
 
const geom::CoordinateSequencegetIntersectionSegments () const
 Gets the endpoints of the intersecting segments. More...
 
bool isDone () const override
 Reports whether the client of this class needs to continue testing all intersections in an arrangement. More...
 
void processIntersections (noding::SegmentString *e0, std::size_t segIndex0, noding::SegmentString *e1, std::size_t segIndex1) override
 This method is called by clients of the SegmentIntersector class to process intersections for two segments of the SegmentStrings being intersected. More...
 
virtual void processIntersections (SegmentString *e0, std::size_t segIndex0, SegmentString *e1, std::size_t segIndex1)=0
 
virtual bool isDone () const
 Reports whether the client of this class needs to continue testing all intersections in an arrangement. More...
 

Detailed Description

Detects and records an intersection between two SegmentStrings, if one exists.

This strategy can be configured to search for proper intersections. In this case, the presence of any intersection will still be recorded, but searching will continue until either a proper intersection has been found or no intersections are detected.

Only a single intersection is recorded.

Version
1.7

Member Function Documentation

◆ getIntersection()

const geom::Coordinate * geos::noding::SegmentIntersectionDetector::getIntersection ( ) const
inline

Gets the computed location of the intersection. Due to round-off, the location may not be exact.

Returns
the coordinate for the intersection location

◆ getIntersectionSegments()

const geom::CoordinateSequence * geos::noding::SegmentIntersectionDetector::getIntersectionSegments ( ) const
inline

Gets the endpoints of the intersecting segments.

Returns
an array of the segment endpoints (p00, p01, p10, p11)

◆ hasIntersection()

bool geos::noding::SegmentIntersectionDetector::hasIntersection ( ) const
inline

Tests whether an intersection was found.

Returns
true if an intersection was found

◆ hasNonProperIntersection()

bool geos::noding::SegmentIntersectionDetector::hasNonProperIntersection ( ) const
inline

Tests whether a non-proper intersection was found.

Returns
true if a non-proper intersection was found

◆ hasProperIntersection()

bool geos::noding::SegmentIntersectionDetector::hasProperIntersection ( ) const
inline

Tests whether a proper intersection was found.

Returns
true if a proper intersection was found

◆ isDone()

bool geos::noding::SegmentIntersectionDetector::isDone ( ) const
inlineoverridevirtual

Reports whether the client of this class needs to continue testing all intersections in an arrangement.

Returns
true if there is not need to continue testing segments

The default implementation always return false (process all intersections).

Reimplemented from geos::noding::SegmentIntersector.

◆ processIntersections()

void geos::noding::SegmentIntersectionDetector::processIntersections ( noding::SegmentString e0,
std::size_t  segIndex0,
noding::SegmentString e1,
std::size_t  segIndex1 
)
overridevirtual

This method is called by clients of the SegmentIntersector class to process intersections for two segments of the SegmentStrings being intersected.

Note
Some clients (such as MonotoneChains) may optimize away this call for segment pairs which they have determined do not intersect (e.g. by an disjoint envelope test).

Implements geos::noding::SegmentIntersector.


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