GEOS  3.9.1dev
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
geos::noding::IntersectionAdder Class Reference

Computes the intersections between two line segments in SegmentString and adds them to each string. More...

#include <IntersectionAdder.h>

Inheritance diagram for geos::noding::IntersectionAdder:
[legend]
Collaboration diagram for geos::noding::IntersectionAdder:
[legend]

Public Member Functions

 IntersectionAdder (algorithm::LineIntersector &newLi)
 
algorithm::LineIntersectorgetLineIntersector ()
 
const geom::CoordinategetProperIntersectionPoint ()
 
bool hasIntersection ()
 
bool hasProperIntersection ()
 A proper intersection is an intersection which is interior to at least two line segments. More...
 
bool hasProperInteriorIntersection ()
 A proper interior intersection is a proper intersection which is not contained in the set of boundary nodes set for this SegmentIntersector. More...
 
bool hasInteriorIntersection ()
 An interior intersection is an intersection which is in the interior of some segment. More...
 
void processIntersections (SegmentString *e0, size_t segIndex0, 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...
 
bool isDone () const override
 Always process all intersections. More...
 
- Public Member Functions inherited from geos::noding::SegmentIntersector
virtual ~SegmentIntersector ()
 

Static Public Member Functions

static bool isAdjacentSegments (size_t i1, size_t i2)
 

Public Attributes

int numIntersections
 
int numInteriorIntersections
 
int numProperIntersections
 
int numTests
 

Private Member Functions

bool isTrivialIntersection (const SegmentString *e0, size_t segIndex0, const SegmentString *e1, size_t segIndex1)
 
 IntersectionAdder (const IntersectionAdder &other)=delete
 
IntersectionAdderoperator= (const IntersectionAdder &rhs)=delete
 

Private Attributes

bool hasIntersectionVar
 
bool hasProper
 
bool hasProperInterior
 
bool hasInterior
 
geom::Coordinate properIntersectionPoint
 
algorithm::LineIntersectorli
 

Additional Inherited Members

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

Detailed Description

Computes the intersections between two line segments in SegmentString and adds them to each string.

The SegmentIntersector is passed to a Noder. The NodedSegmentString::addIntersections(algorithm::LineIntersector* li, size_t segmentIndex, size_t geomIndex) method is called whenever the Noder detects that two SegmentStrings might intersect. This class is an example of the Strategy pattern.

Definition at line 57 of file IntersectionAdder.h.

Constructor & Destructor Documentation

geos::noding::IntersectionAdder::IntersectionAdder ( const IntersectionAdder other)
privatedelete
geos::noding::IntersectionAdder::IntersectionAdder ( algorithm::LineIntersector newLi)
inline

Definition at line 99 of file IntersectionAdder.h.

Member Function Documentation

algorithm::LineIntersector& geos::noding::IntersectionAdder::getLineIntersector ( )
inline

Definition at line 114 of file IntersectionAdder.h.

const geom::Coordinate& geos::noding::IntersectionAdder::getProperIntersectionPoint ( )
inline
Returns
the proper intersection point, or Coordinate::getNull() if none was found

Definition at line 124 of file IntersectionAdder.h.

bool geos::noding::IntersectionAdder::hasInteriorIntersection ( )
inline

An interior intersection is an intersection which is in the interior of some segment.

Definition at line 165 of file IntersectionAdder.h.

bool geos::noding::IntersectionAdder::hasIntersection ( )
inline

Definition at line 130 of file IntersectionAdder.h.

bool geos::noding::IntersectionAdder::hasProperInteriorIntersection ( )
inline

A proper interior intersection is a proper intersection which is not contained in the set of boundary nodes set for this SegmentIntersector.

Definition at line 155 of file IntersectionAdder.h.

bool geos::noding::IntersectionAdder::hasProperIntersection ( )
inline

A proper intersection is an intersection which is interior to at least two line segments.

Note that a proper intersection is not necessarily in the interior of the entire Geometry, since another edge may have an endpoint equal to the intersection, which according to SFS semantics can result in the point being on the Boundary of the Geometry.

Definition at line 145 of file IntersectionAdder.h.

static bool geos::noding::IntersectionAdder::isAdjacentSegments ( size_t  i1,
size_t  i2 
)
inlinestatic

Definition at line 185 of file IntersectionAdder.h.

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

Always process all intersections.

Returns
false always

Reimplemented from geos::noding::SegmentIntersector.

Definition at line 196 of file IntersectionAdder.h.

bool geos::noding::IntersectionAdder::isTrivialIntersection ( const SegmentString e0,
size_t  segIndex0,
const SegmentString e1,
size_t  segIndex1 
)
private

A trivial intersection is an apparent self-intersection which in fact is simply the point shared by adjacent line segments. Note that closed edges require a special check for the point shared by the beginning and end segments.

IntersectionAdder& geos::noding::IntersectionAdder::operator= ( const IntersectionAdder rhs)
privatedelete
void geos::noding::IntersectionAdder::processIntersections ( SegmentString e0,
size_t  segIndex0,
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 that 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.

Member Data Documentation

bool geos::noding::IntersectionAdder::hasInterior
private

Definition at line 68 of file IntersectionAdder.h.

bool geos::noding::IntersectionAdder::hasIntersectionVar
private

These variables keep track of what types of intersections were found during ALL edges that have been intersected.

Definition at line 65 of file IntersectionAdder.h.

bool geos::noding::IntersectionAdder::hasProper
private

Definition at line 66 of file IntersectionAdder.h.

bool geos::noding::IntersectionAdder::hasProperInterior
private

Definition at line 67 of file IntersectionAdder.h.

algorithm::LineIntersector& geos::noding::IntersectionAdder::li
private

Definition at line 73 of file IntersectionAdder.h.

int geos::noding::IntersectionAdder::numInteriorIntersections

Definition at line 93 of file IntersectionAdder.h.

int geos::noding::IntersectionAdder::numIntersections

Definition at line 92 of file IntersectionAdder.h.

int geos::noding::IntersectionAdder::numProperIntersections

Definition at line 94 of file IntersectionAdder.h.

int geos::noding::IntersectionAdder::numTests

Definition at line 97 of file IntersectionAdder.h.

geom::Coordinate geos::noding::IntersectionAdder::properIntersectionPoint
private

Definition at line 71 of file IntersectionAdder.h.


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