Mantid
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::InputControllerDrawShape Class Reference

Controller for drawing mask shapes. More...

#include <InputController.h>

Inheritance diagram for MantidQt::MantidWidgets::InputControllerDrawShape:
MantidQt::MantidWidgets::InputController

Public Slots

void onDisabled () override
 Action on disabling. More...
 
void startCreatingShape2D (const QString &type, const QColor &borderColor, const QColor &fillColor)
 Slot for defining the shape to draw and initializing drawing. More...
 

Signals

void addShape (const QString &type, int x, int y, const QColor &borderColor, const QColor &fillColor)
 Add a new shape. More...
 
void copySelectedShapes ()
 Copy the selected shapes. More...
 
void deselectAll ()
 Deselect all selected shapes. More...
 
void finishSelection (const QRect &)
 Rubber band selection is done. More...
 
void moveBy (int, int)
 Move selected shape or a control point by a displacement vector. More...
 
void moveRightBottomTo (int, int)
 Resize the current shape by moving the right-bottom control point to a location on the screen. More...
 
void pasteCopiedShapes ()
 Paste previously copied shapes. More...
 
void removeSelectedShapes ()
 Remove the selected shapes. More...
 
void restoreOverrideCursor ()
 Restore the cursor to its default image. More...
 
void selectAt (int, int)
 Select a shape or a conrol point at a location on the screen. More...
 
void selectCtrlAt (int, int)
 Select a shape with ctrl key pressed at a location on the screen. More...
 
void setSelection (const QRect &)
 Update the rubber band selection. More...
 
void touchPointAt (int, int)
 Sent when the mouse is moved to a new position with the buttons up. More...
 
- Signals inherited from MantidQt::MantidWidgets::InputController
void disabled ()
 
void enabled ()
 
void touchPointAt (int, int)
 

Public Member Functions

 InputControllerDrawShape (QObject *parent)
 Constructor. More...
 
void keyPressEvent (QKeyEvent *) override
 Process the keyboard key press event. More...
 
void leaveEvent (QEvent *) override
 Process event of the mouse leaving the widget. More...
 
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...
 
- 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
 

Private Attributes

QColor m_borderColor
 
bool m_creating
 a shape is being created with a mouse More...
 
QColor m_fillColor
 
bool m_isButtonPressed
 
QRect m_rect
 
QString m_shapeType
 
int m_x
 
int m_y
 

Detailed Description

Controller for drawing mask shapes.

Definition at line 139 of file InputController.h.

Constructor & Destructor Documentation

◆ InputControllerDrawShape()

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

Constructor.

Definition at line 129 of file InputController.cpp.

Member Function Documentation

◆ addShape

void MantidQt::MantidWidgets::InputControllerDrawShape::addShape ( const QString &  type,
int  x,
int  y,
const QColor &  borderColor,
const QColor &  fillColor 
)
signal

Add a new shape.

Referenced by mousePressEvent().

◆ copySelectedShapes

void MantidQt::MantidWidgets::InputControllerDrawShape::copySelectedShapes ( )
signal

Copy the selected shapes.

Referenced by keyPressEvent().

◆ deselectAll

void MantidQt::MantidWidgets::InputControllerDrawShape::deselectAll ( )
signal

Deselect all selected shapes.

◆ finishSelection

void MantidQt::MantidWidgets::InputControllerDrawShape::finishSelection ( const QRect &  )
signal

Rubber band selection is done.

Referenced by mouseReleaseEvent().

◆ keyPressEvent()

void MantidQt::MantidWidgets::InputControllerDrawShape::keyPressEvent ( QKeyEvent *  event)
overridevirtual

Process the keyboard key press event.

Reimplemented from MantidQt::MantidWidgets::InputController.

Definition at line 184 of file InputController.cpp.

References copySelectedShapes(), pasteCopiedShapes(), and removeSelectedShapes().

◆ leaveEvent()

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

Process event of the mouse leaving the widget.

Reimplemented from MantidQt::MantidWidgets::InputController.

Definition at line 206 of file InputController.cpp.

References restoreOverrideCursor().

◆ mouseMoveEvent()

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

Process the mouse move event.

If the left mouse button is down sends editing signals.

Reimplemented from MantidQt::MantidWidgets::InputController.

Definition at line 155 of file InputController.cpp.

References m_creating, m_isButtonPressed, m_rect, m_x, m_y, moveBy(), moveRightBottomTo(), setSelection(), and touchPointAt().

◆ mousePressEvent()

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

Process the mouse press event.

Sends addShape or selectAt signal.

Reimplemented from MantidQt::MantidWidgets::InputController.

Definition at line 135 of file InputController.cpp.

References addShape(), m_borderColor, m_creating, m_fillColor, m_isButtonPressed, m_rect, m_shapeType, m_x, m_y, selectAt(), and selectCtrlAt().

◆ mouseReleaseEvent()

void MantidQt::MantidWidgets::InputControllerDrawShape::mouseReleaseEvent ( QMouseEvent *  )
overridevirtual

Process the mouse button release event.

Reimplemented from MantidQt::MantidWidgets::InputController.

Definition at line 174 of file InputController.cpp.

References finishSelection(), m_creating, m_isButtonPressed, m_rect, and m_shapeType.

◆ moveBy

void MantidQt::MantidWidgets::InputControllerDrawShape::moveBy ( int  ,
int   
)
signal

Move selected shape or a control point by a displacement vector.

Referenced by mouseMoveEvent().

◆ moveRightBottomTo

void MantidQt::MantidWidgets::InputControllerDrawShape::moveRightBottomTo ( int  ,
int   
)
signal

Resize the current shape by moving the right-bottom control point to a location on the screen.

Referenced by mouseMoveEvent().

◆ onDisabled

void MantidQt::MantidWidgets::InputControllerDrawShape::onDisabled ( )
overrideslot

Action on disabling.

Definition at line 222 of file InputController.cpp.

References MantidQt::MantidWidgets::InputController::disabled(), and m_creating.

◆ pasteCopiedShapes

void MantidQt::MantidWidgets::InputControllerDrawShape::pasteCopiedShapes ( )
signal

Paste previously copied shapes.

Referenced by keyPressEvent().

◆ removeSelectedShapes

void MantidQt::MantidWidgets::InputControllerDrawShape::removeSelectedShapes ( )
signal

Remove the selected shapes.

Referenced by keyPressEvent().

◆ restoreOverrideCursor

void MantidQt::MantidWidgets::InputControllerDrawShape::restoreOverrideCursor ( )
signal

Restore the cursor to its default image.

Referenced by leaveEvent().

◆ selectAt

void MantidQt::MantidWidgets::InputControllerDrawShape::selectAt ( int  ,
int   
)
signal

Select a shape or a conrol point at a location on the screen.

Referenced by mousePressEvent().

◆ selectCtrlAt

void MantidQt::MantidWidgets::InputControllerDrawShape::selectCtrlAt ( int  ,
int   
)
signal

Select a shape with ctrl key pressed at a location on the screen.

Referenced by mousePressEvent().

◆ setSelection

void MantidQt::MantidWidgets::InputControllerDrawShape::setSelection ( const QRect &  )
signal

Update the rubber band selection.

Referenced by mouseMoveEvent().

◆ startCreatingShape2D

void MantidQt::MantidWidgets::InputControllerDrawShape::startCreatingShape2D ( const QString &  type,
const QColor &  borderColor,
const QColor &  fillColor 
)
slot

Slot for defining the shape to draw and initializing drawing.

Definition at line 211 of file InputController.cpp.

References m_borderColor, m_creating, m_fillColor, and m_shapeType.

◆ touchPointAt

void MantidQt::MantidWidgets::InputControllerDrawShape::touchPointAt ( int  ,
int   
)
signal

Sent when the mouse is moved to a new position with the buttons up.

Referenced by mouseMoveEvent().

Member Data Documentation

◆ m_borderColor

QColor MantidQt::MantidWidgets::InputControllerDrawShape::m_borderColor
private

Definition at line 187 of file InputController.h.

Referenced by mousePressEvent(), and startCreatingShape2D().

◆ m_creating

bool MantidQt::MantidWidgets::InputControllerDrawShape::m_creating
private

a shape is being created with a mouse

Definition at line 184 of file InputController.h.

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

◆ m_fillColor

QColor MantidQt::MantidWidgets::InputControllerDrawShape::m_fillColor
private

Definition at line 187 of file InputController.h.

Referenced by mousePressEvent(), and startCreatingShape2D().

◆ m_isButtonPressed

bool MantidQt::MantidWidgets::InputControllerDrawShape::m_isButtonPressed
private

Definition at line 188 of file InputController.h.

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

◆ m_rect

QRect MantidQt::MantidWidgets::InputControllerDrawShape::m_rect
private

Definition at line 189 of file InputController.h.

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

◆ m_shapeType

QString MantidQt::MantidWidgets::InputControllerDrawShape::m_shapeType
private

Definition at line 186 of file InputController.h.

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

◆ m_x

int MantidQt::MantidWidgets::InputControllerDrawShape::m_x
private

Definition at line 185 of file InputController.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ m_y

int MantidQt::MantidWidgets::InputControllerDrawShape::m_y
private

Definition at line 185 of file InputController.h.

Referenced by mouseMoveEvent(), and mousePressEvent().


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