libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
Line< T, N > Class Template Reference

N-dimensional line segment defined by a start and end point. More...

#include <line.h>

Public Types

using Pt = Point< T, N >
 The Point type used for the endpoints of this Line.
 

Public Member Functions

 Line ()=default
 Default constructor. Both endpoints are default-constructed (zero).
 
 Line (const Pt &s, const Pt &e)
 Constructs a Line from a start and end point.
 
 Line (const Pt &&s, const Pt &&e)
 Move-constructs a Line from a start and end point.
 
const Ptstart () const
 Returns a const reference to the start point.
 
const Ptend () const
 Returns a const reference to the end point.
 

Detailed Description

template<typename T, size_t N>
class Line< T, N >

N-dimensional line segment defined by a start and end point.

A simple value type representing a line segment between two Points of the same dimensionality and component type.

Template Parameters
TThe component value type (e.g. int, float, double).
NThe number of dimensions.

Constructor & Destructor Documentation

◆ Line() [1/2]

template<typename T , size_t N>
Line< T, N >::Line ( const Pt s,
const Pt e 
)
inline

Constructs a Line from a start and end point.

Parameters
sThe start point.
eThe end point.

◆ Line() [2/2]

template<typename T , size_t N>
Line< T, N >::Line ( const Pt &&  s,
const Pt &&  e 
)
inline

Move-constructs a Line from a start and end point.

Parameters
sThe start point (moved).
eThe end point (moved).

Member Function Documentation

◆ end()

template<typename T , size_t N>
const Pt & Line< T, N >::end ( ) const
inline

Returns a const reference to the end point.

Returns
The end point of the line segment.

◆ start()

template<typename T , size_t N>
const Pt & Line< T, N >::start ( ) const
inline

Returns a const reference to the start point.

Returns
The start point of the line segment.

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