Cafu Engine
Select.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_MODELEDITOR_COMMAND_SELECT_HPP_INCLUDED
8 #define CAFU_MODELEDITOR_COMMAND_SELECT_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 #include "../ModelDocument.hpp"
12 
13 
14 namespace ModelEditor
15 {
16  class CommandSelectT : public CommandT
17  {
18  public:
19 
20  // Named constructors for easier command creation.
21  static CommandSelectT* Clear (ModelDocumentT* ModelDoc, ModelElementTypeT Type);
22  static CommandSelectT* Add (ModelDocumentT* ModelDoc, ModelElementTypeT Type, const ArrayT<unsigned int>& Elems);
23  static CommandSelectT* Add (ModelDocumentT* ModelDoc, ModelElementTypeT Type, unsigned int Elem);
24  static CommandSelectT* Remove(ModelDocumentT* ModelDoc, ModelElementTypeT Type, const ArrayT<unsigned int>& Elems);
25  static CommandSelectT* Remove(ModelDocumentT* ModelDoc, ModelElementTypeT Type, unsigned int Elem);
26  static CommandSelectT* Set (ModelDocumentT* ModelDoc, ModelElementTypeT Type, const ArrayT<unsigned int>& Elems);
27 
28  // CommandT implementation.
29  bool Do();
30  void Undo();
31  wxString GetName() const;
32 
33 
34  private:
35 
36  /// Only named constructors can create a CommandSelectT.
37  CommandSelectT(ModelDocumentT* ModelDoc, ModelElementTypeT Type, const ArrayT<unsigned int>& OldSel, const ArrayT<unsigned int>& NewSel);
38 
39  ModelDocumentT* m_ModelDoc;
40  const ModelElementTypeT m_Type;
41  const ArrayT<unsigned int> m_OldSel;
42  const ArrayT<unsigned int> m_NewSel;
43  };
44 }
45 
46 #endif
bool Do()
This method executes the command.
Definition: Select.cpp:99
wxString GetName() const
Returns the name (a description) of the command.
Definition: Select.cpp:129
void Undo()
This method un-does the command.
Definition: Select.cpp:117
Definition: Select.hpp:16
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30
Definition: ModelDocument.hpp:30