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

#include <PolylineItem.h>

Inherits FillItem.

Inherited by PolygonItem.

Public Member Functions

 PolylineItem (const QColor &color, int groupNr, const QList< QPoint > &points)
 
virtual ~PolylineItem ()
 
void removeAllPoints ()
 
void addPoint (QPoint point)
 
void removePoint (QPoint point)
 
int getNumberOfPoints ()
 
QPoint * getAllPoints ()
 
DrawType getType ()
 
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)
 

Protected Attributes

QList< QPoint > points
 
- 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 ()
 
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 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

Polyline shape which draws multiple lines without filling.

Definition at line 18 of file PolylineItem.h.

Constructor & Destructor Documentation

PolylineItem::PolylineItem ( const QColor &  color,
int  groupNr,
const QList< QPoint > &  points 
)

Creates a PolyLine Item

Parameters
colorthe line color
groupNrthe group number
pointsarray of QPoint
numberOfpointsthe number of QPoint objects in the points array

Definition at line 15 of file PolylineItem.cc.

17 {
18 }
FillItem(int posX, int posY, int groupNr, const QColor &color)
Definition: FillItem.cc:11
int groupNr
Definition: DrawItem.h:169
QList< QPoint > points
Definition: PolylineItem.h:76
QColor color
Definition: DrawItem.h:184
PolylineItem::~PolylineItem ( )
virtual

Destructor

Definition at line 20 of file PolylineItem.cc.

21 {
22 }

Member Function Documentation

void PolylineItem::addPoint ( QPoint  point)

Adds a point to the polyline

Parameters
pointthe point to add

Definition at line 30 of file PolylineItem.cc.

31 {
32  points.push_back(point);
33 }
QList< QPoint > points
Definition: PolylineItem.h:76
void PolylineItem::draw ( QPainter *  painter,
QRectF &  source,
QRectF &  target 
)
virtual
See Also
DrawItem::draw

Reimplemented from FillItem.

Definition at line 24 of file PolylineItem.cc.

25 {
26  addPenStyle(painter);
27  painter->drawPolyline(getAllPoints(), getNumberOfPoints());
28 }
void addPenStyle(QPainter *painter)
Definition: DrawItem.cc:27
int getNumberOfPoints()
Definition: PolylineItem.cc:45
QPoint * getAllPoints()
Definition: PolylineItem.cc:50
QPoint * PolylineItem::getAllPoints ( )

Returns an array of Qpoint

Returns
a QPoint array

Definition at line 50 of file PolylineItem.cc.

51 {
52  return points.toVector().data();
53 }
QList< QPoint > points
Definition: PolylineItem.h:76
int PolylineItem::getNumberOfPoints ( )

Returns the number of points

Returns
the number of points

Definition at line 45 of file PolylineItem.cc.

46 {
47  return points.size();
48 }
QList< QPoint > points
Definition: PolylineItem.h:76
DrawType PolylineItem::getType ( )
inlinevirtual

Returns DrawType::Polyline

Returns
DrawType::Polyline

Implements DrawItem.

Definition at line 68 of file PolylineItem.h.

68 {return Polyline;};
void PolylineItem::removeAllPoints ( )

removes all points

Definition at line 35 of file PolylineItem.cc.

36 {
37  points.clear();
38 }
QList< QPoint > points
Definition: PolylineItem.h:76
void PolylineItem::removePoint ( QPoint  point)

Removes a point

Parameters
pointthe point to remove

Definition at line 40 of file PolylineItem.cc.

41 {
42  points.removeAll(point);
43 }
QList< QPoint > points
Definition: PolylineItem.h:76

Member Data Documentation

QList<QPoint> PolylineItem::points
protected

List of points for the polyline

Definition at line 76 of file PolylineItem.h.


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