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

#include <Geometry.hpp>

Public Member Functions

 Triangle () noexcept
 
 Triangle (const T &x1, const T &y1, const T &x2, const T &y2, const T &x3, const T &y3) noexcept
 
 Triangle (const Point< T > &pos1, const Point< T > &pos2, const Point< T > &pos3) noexcept
 
 Triangle (const Triangle< T > &tri) noexcept
 
bool isNull () const noexcept
 
bool isNotNull () const noexcept
 
bool isValid () const noexcept
 
bool isInvalid () const noexcept
 
void draw (const GraphicsContext &context)
 
void drawOutline (const GraphicsContext &context, T lineWidth=1)
 
Triangle< T > & operator= (const Triangle< T > &tri) noexcept
 
bool operator== (const Triangle< T > &tri) const noexcept
 
bool operator!= (const Triangle< T > &tri) const noexcept
 
void draw ()
 
void drawOutline ()
 

Detailed Description

template<typename T>
class Triangle< T >

DGL Triangle class.

This class describes a triangle, defined by 3 points.

Constructor & Destructor Documentation

◆ Triangle() [1/4]

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

Constructor for a null triangle.

◆ Triangle() [2/4]

template<typename T >
Triangle< T >::Triangle ( const T &  x1,
const T &  y1,
const T &  x2,
const T &  y2,
const T &  x3,
const T &  y3 
)
noexcept

Constructor using custom X and Y values.

◆ Triangle() [3/4]

template<typename T >
Triangle< T >::Triangle ( const Point< T > &  pos1,
const Point< T > &  pos2,
const Point< T > &  pos3 
)
noexcept

Constructor using custom position values.

◆ Triangle() [4/4]

template<typename T >
Triangle< T >::Triangle ( const Triangle< T > &  tri)
noexcept

Constructor using another Triangle class values.

Member Function Documentation

◆ isNull()

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

Return true if triangle is null (all its points are equal). An null triangle is also invalid.

◆ isNotNull()

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

Return true if triangle is not null (one its points is different from the others). A non-null triangle is still invalid if two of its points are equal.

◆ isValid()

template<typename T >
bool Triangle< T >::isValid ( ) const
noexcept

Return true if triangle is valid (all its points are different).

◆ isInvalid()

template<typename T >
bool Triangle< T >::isInvalid ( ) const
noexcept

Return true if triangle is invalid (one or two of its points are equal). An invalid triangle might not be null under some circumstances.

◆ draw() [1/2]

template<typename T >
void Triangle< T >::draw ( const GraphicsContext context)

Draw this triangle using the provided graphics context.

◆ drawOutline() [1/2]

template<typename T >
void Triangle< T >::drawOutline ( const GraphicsContext context,
lineWidth = 1 
)

Draw lines (outline of this triangle) using the provided graphics context, optionally specifying line width.

◆ draw() [2/2]

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

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

◆ drawOutline() [2/2]

template<typename T >
void Triangle< T >::drawOutline ( )

Draw lines (outline of this triangle) using the current OpenGL state.
DEPRECATED Please use drawOutline(const GraphicsContext&,T) instead.


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