LuciadCPillar 2025.0.02
luciad::Line Class Referencefinal

Represents a line. More...

#include <luciad/geometries/Line.h>

Inheritance diagram for luciad::Line:
luciad::Curve luciad::Geometry

Public Member Functions

 Line (const Line &other)
 
 Line (Coordinate startPoint, Coordinate endPoint, LineInterpolationType interpolationType, std::shared_ptr< CoordinateReference > reference)
 Creates a line segment. More...
 
 Line (Line &&other) noexcept
 
 ~Line () override
 
Coordinate computePoint (double parameter) const override
 Computes a point of the curve, defined by the given parameter. More...
 
Bounds getBounds () const override
 Returns the bounds for the geometry object. More...
 
Coordinate getEndPoint () const
 Returns the end point of the line segment. More...
 
LineInterpolationType getInterpolationType () const
 Returns the interpolation type of the line segment. More...
 
double getLength2D () const override
 Returns the length of the curve. More...
 
std::shared_ptr< CoordinateReferencegetReference () const override
 Returns the coordinate reference of the geometry. More...
 
Coordinate getStartPoint () const
 Returns the start point of the line segment. More...
 
Lineoperator= (Line other) noexcept
 
virtual Coordinate computePoint (double parameter) const =0
 Computes a point of the curve, defined by the given parameter. More...
 
virtual double getLength2D () const =0
 Returns the length of the curve. More...
 
- Public Member Functions inherited from luciad::Geometry
virtual ~Geometry ()=default
 
virtual Bounds getBounds () const =0
 Returns the bounds for the geometry object. More...
 
virtual std::shared_ptr< CoordinateReferencegetReference () const =0
 Returns the coordinate reference of the geometry. More...
 

Protected Member Functions

size_t getHash () const override
 Returns the hash value for this geometry. More...
 
virtual size_t getHash () const =0
 Returns the hash value for this geometry. More...
 

Detailed Description

Represents a line.

See also
GeometryFactory::createLine

Constructor & Destructor Documentation

◆ Line() [1/3]

luciad::Line::Line ( Coordinate  startPoint,
Coordinate  endPoint,
LineInterpolationType  interpolationType,
std::shared_ptr< CoordinateReference reference 
)

Creates a line segment.

Line objects can be created with the interpolation types:

  • linear
  • geodesic
  • rhumb

The interpolation types geodesic and rhumb are only allowed for geodetic coordinate references.

Parameters
startPointthe start point of the line
endPointthe end point of the line
interpolationTypethe interpolation type
referencethe reference of the line
Since
2025.0
Exceptions
luciad::InvalidArgumentExceptionif the line cannot be constructed. For example for an invalid combination of coordinate reference and interpolation type.

◆ ~Line()

luciad::Line::~Line ( )
override

◆ Line() [2/3]

luciad::Line::Line ( const Line other)

◆ Line() [3/3]

luciad::Line::Line ( Line &&  other)
noexcept

Member Function Documentation

◆ computePoint()

Coordinate luciad::Line::computePoint ( double  parameter) const
overridevirtual

Computes a point of the curve, defined by the given parameter.

  1. At parameter 0, the point is the start point of the curve.
  2. At parameter 1, the point is the end point of the curve.
Parameters
parameterthe parameter value, within [0,1], to compute the point location for.
Returns
the computed point location.
Exceptions
luciad::InvalidArgumentExceptionif parameter is not within [0,1], or if the point could not be computed. For example, when the curve is defined by invalid points.

Implements luciad::Curve.

◆ getBounds()

Bounds luciad::Line::getBounds ( ) const
overridevirtual

Returns the bounds for the geometry object.

Returns
the bounds for the geometry object.
Exceptions
luciad::InvalidArgumentExceptionif the bounds could not be computed. For example, when the geometry is defined by invalid points.

Implements luciad::Geometry.

◆ getEndPoint()

Coordinate luciad::Line::getEndPoint ( ) const

Returns the end point of the line segment.

Returns
the end point of the line segment.

◆ getHash()

size_t luciad::Line::getHash ( ) const
overrideprotectedvirtual

Returns the hash value for this geometry.

Returns
the hash value for this geometry.

Implements luciad::Geometry.

◆ getInterpolationType()

LineInterpolationType luciad::Line::getInterpolationType ( ) const

Returns the interpolation type of the line segment.

One of

  • LineInterpolationType::geodesic
  • LineInterpolationType::rhumb
  • LineInterpolationType::linear
Returns
the interpolation type of the line segment.

◆ getLength2D()

double luciad::Line::getLength2D ( ) const
overridevirtual

Returns the length of the curve.

Returns
the length of the curve.
Exceptions
luciad::InvalidArgumentExceptionif the length could not be computed. For example, when the curve is defined by invalid points.

Implements luciad::Curve.

◆ getReference()

std::shared_ptr< CoordinateReference > luciad::Line::getReference ( ) const
overridevirtual

Returns the coordinate reference of the geometry.

Returns
the coordinate reference of the geometry.

Implements luciad::Geometry.

◆ getStartPoint()

Coordinate luciad::Line::getStartPoint ( ) const

Returns the start point of the line segment.

Returns
the start point of the line segment.

◆ operator=()

Line & luciad::Line::operator= ( Line  other)
noexcept