Fawkes API Fawkes Development Version
|
Class representing a rectangle. More...
#include "visdisplay.h"
Public Member Functions | |
Rectangle (float x, float y, float width, float height, unsigned int id, unsigned int owner, fawkes::VisualDisplay2DInterface::LineStyle line_style=fawkes::VisualDisplay2DInterface::LS_SOLID, unsigned char r=0, unsigned char g=0, unsigned char b=0, unsigned char a=0) | |
Constructor. | |
void | draw (Cairo::RefPtr< Cairo::Context > &cr) |
Draw shape to Cairo context. |
Class representing a rectangle.
Rectangle represented the cartesian coordinates of the lower right corner and its width and height.
Definition at line 85 of file visdisplay.h.
VisualDisplay2D::Rectangle::Rectangle | ( | float | x, |
float | y, | ||
float | width, | ||
float | height, | ||
unsigned int | id, | ||
unsigned int | owner, | ||
fawkes::VisualDisplay2DInterface::LineStyle | line_style = fawkes::VisualDisplay2DInterface::LS_SOLID , |
||
unsigned char | r = 0 , |
||
unsigned char | g = 0 , |
||
unsigned char | b = 0 , |
||
unsigned char | a = 0 |
||
) |
Constructor.
x | X coordinate of lower right point |
y | Y coordinate of lower right point |
width | width of rectangle |
height | height of rectangle |
id | object ID |
owner | ID of the owner of the object |
line_style | drawing style of lines of shapes |
r | red part of RGBA color |
g | green part of RGBA color |
b | blue part of RGBA color |
a | alpha part of RGBA color |
Definition at line 263 of file visdisplay.cpp.
void VisualDisplay2D::Rectangle::draw | ( | Cairo::RefPtr< Cairo::Context > & | cr | ) | [virtual] |
Draw shape to Cairo context.
This method shall be implemented by a shape to draw itself using the provided Cairo context.
cr | reference to Cairo context. Note that this is a reference bypassing the reference pointer. This is done for efficiency and with the assumption that this method is only called by VisualDisplay2D::draw() which itself has proper refptr handling. |
Implements VisualDisplay2D::Shape.
Definition at line 278 of file visdisplay.cpp.