#include <PointItem.h>
Inherits DrawItem.
|
| | PointItem (const QList< int > &points_x, const QList< int > &points_y, int groupNr, const QColor &color) |
| |
| virtual | ~PointItem () |
| |
| | 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) |
| |
PointItem for drawing a line from one point to another
Definition at line 18 of file PointItem.h.
| PointItem::PointItem |
( |
const QList< int > & |
points_x, |
|
|
const QList< int > & |
points_y, |
|
|
int |
groupNr, |
|
|
const QColor & |
color |
|
) |
| |
Definition at line 13 of file PointItem.cc.
16 this->points_x = points_x;
17 this->points_y = points_y;
DrawItem(int posX, int posY, int groupNr, const QColor &color)
| virtual PointItem::~PointItem |
( |
| ) |
|
|
inlinevirtual |
| void PointItem::draw |
( |
QPainter * |
painter, |
|
|
QRectF & |
source, |
|
|
QRectF & |
target |
|
) |
| |
|
slot |
| void PointItem::renderOnGl |
( |
QGLWidget & |
widget, |
|
|
QRectF & |
source, |
|
|
QRectF & |
target |
|
) |
| |
|
slot |
- See Also
- DrawItem::draw
Definition at line 27 of file PointItem.cc.
29 float factor_x = ((float)target.width())/source.width();
30 float factor_y = ((float)target.height())/source.height();
32 QList<int>::iterator iter_x = points_x.begin();
33 QList<int>::iterator iter_y = points_y.begin();
36 while(iter_x != points_x.end())
39 glVertex3f(factor_x*(*(iter_x++))+target.x(), widget.height()-(factor_y*(*(iter_y++))+target.y()), 0.0f);
| void PointItem::setPoints |
( |
const QList< int > & |
points_x, |
|
|
const QList< int > & |
points_y |
|
) |
| |
|
inlineslot |
Definition at line 26 of file PointItem.h.
28 if(points_x.size() != points_y.size())
29 throw std::runtime_error(
"size of points_x differs from the size of points_y");
31 this->points_x = points_x;
32 this->points_y = points_y;
34 if(points_x.size() > 0)
The documentation for this class was generated from the following files:
- /build/rock-master-18.09-gui-rock-widget-collection-0.20180124/src/generic_widgets/PointItem.h
- /build/rock-master-18.09-gui-rock-widget-collection-0.20180124/src/generic_widgets/PointItem.cc