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

#include <Geometry.hpp>

Public Member Functions

 Circle () noexcept
 
 Circle (const T &x, const T &y, const float size, const uint numSegments=300)
 
 Circle (const Point< T > &pos, const float size, const uint numSegments=300)
 
 Circle (const Circle< T > &cir) noexcept
 
const T & getX () const noexcept
 
const T & getY () const noexcept
 
const Point< T > & getPos () const noexcept
 
void setX (const T &x) noexcept
 
void setY (const T &y) noexcept
 
void setPos (const T &x, const T &y) noexcept
 
void setPos (const Point< T > &pos) noexcept
 
float getSize () const noexcept
 
void setSize (const float size) noexcept
 
uint getNumSegments () const noexcept
 
void setNumSegments (const uint num)
 
void draw (const GraphicsContext &context)
 
void drawOutline (const GraphicsContext &context, T lineWidth=1)
 
Circle< T > & operator= (const Circle< T > &cir) noexcept
 
bool operator== (const Circle< T > &cir) const noexcept
 
bool operator!= (const Circle< T > &cir) const noexcept
 
void draw ()
 
void drawOutline ()
 

Detailed Description

template<typename T>
class Circle< T >

DGL Circle class.

This class describes a circle, defined by position, size and a minimum of 3 segments.

TODO: report if circle starts at top-left, bottom-right or center. and size grows from which point?

Constructor & Destructor Documentation

◆ Circle() [1/4]

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

Constructor for a null circle.

◆ Circle() [2/4]

template<typename T >
Circle< T >::Circle ( const T &  x,
const T &  y,
const float  size,
const uint  numSegments = 300 
)

Constructor using custom X, Y and size values.

◆ Circle() [3/4]

template<typename T >
Circle< T >::Circle ( const Point< T > &  pos,
const float  size,
const uint  numSegments = 300 
)

Constructor using custom position and size values.

◆ Circle() [4/4]

template<typename T >
Circle< T >::Circle ( const Circle< T > &  cir)
noexcept

Constructor using another Circle class values.

Member Function Documentation

◆ getX()

template<typename T >
const T& Circle< T >::getX ( ) const
noexcept

Get X value.

◆ getY()

template<typename T >
const T& Circle< T >::getY ( ) const
noexcept

Get Y value.

◆ getPos()

template<typename T >
const Point<T>& Circle< T >::getPos ( ) const
noexcept

Get position.

◆ setX()

template<typename T >
void Circle< T >::setX ( const T &  x)
noexcept

Set X value to x.

◆ setY()

template<typename T >
void Circle< T >::setY ( const T &  y)
noexcept

Set Y value to y.

◆ setPos() [1/2]

template<typename T >
void Circle< T >::setPos ( const T &  x,
const T &  y 
)
noexcept

Set X and Y values to x and y respectively.

◆ setPos() [2/2]

template<typename T >
void Circle< T >::setPos ( const Point< T > &  pos)
noexcept

Set X and Y values according to pos.

◆ getSize()

template<typename T >
float Circle< T >::getSize ( ) const
noexcept

Get size.

◆ setSize()

template<typename T >
void Circle< T >::setSize ( const float  size)
noexcept

Set size.

Note
Must always be > 0

◆ getNumSegments()

template<typename T >
uint Circle< T >::getNumSegments ( ) const
noexcept

Get the current number of line segments that make this circle.

◆ setNumSegments()

template<typename T >
void Circle< T >::setNumSegments ( const uint  num)

Set the number of line segments that will make this circle.

Note
Must always be >= 3

◆ draw() [1/2]

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

Draw this circle using the provided graphics context.

◆ drawOutline() [1/2]

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

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

◆ draw() [2/2]

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

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

◆ drawOutline() [2/2]

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

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


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