DISTRHO Plugin Framework
Public Member Functions | List of all members
Line< T > Class Template Reference

#include <Geometry.hpp>

Public Member Functions

 Line () noexcept
 
 Line (const T &startX, const T &startY, const T &endX, const T &endY) noexcept
 
 Line (const T &startX, const T &startY, const Point< T > &endPos) noexcept
 
 Line (const Point< T > &startPos, const T &endX, const T &endY) noexcept
 
 Line (const Point< T > &startPos, const Point< T > &endPos) noexcept
 
 Line (const Line< T > &line) noexcept
 
const T & getStartX () const noexcept
 
const T & getStartY () const noexcept
 
const T & getEndX () const noexcept
 
const T & getEndY () const noexcept
 
const Point< T > & getStartPos () const noexcept
 
const Point< T > & getEndPos () const noexcept
 
void setStartX (const T &x) noexcept
 
void setStartY (const T &y) noexcept
 
void setStartPos (const T &x, const T &y) noexcept
 
void setStartPos (const Point< T > &pos) noexcept
 
void setEndX (const T &x) noexcept
 
void setEndY (const T &y) noexcept
 
void setEndPos (const T &x, const T &y) noexcept
 
void setEndPos (const Point< T > &pos) noexcept
 
void moveBy (const T &x, const T &y) noexcept
 
void moveBy (const Point< T > &pos) noexcept
 
bool isNull () const noexcept
 
bool isNotNull () const noexcept
 
void draw (const GraphicsContext &context, T width=1)
 
Line< T > & operator= (const Line< T > &line) noexcept
 
bool operator== (const Line< T > &line) const noexcept
 
bool operator!= (const Line< T > &line) const noexcept
 
void draw ()
 

Detailed Description

template<typename T>
class Line< T >

DGL Line class.

This class describes a line, defined by two points.

Constructor & Destructor Documentation

◆ Line() [1/6]

template<typename T >
Line< T >::Line ( )
noexcept

Constructor for a null line ([0,0] to [0,0]).

◆ Line() [2/6]

template<typename T >
Line< T >::Line ( const T &  startX,
const T &  startY,
const T &  endX,
const T &  endY 
)
noexcept

Constructor using custom start X, start Y, end X and end Y values.

◆ Line() [3/6]

template<typename T >
Line< T >::Line ( const T &  startX,
const T &  startY,
const Point< T > &  endPos 
)
noexcept

Constructor using custom start X, start Y and end pos values.

◆ Line() [4/6]

template<typename T >
Line< T >::Line ( const Point< T > &  startPos,
const T &  endX,
const T &  endY 
)
noexcept

Constructor using custom start pos, end X and end Y values.

◆ Line() [5/6]

template<typename T >
Line< T >::Line ( const Point< T > &  startPos,
const Point< T > &  endPos 
)
noexcept

Constructor using custom start and end pos values.

◆ Line() [6/6]

template<typename T >
Line< T >::Line ( const Line< T > &  line)
noexcept

Constructor using another Line class values.

Member Function Documentation

◆ getStartX()

template<typename T >
const T& Line< T >::getStartX ( ) const
noexcept

Get start X value.

◆ getStartY()

template<typename T >
const T& Line< T >::getStartY ( ) const
noexcept

Get start Y value.

◆ getEndX()

template<typename T >
const T& Line< T >::getEndX ( ) const
noexcept

Get end X value.

◆ getEndY()

template<typename T >
const T& Line< T >::getEndY ( ) const
noexcept

Get end Y value.

◆ getStartPos()

template<typename T >
const Point<T>& Line< T >::getStartPos ( ) const
noexcept

Get start position.

◆ getEndPos()

template<typename T >
const Point<T>& Line< T >::getEndPos ( ) const
noexcept

Get end position.

◆ setStartX()

template<typename T >
void Line< T >::setStartX ( const T &  x)
noexcept

Set start X value to x.

◆ setStartY()

template<typename T >
void Line< T >::setStartY ( const T &  y)
noexcept

Set start Y value to y.

◆ setStartPos() [1/2]

template<typename T >
void Line< T >::setStartPos ( const T &  x,
const T &  y 
)
noexcept

Set start X and Y values to x and y respectively.

◆ setStartPos() [2/2]

template<typename T >
void Line< T >::setStartPos ( const Point< T > &  pos)
noexcept

Set start X and Y values according to pos.

◆ setEndX()

template<typename T >
void Line< T >::setEndX ( const T &  x)
noexcept

Set end X value to x.

◆ setEndY()

template<typename T >
void Line< T >::setEndY ( const T &  y)
noexcept

Set end Y value to y.

◆ setEndPos() [1/2]

template<typename T >
void Line< T >::setEndPos ( const T &  x,
const T &  y 
)
noexcept

Set end X and Y values to x and y respectively.

◆ setEndPos() [2/2]

template<typename T >
void Line< T >::setEndPos ( const Point< T > &  pos)
noexcept

Set end X and Y values according to pos.

◆ moveBy() [1/2]

template<typename T >
void Line< T >::moveBy ( const T &  x,
const T &  y 
)
noexcept

Move this line by x and y values.

◆ moveBy() [2/2]

template<typename T >
void Line< T >::moveBy ( const Point< T > &  pos)
noexcept

Move this line by pos.

◆ isNull()

template<typename T >
bool Line< T >::isNull ( ) const
noexcept

Return true if line is null (start and end pos are equal).

◆ isNotNull()

template<typename T >
bool Line< T >::isNotNull ( ) const
noexcept

Return true if line is not null (start and end pos are different).

◆ draw() [1/2]

template<typename T >
void Line< T >::draw ( const GraphicsContext context,
width = 1 
)

Draw this line using the provided graphics context, optionally specifying line width.

◆ draw() [2/2]

template<typename T >
void Line< T >::draw ( )

Draw this line using the current OpenGL state.
DEPRECATED Please use draw(const GraphicsContext&) instead.


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