18#ifndef _EDITOR_VIEW_HH_
19#define _EDITOR_VIEW_HH_
37 class WallSegmentItem;
40 class LevelInspectorDialog;
48 public:
Level() : level(0), name(
"level"), baseHeight(0),
51 backgroundPixmap(nullptr),
123 private:
void resizeEvent(QResizeEvent *_event);
128 private:
void scrollContentsBy(
int _dx,
int _dy);
132 private:
void contextMenuEvent(QContextMenuEvent *_event);
136 private:
void wheelEvent(QWheelEvent *_event);
140 private:
void mouseMoveEvent(QMouseEvent *_event);
144 private:
void mousePressEvent(QMouseEvent *_event);
148 private:
void mouseReleaseEvent(QMouseEvent *_event);
152 private:
void mouseDoubleClickEvent(QMouseEvent *_event);
156 private:
void leaveEvent(QEvent *_event);
160 private:
void keyPressEvent(QKeyEvent *_event);
164 private:
void DrawWall(
const QPoint &_pos);
169 private:
void DrawWindow(
const QPoint &_pos);
174 private:
void DrawDoor(
const QPoint &_pos);
179 private:
void DrawStairs(
const QPoint &_pos);
184 private:
void OnCreateEditorItem(
const std::string &_type);
189 private:
void OnColorSelected(QColor _color);
194 private:
void OnTextureSelected(QString _texture);
198 private:
void OnFinishModel();
201 private:
void OnDiscardModel();
204 private slots:
void OnAddLevel();
208 private slots:
void OnDeleteLevel();
211 private slots:
void OnLevelApply();
214 private slots:
void OnOpenLevelInspector();
219 private:
void OnChangeLevel(
int _level);
223 private:
void DeleteLevel(
int _level);
226 private:
void CancelDrawMode();
229 private:
void OnShowFloorplan();
232 private:
void OnShowElements();
235 private:
void ShowCurrentLevelItems();
252 private:
int drawMode;
255 private:
bool drawInProgress;
258 private:
bool floorplanVisible;
261 private:
bool elementsVisible;
264 private: std::vector<WallSegmentItem*> wallSegmentList;
267 private: std::vector<WindowItem*> windowList;
270 private: std::vector<DoorItem*> doorList;
273 private: std::vector<StairsItem*> stairsList;
276 private: std::vector<FloorItem*> floorList;
279 private: std::map<EditorItem *, std::string> itemToVisualMap;
282 private: std::vector<event::ConnectionPtr> connections;
286 private: QGraphicsItem *currentMouseItem =
nullptr;
289 private: QGraphicsItem *currentSelectedItem =
nullptr;
295 private:
int currentLevel = 0;
298 private: std::vector<Level *> levels;
302 private:
int levelCounter = 0;
305 private:
double levelDefaultHeight = 0.0;
308 private: QAction *openLevelInspectorAct;
311 private: QAction *addLevelAct;
314 private: QAction *deleteLevelAct;
318 private:
double mousePressRotation;
327 private:
double viewScale;
331 private:
bool snapToGrabber =
false;
340 private: QGraphicsTextItem *mouseTooltip;
gui
Definition KeyEventHandler.hh:29
Create and manage 3D visuals of a building.
Definition BuildingMaker.hh:49
Base class of an item in the editor.
Definition EditorItem.hh:43
Control the editor view and manage contents in the editor scene.
Definition EditorView.hh:79
void Create3DVisual(EditorItem *_item)
Create a 3D visual from a 2D editor item.
EditorView(QWidget *_parent=0)
Constructor.
DrawModes
Unique identifiers for all drawing modes within the editor.
Definition EditorView.hh:84
@ STAIRS
Stairs mode.
Definition EditorView.hh:94
@ TEXTURE
Texture mode.
Definition EditorView.hh:98
@ WINDOW
Window mode.
Definition EditorView.hh:90
@ COLOR
Color mode.
Definition EditorView.hh:96
@ NONE
None mode.
Definition EditorView.hh:86
@ DOOR
Door mode.
Definition EditorView.hh:92
@ WALL
Wall mode.
Definition EditorView.hh:88
void SetBackgroundImage(const std::string &_filename, double _scale)
Set the graphics view background image.
void DeleteItem(EditorItem *_item)
Delete an editor item.
2D representation of a floor.
Definition FloorItem.hh:44
Definition GrabberHandle.hh:39
2D grid lines.
Definition GridLines.hh:38
Dialog for configuring a building level.
Definition LevelInspectorDialog.hh:42
A convenient structure for storing level information.
Definition EditorView.hh:46
QGraphicsPixmapItem * backgroundPixmap
Background pixmap for a level.
Definition EditorView.hh:67
FloorItem * floorItem
Level's floor item.
Definition EditorView.hh:70
double height
Level height.
Definition EditorView.hh:64
std::string name
Level name.
Definition EditorView.hh:58
Level()
Constructor.
Definition EditorView.hh:48
double baseHeight
Level height from ground.
Definition EditorView.hh:61
int level
Level number.
Definition EditorView.hh:55
Forward declarations for the common classes.
Definition Animation.hh:27