2 * PlaygroundScene.h 07/10/31
4 * Draw a playground and likewise scene.
6 * Copyright: (c) 2007 CTU Dragons
7 * CTU FEE - Department of Control Engineering
8 * Authors: Martin Zidek, Michal Sojka, Tran Duy Khanh
12 #ifndef PLAYGROUND_SCENE_H
13 #define PLAYGROUND_SCENE_H
15 #include <QGraphicsScene>
18 class PlaygroundScene : public QGraphicsScene
23 PlaygroundScene(QObject *parent = 0);
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);
31 void obstacleChanged(QPointF pos);
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;
41 void showObstacle(int val);
42 void showMap(bool show);