Cafu Engine
ToolT Class Referenceabstract

This is the base class for all tools in the map editor. More...

#include "Tool.hpp"

Inheritance diagram for ToolT:

Classes

class  ToolCreateParamsT
 Parameters for creating a tool via the TypeSys. More...
 

Public Member Functions

 ToolT (MapDocumentT &MapDoc, ToolManagerT &ToolMan)
 The constructor. More...
 
virtual ~ToolT ()
 The destructor. More...
 
virtual int GetWxEventID () const =0
 Returns the ID of the wxWidgets event (menu selection or toolbar button click) that is associated with activating this tool. More...
 
virtual wxWindow * GetOptionsBar ()
 Returns the options bar window associated with this tool. NULL if no options bar has been assigned. More...
 
void Activate (ToolT *OldTool)
 
void Deactivate (ToolT *NewTool)
 
bool IsActiveTool () const
 
virtual bool CanDeactivate ()
 
virtual bool IsHiddenByTool (const MapElementT *Elem) const
 The caller calls this method in order to learn whether it should exempt the given map element Elem from normal 2D and 3D rendering. This is usually true when Elem is currently being modified by the tool and thus rendered (in a special way) by the tool itself. Examples include brushes being morphed and terrains being edited. More...
 
virtual void RenderTool2D (Renderer2DT &Renderer) const
 
virtual void RenderTool3D (Renderer3DT &Renderer) const
 
virtual bool UpdateStatusBar (ChildFrameT *ChildFrame) const
 
virtual bool OnKeyDown2D (ViewWindow2DT &ViewWindow, wxKeyEvent &KE)
 
virtual bool OnKeyUp2D (ViewWindow2DT &ViewWindow, wxKeyEvent &KE)
 
virtual bool OnChar2D (ViewWindow2DT &ViewWindow, wxKeyEvent &KE)
 
virtual bool OnLMouseDown2D (ViewWindow2DT &ViewWindow, wxMouseEvent &ME)
 Also used for LMB "double-click" events (use ME.ButtonDClick() for distinction). More...
 
virtual bool OnLMouseUp2D (ViewWindow2DT &ViewWindow, wxMouseEvent &ME)
 
virtual bool OnMMouseDown2D (ViewWindow2DT &ViewWindow, wxMouseEvent &ME)
 Also used for MMB "double-click" events (use ME.ButtonDClick() for distinction). More...
 
virtual bool OnMMouseUp2D (ViewWindow2DT &ViewWindow, wxMouseEvent &ME)
 
virtual bool OnRMouseClick2D (ViewWindow2DT &ViewWindow, wxMouseEvent &ME)
 For the RMB, only a "click" event is available, because the RMB is also used for mouse-looking and the context menu. More...
 
virtual bool OnMouseWheel2D (ViewWindow2DT &ViewWindow, wxMouseEvent &ME)
 
virtual bool OnMouseMove2D (ViewWindow2DT &ViewWindow, wxMouseEvent &ME)
 
virtual int OnContextMenu2D (ViewWindow2DT &ViewWindow, wxContextMenuEvent &CE, wxMenu &Menu)
 
virtual bool OnKeyDown3D (ViewWindow3DT &ViewWindow, wxKeyEvent &KE)
 
virtual bool OnKeyUp3D (ViewWindow3DT &ViewWindow, wxKeyEvent &KE)
 
virtual bool OnChar3D (ViewWindow3DT &ViewWindow, wxKeyEvent &KE)
 
virtual bool OnLMouseDown3D (ViewWindow3DT &ViewWindow, wxMouseEvent &ME)
 Also used for LMB "double-click" events (use ME.ButtonDClick() for distinction). More...
 
virtual bool OnLMouseUp3D (ViewWindow3DT &ViewWindow, wxMouseEvent &ME)
 
virtual bool OnMMouseDown3D (ViewWindow3DT &ViewWindow, wxMouseEvent &ME)
 Also used for MMB "double-click" events (use ME.ButtonDClick() for distinction). More...
 
virtual bool OnMMouseUp3D (ViewWindow3DT &ViewWindow, wxMouseEvent &ME)
 
virtual bool OnRMouseClick3D (ViewWindow3DT &ViewWindow, wxMouseEvent &ME)
 For the RMB, only a "click" event is available, because the RMB is also used for mouse-looking and the context menu. More...
 
virtual bool OnMouseWheel3D (ViewWindow3DT &ViewWindow, wxMouseEvent &ME)
 
virtual bool OnMouseMove3D (ViewWindow3DT &ViewWindow, wxMouseEvent &ME)
 
virtual int OnContextMenu3D (ViewWindow3DT &ViewWindow, wxContextMenuEvent &CE, wxMenu &Menu)
 
virtual bool OnIdle3D (ViewWindow3DT &ViewWindow, const wxPoint &Point)
 
virtual const
cf::TypeSys::TypeInfoT
GetType () const
 

Static Public Member Functions

static void * CreateInstance (const cf::TypeSys::CreateParamsT &Params)
 

Static Public Attributes

static const cf::TypeSys::TypeInfoT TypeInfo
 

Protected Attributes

MapDocumentTm_MapDoc
 The document that is modified by this tool. More...
 
ToolManagerTm_ToolMan
 The tool manager that manages this tool. More...
 

Detailed Description

This is the base class for all tools in the map editor.

The 2D and 3D views keep a ToolT reference to the currently active tool, forwarding their key events, mouse events and render requests to it.

Constructor & Destructor Documentation

ToolT::ToolT ( MapDocumentT MapDoc,
ToolManagerT ToolMan 
)

The constructor.

virtual ToolT::~ToolT ( )
inlinevirtual

The destructor.

Member Function Documentation

virtual wxWindow* ToolT::GetOptionsBar ( )
inlinevirtual

Returns the options bar window associated with this tool. NULL if no options bar has been assigned.

Reimplemented in ToolTerrainEditorT, ToolMorphT, ToolSelectionT, ToolCameraT, ToolClipT, ToolNewBezierPatchT, ToolNewBrushT, ToolNewTerrainT, ToolNewEntityT, and ToolEditSurfaceT.

virtual int ToolT::GetWxEventID ( ) const
pure virtual

Returns the ID of the wxWidgets event (menu selection or toolbar button click) that is associated with activating this tool.

Implemented in ToolTerrainEditorT, ToolMorphT, ToolSelectionT, ToolCameraT, ToolClipT, ToolNewBezierPatchT, ToolNewBrushT, ToolNewTerrainT, ToolNewEntityT, and ToolEditSurfaceT.

virtual bool ToolT::IsHiddenByTool ( const MapElementT Elem) const
inlinevirtual

The caller calls this method in order to learn whether it should exempt the given map element Elem from normal 2D and 3D rendering. This is usually true when Elem is currently being modified by the tool and thus rendered (in a special way) by the tool itself. Examples include brushes being morphed and terrains being edited.

Reimplemented in ToolTerrainEditorT, and ToolMorphT.

virtual bool ToolT::OnLMouseDown2D ( ViewWindow2DT ViewWindow,
wxMouseEvent &  ME 
)
inlinevirtual

Also used for LMB "double-click" events (use ME.ButtonDClick() for distinction).

Reimplemented in ToolTerrainEditorT, ToolMorphT, ToolSelectionT, ToolClipT, ToolCameraT, ToolNewBezierPatchT, ToolNewBrushT, ToolNewTerrainT, ToolNewEntityT, and ToolEditSurfaceT.

virtual bool ToolT::OnLMouseDown3D ( ViewWindow3DT ViewWindow,
wxMouseEvent &  ME 
)
inlinevirtual

Also used for LMB "double-click" events (use ME.ButtonDClick() for distinction).

Reimplemented in ToolTerrainEditorT, ToolMorphT, ToolSelectionT, ToolNewBezierPatchT, ToolNewTerrainT, ToolEditSurfaceT, and ToolNewEntityT.

virtual bool ToolT::OnMMouseDown2D ( ViewWindow2DT ViewWindow,
wxMouseEvent &  ME 
)
inlinevirtual

Also used for MMB "double-click" events (use ME.ButtonDClick() for distinction).

virtual bool ToolT::OnMMouseDown3D ( ViewWindow3DT ViewWindow,
wxMouseEvent &  ME 
)
inlinevirtual

Also used for MMB "double-click" events (use ME.ButtonDClick() for distinction).

virtual bool ToolT::OnRMouseClick2D ( ViewWindow2DT ViewWindow,
wxMouseEvent &  ME 
)
inlinevirtual

For the RMB, only a "click" event is available, because the RMB is also used for mouse-looking and the context menu.

virtual bool ToolT::OnRMouseClick3D ( ViewWindow3DT ViewWindow,
wxMouseEvent &  ME 
)
inlinevirtual

For the RMB, only a "click" event is available, because the RMB is also used for mouse-looking and the context menu.

Reimplemented in ToolNewBrushT, and ToolEditSurfaceT.

Member Data Documentation

MapDocumentT& ToolT::m_MapDoc
protected

The document that is modified by this tool.

ToolManagerT& ToolT::m_ToolMan
protected

The tool manager that manages this tool.


The documentation for this class was generated from the following files: