rock_widget_collection  0.1
Public Member Functions | Protected Attributes | List of all members
RectangleItem Class Reference

#include <RectangleItem.h>

Inherits FillItem.

Inherited by EllipseItem.

Public Member Functions

 RectangleItem (int posX, int posY, int groupNr, const QColor &color, int width, int height)
 
virtual ~RectangleItem ()
 
int getWidth ()
 
int getHeight ()
 
DrawType getType ()
 
void setWidth (int width)
 
void setHeight (int height)
 
void draw (QPainter *painter, QRectF &source, QRectF &target)
 
- Public Member Functions inherited from FillItem
 FillItem (int posX, int posY, int groupNr, const QColor &color)
 
bool isDrawBorder ()
 
QColor * getInteriorColor ()
 
void setDrawBorder (bool drawBorder)
 
void setInteriorColor (QColor *interiorColor)
 
- Public Member Functions inherited from DrawItem
 DrawItem (int posX, int posY, int groupNr, const QColor &color)
 
virtual ~DrawItem ()
 
bool operator== (const DrawItem &other)
 
virtual void renderOnGl (QGLWidget &widget, QRectF &source, QRectF &target)
 
int getPosY ()
 
int getGroupNr ()
 
QColor getColor ()
 
void setPosX (int posX)
 
void setPosY (int posY)
 
void setGroupNr (int groupNr)
 
void setColor (const QColor &color)
 
int getLineWidth ()
 
Qt::PenStyle getPenStyle ()
 
Qt::PenCapStyle getPenCapStyle ()
 
void setLineWidth (int lineWidth)
 
void setPenStyle (Qt::PenStyle penStyle)
 
void setPenCapStyle (Qt::PenCapStyle penCapStyle)
 
int getID () const
 
void openGL (bool value)
 
bool onOpenGL ()
 
void setPosFactor (float fx, float fy)
 

Protected Attributes

int width
 
int height
 
- Protected Attributes inherited from FillItem
bool drawBorder
 
QColor * interiorColor
 
- Protected Attributes inherited from DrawItem
int groupNr
 
int posX
 
int posY
 
QColor color
 
int lineWidth
 
Qt::PenCapStyle penCapStyle
 
Qt::PenStyle penStyle
 
int m_id
 
float position_factor_x
 
float position_factor_y
 
bool brender_on_opengl
 

Additional Inherited Members

- Public Slots inherited from DrawItem
int getPosX ()
 
- Protected Member Functions inherited from FillItem
void addBrushStyle (QPainter *painter)
 
- Protected Member Functions inherited from DrawItem
void addPenStyle (QPainter *painter)
 
- Static Protected Attributes inherited from DrawItem
static int _ID = 0
 

Detailed Description

Rectangle shape extending the fill item

Definition at line 16 of file RectangleItem.h.

Constructor & Destructor Documentation

RectangleItem::RectangleItem ( int  posX,
int  posY,
int  groupNr,
const QColor &  color,
int  width,
int  height 
)

Creates a rectangle item

Parameters
posXthe starting x position
posYthe starting y position
groupNrthe group number
colorthe border color
widththe width of the rectangle
heightthe height of the rectangle

Definition at line 12 of file RectangleItem.cc.

14 {
15  this->width = width;
16  this->height = height;
17 }
FillItem(int posX, int posY, int groupNr, const QColor &color)
Definition: FillItem.cc:11
int posY
Definition: DrawItem.h:182
int posX
Definition: DrawItem.h:180
int groupNr
Definition: DrawItem.h:169
QColor color
Definition: DrawItem.h:184
virtual RectangleItem::~RectangleItem ( )
inlinevirtual

Destructor

Definition at line 33 of file RectangleItem.h.

33 {};

Member Function Documentation

void RectangleItem::draw ( QPainter *  painter,
QRectF &  source,
QRectF &  target 
)
virtual
See also
DrawItem::draw

Reimplemented from FillItem.

Definition at line 19 of file RectangleItem.cc.

20 {
21  FillItem::draw(painter,source,target);
22  painter->drawRect(posX, posY, width, height);
23 }
int posY
Definition: DrawItem.h:182
int posX
Definition: DrawItem.h:180
void draw(QPainter *painter, QRectF &source, QRectF &target)
Definition: FillItem.cc:26
int RectangleItem::getHeight ( )
inline

Returns the height of the rectangle

Returns
the height of the ractangle

Definition at line 45 of file RectangleItem.h.

45 {return height;};
DrawType RectangleItem::getType ( )
inlinevirtual

Returns DrawType::Rectangle

Returns
DrawType::Rectangle

Implements DrawItem.

Definition at line 51 of file RectangleItem.h.

51 {return Rectangle;};
int RectangleItem::getWidth ( )
inline

Returns the width of the rectangle

Returns
the width of the rectangle

Definition at line 39 of file RectangleItem.h.

39 {return width;};
void RectangleItem::setHeight ( int  height)
inline

Sets the height of the rectangle

Parameters
heightthe height of the rectangle

Definition at line 63 of file RectangleItem.h.

63 {this->height = height;};
void RectangleItem::setWidth ( int  width)
inline

Sets the width of the rectangle

Parameters
widththe width of the rectangle

Definition at line 57 of file RectangleItem.h.

57 {this->width = width;};

Member Data Documentation

int RectangleItem::height
protected

The height of the Rectangle

Definition at line 73 of file RectangleItem.h.

int RectangleItem::width
protected

The width of the Rectangle

Definition at line 71 of file RectangleItem.h.


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