Cafu Engine
MakeHollow.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_COMMAND_MAKE_HOLLOW_HPP_INCLUDED
8 #define CAFU_COMMAND_MAKE_HOLLOW_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 
12 
13 class CommandDeleteT;
14 class CommandSelectT;
15 class GroupT;
16 class MapBrushT;
17 class MapDocumentT;
18 class MapElementT;
19 
20 
22 {
23  public:
24 
25  /// Constructor to hollow the brushes that are among the map elements in the given list.
26  CommandMakeHollowT(MapDocumentT& MapDoc, const float WallWidth, const ArrayT<MapElementT*>& Elems);
27 
29 
30  // Implementation of the CommandT interface.
31  bool Do();
32  void Undo();
33  wxString GetName() const;
34 
35 
36  private:
37 
38  MapDocumentT& m_MapDoc;
39  ArrayT<MapBrushT*> m_Brushes; ///< The brushes that are to be hollowed by this command.
40  ArrayT< ArrayT<MapBrushT*> > m_Hollows; ///< For each brush, this keeps the resulting hollow (Hohlraum) created by this command. Each hollow in turn is defined by a set of "wall" brushes.
41  ArrayT<GroupT*> m_NewGroups; ///< One new group for the walls of each hollow, when the original brush was in no group before.
42  CommandDeleteT* m_CmdDelete; ///< Subcommand to delete the m_Brushes.
43  CommandSelectT* m_CmdSelect; ///< Subcommand to select the (walls of the) new hollows.
44 };
45 
46 #endif
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
CommandMakeHollowT(MapDocumentT &MapDoc, const float WallWidth, const ArrayT< MapElementT * > &Elems)
Constructor to hollow the brushes that are among the map elements in the given list.
Definition: MakeHollow.cpp:20
void Undo()
This method un-does the command.
Definition: MakeHollow.cpp:196
bool Do()
This method executes the command.
Definition: MakeHollow.cpp:147
wxString GetName() const
Returns the name (a description) of the command.
Definition: MakeHollow.cpp:232
This class represents groups.
Definition: Group.hpp:20
Definition: Select.hpp:18
Definition: MakeHollow.hpp:21
Definition: MapBrush.hpp:15
Definition: Delete.hpp:22
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30
This is the base class for all elements ("objects") that can exist in a map.
Definition: MapElement.hpp:57