Walls And Holes  1
editor.h
Go to the documentation of this file.
1 #ifndef EDITOR_H
2 #define EDITOR_H
3 
4 #include "tilemap.h"
5 #include "tilemaptoolmanager.h"
6 #include "tiletemplateset.h"
7 #include "mapviewcontainer.h"
8 #include "xmltool.h"
9 #include "map2mesh.h"
10 #include "meshviewcontainer.h"
11 #include "tiletemplatesetsview.h"
13 #include "propertybrowser.h"
14 #include "tilematerialview.h"
15 #include "qmainwindow.h"
16 
17 #include <QObject>
18 #include <QList>
19 #include <QToolBar>
20 #include <QSettings>
21 #include <QMainWindow>
22 #include <QUndoGroup>
23 #include <QUndoStack>
24 
32 class Editor : public QObject
33 {
34  Q_OBJECT
35 
36 public:
37  explicit Editor(QObject *parent = nullptr);
38  ~Editor();
39 
40 public slots:
41  //File:
42  void newMap();
43  void saveMap();
44  void saveMapAs();
45  void loadMap();
46  void closeMap();
47  void exportMapMesh();
48 
49  //Map:
50  void viewMapProperties();
51 
52 
53 private:
54  //sets mTileMap to tileMap, and updates everything accordingly
55  void setTileMap(TileMap *tileMap);
56  void setUpMenuBar();
57 
58  QMainWindow *mMainWindow;
59 
60  // Undo system.
61 
65  QUndoGroup *mUndoGroup;
66 
71  QUndoStack *mTileMapUndoStack;
72 
73  // Map-to-Mesh Converter
74  Map2Mesh *mMap2Mesh;
75 
76  //TileMap data
77  TileMap *mTileMap;
78  TileTemplateSetsManager *mTileTemplateSetManager;
79  QRegion mTileMapSelectedRegion;
80 
81  //views
82  MapViewContainer *mMapViewContainer;
83  MeshViewContainer *mMeshViewContainer;
84  TileTemplateSetsView *mTileTemplateSetsView;
85  PropertyBrowser *mPropertyBrowser;
86  TileMaterialView *mMaterialView;
87 
88  //Tools
89  TileMapToolManager *mTileMapToolManager;
90  QToolBar *mToolBar;
91 
92  //QActions which should be disabled when there is no map.
93  QVector<QAction*> mMapDependantActions;
94  void setMapDependantActionsEnabled(bool enabled)
95  {
96  for (QAction *a : mMapDependantActions)
97  a->setEnabled(enabled);
98  }
99 
100  //Saving and loading settings
101  QString mSavePath = "/home/";
102  QString mExportPath = "/home/";
103  void loadSettings();
104  void saveSettings();
105 };
106 
107 #endif // EDITOR_H
Definition: mapviewcontainer.h:10
The TileTemplateSetsView class Stores and displays all open TileTemplateSets. Has a tool bar for savi...
Definition: tiletemplatesetsview.h:20
Definition: tilematerialview.h:12
The PropertyBrowser class.
Definition: propertybrowser.h:17
An object that keeps track of map-to-mesh conversion.
Definition: map2mesh.h:22
void saveMap()
Definition: editor.cpp:161
Definition: tilemaptoolmanager.h:8
void loadMap()
Definition: editor.cpp:212
void closeMap()
Definition: editor.cpp:231
void saveMapAs()
Definition: editor.cpp:187
The TileTemplateSetsManager class Handles the active tileTemplateSets of the application. Can create dialogs to interact with the user. May modify the attached TileMap when removing templateSets.
Definition: tiletemplatesetsmanager.h:16
~Editor()
Definition: editor.cpp:142
void newMap()
Definition: editor.cpp:149
void exportMapMesh()
Definition: editor.cpp:236
Editor(QObject *parent=nullptr)
Definition: editor.cpp:30
Definition: meshviewcontainer.h:12
The Editor class This is responsible for creating and managing all windows of the editor...
Definition: editor.h:32
void viewMapProperties()
Definition: editor.cpp:264
Definition: tilemap.h:14