Pen

Class which is used for drawing primitives.

Each instance of pen has a color, and the various members simply draw primitives in that color.

Summary
Class which is used for drawing primitives.
Default constructor, sets color to white.
Initializing constructor, takes components of color to use for drawing.
Initializing constructor, takes Color to use for drawing..
Sets color to use for drawing.
Sets color to use for drawing.
Draws a single point.
Draw a line from one point to another.
Draw a vector, including small arrow, with base at a given point.
Draw an empty rectangle.
Draw a filled rectangle.
Draw an empty circle.
Draw a filled circle.

(Con/ De)structors

Pen

Pen()

Default constructor, sets color to white.

Pen

Pen(ubyte r,  
ubyte g,  
ubyte b,  
ubyte a = 255)

Initializing constructor, takes components of color to use for drawing.

Parameters

rValue for red component.
gValue for green component.
bValue for blue component.
aValue for alpha component.  [default: 255]

See Also

setColor

Pen

Pen(const Color &color)

Initializing constructor, takes Color to use for drawing..

Parameters

colorColor to use for drawing.

See Also

setColor

Color

setColor

void setColor(ubyte r,  
ubyte g,  
ubyte b,  
ubyte a = 255)

Sets color to use for drawing.

Parameters

rValue for red component.
gValue for green component.
bValue for blue component.
aValue for alpha component.  [default: 255]

setColor

void setColor(const Color &color)

Sets color to use for drawing.

Parameters

colorColor to use for drawing.

Drawing

drawPoint

void drawPoint(const math::Point2 &point) const

Draws a single point.

Parameters

pointPoint to draw.

drawLine

void drawLine(const math::Point2 &p1,
const math::Point2 &p2) const

Draw a line from one point to another.

Parameters

p1First endpoint of line.
p2Second endpoint of line.

drawVector

void drawVector(const math::Point2 &point,
const math::Vector2 &vector) const

Draw a vector, including small arrow, with base at a given point.

Parameters

pointBase point for vector.
vectorVector to draw.

drawRect

void drawRect(const math::Rect &rect) const

Draw an empty rectangle.

Parameters

rectRect to draw.

fillRect

void fillRect(const math::Rect &rect) const

Draw a filled rectangle.

Parameters

rectRect to draw.

drawCircle

void drawCircle(const math::Circle &circle) const

Draw an empty circle.

Parameters

circleCircle to draw.

fillCircle

void fillCircle(const math::Circle &circle) const

Draw a filled circle.

Parameters

circleCircle to draw.
Pen()
Default constructor, sets color to white.
void setColor(ubyte r,  
ubyte g,  
ubyte b,  
ubyte a = 255)
Sets color to use for drawing.
void drawPoint(const math::Point2 &point) const
Draws a single point.
void drawLine(const math::Point2 &p1,
const math::Point2 &p2) const
Draw a line from one point to another.
void drawVector(const math::Point2 &point,
const math::Vector2 &vector) const
Draw a vector, including small arrow, with base at a given point.
void drawRect(const math::Rect &rect) const
Draw an empty rectangle.
void fillRect(const math::Rect &rect) const
Draw a filled rectangle.
void drawCircle(const math::Circle &circle) const
Draw an empty circle.
void fillCircle(const math::Circle &circle) const
Draw a filled circle.
Defines geometric entity known as a rectangle.
Defines geometric entity known as a circle.