arenacontroller.h
Go to the documentation of this file.
1 #ifndef ARENACONTROLLER_H
2 #define ARENACONTROLLER_H
3 
4 #include <QPointF>
5 #include <QRectF>
6 #include <QList>
7 #include <QMap>
8 
9 class QPainter;
10 class Arena;
11 class ArenaScene;
12 class ArenaSceneElement;
13 
15 {
16 public:
17  ArenaController(Arena *arena, ArenaScene *scene);
18 
19  void startInsertion(const QString &elementType, const QPointF &pos);
20  void cancelInsertion();
21 
22  void startDrag(ArenaSceneElement *sceneElement);
23  void startDrag(QList<ArenaSceneElement *> sceneElements);
24 
25  void dragTo(const QPointF &to);
26  void dragBy(const QPointF &by);
27 
28  void setSnapToGrid(bool snap) { m_snapToGrid = snap; }
31  void setAutoRotateWalls(bool autoRotate) { m_autoRotateWalls = autoRotate; }
32 
33  void endOperation();
34 
35  bool operationInProgress() const;
36 
37  void draw(QPainter *painter, const QRectF &rect);
38 
39 private:
40  void dragTo(ArenaSceneElement *sceneElement, const QPointF &to);
41 
45  QList<ArenaSceneElement*> m_activeElements;
46  QMap<ArenaSceneElement*, QPointF> m_origPositions;
48 
51 
54 };
55 
56 #endif // ARENACONTROLLER_H
QMap< ArenaSceneElement *, QPointF > m_origPositions
bool operationInProgress() const
void draw(QPainter *painter, const QRectF &rect)
void dragTo(const QPointF &to)
void setSnapToGrid(bool snap)
void dragBy(const QPointF &by)
Definition: arena.h:10
ArenaScene * m_scene
ArenaController(Arena *arena, ArenaScene *scene)
void startInsertion(const QString &elementType, const QPointF &pos)
QPointF m_totalMouseOffset
QList< ArenaSceneElement * > m_activeElements
SceneElement currently being manipulated through this controller.
bool m_lastDragFinished
True iff. endDrag() has been called after last startDrag()
void startDrag(ArenaSceneElement *sceneElement)
void setAutoRotateWalls(bool autoRotate)


hector_nist_arena_designer
Author(s): Stefan Kohlbrecher , Johannes Simon
autogenerated on Fri Aug 21 2020 10:45:27