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>
19 #define SIM_OBST_SIZE_M 0.3
21 class PlaygroundScene : public QGraphicsScene
26 PlaygroundScene(QObject *parent = 0);
28 static QPointF scene2world(QPointF scenePos);
29 static QPointF world2scene(QPointF worldPos);
31 void obstacleChanged(QPointF pos);
32 void mouseMoved(QPointF pos);
35 virtual void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
36 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);
39 QGraphicsEllipseItem *obstacle;
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);
49 void showObstacle(int val);