GEOS  3.9.1dev
Public Member Functions | Private Attributes | 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:
[legend]
Collaboration diagram for geos::noding::SegmentIntersectionDetector:
[legend]

Public Member Functions

 SegmentIntersectionDetector (algorithm::LineIntersector *p_li)
 
 ~SegmentIntersectionDetector () override
 
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, size_t segIndex0, noding::SegmentString *e1, 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...
 
- Public Member Functions inherited from geos::noding::SegmentIntersector
virtual ~SegmentIntersector ()
 

Private Attributes

algorithm::LineIntersectorli
 
bool findProper
 
bool findAllTypes
 
bool _hasIntersection
 
bool _hasProperIntersection
 
bool _hasNonProperIntersection
 
const geom::CoordinateintPt
 
geom::CoordinateArraySequenceintSegments
 

Additional Inherited Members

- Protected Member Functions inherited from geos::noding::SegmentIntersector
 SegmentIntersector ()
 

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

Definition at line 42 of file SegmentIntersectionDetector.h.

Constructor & Destructor Documentation

geos::noding::SegmentIntersectionDetector::SegmentIntersectionDetector ( algorithm::LineIntersector p_li)
inline

Definition at line 58 of file SegmentIntersectionDetector.h.

geos::noding::SegmentIntersectionDetector::~SegmentIntersectionDetector ( )
inlineoverride

Definition at line 70 of file SegmentIntersectionDetector.h.

References intSegments.

Member Function Documentation

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

Definition at line 129 of file SegmentIntersectionDetector.h.

References intPt.

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)

Definition at line 141 of file SegmentIntersectionDetector.h.

References intSegments.

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

Tests whether an intersection was found.

Returns
true if an intersection was found

Definition at line 95 of file SegmentIntersectionDetector.h.

References _hasIntersection.

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

Tests whether a non-proper intersection was found.

Returns
true if a non-proper intersection was found

Definition at line 117 of file SegmentIntersectionDetector.h.

References _hasNonProperIntersection.

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

Tests whether a proper intersection was found.

Returns
true if a proper intersection was found

Definition at line 106 of file SegmentIntersectionDetector.h.

References _hasProperIntersection.

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.

Definition at line 147 of file SegmentIntersectionDetector.h.

References _hasIntersection, _hasNonProperIntersection, _hasProperIntersection, and processIntersections().

Here is the call graph for this function:

void geos::noding::SegmentIntersectionDetector::processIntersections ( noding::SegmentString e0,
size_t  segIndex0,
noding::SegmentString e1,
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.

Referenced by isDone().

Here is the caller graph for this function:

void geos::noding::SegmentIntersectionDetector::setFindAllIntersectionTypes ( bool  p_findAllTypes)
inline

Definition at line 84 of file SegmentIntersectionDetector.h.

void geos::noding::SegmentIntersectionDetector::setFindProper ( bool  p_findProper)
inline

Definition at line 78 of file SegmentIntersectionDetector.h.

Member Data Documentation

bool geos::noding::SegmentIntersectionDetector::_hasIntersection
private

Definition at line 49 of file SegmentIntersectionDetector.h.

Referenced by hasIntersection(), and isDone().

bool geos::noding::SegmentIntersectionDetector::_hasNonProperIntersection
private

Definition at line 51 of file SegmentIntersectionDetector.h.

Referenced by hasNonProperIntersection(), and isDone().

bool geos::noding::SegmentIntersectionDetector::_hasProperIntersection
private

Definition at line 50 of file SegmentIntersectionDetector.h.

Referenced by hasProperIntersection(), and isDone().

bool geos::noding::SegmentIntersectionDetector::findAllTypes
private

Definition at line 47 of file SegmentIntersectionDetector.h.

bool geos::noding::SegmentIntersectionDetector::findProper
private

Definition at line 46 of file SegmentIntersectionDetector.h.

const geom::Coordinate* geos::noding::SegmentIntersectionDetector::intPt
private

Definition at line 53 of file SegmentIntersectionDetector.h.

Referenced by getIntersection().

geom::CoordinateArraySequence* geos::noding::SegmentIntersectionDetector::intSegments
private
algorithm::LineIntersector* geos::noding::SegmentIntersectionDetector::li
private

Definition at line 44 of file SegmentIntersectionDetector.h.


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