OpenASIP  2.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MachineCanvasTool Class Referenceabstract

#include <MachineCanvasTool.hh>

Inheritance diagram for MachineCanvasTool:
Inheritance graph
Collaboration diagram for MachineCanvasTool:
Collaboration graph

Public Member Functions

virtual ~MachineCanvasTool ()
 
virtual void activate ()=0
 
virtual void deactivate ()=0
 
virtual void onMouseEvent (wxMouseEvent &event, wxDC &dc)=0
 
virtual Figurefigure ()
 

Protected Member Functions

 MachineCanvasTool (MachineCanvas *canvas)
 

Protected Attributes

MachineCanvascanvas_
 Machine canvas where the tool is used. More...
 

Detailed Description

Base class for the mouse tools used on the MachineCanvas.

MachineCanvas and MachineCanvasTool follow the 'state' -design pattern. MachineCanvas has always an active tool, which handles the mouse events on the canvas, such as mouse button clicks. The actual tools handling the mouse events are subclasses of this interface class.

Definition at line 49 of file MachineCanvasTool.hh.

Constructor & Destructor Documentation

◆ ~MachineCanvasTool()

MachineCanvasTool::~MachineCanvasTool ( )
virtual

The Destructor.

Definition at line 49 of file MachineCanvasTool.cc.

49  {
50 }

◆ MachineCanvasTool()

MachineCanvasTool::MachineCanvasTool ( MachineCanvas canvas)
protected

The Constructor.

Parameters
canvasMachineCanvas where the tool is used.

Definition at line 41 of file MachineCanvasTool.cc.

41  :
42  canvas_(canvas) {
43 }

Member Function Documentation

◆ activate()

virtual void MachineCanvasTool::activate ( )
pure virtual

◆ deactivate()

virtual void MachineCanvasTool::deactivate ( )
pure virtual

Deactivate the tool.

Implemented in ConnectTool, SelectTool, and ProximMachineCanvasTool.

Referenced by BridgeDialog::BridgeDialog(), and MachineCanvas::setTool().

◆ figure()

Figure * MachineCanvasTool::figure ( )
virtual

Returns figure of the tool, or NULL if the tool has no figure.

Returns
Base class implementation returns always NULL (no figure).

Reimplemented in ConnectTool, and SelectTool.

Definition at line 59 of file MachineCanvasTool.cc.

59  {
60  return NULL;
61 }

Referenced by MachineCanvas::OnDraw(), and MachineCanvas::refreshToolFigure().

◆ onMouseEvent()

virtual void MachineCanvasTool::onMouseEvent ( wxMouseEvent &  event,
wxDC &  dc 
)
pure virtual

Handle the mouse events of the canvas in a tool-specific way.

Parameters
eventMouse event to handle.
dcDevice context.

Implemented in ConnectTool, SelectTool, and ProximMachineCanvasTool.

Referenced by MachineCanvas::onMouseEvent().

Member Data Documentation

◆ canvas_

MachineCanvas* MachineCanvasTool::canvas_
protected

The documentation for this class was generated from the following files:
MachineCanvasTool::canvas_
MachineCanvas * canvas_
Machine canvas where the tool is used.
Definition: MachineCanvasTool.hh:77