Seamly2D
Code documentation
Pen Struct Reference

#include <pen.h>

Collaboration diagram for Pen:

Public Member Functions

 Pen ()
 
 Pen (const QString &color, const qreal &weight, const QString &type)
 
virtual ~Pen ()
 
QString getLineType () const
 
void setLineType (const QString &type)
 
qreal getLineWeight () const
 
void setLineWeight (const qreal &weight)
 
QString getColor () const
 
void setColor (const QString &color)
 
bool operator== (const Pen &pen) const
 
bool operator!= (const Pen &pen) const
 

Public Attributes

QString color {QString("black")}
 
qreal lineWeight {1.20}
 
QString lineType {QString("solidline")}
 

Protected Attributes

QString m_color
 
qreal m_lineWeight
 
QString m_lineType
 

Friends

std::ostream & operator<< (std::ostream &stream, const Pen &pen)
 

Detailed Description

A pen stores attributes for painting such as line weight, linetype, color, ...

Definition at line 36 of file pen.h.

Constructor & Destructor Documentation

◆ Pen() [1/2]

Pen::Pen ( )
inline

Creates a default pen (black, solid, weight 0).

Definition at line 43 of file pen.h.

References setColor(), setLineType(), and setLineWeight().

◆ Pen() [2/2]

Pen::Pen ( const QString &  color,
const qreal &  weight,
const QString &  type 
)
inline

Creates a pen with the given attributes.

Definition at line 53 of file pen.h.

References color, setColor(), setLineType(), and setLineWeight().

◆ ~Pen()

virtual Pen::~Pen ( )
inlinevirtual

Definition at line 60 of file pen.h.

Member Function Documentation

◆ getColor()

QString Pen::getColor ( ) const
inline

Definition at line 82 of file pen.h.

References m_color.

◆ getLineType()

QString Pen::getLineType ( ) const
inline

Definition at line 62 of file pen.h.

References m_lineType.

◆ getLineWeight()

qreal Pen::getLineWeight ( ) const
inline

Definition at line 72 of file pen.h.

References m_lineWeight.

◆ operator!=()

bool Pen::operator!= ( const Pen pen) const
inline

Definition at line 97 of file pen.h.

◆ operator==()

bool Pen::operator== ( const Pen pen) const
inline

Definition at line 92 of file pen.h.

References m_color, m_lineType, and m_lineWeight.

◆ setColor()

void Pen::setColor ( const QString &  color)
inline

Definition at line 87 of file pen.h.

References color, and m_color.

Referenced by Pen().

◆ setLineType()

void Pen::setLineType ( const QString &  type)
inline

Definition at line 67 of file pen.h.

References m_lineType.

Referenced by Pen().

◆ setLineWeight()

void Pen::setLineWeight ( const qreal &  weight)
inline

Definition at line 77 of file pen.h.

References m_lineWeight.

Referenced by Pen().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const Pen pen 
)
friend

Definition at line 31 of file pen.cpp.

Member Data Documentation

◆ color

QString Pen::color {QString("black")}

◆ lineType

QString Pen::lineType {QString("solidline")}

◆ lineWeight

qreal Pen::lineWeight {1.20}

◆ m_color

QString Pen::m_color
protected

Definition at line 105 of file pen.h.

Referenced by getColor(), operator==(), and setColor().

◆ m_lineType

QString Pen::m_lineType
protected

Definition at line 107 of file pen.h.

Referenced by getLineType(), operator==(), and setLineType().

◆ m_lineWeight

qreal Pen::m_lineWeight
protected

Definition at line 106 of file pen.h.

Referenced by getLineWeight(), operator==(), and setLineWeight().


The documentation for this struct was generated from the following files: