Cafu Engine
UpdateSurface.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_UPDATE_SURFACE_HPP_INCLUDED
8 #define CAFU_COMMAND_UPDATE_SURFACE_HPP_INCLUDED
9 
10 #include "../../CommandPattern.hpp"
11 #include "../SurfaceInfo.hpp"
12 
13 
14 class MapBrushT;
15 class MapBezierPatchT;
16 class MapTerrainT;
17 class MapDocumentT;
18 class EditorMaterialI;
19 
20 
22 {
23  public:
24 
26  const SurfaceInfoT& SurfaceInfoNew_, const SurfaceInfoT& SurfaceInfoOld_,
27  EditorMaterialI* MaterialNew_, EditorMaterialI* MaterialOld_);
28 
29 
30  protected:
31 
32  MapDocumentT& MapDoc;
33  const SurfaceInfoT SurfaceInfoNew; ///< The surface info that is applied to the surface.
34  const SurfaceInfoT SurfaceInfoOld; ///< The surfaces former surface info for undo.
35  EditorMaterialI* MaterialNew; ///< The material that is applied to the surface.
36  EditorMaterialI* MaterialOld; ///< The surface's former material for undo.
37 };
38 
39 
41 {
42  public:
43 
44  CommandUpdateSurfaceFaceT(MapDocumentT& MapDoc_, MapBrushT* Brush_, unsigned long FaceIndex_, const SurfaceInfoT& SurfaceInfoNew_, EditorMaterialI* MaterialNew_);
45 
46  // Implementation of the CommandT interface.
47  bool Do();
48  void Undo();
49  wxString GetName() const;
50 
51 
52  private:
53 
54  MapBrushT* Brush;
55  const unsigned long FaceIndex;
56 };
57 
58 
60 {
61  public:
62 
63  CommandUpdateSurfaceBezierPatchT(MapDocumentT& MapDoc_, MapBezierPatchT* BezierPatch_, const SurfaceInfoT& SurfaceInfoNew_, EditorMaterialI* MaterialNew_);
64 
65  // Implementation of the CommandT interface.
66  bool Do();
67  void Undo();
68  wxString GetName() const;
69 
70 
71  private:
72 
73  MapBezierPatchT* BezierPatch;
74 };
75 
76 
78 {
79  public:
80 
81  CommandUpdateSurfaceTerrainT(MapDocumentT& MapDoc_, MapTerrainT* Terrain_, EditorMaterialI* MaterialNew_);
82 
83  // Implementation of the CommandT interface.
84  bool Do();
85  void Undo();
86  wxString GetName() const;
87 
88 
89  private:
90 
91  MapTerrainT* Terrain;
92 };
93 
94 #endif
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
Definition: UpdateSurface.hpp:21
This class holds all information that is needed in order to compute the UV texture-space coordinates ...
Definition: SurfaceInfo.hpp:51
EditorMaterialI * MaterialNew
The material that is applied to the surface.
Definition: UpdateSurface.hpp:35
wxString GetName() const
Returns the name (a description) of the command.
Definition: UpdateSurface.cpp:131
Definition: UpdateSurface.hpp:59
void Undo()
This method un-does the command.
Definition: UpdateSurface.cpp:156
const SurfaceInfoT SurfaceInfoNew
The surface info that is applied to the surface.
Definition: UpdateSurface.hpp:33
wxString GetName() const
Returns the name (a description) of the command.
Definition: UpdateSurface.cpp:77
Definition: UpdateSurface.hpp:40
Definition: MapBrush.hpp:15
The TerrainT class represents a terrain in a map.
Definition: MapTerrain.hpp:22
bool Do()
This method executes the command.
Definition: UpdateSurface.cpp:34
This class represents a bezier patch.
Definition: MapBezierPatch.hpp:44
bool Do()
This method executes the command.
Definition: UpdateSurface.cpp:90
Definition: EditorMaterial.hpp:21
wxString GetName() const
Returns the name (a description) of the command.
Definition: UpdateSurface.cpp:167
Definition: UpdateSurface.hpp:77
bool Do()
This method executes the command.
Definition: UpdateSurface.cpp:144
This class represents a general command for implementing modifications to the applications document...
Definition: CommandPattern.hpp:30
EditorMaterialI * MaterialOld
The surface's former material for undo.
Definition: UpdateSurface.hpp:36
void Undo()
This method un-does the command.
Definition: UpdateSurface.cpp:56
void Undo()
This method un-does the command.
Definition: UpdateSurface.cpp:111
const SurfaceInfoT SurfaceInfoOld
The surfaces former surface info for undo.
Definition: UpdateSurface.hpp:34