maliput_sparse
LineString< CoordinateT, DistanceFunction >::Point Class Reference

Detailed Description

template<typename CoordinateT, typename DistanceFunction = details::EuclideanDistance<CoordinateT>>
class maliput_sparse::geometry::LineString< CoordinateT, DistanceFunction >::Point

Extends the CoordinateT class with information about the index of the coordinate in the LineString and the \( p \) value up-to the coordinate in the parametrized LineString.

Convenient to use with the KDTree.

#include <include/maliput_sparse/geometry/line_string.h>

Inheritance diagram for LineString< CoordinateT, DistanceFunction >::Point:
[legend]

Public Member Functions

 Point ()=default
 Default constructor. More...
 
 Point (const CoordinateT &coordinate, std::size_t idx, double p)
 Creates a Point. More...
 
 Point (const CoordinateT &coordinate)
 Creates a point. More...
 
std::optional< std::size_t > idx () const
 
std::optional< double > p () const
 
const CoordinateT * coordinate () const
 

Constructor & Destructor Documentation

◆ Point() [1/3]

Point ( )
default

Default constructor.

◆ Point() [2/3]

Point ( const CoordinateT &  coordinate,
std::size_t  idx,
double  p 
)

Creates a Point.

Parameters
coordinateThe coordinate of the point.
idxThe index of the coordinate in the LineString.
pThe \( p \) value up-to the coordinate in the parametrized LineString.
Exceptions
maliput::common::assertion_errorWhen p is negative.

◆ Point() [3/3]

Point ( const CoordinateT &  coordinate)
explicit

Creates a point.

Parameters
coordinateThe coordinate of the point.

Member Function Documentation

◆ coordinate()

const CoordinateT* coordinate ( ) const
Returns
The underlying coordinate of the point.

◆ idx()

std::optional<std::size_t> idx ( ) const
Returns
If provided via constructor, the index of the coordinate in the LineString, std::nullopt otherwise.

◆ p()

std::optional<double> p ( ) const
Returns
If provided via constructor, the \( p \) value up-to the coordinate in the parametrized LineString, std::nullopt otherwise.

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