7 #ifndef CAFU_MAP_DOCUMENT_HPP_INCLUDED
8 #define CAFU_MAP_DOCUMENT_HPP_INCLUDED
11 #include "../DocumentAdapter.hpp"
13 #include "Plants/PlantDescrMan.hpp"
14 #include "Templates/Array.hpp"
15 #include "Templates/Pointer.hpp"
16 #include "SceneGraph/LightMapMan.hpp"
17 #include "UniScriptState.hpp"
29 class wxProgressDialog;
30 namespace MapEditor {
class CompMapEntityT; }
31 namespace cf {
namespace GameSys {
class EntityT; } }
32 namespace cf {
namespace GameSys {
class WorldT; } }
39 unsigned short Heading;
49 static const unsigned int CMAP_FILE_VERSION;
90 void SetChildFrame(
ChildFrameT* ChildFrame) { m_ChildFrame=ChildFrame; }
91 ChildFrameT* GetChildFrame()
const {
return m_ChildFrame; }
92 const wxString& GetFileName()
const {
return m_FileName; }
130 GameConfigT* GetGameConfig()
const {
return m_GameConfig; }
134 const ArrayT<PtsPointT>& GetPointFilePoints()
const {
return m_PointFilePoints; }
135 const ArrayT<wxColour>& GetPointFileColors()
const {
return m_PointFileColors; }
138 int GetGridSpacing()
const {
return m_GridSpacing>0 ? m_GridSpacing : 1; }
139 bool Is2DGridEnabled()
const {
return m_ShowGrid; }
143 bool GetAutoGroupEntities()
const {
return m_AutoGroupEntities; }
152 void SetPasteParent(
unsigned int ID);
188 unsigned int m_PasteParentID;
199 bool m_AutoGroupEntities;
206 void OnMapSnapToGrid (wxCommandEvent& CE);
207 void OnMapToggleGrid2D (wxCommandEvent& CE);
208 void OnMapFinerGrid (wxCommandEvent& CE);
209 void OnMapCoarserGrid (wxCommandEvent& CE);
210 void OnMapAutoGroupEntities (wxCommandEvent& CE);
211 void OnMapGotoPrimitive (wxCommandEvent& CE);
212 void OnMapShowInfo (wxCommandEvent& CE);
213 void OnMapCheckForProblems (wxCommandEvent& CE);
214 void OnMapLoadPointFile (wxCommandEvent& CE);
215 void OnMapUnloadPointFile (wxCommandEvent& CE);
217 void OnUpdateMapAutoGroupEntities (wxUpdateUIEvent& UE);
219 void OnViewShowEntityInfo (wxCommandEvent& CE);
220 void OnViewShowEntityTargets (wxCommandEvent& CE);
221 void OnSelectionGroup (wxCommandEvent& CE);
222 void OnSelectionHideOther (wxCommandEvent& CE);
224 void OnUpdateViewShowEntityInfo (wxUpdateUIEvent& UE);
225 void OnUpdateViewShowEntityTargets (wxUpdateUIEvent& UE);
227 void OnToolsCarve (wxCommandEvent& CE);
228 void OnToolsHollow (wxCommandEvent& CE);
229 void OnSelectionAssignToEntity (wxCommandEvent& CE);
230 void OnToolsApplyMaterial (wxCommandEvent& CE);
231 void OnToolsReplaceMaterials (wxCommandEvent& CE);
232 void OnToolsMaterialLock (wxCommandEvent& CE);
233 void OnToolsTransform (wxCommandEvent& CE);
234 void OnToolsAlign (wxCommandEvent& CE);
235 void OnToolsMirror (wxCommandEvent& CE);
237 void OnUpdateToolsApplyMaterial (wxUpdateUIEvent& UE);
238 void OnUpdateToolsMaterialLock (wxUpdateUIEvent& UE);
240 DECLARE_EVENT_TABLE()
This class manages lightmaps, e.g. by "allocating" rectangular areas in larger bitmaps.
Definition: LightMapMan.hpp:25
static MapDocumentT * ImportHalfLife1Map(GameConfigT *GameConfig, wxProgressDialog *ProgressDialog, const wxString &FileName)
A named constructor for importing a map in HL1 map file format.
Definition: MapDocument.cpp:334
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
void GetAllElems(ArrayT< MapElementT * > &Elems) const
Adds all elements in this map (entity representations and primitives) to the given array...
Definition: MapDocument.cpp:1444
bool Save()
Calls OnSaveDocument().
Definition: MapDocument.cpp:1421
void SetSelection(const ArrayT< MapElementT * > &NewSelection)
Methods for managing the set of currently selected map elements.
Definition: MapDocument.cpp:1568
IntrusivePtrT< MapEditor::CompMapEntityT > GetRootMapEntity() const
Returns the root "map" entity of the map.
Definition: MapDocument.cpp:1438
void Remove(IntrusivePtrT< cf::GameSys::EntityT > Entity)
Removes the given entity from the map.
Definition: MapDocument.cpp:1496
The plant description manager holds and manages all plant descriptions so they can be shared with mul...
Definition: PlantDescrMan.hpp:19
static MapDocumentT * CreateNew(GameConfigT *GameConfig)
A named constructor for creating a new, empty map.
Definition: MapDocument.cpp:315
Definition: DocumentAdapter.hpp:37
bool SaveAs()
Calls OnSaveDocument().
Definition: MapDocument.cpp:1384
void Insert(IntrusivePtrT< cf::GameSys::EntityT > Entity, IntrusivePtrT< cf::GameSys::EntityT > Parent, unsigned long Pos=0xFFFFFFFF)
Inserts the given entity into the map.
Definition: MapDocument.cpp:1463
Definition: MapDocument.hpp:35
This class adds no functionality of its own, but only exists for proper type separation.
Definition: MapPrimitive.hpp:21
This class represents a child frame.
Definition: ChildFrame.hpp:55
float SnapToGrid(float f, bool Toggle) const
Returns the given number f snapped to the grid if the grid is active, rounded to the nearest integer ...
Definition: MapDocument.cpp:2434
This class represents groups.
Definition: Group.hpp:20
const BoundingBox3fT & GetMostRecentSelBB() const
Returns the most recent bounding-box of the selection. That is, it returns the bounding-box of the cu...
Definition: MapDocument.cpp:2454
void GetUsedMaterials(ArrayT< EditorMaterialI * > &UsedMaterials) const
Determines all materials that are currently being used in the world (in brushes, Bezier patches and t...
Definition: MapDocument.cpp:1619
IntrusivePtrT< cf::GameSys::EntityT > GetPasteParent() const
Returns a suitable parent entity into which new objects from the clipboard should be pasted...
Definition: MapDocument.cpp:2475
const ArrayT< GroupT * > & GetGroups() const
Methods for managing the groups.
Definition: MapDocument.hpp:161
Definition: EditorMaterial.hpp:21
static MapDocumentT * ImportHalfLife2Vmf(GameConfigT *GameConfig, wxProgressDialog *ProgressDialog, const wxString &FileName)
A named constructor for importing a map in HL2 vmf file format.
Definition: MapDocument.cpp:384
The class describes the settings for a game/MOD.
Definition: GameConfig.hpp:32
Definition: ObserverPattern.hpp:158
static void Reduce(ArrayT< MapElementT * > &Elems)
Reduces the given set of map elements by removing each element whose parent is in the set as well...
Definition: MapDocument.cpp:2490
~MapDocumentT()
The destructor.
Definition: MapDocument.cpp:1085
This class holds the hierarchy of game entities that populate a game world.
Definition: World.hpp:39
MapDocumentT(GameConfigT *GameConfig, wxProgressDialog *ProgressDialog, const wxString &FileName)
The regular constructor for loading a cmap file from disk.
Definition: MapDocument.cpp:188
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30
bool OnSaveDocument(const wxString &FileName, bool IsAutoSave, IntrusivePtrT< cf::GameSys::EntityT > RootEntity=NULL)
Saves the document. Non-const, as it updates the m_FileName member.
Definition: MapDocument.cpp:1268
bool IsSnapEnabled() const
Returns whether or not grid snap is enabled. Called by the tools and views to determine snap behavior...
Definition: MapDocument.hpp:137
This class represents an orthogonal BSP tree (axis-aligned split planes) that spatially organizes Map...
Definition: OrthoBspTree.hpp:41
ArrayT< GroupT * > GetAbandonedGroups() const
Returns only the groups that are empty (have no members).
Definition: MapDocument.cpp:2526
This class represents the state of a script: the underlying Lua state, pending coroutines, metatables for C++ class hierarchies, etc.
Definition: UniScriptState.hpp:214
This file provides the classes for the Observer pattern as described in the book by the GoF...
static MapDocumentT * ImportDoom3Map(GameConfigT *GameConfig, wxProgressDialog *ProgressDialog, const wxString &FileName)
A named constructor for importing a map in Doom3 map file format.
Definition: MapDocument.cpp:445
bool CompatSubmitCommand(CommandT *Command)
For compatibility only. This method should be removed.
Definition: MapDocument.cpp:1432