Cafu Engine
Group_SetVisibility.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_GROUP_SET_VISIBILITY_HPP_INCLUDED
8 #define CAFU_COMMAND_GROUP_SET_VISIBILITY_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 
12 
13 class CommandSelectT;
14 class GroupT;
15 class MapDocumentT;
16 
17 
18 /// This class implements a command for setting the visibility status of a group.
19 /// The current selection is automatically reduced to visible elements only, that is,
20 /// selected map elements that are hidden become automatically unselected.
22 {
23  public:
24 
25  /// The constructor.
26  /// @param MapDoc The map document the group is in.
27  /// @param Group The group whose visibility is set.
28  /// @param NewVis The new visibility status for the group. If Group->IsVisible is already NewVis, Do() will fail.
29  CommandGroupSetVisibilityT(MapDocumentT& MapDoc, GroupT* Group, bool NewVis);
30 
31  /// The destructor.
33 
34  /// Returns the group whose visibility is set.
35  const GroupT* GetGroup() const { return m_Group; }
36 
37  // Implementation of the CommandT interface.
38  bool Do();
39  void Undo();
40  wxString GetName() const;
41 
42 
43  private:
44 
45  MapDocumentT& m_MapDoc;
46  GroupT* m_Group;
47  const bool m_NewVis;
48  CommandSelectT* m_CommandReduceSel;
49 };
50 
51 #endif
const GroupT * GetGroup() const
Returns the group whose visibility is set.
Definition: Group_SetVisibility.hpp:35
wxString GetName() const
Returns the name (a description) of the command.
Definition: Group_SetVisibility.cpp:114
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
~CommandGroupSetVisibilityT()
The destructor.
Definition: Group_SetVisibility.cpp:53
This class represents groups.
Definition: Group.hpp:20
Definition: Select.hpp:18
bool Do()
This method executes the command.
Definition: Group_SetVisibility.cpp:59
void Undo()
This method un-does the command.
Definition: Group_SetVisibility.cpp:88
CommandGroupSetVisibilityT(MapDocumentT &MapDoc, GroupT *Group, bool NewVis)
The constructor.
Definition: Group_SetVisibility.cpp:14
This class implements a command for setting the visibility status of a group.
Definition: Group_SetVisibility.hpp:21
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30