Cafu Engine
ChildFrameViewWin.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_CHILDFRAME_VIEW_WIN_HPP_INCLUDED
8 #define CAFU_CHILDFRAME_VIEW_WIN_HPP_INCLUDED
9 
10 #include "ObserverPattern.hpp"
11 #include "ObserverPatternTools.hpp"
12 
13 
14 class AxesInfoT;
15 class ChildFrameT;
16 class MapDocumentT;
17 class wxWindow;
18 
19 
20 /// This class represents a (superclass of a) 2D or 3D map view window.
21 class ViewWindowT : public ObserverT, public ToolsObserverT
22 {
23  public:
24 
25  enum ViewTypeT
26  {
27  VT_2D_XY, // Top
28  VT_2D_XZ, // Front
29  VT_2D_YZ, // Side
30  VT_3D_WIREFRAME,
31  VT_3D_FLAT,
32  VT_3D_EDIT_MATS, // Materials in Edit mode (shows the meta_EditorImage texture).
33  VT_3D_FULL_MATS, // Materials in Preview mode (shows the real material).
34  VT_3D_LM_GRID,
35  VT_3D_LM_PREVIEW
36  };
37 
38 
39  // Methods inherited from ObserverT.
40  // void NotifySubjectChanged(...); // Implemented by derived classes.
41  void NotifySubjectDies(SubjectT* dyingSubject);
42 
43  virtual wxWindow* GetWindow()=0; ///< This function is not const because we can mutate this(!) object via the returned pointer.
44  virtual ViewTypeT GetViewType() const=0; ///< Returns the view type of this view window.
45  virtual AxesInfoT GetAxesInfo() const=0; ///< This method returns the axes info for this window. In the case of a 3D window, it computes the 2D axes info that this view is closest to.
46  wxString GetCaption() const; ///< Returns the caption that the AUI pane for this window should have.
47  ChildFrameT* GetChildFrame() const; ///< Returns the child frame that owns this view (that is, our parent).
48  MapDocumentT& GetMapDoc() const; ///< The document that is associated with this view window (or more precisely, our child frame).
49 
50 
51  protected:
52 
53  /// The constructor. It is protected because only child classes should ever be instantiated.
54  ViewWindowT(ChildFrameT* ChildFrame);
55 
56  /// The destructor. Virtual such that also the child destructors will be called.
57  virtual ~ViewWindowT();
58 
59  void UpdateChildFrameMRU();
60 
61  ChildFrameT* m_ChildFrame; ///< The child frame that owns us (that is, is our parent).
62 };
63 
64 #endif
virtual wxWindow * GetWindow()=0
This function is not const because we can mutate this(!) object via the returned pointer.
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
wxString GetCaption() const
Returns the caption that the AUI pane for this window should have.
Definition: ChildFrameViewWin.cpp:49
This class represents a child frame.
Definition: ChildFrame.hpp:55
Definition: ObserverPattern.hpp:64
ChildFrameT * GetChildFrame() const
Returns the child frame that owns this view (that is, our parent).
Definition: ChildFrameViewWin.cpp:68
ViewWindowT(ChildFrameT *ChildFrame)
The constructor. It is protected because only child classes should ever be instantiated.
Definition: ChildFrameViewWin.cpp:13
void NotifySubjectDies(SubjectT *dyingSubject)
This method is called whenever a subject is about the be destroyed (and become unavailable).
Definition: ChildFrameViewWin.cpp:39
This class represents a (superclass of a) 2D or 3D map view window.
Definition: ChildFrameViewWin.hpp:21
virtual ViewTypeT GetViewType() const =0
Returns the view type of this view window.
Definition: ObserverPattern.hpp:158
MapDocumentT & GetMapDoc() const
The document that is associated with this view window (or more precisely, our child frame)...
Definition: ChildFrameViewWin.cpp:74
This class describes how the three world-space axes are mapped to the two screen- or window-space axe...
Definition: AxesInfo.hpp:15
virtual ~ViewWindowT()
The destructor. Virtual such that also the child destructors will be called.
Definition: ChildFrameViewWin.cpp:22
This file provides the classes for the Observer pattern as described in the book by the GoF...
Definition: ObserverPatternTools.hpp:28
This file provides the classes for the Observer pattern as described in the book by the GoF...
virtual AxesInfoT GetAxesInfo() const =0
This method returns the axes info for this window. In the case of a 3D window, it computes the 2D axe...
ChildFrameT * m_ChildFrame
The child frame that owns us (that is, is our parent).
Definition: ChildFrameViewWin.hpp:61