Cafu Engine
Add.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_ADD_HPP_INCLUDED
8 #define CAFU_MODELEDITOR_COMMAND_ADD_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 #include "../ElementTypes.hpp"
12 #include "Models/Loader_cmdl.hpp"
13 
14 
15 namespace ModelEditor
16 {
17  class CommandSelectT;
18  class ModelDocumentT;
19 
20 
21  class CommandAddT : public CommandT
22  {
23  public:
24 
25  CommandAddT(ModelDocumentT* ModelDoc, const CafuModelT::SkinT& Skin);
26  CommandAddT(ModelDocumentT* ModelDoc, const ArrayT<CafuModelT::GuiFixtureT>& GuiFixtures);
27  CommandAddT(ModelDocumentT* ModelDoc, const ArrayT<CafuModelT::AnimT>& Anims);
28  CommandAddT(ModelDocumentT* ModelDoc, const CafuModelT::ChannelT& Channel);
29 
30  // CommandT implementation.
31  bool Do();
32  void Undo();
33  wxString GetName() const;
34 
35 
36  private:
37 
38  ModelDocumentT* m_ModelDoc;
39  const ModelElementTypeT m_Type;
40  // ArrayT<CafuModelT::JointT> m_Joints; ///< The added joints (if m_Type==JOINT).
41  // ArrayT<CafuModelT::MeshT> m_Meshes; ///< The added meshes (if m_Type==MESH).
42  // ArrayT<MatSys::MeshT> m_DrawMs; ///< The draw meshes related to m_Meshes.
43  ArrayT<CafuModelT::SkinT> m_Skins; ///< The added skins (if m_Type==SKIN).
44  ArrayT<CafuModelT::GuiFixtureT> m_GuiFixtures; ///< The added GUI fixtures (if m_Type==GFIX).
45  ArrayT<CafuModelT::AnimT> m_Anims; ///< The added anims (if m_Type==ANIM).
46  ArrayT<CafuModelT::ChannelT> m_Channels; ///< The added channels (if m_Type==CHAN).
47  };
48 }
49 
50 #endif
Definition: Add.hpp:21
void Undo()
This method un-does the command.
Definition: Add.cpp:112
bool Do()
This method executes the command.
Definition: Add.cpp:51
Definition: Select.hpp:18
Channels allow animations to play only on a subset of the joints, so that multiple animations can pla...
Definition: Model_cmdl.hpp:223
wxString GetName() const
Returns the name (a description) of the command.
Definition: Add.cpp:172
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30
This struct describes additional/alternative skins for the meshes of this model.
Definition: Model_cmdl.hpp:142
Definition: ModelDocument.hpp:30