Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::InputControllerDraw Class Referenceabstract

Controller for free drawing on an unwrapped surface. More...

#include <InputController.h>

Inheritance diagram for MantidQt::MantidWidgets::InputControllerDraw:
MantidQt::MantidWidgets::InputController MantidQt::MantidWidgets::InputControllerDrawAndErase MantidQt::MantidWidgets::InputControllerSelection

Public Member Functions

void enterEvent (QEvent *) override
 
 InputControllerDraw (QObject *parent)
 Constructor. More...
 
void leaveEvent (QEvent *) override
 
void mouseMoveEvent (QMouseEvent *) override
 Process the mouse move event. More...
 
void mousePressEvent (QMouseEvent *) override
 Process the mouse press event. More...
 
void mouseReleaseEvent (QMouseEvent *) override
 Process the mouse button release event. More...
 
void wheelEvent (QWheelEvent *) override
 
 ~InputControllerDraw () override
 
- Public Member Functions inherited from MantidQt::MantidWidgets::InputController
bool canShowContextMenu () const
 Returns true if a surface using this controller can show a context menu on right-click. More...
 
virtual void enterEvent (QEvent *)
 
virtual void freezeRotation (bool)
 
 InputController (QObject *parent, bool contextAllowed=true)
 
virtual void keyPressEvent (QKeyEvent *)
 
virtual void leaveEvent (QEvent *)
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void mousePressEvent (QMouseEvent *)
 
virtual void mouseReleaseEvent (QMouseEvent *)
 
virtual void onDisabled ()
 To be called when this controller looses control. More...
 
virtual void onEnabled ()
 To be called when this controller takes control of the input. More...
 
virtual void onPaint (QPainter &)
 To be called after the owner widget has drawn its content. More...
 
virtual void wheelEvent (QWheelEvent *)
 
 ~InputController () override=default
 

Protected Member Functions

int cursorSize () const
 
bool isActive () const
 
bool isLeftButtonPressed () const
 
bool isRightButtonPressed () const
 

Private Member Functions

virtual void drawCursor (QPixmap *cursor)=0
 
void redrawCursor ()
 
virtual void resize ()=0
 
virtual void setPosition (const QPoint &pos)=0
 
virtual void signalLeftClick ()=0
 
virtual void signalRightClick ()
 

Private Attributes

QPixmap * m_cursor
 
bool m_isActive
 
bool m_isLeftButtonPressed
 
bool m_isRightButtonPressed
 
const int m_max_size
 
int m_size
 Size of the cursor. More...
 

Additional Inherited Members

- Signals inherited from MantidQt::MantidWidgets::InputController
void disabled ()
 
void enabled ()
 
void touchPointAt (int, int)
 

Detailed Description

Controller for free drawing on an unwrapped surface.

Definition at line 218 of file InputController.h.

Constructor & Destructor Documentation

◆ InputControllerDraw()

MantidQt::MantidWidgets::InputControllerDraw::InputControllerDraw ( QObject *  parent)

Constructor.

Definition at line 277 of file InputController.cpp.

◆ ~InputControllerDraw()

MantidQt::MantidWidgets::InputControllerDraw::~InputControllerDraw ( )
override

Definition at line 281 of file InputController.cpp.

References m_cursor.

Member Function Documentation

◆ cursorSize()

int MantidQt::MantidWidgets::InputControllerDraw::cursorSize ( ) const
inlineprotected

◆ drawCursor()

virtual void MantidQt::MantidWidgets::InputControllerDraw::drawCursor ( QPixmap *  cursor)
privatepure virtual

◆ enterEvent()

void MantidQt::MantidWidgets::InputControllerDraw::enterEvent ( QEvent *  )
overridevirtual

Reimplemented from MantidQt::MantidWidgets::InputController.

Definition at line 333 of file InputController.cpp.

References m_cursor, m_isActive, and redrawCursor().

◆ isActive()

bool MantidQt::MantidWidgets::InputControllerDraw::isActive ( ) const
inlineprotected

◆ isLeftButtonPressed()

bool MantidQt::MantidWidgets::InputControllerDraw::isLeftButtonPressed ( ) const
inlineprotected

◆ isRightButtonPressed()

bool MantidQt::MantidWidgets::InputControllerDraw::isRightButtonPressed ( ) const
inlineprotected

Definition at line 235 of file InputController.h.

◆ leaveEvent()

void MantidQt::MantidWidgets::InputControllerDraw::leaveEvent ( QEvent *  )
overridevirtual

Reimplemented from MantidQt::MantidWidgets::InputController.

Definition at line 339 of file InputController.cpp.

References m_isActive.

◆ mouseMoveEvent()

void MantidQt::MantidWidgets::InputControllerDraw::mouseMoveEvent ( QMouseEvent *  event)
overridevirtual

Process the mouse move event.

Reimplemented from MantidQt::MantidWidgets::InputController.

Definition at line 301 of file InputController.cpp.

References m_isActive, m_isLeftButtonPressed, m_isRightButtonPressed, setPosition, signalLeftClick(), and signalRightClick().

◆ mousePressEvent()

void MantidQt::MantidWidgets::InputControllerDraw::mousePressEvent ( QMouseEvent *  event)
overridevirtual

Process the mouse press event.

Reimplemented from MantidQt::MantidWidgets::InputController.

Definition at line 286 of file InputController.cpp.

References m_isActive, m_isLeftButtonPressed, m_isRightButtonPressed, setPosition, signalLeftClick(), and signalRightClick().

◆ mouseReleaseEvent()

void MantidQt::MantidWidgets::InputControllerDraw::mouseReleaseEvent ( QMouseEvent *  event)
overridevirtual

Process the mouse button release event.

Reimplemented from MantidQt::MantidWidgets::InputController.

Definition at line 314 of file InputController.cpp.

References m_isLeftButtonPressed, and m_isRightButtonPressed.

◆ redrawCursor()

void MantidQt::MantidWidgets::InputControllerDraw::redrawCursor ( )
private

Definition at line 344 of file InputController.cpp.

References drawCursor(), m_cursor, and m_max_size.

Referenced by enterEvent(), and wheelEvent().

◆ resize()

virtual void MantidQt::MantidWidgets::InputControllerDraw::resize ( )
privatepure virtual

◆ setPosition()

virtual void MantidQt::MantidWidgets::InputControllerDraw::setPosition ( const QPoint &  pos)
privatepure virtual

◆ signalLeftClick()

virtual void MantidQt::MantidWidgets::InputControllerDraw::signalLeftClick ( )
privatepure virtual

◆ signalRightClick()

void MantidQt::MantidWidgets::InputControllerDraw::signalRightClick ( )
privatevirtual

Reimplemented in MantidQt::MantidWidgets::InputControllerDrawAndErase.

Definition at line 351 of file InputController.cpp.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ wheelEvent()

void MantidQt::MantidWidgets::InputControllerDraw::wheelEvent ( QWheelEvent *  event)
overridevirtual

Member Data Documentation

◆ m_cursor

QPixmap* MantidQt::MantidWidgets::InputControllerDraw::m_cursor
private

Definition at line 251 of file InputController.h.

Referenced by enterEvent(), redrawCursor(), wheelEvent(), and ~InputControllerDraw().

◆ m_isActive

bool MantidQt::MantidWidgets::InputControllerDraw::m_isActive
private

Definition at line 250 of file InputController.h.

Referenced by enterEvent(), leaveEvent(), mouseMoveEvent(), and mousePressEvent().

◆ m_isLeftButtonPressed

bool MantidQt::MantidWidgets::InputControllerDraw::m_isLeftButtonPressed
private

Definition at line 248 of file InputController.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

◆ m_isRightButtonPressed

bool MantidQt::MantidWidgets::InputControllerDraw::m_isRightButtonPressed
private

Definition at line 249 of file InputController.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

◆ m_max_size

const int MantidQt::MantidWidgets::InputControllerDraw::m_max_size
private

Definition at line 246 of file InputController.h.

Referenced by redrawCursor(), and wheelEvent().

◆ m_size

int MantidQt::MantidWidgets::InputControllerDraw::m_size
private

Size of the cursor.

Definition at line 247 of file InputController.h.

Referenced by wheelEvent().


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