rock_widget_collection  0.1
Public Member Functions | List of all members
PolygonItem Class Reference

#include <PolygonItem.h>

Inherits PolylineItem.

Public Member Functions

 PolygonItem (const QColor &color, int groupNr, const QList< QPoint > &points)
 
virtual ~PolygonItem ()
 
DrawType getType ()
 
void draw (QPainter *painter, QRectF &source, QRectF &target)
 
- Public Member Functions inherited from PolylineItem
 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)
 
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)
 

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)
 
- Protected Attributes inherited from PolylineItem
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
 
- Static Protected Attributes inherited from DrawItem
static int _ID = 0
 

Detailed Description

Class whioch implements a polygon shape

Definition at line 16 of file PolygonItem.h.

Constructor & Destructor Documentation

◆ PolygonItem()

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

Creates a polygon

Parameters
colorthe color of the border
groupNrthe group number
pointsarray of Qpoint creating of the polygons edges
numberOfpointsthe number of points in the points array

Definition at line 14 of file PolygonItem.cc.

16 {
17 }
int groupNr
Definition: DrawItem.h:169
PolylineItem(const QColor &color, int groupNr, const QList< QPoint > &points)
Definition: PolylineItem.cc:15
QList< QPoint > points
Definition: PolylineItem.h:76
QColor color
Definition: DrawItem.h:184

◆ ~PolygonItem()

PolygonItem::~PolygonItem ( )
virtual

Destructor

Definition at line 19 of file PolygonItem.cc.

20 {
21 }

Member Function Documentation

◆ draw()

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

Reimplemented from FillItem.

Definition at line 23 of file PolygonItem.cc.

24 {
25  FillItem::draw(painter,source,target);
26  painter->drawPolygon(getAllPoints(), getNumberOfPoints());
27 }
int getNumberOfPoints()
Definition: PolylineItem.cc:45
void draw(QPainter *painter, QRectF &source, QRectF &target)
Definition: FillItem.cc:26
QPoint * getAllPoints()
Definition: PolylineItem.cc:50

◆ getType()

DrawType PolygonItem::getType ( )
inlinevirtual

Returns DrawType::Polygon

Returns
DrawType::Polygon

Implements DrawItem.

Definition at line 37 of file PolygonItem.h.

37 {return Polygon;};

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