LuciadCPillar 2025.0.01
luciad::LineIntersection Class Referencefinal

The result of a line intersection. More...

#include <luciad/geodesy/GeodesyCalculations.h>

Public Types

enum class  IntersectionType { Point , LineSegment }
 The type of intersection. More...
 

Public Member Functions

 LineIntersection (Coordinate point)
 Creates a line intersection result that consists of a single point. More...
 
 LineIntersection (Line lineSegment)
 Creates a line intersection result that consists of a line segment. More...
 
 ~LineIntersection ()
 
const LinegetLineSegment () const
 Returns the line segment that forms the intersection. More...
 
Coordinate getPoint () const
 Returns the single intersection point. More...
 
IntersectionType getType () const
 Returns the intersection type. More...
 

Detailed Description

The result of a line intersection.

If an intersection exists, this can either be a single point, or a line segment.

Since
2025.0
See also
GeodesyCalculations::intersectLineSegments

Member Enumeration Documentation

◆ IntersectionType

The type of intersection.

Since
2025.0
Enumerator
Point 

When the intersection is a single point.

LineSegment 

When the intersection is a line segment.

Constructor & Destructor Documentation

◆ LineIntersection() [1/2]

luciad::LineIntersection::LineIntersection ( Coordinate  point)
explicit

Creates a line intersection result that consists of a single point.

Parameters
pointthe intersection point

◆ LineIntersection() [2/2]

luciad::LineIntersection::LineIntersection ( Line  lineSegment)
explicit

Creates a line intersection result that consists of a line segment.

Parameters
lineSegmentthe line segment that forms the intersection

◆ ~LineIntersection()

luciad::LineIntersection::~LineIntersection ( )

Member Function Documentation

◆ getLineSegment()

const Line & luciad::LineIntersection::getLineSegment ( ) const

Returns the line segment that forms the intersection.

Returns
the line segment that forms the intersection.
Exceptions
luciad::LogicExceptionwhen LineIntersection::getType returns a value other than LineSegment

◆ getPoint()

Coordinate luciad::LineIntersection::getPoint ( ) const

Returns the single intersection point.

Returns
the single intersection point.
Exceptions
luciad::LogicExceptionwhen LineIntersection::getType returns a value other than Point

◆ getType()

IntersectionType luciad::LineIntersection::getType ( ) const
inline

Returns the intersection type.

This can either be a single point, or a line segment.

Returns
the intersection type.