root/cafu/trunk/CaWE/ToolManager.hpp

Revision 457, 2.8 KB (checked in by Carsten, 4 months ago)

Using UltraEdit's multi-line search-and-replace-in-files feature, replaced


^#ifndef _(CAFU|CF|CFS|CA)_(.*)_$
^#define _\1_\2_$

with

#ifndef CAFU_\2_INCLUDED
#define CAFU_\2_INCLUDED

and


^#ifndef _(.*)_HPP_$
^#define _\1_HPP_$

with

#ifndef CAFU_\1_HPP_INCLUDED
#define CAFU_\1_HPP_INCLUDED

Closes #91.

Line 
1/*
2=================================================================================
3This file is part of Cafu, the open-source game engine and graphics engine
4for multiplayer, cross-platform, real-time 3D action.
5Copyright (C) 2002-2012 Carsten Fuchs Software.
6
7Cafu is free software: you can redistribute it and/or modify it under the terms
8of the GNU General Public License as published by the Free Software Foundation,
9either version 3 of the License, or (at your option) any later version.
10
11Cafu is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13PURPOSE. See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Cafu. If not, see <http://www.gnu.org/licenses/>.
17
18For support and more information about Cafu, visit us at <http://www.cafu.de>.
19=================================================================================
20*/
21
22#ifndef CAFU_TOOL_MANAGER_HPP_INCLUDED
23#define CAFU_TOOL_MANAGER_HPP_INCLUDED
24
25#include "ObserverPatternTools.hpp"
26#include "Templates/Array.hpp"
27
28
29class MapDocumentT;
30class ToolT;
31class wxWindow;
32namespace cf { namespace TypeSys { class TypeInfoT; } }
33
34
35class ToolManagerT : public ToolsSubjectT
36{
37    public:
38
39    /// The constructor.
40    ToolManagerT(MapDocumentT& MapDoc, wxWindow* ParentToolOptions);
41
42    /// The destructor.
43    ~ToolManagerT();
44
45
46    /// Returns the array of all tools registered with and known to the tool manager.
47    const ArrayT<ToolT*>& GetTools() const { return m_Tools; }
48
49    /// Returns the tool instance matching the given type.
50    /// NULL is returned when Type is not a type of a valid tool.
51    ToolT* GetTool(const cf::TypeSys::TypeInfoT& Type);
52
53    /// Returns the currently active tool.
54    ToolT* GetActiveTool() const { return m_ActiveTool; }
55
56    /// Returns the type of the currently active tool.
57    /// This method is just a convenience method that saves the caller the explicit check for NULL when calling GetActiveTool().
58    const cf::TypeSys::TypeInfoT* GetActiveToolType() const;
59
60    /// Sets the tool of the given type as the currently active tool.
61    void SetActiveTool(const cf::TypeSys::TypeInfoT* Type);
62
63
64    private:
65
66    ToolManagerT(const ToolManagerT&);          ///< Use of the Copy Constructor    is not allowed.
67    void operator = (const ToolManagerT&);      ///< Use of the Assignment Operator is not allowed.
68
69
70    MapDocumentT&  m_MapDoc;        ///< The MapDocumentT whose tool manager we are.
71    ArrayT<ToolT*> m_Tools;         ///< The list of all tools available for editing the map document.
72    ToolT*         m_ActiveTool;    ///< One of the tools in m_Tools, this is the currently active one. NULL when no tool is currently active.
73};
74
75#endif
Note: See TracBrowser for help on using the browser.