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),
103 public:
explicit EditorView(QWidget *_parent = 0);
109 public:
void Create3DVisual(
EditorItem *_item);
118 public:
void SetBackgroundImage(
const std::string &_filename,
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;
double baseHeight
Level height from ground.
Definition: EditorView.hh:61
None mode.
Definition: EditorView.hh:86
Base class of an item in the editor.
Definition: EditorItem.hh:42
Door mode.
Definition: EditorView.hh:92
int level
Level number.
Definition: EditorView.hh:55
Color mode.
Definition: EditorView.hh:96
double height
Level height.
Definition: EditorView.hh:64
Wall mode.
Definition: EditorView.hh:88
2D representation of a floor.
Definition: FloorItem.hh:43
DrawModes
Unique identifiers for all drawing modes within the editor.
Definition: EditorView.hh:84
Create and manage 3D visuals of a building.
Definition: BuildingMaker.hh:48
A convenient structure for storing level information.
Definition: EditorView.hh:45
Window mode.
Definition: EditorView.hh:90
Dialog for configuring a building level.
Definition: LevelInspectorDialog.hh:40
Control the editor view and manage contents in the editor scene.
Definition: EditorView.hh:78
Definition: GrabberHandle.hh:38
QGraphicsPixmapItem * backgroundPixmap
Background pixmap for a level.
Definition: EditorView.hh:67
std::string name
Level name.
Definition: EditorView.hh:58
FloorItem * floorItem
Level's floor item.
Definition: EditorView.hh:70
2D grid lines.
Definition: GridLines.hh:37
Level()
Constructor.
Definition: EditorView.hh:48
Stairs mode.
Definition: EditorView.hh:94