Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::utils::PointWithId< Point > Class Template Reference

#include <quetzal/utils/PointWithId.hpp>

Detailed Description

template<typename Point>
class quetzal::utils::PointWithId< Point >

Class to associate an indexing semantics to a collection of points.

it is mainly used when geographic coordinates are stored in a vector and that a pairwise matrix has to be computed: PointWithId class make easy to switch between geographic and indexing semantics.

Template Parameters
Pointthe class for which an indexing semantics is needed, usually GeographicCoordinates

Public Member Functions

 PointWithId (std::vector< Point > const &vect, size_t index)
 Constructor.
 
 PointWithId (std::vector< Point > const &vect, Point const &p)
 Constructor.
 
Point getPoint () const
 Getter.
 
size_t getId () const
 Getter.
 
bool operator== (PointWithId const &other) const
 Comparator.
 
bool operator!= (PointWithId const &other) const
 Comparator.
 

Constructor & Destructor Documentation

◆ PointWithId() [1/2]

template<typename Point >
quetzal::utils::PointWithId< Point >::PointWithId ( std::vector< Point > const &  vect,
size_t  index 
)
inline

Constructor.

Parameters
vectreference to the vector of coordinates
indexindex of the point in the vector

◆ PointWithId() [2/2]

template<typename Point >
quetzal::utils::PointWithId< Point >::PointWithId ( std::vector< Point > const &  vect,
Point const &  p 
)
inline

Constructor.

Parameters
vectreference to the vector of coordinates
ppoint
Precondition
Point p is in the vector vect.

Member Function Documentation

◆ getId()

template<typename Point >
size_t quetzal::utils::PointWithId< Point >::getId ( ) const
inline

Getter.

Returns
the index of the PointWithId

◆ getPoint()

template<typename Point >
Point quetzal::utils::PointWithId< Point >::getPoint ( ) const
inline

Getter.

Returns
the underlying Point object

◆ operator!=()

template<typename Point >
bool quetzal::utils::PointWithId< Point >::operator!= ( PointWithId< Point > const &  other) const
inline

Comparator.

Returns
false if equal to other

◆ operator==()

template<typename Point >
bool quetzal::utils::PointWithId< Point >::operator== ( PointWithId< Point > const &  other) const
inline

Comparator.

Returns
true if equal to other

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