Pen Class Reference

#include <Pt/Gfx/Pen.h>

Attributs for the drawing of outlines. More...

Public Types

enum  CapStyle
 Pen cap style.
 
enum  JoinStyle
 Pen join style.
 
enum  Style
 Pen line style.
 

Public Member Functions

 Pen ()
 Constructs a null pen. More...
 
 Pen (const Color &color)
 Constructs a Pen with the specified color. More...
 
 Pen (const Color &color, std::size_t width, Style style=Solid, CapStyle cap=FlatCap, JoinStyle join=BevelJoin)
 Constructs a Pen with the specified size, color and styles.
 
 Pen (const Color &color, std::size_t width, Pt::uint64_t stylePattern, CapStyle cap=FlatCap, JoinStyle join=BevelJoin)
 Constructs a Pen with the specified size, color and custom styles.
 
CapStyle capStyle () const
 Returns the cap style.
 
const Color & color () const
 Returns the color of the pen.
 
bool isNull () const
 Returns true if the pen is null.
 
JoinStyle joinStyle () const
 Returns the join style.
 
void setCapStyle (CapStyle cap=FlatCap)
 Sets the cap style.
 
void setColor (const Color &color)
 Sets the color of the pen.
 
void setJoinStyle (JoinStyle join=BevelJoin)
 Sets the join style.
 
void setSize (std::size_t size)
 Sets the size of the pen.
 
void setStyle (Style style=Solid)
 Sets the pen style.
 
void setStyle (Pt::uint64_t stylePattern)
 Sets the pen style.
 
std::size_t size () const
 Returns the size of the pen.
 
Style style () const
 Returns the pen style.
 
Pt::uint64_t styleUserPattern () const
 Returns the pen style user pattern.
 

Detailed Description

Pen objects are used as container of drawing attributes for Painter objects. A size and a color can be specified per pen. The size and color are used to draw outlined shapes by the Painter. Outlined shapes for example are lines, outlined rectangles or ellipses and text.

Constructor & Destructor Documentation

Pen ( )

The default pen is null.

Pen ( const Color &  color)

The pen size is 1, the style is solid and the cap and join styles are round.