| 1 | /* |
|---|
| 2 | ================================================================================= |
|---|
| 3 | This file is part of Cafu, the open-source game engine and graphics engine |
|---|
| 4 | for multiplayer, cross-platform, real-time 3D action. |
|---|
| 5 | Copyright (C) 2002-2012 Carsten Fuchs Software. |
|---|
| 6 | |
|---|
| 7 | Cafu is free software: you can redistribute it and/or modify it under the terms |
|---|
| 8 | of the GNU General Public License as published by the Free Software Foundation, |
|---|
| 9 | either version 3 of the License, or (at your option) any later version. |
|---|
| 10 | |
|---|
| 11 | Cafu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|---|
| 12 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|---|
| 13 | PURPOSE. See the GNU General Public License for more details. |
|---|
| 14 | |
|---|
| 15 | You should have received a copy of the GNU General Public License |
|---|
| 16 | along with Cafu. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | |
|---|
| 18 | For support and more information about Cafu, visit us at <http://www.cafu.de>. |
|---|
| 19 | ================================================================================= |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | #ifndef CAFU_CHILDFRAME_VIEW_WIN_HPP_INCLUDED |
|---|
| 23 | #define CAFU_CHILDFRAME_VIEW_WIN_HPP_INCLUDED |
|---|
| 24 | |
|---|
| 25 | #include "ObserverPattern.hpp" |
|---|
| 26 | #include "ObserverPatternTools.hpp" |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | class AxesInfoT; |
|---|
| 30 | class ChildFrameT; |
|---|
| 31 | class MapDocumentT; |
|---|
| 32 | class wxWindow; |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | /// This class represents a (superclass of a) 2D or 3D map view window. |
|---|
| 36 | class ViewWindowT : public ObserverT, public ToolsObserverT |
|---|
| 37 | { |
|---|
| 38 | public: |
|---|
| 39 | |
|---|
| 40 | enum ViewTypeT |
|---|
| 41 | { |
|---|
| 42 | VT_2D_XY, // Top |
|---|
| 43 | VT_2D_XZ, // Front |
|---|
| 44 | VT_2D_YZ, // Side |
|---|
| 45 | VT_3D_WIREFRAME, |
|---|
| 46 | VT_3D_FLAT, |
|---|
| 47 | VT_3D_EDIT_MATS, // Materials in Edit mode (shows the meta_EditorImage texture). |
|---|
| 48 | VT_3D_FULL_MATS, // Materials in Preview mode (shows the real material). |
|---|
| 49 | VT_3D_LM_GRID, |
|---|
| 50 | VT_3D_LM_PREVIEW |
|---|
| 51 | }; |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | // Methods inherited from ObserverT. |
|---|
| 55 | // void NotifySubjectChanged(...); // Implemented by derived classes. |
|---|
| 56 | void NotifySubjectDies(SubjectT* dyingSubject); |
|---|
| 57 | |
|---|
| 58 | virtual wxWindow* GetWindow()=0; ///< This function is not const because we can mutate this(!) object via the returned pointer. |
|---|
| 59 | virtual ViewTypeT GetViewType() const=0; ///< Returns the view type of this view window. |
|---|
| 60 | 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. |
|---|
| 61 | wxString GetCaption() const; ///< Returns the caption that the AUI pane for this window should have. |
|---|
| 62 | ChildFrameT* GetChildFrame() const; ///< Returns the child frame that owns this view (that is, our parent). |
|---|
| 63 | MapDocumentT& GetMapDoc() const; ///< The document that is associated with this view window (or more precisely, our child frame). |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | protected: |
|---|
| 67 | |
|---|
| 68 | /// The constructor. It is protected because only child classes should ever be instantiated. |
|---|
| 69 | ViewWindowT(ChildFrameT* ChildFrame); |
|---|
| 70 | |
|---|
| 71 | /// The destructor. Virtual such that also the child destructors will be called. |
|---|
| 72 | virtual ~ViewWindowT(); |
|---|
| 73 | |
|---|
| 74 | void UpdateChildFrameMRU(); |
|---|
| 75 | |
|---|
| 76 | ChildFrameT* m_ChildFrame; ///< The child frame that owns us (that is, is our parent). |
|---|
| 77 | }; |
|---|
| 78 | |
|---|
| 79 | #endif |
|---|