Cafu Engine
SetMaterial.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_SET_MATERIAL_HPP_INCLUDED
8 #define CAFU_MODELEDITOR_SET_MATERIAL_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 
12 
13 class MaterialT;
14 namespace MatSys { class RenderMaterialT; }
15 
16 
17 namespace ModelEditor
18 {
19  class ModelDocumentT;
20 
21  /// This command sets a new material for a given mesh in a given skin.
23  {
24  public:
25 
26  CommandSetMaterialT(ModelDocumentT* ModelDoc, unsigned int MeshNr, int SkinNr, const wxString& NewName);
27 
28  // CommandT implementation.
29  bool Do();
30  void Undo();
31  wxString GetName() const;
32 
33 
34  private:
35 
36  MaterialT*& GetMaterial();
37  MatSys::RenderMaterialT*& GetRenderMaterial();
38 
39  ModelDocumentT* m_ModelDoc;
40  const unsigned int m_MeshNr;
41  const int m_SkinNr;
42  MaterialT* m_NewMat;
43  MaterialT* m_OldMat;
44  };
45 }
46 
47 #endif
bool Do()
This method executes the command.
Definition: SetMaterial.cpp:26
This class represents a surface render material.
Definition: RenderMaterial.hpp:25
wxString GetName() const
Returns the name (a description) of the command.
Definition: SetMaterial.cpp:95
This class represents a surface material ("A datastructural representation of a scripts material def...
Definition: Material.hpp:22
This command sets a new material for a given mesh in a given skin.
Definition: SetMaterial.hpp:22
void Undo()
This method un-does the command.
Definition: SetMaterial.cpp:55
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30
Definition: ModelDocument.hpp:30