|
rock_widget_collection
0.1
|
#include <DrawItem.h>
Inherits QObject.
Inherited by FillItem, LineItem, PointItem, and TextItem.
Public Slots | |
| int | getPosX () |
Public Member Functions | |
| DrawItem (int posX, int posY, int groupNr, const QColor &color) | |
| virtual | ~DrawItem () |
| virtual DrawType | getType ()=0 |
| virtual void | draw (QPainter *painter, QRectF &source, QRectF &target)=0 |
| 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 Member Functions | |
| void | addPenStyle (QPainter *painter) |
Protected Attributes | |
| 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 |
Static Protected Attributes | |
| static int | _ID = 0 |
Abstract Base class for all shapes. It defines basic members and methods and the abstract getType() method which needs to be overwritten with a type from the DrawType enum. The abstract draw method needs to be overwritten in each item. So each item draws itself.
Definition at line 28 of file DrawItem.h.
| DrawItem::DrawItem | ( | int | posX, |
| int | posY, | ||
| int | groupNr, | ||
| const QColor & | color | ||
| ) |
Generates a DrawItem
| posX | the starting x position |
| posY | the starting y position |
| groupNr | the group number |
| color | the color |
Definition at line 11 of file DrawItem.cc.
|
inlinevirtual |
|
protected |
Adds a pen to the given painter with the parameters given to the item
| painter | teh painter with which afterwards teh shape will be drawn |
Definition at line 27 of file DrawItem.cc.
|
pure virtual |
avstract method to draw the item
| painter | the painter with wich to draw the shape |
Implemented in PolylineItem, LineItem, RectangleItem, FillItem, ArrowItem, PointItem, EllipseItem, PolygonItem, and TextItem.
|
inline |
|
inline |
|
inline |
Definition at line 152 of file DrawItem.h.
|
inline |
Returns the width of lines drawn. the smallest visible width is zero
Definition at line 119 of file DrawItem.h.
|
inline |
|
inline |
Returns the pen style, usually this should be solid
Definition at line 125 of file DrawItem.h.
|
inlineslot |
|
inline |
|
pure virtual |
virtual method wjich returns the type of teh item
Implemented in PolylineItem, TextItem, LineItem, RectangleItem, ArrowItem, EllipseItem, and PolygonItem.
|
inline |
Definition at line 162 of file DrawItem.h.
|
inline |
Definition at line 157 of file DrawItem.h.
|
inline |
Definition at line 57 of file DrawItem.h.
|
inlinevirtual |
Reimplemented in LineItem, PointItem, and TextItem.
Definition at line 62 of file DrawItem.h.
|
inline |
|
inline |
|
inline |
Sets the width of the lines drawn, 0 is the smallest visible line available
| lineWidth | the width of the line |
Definition at line 138 of file DrawItem.h.
|
inline |
Sets the pen cap style
| penCapStyle |
Definition at line 150 of file DrawItem.h.
|
inline |
Sets the pen style
| penStyle | the penStyle |
Definition at line 144 of file DrawItem.h.
|
inline |
Set the facor to calculate the pos during scaling x = posx + fx*window_width x = posx + fy*window_height
Definition at line 169 of file DrawItem.h.
|
inline |
|
inline |
|
staticprotected |
Definition at line 192 of file DrawItem.h.
|
protected |
Definition at line 196 of file DrawItem.h.
|
protected |
The color
Definition at line 184 of file DrawItem.h.
|
protected |
The group number
Definition at line 169 of file DrawItem.h.
|
protected |
the width of the shapes lines
Definition at line 186 of file DrawItem.h.
|
protected |
Definition at line 191 of file DrawItem.h.
|
protected |
the pen cap style of the item, irrelevant for lines which have no start or end point
Definition at line 188 of file DrawItem.h.
|
protected |
The pen style of the lines
Definition at line 190 of file DrawItem.h.
|
protected |
Definition at line 193 of file DrawItem.h.
|
protected |
Definition at line 194 of file DrawItem.h.
|
protected |
The x position
Definition at line 180 of file DrawItem.h.
|
protected |
The y position
Definition at line 182 of file DrawItem.h.
1.8.13