]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/robomon/PlaygroundScene.h
robofsm: Strategy
[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 <QPainter>
17 #include <map.h>
18
19 #define SIM_OBST_SIZE_M 0.3
20
21 class PlaygroundScene : public QGraphicsScene
22 {
23         Q_OBJECT
24
25 public:
26         PlaygroundScene(QObject *parent = 0);
27         ~PlaygroundScene();
28         static QPointF scene2world(QPointF scenePos);
29         static QPointF world2scene(QPointF worldPos);
30 signals:
31         void obstacleChanged(QPointF pos);
32         void mouseMoved(QPointF pos);
33
34 protected:
35         virtual void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
36         virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);
37
38 private:
39         QGraphicsEllipseItem *obstacle;
40         
41         void paintCorns(int side_configuration, int center_configuration);
42         void putCorn(struct corn * corn);
43         void putBonus(QGraphicsEllipseItem *g, int centerX, int centerY);
44         void putPawn(QGraphicsEllipseItem *g, int centerX, int centerY);
45         void putKing(QGraphicsEllipseItem *g, int centerX, int centerY);
46         void putQueen(QGraphicsEllipseItem *g, int centerX, int centerY);
47
48 public slots:
49         void showObstacle(int val);
50 };
51
52 #endif