Cafu Engine
ToolNewEntity.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_TOOL_NEW_ENTITY_HPP_INCLUDED
8 #define CAFU_TOOL_NEW_ENTITY_HPP_INCLUDED
9 
10 #include "Tool.hpp"
11 #include "wx/wx.h"
12 
13 
15 
16 
17 /// This class implements the "New Entity" tool.
18 class ToolNewEntityT : public ToolT
19 {
20  public:
21 
22  /// The constructor.
23  ToolNewEntityT(MapDocumentT& MapDoc, ToolManagerT& ToolMan, wxWindow* ParentOptionsBar, bool CreateOptionsBar=true);
24 
25 
26  // Implementations/overrides of ToolT methods.
27  int GetWxEventID() const { return ChildFrameT::ID_MENU_TOOLS_TOOL_NEWENTITY; }
28  wxWindow* GetOptionsBar();
29 
30  bool OnKeyDown2D (ViewWindow2DT& ViewWindow, wxKeyEvent& KE);
31  bool OnLMouseDown2D(ViewWindow2DT& ViewWindow, wxMouseEvent& ME);
32  bool OnMouseMove2D (ViewWindow2DT& ViewWindow, wxMouseEvent& ME);
33 
34  bool OnKeyDown3D (ViewWindow3DT& ViewWindow, wxKeyEvent& KE);
35  bool OnLMouseDown3D(ViewWindow3DT& ViewWindow, wxMouseEvent& ME);
36  bool OnMouseMove3D (ViewWindow3DT& ViewWindow, wxMouseEvent& ME);
37 
38  void RenderTool2D(Renderer2DT& Renderer) const;
39  void RenderTool3D(Renderer3DT& Renderer) const;
40 
41  // The TypeSys related declarations for this class.
42  virtual const cf::TypeSys::TypeInfoT* GetType() const { return &TypeInfo; }
43  static void* CreateInstance(const cf::TypeSys::CreateParamsT& Params);
44  static const cf::TypeSys::TypeInfoT TypeInfo;
45 
46 
47  protected:
48 
49  OptionsBar_NewEntityToolT* m_OptionsBar; ///< The options bar for this tool.
50 };
51 
52 #endif
This class provides auxiliary means for rendering a 3D view.
Definition: Renderer3D.hpp:30
This class implements the rendering into a 2D view.
Definition: Renderer2D.hpp:22
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
ToolNewEntityT(MapDocumentT &MapDoc, ToolManagerT &ToolMan, wxWindow *ParentOptionsBar, bool CreateOptionsBar=true)
The constructor.
Definition: ToolNewEntity.cpp:47
int GetWxEventID() const
Returns the ID of the wxWidgets event (menu selection or toolbar button click) that is associated wit...
Definition: ToolNewEntity.hpp:27
OptionsBar_NewEntityToolT * m_OptionsBar
The options bar for this tool.
Definition: ToolNewEntity.hpp:49
The options bar for the New Entity tool.
Definition: ToolOptionsBars.hpp:99
bool OnLMouseDown3D(ViewWindow3DT &ViewWindow, wxMouseEvent &ME)
Also used for LMB "double-click" events (use ME.ButtonDClick() for distinction).
Definition: ToolNewEntity.cpp:116
This class implements the "New Entity" tool.
Definition: ToolNewEntity.hpp:18
Definition: ChildFrameViewWin2D.hpp:24
Definition: ChildFrameViewWin3D.hpp:21
bool OnLMouseDown2D(ViewWindow2DT &ViewWindow, wxMouseEvent &ME)
Also used for LMB "double-click" events (use ME.ButtonDClick() for distinction).
Definition: ToolNewEntity.cpp:75
wxWindow * GetOptionsBar()
Returns the options bar window associated with this tool. NULL if no options bar has been assigned...
Definition: ToolNewEntity.cpp:54
Definition: ToolManager.hpp:20
This is the base class for all tools in the map editor.
Definition: Tool.hpp:34
Definition: TypeSys.hpp:52
This class keeps type information (about an entity class that occurs in the game).
Definition: TypeSys.hpp:79