Walls And Holes  1
AbstractTool Class Reference

The AbstractTool class represents a UI tool. A UI tool can be activated or deactivated. More...

#include <abstracttool.h>

Inheritance diagram for AbstractTool:
Collaboration diagram for AbstractTool:

Public Member Functions

virtual ~AbstractTool ()
 
virtual void activate ()
 Activates the tool. This is called before the tool is used. More...
 
virtual void deactivate ()
 Deactivates the tool. This is called before the tool stops being used. More...
 
virtual QList< QAction * > contextActions ()
 Returns a vector of qactions which can be used to modify the behaviour of the tool. Will be used by the tool manager to add the actions to a context tool bar. More...
 
virtual void mousePressEvent (QMouseEvent *)
 
virtual void mouseReleaseEvent (QMouseEvent *)
 
virtual void mouseMoveEvent (QMouseEvent *)
 
virtual void wheelEvent (QWheelEvent *)
 

Detailed Description

The AbstractTool class represents a UI tool. A UI tool can be activated or deactivated.

The purpose of the AbstractTool class is to separate a tool's implementation from the implementation of the context in which it is used (e.g. separate the code of the brush tool from the grid rendering widget).

It is assumed that tools are used with a mouse. A tool can expect to receive mouse press, release, and move events from whatever widget it is assigned to.

A constructor of a subclass of AbstractTool should receive whatever data it needs to function. A Brush tool should have some way of accessing the TileMap and some way of determining the visual parameters of the grid.

Constructor & Destructor Documentation

◆ ~AbstractTool()

virtual AbstractTool::~AbstractTool ( )
inlinevirtual

Member Function Documentation

◆ activate()

virtual void AbstractTool::activate ( )
inlinevirtual

Activates the tool. This is called before the tool is used.

Reimplemented in AbstractMeshViewCamera.

Here is the caller graph for this function:

◆ contextActions()

virtual QList<QAction *> AbstractTool::contextActions ( )
inlinevirtual

Returns a vector of qactions which can be used to modify the behaviour of the tool. Will be used by the tool manager to add the actions to a context tool bar.

Reimplemented in TileMapBrushTool.

Here is the caller graph for this function:

◆ deactivate()

virtual void AbstractTool::deactivate ( )
inlinevirtual

Deactivates the tool. This is called before the tool stops being used.

Reimplemented in AbstractMeshViewCamera, FillTool, AbstractShapeBrushTool, and AbstractTileSelectionTool.

◆ mouseMoveEvent()

virtual void AbstractTool::mouseMoveEvent ( QMouseEvent *  )
inlinevirtual

Reimplemented in AbstractMeshViewCamera, MapViewMatcherCamera, and MeshViewCameraLikeBlender.

Here is the caller graph for this function:

◆ mousePressEvent()

virtual void AbstractTool::mousePressEvent ( QMouseEvent *  )
inlinevirtual

Reimplemented in AbstractMeshViewCamera, MapViewMatcherCamera, and MeshViewCameraLikeBlender.

Here is the caller graph for this function:

◆ mouseReleaseEvent()

virtual void AbstractTool::mouseReleaseEvent ( QMouseEvent *  )
inlinevirtual

Reimplemented in AbstractMeshViewCamera, and MapViewMatcherCamera.

Here is the caller graph for this function:

◆ wheelEvent()

virtual void AbstractTool::wheelEvent ( QWheelEvent *  )
inlinevirtual

Reimplemented in AbstractMeshViewCamera, MapViewMatcherCamera, and MeshViewCameraLikeBlender.

Here is the caller graph for this function:

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