LuciadCPillar 2024.0.05
luciad::Polyline Class Referencefinal

Represents a polyline. More...

#include <luciad/geometries/Polyline.h>

Inheritance diagram for luciad::Polyline:
luciad::CompositeCurve luciad::Curve luciad::Geometry

Public Member Functions

 ~Polyline () 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...
 
std::shared_ptr< CurvegetCurveAt (size_t index) const override
 Returns the curve for the requested index. More...
 
size_t getCurveCount () const override
 Returns the number of curves in this composite. More...
 
LineInterpolationType getInterpolationType () const
 Returns the interpolation type of the line segment. More...
 
double getLength2D () const override
 Returns the length of the curve. More...
 
Coordinate getPoint (size_t index) const
 Returns the coordinate for the requested index. More...
 
size_t getPointCount () const
 Returns the number of points in the polyline. More...
 
const std::vector< Coordinate > & getPoints () const
 Returns the list of points of this polyline. More...
 
std::shared_ptr< luciad::CoordinateReferencegetReference () const override
 Returns the coordinate reference of the geometry. More...
 
std::shared_ptr< PolylineinsertPoint (size_t index, Coordinate newLocation) const
 Creates a new Polyline with an newly inserted control point. More...
 
std::shared_ptr< PolylinemovePoint (size_t index, Coordinate newLocation) const
 Creates a new Polyline with a moved control point. More...
 
std::shared_ptr< PolylineremovePoint (size_t index) const
 Creates a new Polyline with a control point removed. More...
 
std::shared_ptr< Polylinetranslate (Coordinate translation) const
 Translates the entire polyline. More...
 
- Public Member Functions inherited from luciad::CompositeCurve
 ~CompositeCurve () 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...
 
virtual std::shared_ptr< CurvegetCurveAt (size_t index) const
 Returns the curve for the requested index. More...
 
virtual size_t getCurveCount () const
 Returns the number of curves in this composite. 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...
 
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...
 
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 polyline.

See also
GeometryFactory::createPolyline

Constructor & Destructor Documentation

◆ ~Polyline()

luciad::Polyline::~Polyline ( )
override

Member Function Documentation

◆ computePoint()

Coordinate luciad::Polyline::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.

Reimplemented from luciad::CompositeCurve.

◆ getBounds()

Bounds luciad::Polyline::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.

Reimplemented from luciad::CompositeCurve.

◆ getCurveAt()

std::shared_ptr< Curve > luciad::Polyline::getCurveAt ( size_t  index) const
overridevirtual

Returns the curve for the requested index.

Parameters
indexthe curve index
Returns
the curve at index
See also
getCurveCount
Exceptions
luciad::InvalidArgumentExceptionwhen requesting an invalid index.

Reimplemented from luciad::CompositeCurve.

◆ getCurveCount()

size_t luciad::Polyline::getCurveCount ( ) const
overridevirtual

Returns the number of curves in this composite.

Returns
the number of curves in this composite.
See also
getCurveAt

Reimplemented from luciad::CompositeCurve.

◆ getHash()

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

Returns the hash value for this geometry.

Returns
the hash value for this geometry.

Reimplemented from luciad::CompositeCurve.

◆ getInterpolationType()

LineInterpolationType luciad::Polyline::getInterpolationType ( ) const

Returns the interpolation type of the line segment.

One of

Returns
the interpolation type of the line segment.

◆ getLength2D()

double luciad::Polyline::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.

Reimplemented from luciad::CompositeCurve.

◆ getPoint()

Coordinate luciad::Polyline::getPoint ( size_t  index) const

Returns the coordinate for the requested index.

Parameters
indexthe index of the requested point.
Returns
the point at the index.
Exceptions
luciad::InvalidArgumentExceptionwhen requesting an invalid index.

◆ getPointCount()

size_t luciad::Polyline::getPointCount ( ) const

Returns the number of points in the polyline.

Returns
the number of points in the polyline.

◆ getPoints()

const std::vector< Coordinate > & luciad::Polyline::getPoints ( ) const

Returns the list of points of this polyline.

Returns
the list of points of this polyline.

◆ getReference()

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

Returns the coordinate reference of the geometry.

Returns
the coordinate reference of the geometry.

Reimplemented from luciad::CompositeCurve.

◆ insertPoint()

std::shared_ptr< Polyline > luciad::Polyline::insertPoint ( size_t  index,
Coordinate  newLocation 
) const

Creates a new Polyline with an newly inserted control point.

Parameters
indexthe index of the newly inserted control point. Should be in [0, getPointCount()]. For index 0, a new point will be added at the start of the Polyline. For index getPointCount(), a new point will be added at the end of the Polyline. For other index values, a point will be added between 2 other points.
newLocationthe location of the new point
Returns
a new geometry
Exceptions
luciad::InvalidArgumentExceptionfor an invalid index
Since
2020.1

◆ movePoint()

std::shared_ptr< Polyline > luciad::Polyline::movePoint ( size_t  index,
Coordinate  newLocation 
) const

Creates a new Polyline with a moved control point.

Parameters
indexthe index of the point to move. Should be in [0, getPointCount() - 1].
newLocationthe new location of the point
Returns
a new geometry
Exceptions
luciad::InvalidArgumentExceptionfor an invalid index
Since
2020.1

◆ removePoint()

std::shared_ptr< Polyline > luciad::Polyline::removePoint ( size_t  index) const

Creates a new Polyline with a control point removed.

This methods returns a copy of the polyline if its point count is less or equal to 2.

Parameters
indexthe index of the point to be removed. Should be in [0, getPointCount() - 1].
Returns
a new geometry
Exceptions
luciad::InvalidArgumentExceptionfor an invalid index
Since
2020.1

◆ translate()

std::shared_ptr< Polyline > luciad::Polyline::translate ( Coordinate  translation) const

Translates the entire polyline.

Note: when the polyline is defined in a geodetic reference and uses geodetic interpolation, the translation is not performed by translating the points one by one. Instead, a translation method is used that better preserves the shape of the polyline when moving it towards (or away from) the poles.

Parameters
translationthe translation vector
Returns
a new, translated geometry
Since
2020.1