]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robomon/SmallRobot.h
robodim: Hokuyo returned back to original position.
[eurobot/public.git] / src / robomon / SmallRobot.h
1 /*
2  * SmallRobot.h                         07/12/04
3  *
4  * Draw a small robot on the playground.
5  *
6  * Copyright: (c) 2007 CTU Dragons
7  *            CTU FEE - Department of Control Engineering
8  * Authors: Martin Zidek, Michal Sojka, Tran Duy Khanh
9  * License: GNU GPL v.2
10  */
11
12 #ifndef SMALLROBOT_H
13 #define SMALLROBOT_H
14
15 #include <QGraphicsItem>
16 #include <QGraphicsLineItem>
17 #include <QPainter>
18 #include <mcl_laser.h>
19
20 class SmallRobot : public QObject, public QGraphicsItem
21 {
22         Q_OBJECT
23
24 public:
25         SmallRobot();
26         SmallRobot(QColor color);
27
28         QRectF boundingRect() const;
29         QPainterPath shape() const;
30         void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
31                         QWidget *widget);
32
33         void init();
34         void move();
35         void updateRobot();
36         void setParent(QWidget *parent);
37
38         struct mcl_laser_state *mclPart;
39         QColor color;
40         QSize widgetSize;
41         QSizeF playgroundSize;
42         QWidget *parent;
43
44 signals:
45         void robotMovedSignal();
46
47 protected:
48         void mousePressEvent(QGraphicsSceneMouseEvent *event);
49         void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
50
51 private:
52 };
53
54 #endif