OpenStructure
Public Member Functions | Protected Member Functions
Tool Class Referenceabstract

#include <tool.hh>

Inherits QObject.

Inherited by Manipulator, MapTool, MeasureTool, and SelectionTool.

Public Member Functions

virtual ~Tool ()
 
virtual void Click (const MouseEvent &event)
 
virtual void DoubleClick (const MouseEvent &event)
 
virtual void MousePress (const MouseEvent &event)
 
virtual void MouseMove (const MouseEvent &event)
 
virtual void RenderGL ()
 
virtual void Activate ()
 
virtual void Deactivate ()
 
virtual bool CanOperateOn (gfx::NodePtrList nodes)=0
 
ToolOptionsGetToolOptions () const
 
const StringGetName () const
 
virtual QIcon GetIcon () const
 

Protected Member Functions

 Tool (const String &name)
 

Detailed Description

base class for tools

Parameters of the tool that are configurable should be implemented using the ToolOptions facility. This automatically takes care of remembering the used options over different sessions (in the future) and creates a widget to modify these options.

Input Events

Tools receive input events when the Control key (Command on macOS) is pressed. This includes both keyboard events and mouse events such as mouse move events, clicks and Real clicks.

Tools only receive mouse move events when one of the mouse buttons is pressed.

CanOperateOn() determines if the tool can manipulate a certain gfx::GfxNodeP. This method is used to enabled/disable certain actions (in the toolbar, for example).

See also
Color Tool Example

Definition at line 62 of file tool.hh.

Constructor & Destructor Documentation

◆ Tool()

Tool ( const String name)
protected

◆ ~Tool()

virtual ~Tool ( )
virtual

Member Function Documentation

◆ Activate()

virtual void Activate ( )
inlinevirtual

called when the tool becomes active

Definition at line 82 of file tool.hh.

◆ CanOperateOn()

virtual bool CanOperateOn ( gfx::NodePtrList  nodes)
pure virtual

whether the tool is capable of manipulating the given node

Implemented in SelectionTool, MeasureTool, MapTool, and Manipulator.

◆ Click()

virtual void Click ( const MouseEvent event)
inlinevirtual

left mouse click

Reimplemented in SelectionTool, and MeasureTool.

Definition at line 69 of file tool.hh.

◆ Deactivate()

virtual void Deactivate ( )
inlinevirtual

called when the tool becomes inactive

Definition at line 85 of file tool.hh.

◆ DoubleClick()

virtual void DoubleClick ( const MouseEvent event)
inlinevirtual

Real click.

Reimplemented in Manipulator.

Definition at line 72 of file tool.hh.

◆ GetIcon()

virtual QIcon GetIcon ( ) const
virtual

Reimplemented in SelectionTool, MeasureTool, MapTool, and Manipulator.

◆ GetName()

const String& GetName ( ) const

◆ GetToolOptions()

ToolOptions* GetToolOptions ( ) const

◆ MouseMove()

virtual void MouseMove ( const MouseEvent event)
inlinevirtual

Reimplemented in MapTool, and Manipulator.

Definition at line 76 of file tool.hh.

◆ MousePress()

virtual void MousePress ( const MouseEvent event)
inlinevirtual

Definition at line 74 of file tool.hh.

◆ RenderGL()

virtual void RenderGL ( )
inlinevirtual

Reimplemented in MeasureTool.

Definition at line 78 of file tool.hh.


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