LuciadCPillar 2024.0.04
luciad::PolylineRing Class Referencefinal

Represents a polyline that is closed, i.e., the first point and the last point coincide. More...

#include <luciad/geometries/PolylineRing.h>

Inheritance diagram for luciad::PolylineRing:
luciad::CompositeRing luciad::Ring luciad::Curve luciad::Geometry

Public Member Functions

 ~PolylineRing () 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 ring. More...
 
const std::vector< Coordinate > & getPoints () const
 Returns the list of points of this polyline ring. More...
 
std::shared_ptr< luciad::CoordinateReferencegetReference () const override
 Returns the coordinate reference of the geometry. More...
 
std::shared_ptr< PolylineRinginsertPoint (size_t index, Coordinate newLocation) const
 Creates a new PolylineRing with an newly inserted control point. More...
 
std::shared_ptr< PolylineRingmovePoint (size_t index, Coordinate newLocation) const
 Creates a new PolylineRing with a moved control point. More...
 
std::shared_ptr< PolylineRingremovePoint (size_t index) const
 Creates a new PolylineRing with a control point removed. More...
 
std::shared_ptr< PolylineRingtranslate (Coordinate translation) const
 Translates the entire polyline ring. More...
 
- Public Member Functions inherited from luciad::CompositeRing
 ~CompositeRing () 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 that is closed, i.e., the first point and the last point coincide.

See also
GeometryFactory::createPolylineRing

Constructor & Destructor Documentation

◆ ~PolylineRing()

luciad::PolylineRing::~PolylineRing ( )
override

Member Function Documentation

◆ computePoint()

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

◆ getBounds()

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

◆ getCurveAt()

std::shared_ptr< Curve > luciad::PolylineRing::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::CompositeRing.

◆ getCurveCount()

size_t luciad::PolylineRing::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::CompositeRing.

◆ getHash()

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

Returns the hash value for this geometry.

Returns
the hash value for this geometry.

Reimplemented from luciad::CompositeRing.

◆ getInterpolationType()

LineInterpolationType luciad::PolylineRing::getInterpolationType ( ) const

Returns the interpolation type of the line segment.

One of

Returns
the interpolation type of the line segment.

◆ getLength2D()

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

◆ getPoint()

Coordinate luciad::PolylineRing::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::PolylineRing::getPointCount ( ) const

Returns the number of points in the polyline ring.

Returns
the number of points in the polyline ring.

◆ getPoints()

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

Returns the list of points of this polyline ring.

Returns
the list of points of this polyline ring.

◆ getReference()

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

Returns the coordinate reference of the geometry.

Returns
the coordinate reference of the geometry.

Reimplemented from luciad::CompositeRing.

◆ insertPoint()

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

Creates a new PolylineRing 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 ring. For index getPointCount(), a new point is added at the end of the Polyline ring. For other index values, a new point will be added between the point at specified (index-1) and the point at the index position.
newLocationthe location of the new point
Returns
a new geometry
Exceptions
luciad::InvalidArgumentExceptionfor an invalid index
Since
2020.1

◆ movePoint()

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

Creates a new PolylineRing 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< PolylineRing > luciad::PolylineRing::removePoint ( size_t  index) const

Creates a new PolylineRing with a control point removed.

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

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< PolylineRing > luciad::PolylineRing::translate ( Coordinate  translation) const

Translates the entire polyline ring.

Note: when the polyline ring 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 ring when moving it towards (or away from) the poles.

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