trikRuntime
trikControl::Shape Class Referenceabstract

Base class for elements that can be drawn on display. More...

#include <shape.h>

Inheritance diagram for trikControl::Shape:

Public Member Functions

 Shape (const QColor &color, int penWidth)
 
virtual ~Shape ()=default
 
virtual void draw (QPainter *painter)=0
 Draws a shape with a given painter. More...
 
virtual bool equals (const Shape *other) const =0
 Checks whether to shapes are equal. More...
 

Protected Attributes

QColor mColor
 
int mPenWidth
 

Detailed Description

Base class for elements that can be drawn on display.

Constructor & Destructor Documentation

trikControl::Shape::Shape ( const QColor &  color,
int  penWidth 
)
inline
Parameters
color- color of pen with which a shape must be drawn
penWidth- width of lines
virtual trikControl::Shape::~Shape ( )
virtualdefault

Member Function Documentation

virtual void trikControl::Shape::draw ( QPainter *  painter)
pure virtual

Draws a shape with a given painter.

Implemented in trikControl::Arc, trikControl::Ellipse, trikControl::Line, trikControl::Point, and trikControl::Rectangle.

virtual bool trikControl::Shape::equals ( const Shape other) const
pure virtual

Checks whether to shapes are equal.

Implemented in trikControl::Arc, trikControl::Ellipse, trikControl::Line, trikControl::Point, and trikControl::Rectangle.

Member Data Documentation

QColor trikControl::Shape::mColor
protected
int trikControl::Shape::mPenWidth
protected

The documentation for this class was generated from the following file: