]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robomon/PlaygroundScene.h
robomon controls map and trail visibility from the new View menu
[eurobot/public.git] / src / robomon / PlaygroundScene.h
1 /*
2  * PlaygroundScene.h                    07/10/31
3  *
4  * Draw a playground and likewise scene.
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 PLAYGROUND_SCENE_H
13 #define PLAYGROUND_SCENE_H
14
15 #include <QGraphicsScene>
16 #include <map.h>
17
18 class PlaygroundScene : public QGraphicsScene
19 {
20         Q_OBJECT
21
22 public:
23         PlaygroundScene(QObject *parent = 0);
24         ~PlaygroundScene();
25         virtual void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
26         static QPointF scene2world(QPointF scenePos);
27         static QPointF world2scene(QPointF worldPos);
28         void setMapColor(int x, int y, QColor color);
29
30 signals:
31         void obstacleChanged(QPointF pos);
32
33 private:
34         void initMap();
35         QGraphicsItemGroup *map;
36         QGraphicsRectItem *rects[MAP_WIDTH][MAP_HEIGHT];  // This must be slow - convert to pixmap. -- M.S.
37         QGraphicsEllipseItem *obstacle;
38         QGraphicsItemGroup *freePucks;
39
40 public slots:
41         void showObstacle(int val);
42         void showMap(bool show);
43 };
44
45 #endif