DISTRHO Plugin Framework
|
#include <Geometry.hpp>
Public Member Functions | |
Rectangle () noexcept | |
Rectangle (const T &x, const T &y, const T &width, const T &height) noexcept | |
Rectangle (const T &x, const T &y, const Size< T > &size) noexcept | |
Rectangle (const Point< T > &pos, const T &width, const T &height) noexcept | |
Rectangle (const Point< T > &pos, const Size< T > &size) noexcept | |
Rectangle (const Rectangle< T > &rect) noexcept | |
const T & | getX () const noexcept |
const T & | getY () const noexcept |
const T & | getWidth () const noexcept |
const T & | getHeight () const noexcept |
const Point< T > & | getPos () const noexcept |
const Size< T > & | getSize () 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 |
void | moveBy (const T &x, const T &y) noexcept |
void | moveBy (const Point< T > &pos) noexcept |
void | setWidth (const T &width) noexcept |
void | setHeight (const T &height) noexcept |
void | setSize (const T &width, const T &height) noexcept |
void | setSize (const Size< T > &size) noexcept |
void | growBy (double multiplier) noexcept |
void | shrinkBy (double divider) noexcept |
void | setRectangle (const Point< T > &pos, const Size< T > &size) noexcept |
void | setRectangle (const Rectangle< T > &rect) noexcept |
bool | contains (const T &x, const T &y) const noexcept |
bool | contains (const Point< T > &pos) const noexcept |
bool | containsAfterScaling (const Point< T > &pos, double scaling) const noexcept |
template<typename T2 > | |
bool | contains (const Point< T2 > &pos) const noexcept |
bool | containsX (const T &x) const noexcept |
bool | containsY (const T &y) const 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) |
Rectangle< T > & | operator= (const Rectangle< T > &rect) noexcept |
Rectangle< T > & | operator*= (double m) noexcept |
Rectangle< T > & | operator/= (double d) noexcept |
bool | operator== (const Rectangle< T > &size) const noexcept |
bool | operator!= (const Rectangle< T > &size) const noexcept |
void | draw () |
void | drawOutline () |
DGL Rectangle class.
This class describes a rectangle, defined by a starting point and a size.
|
noexcept |
Constructor using custom X, Y, width and height values.
|
noexcept |
Constructor using custom X, Y and size values.
|
noexcept |
Constructor using custom pos, width and height values.
|
noexcept |
Constructor using custom position and size.
Constructor using another Rectangle class values.
|
noexcept |
Get X value.
|
noexcept |
Get Y value.
|
noexcept |
Get width.
|
noexcept |
Get height.
|
noexcept |
Set X value as x.
|
noexcept |
Set Y value as y.
|
noexcept |
Set X and Y values as x and y respectively.
Set X and Y values according to pos.
|
noexcept |
Move this rectangle by x and y values.
Move this rectangle by pos.
|
noexcept |
Set width.
|
noexcept |
Set height.
|
noexcept |
Set size using width and height.
|
noexcept |
Grow size by multiplier.
|
noexcept |
Shrink size by divider.
|
noexcept |
Set rectangle using pos and size.
Set rectangle.
|
noexcept |
Check if this rectangle contains the point defined by X and Y.
Check if this rectangle contains the point pos.
|
noexcept |
Check if this rectangle contains the point pos affected by a custom scale.
|
noexcept |
Check if this rectangle contains the point pos of another type.
|
noexcept |
Check if this rectangle contains X.
|
noexcept |
Check if this rectangle contains Y.
|
noexcept |
Return true if size is null (0x0). An null size is also invalid.
|
noexcept |
Return true if size is not null (0x0). A non-null size is still invalid if its width or height are negative.
|
noexcept |
Return true if size is valid (width and height are higher than zero).
|
noexcept |
Return true if size is invalid (width or height are lower or equal to zero). An invalid size might not be null under some circumstances.
void Rectangle< T >::draw | ( | const GraphicsContext & | context | ) |
Draw this rectangle using the provided graphics context.
void Rectangle< T >::drawOutline | ( | const GraphicsContext & | context, |
T | lineWidth = 1 |
||
) |
Draw lines (outline of this rectangle) using the provided graphics context, optionally specifying line width.
void Rectangle< T >::draw | ( | ) |
Draw this rectangle using the current OpenGL state.
DEPRECATED Please use draw(const GraphicsContext&) instead.
void Rectangle< T >::drawOutline | ( | ) |
Draw lines (outline of this rectangle) using the current OpenGL state.
DEPRECATED Please use drawOutline(const GraphicsContext&,T) instead.