|
ManiVault 1.0.0
A Flexible and Extensible Visual Analytics Framework for High-Dimensional Data
|
#include <PixelSelectionTool.h>
Signals | |
| void | typeChanged (const PixelSelectionType &type) |
| void | modifierChanged (const PixelSelectionModifierType &modifier) |
| void | notifyDuringSelectionChanged (const bool ¬ifyDuringSelection) |
| void | brushRadiusChanged (const float &brushRadius) |
| void | shapeChanged () |
| void | areaChanged () |
| void | started () |
| void | ended () |
Public Member Functions | |
| PixelSelectionTool (QWidget *targetWidget, const bool &enabled=true) | |
| bool | isEnabled () const |
| void | setEnabled (const bool &enabled) |
| PixelSelectionType | getType () const |
| void | setType (const PixelSelectionType &type) |
| PixelSelectionModifierType | getModifier () const |
| void | setModifier (const PixelSelectionModifierType &modifier) |
| bool | isNotifyDuringSelection () const |
| void | setNotifyDuringSelection (const bool ¬ifyDuringSelection) |
| float | getBrushRadius () const |
| void | setBrushRadius (const float &brushRadius) |
| QColor | getMainColor () const |
| void | setMainColor (const QColor &mainColor) |
| void | setChanged () |
| bool | isActive () const |
| bool | isAborted () const |
| QPixmap | getShapePixmap () |
| QPixmap | getAreaPixmap () |
| void | update () |
| bool | eventFilter (QObject *target, QEvent *event) override |
Static Public Attributes | |
| static constexpr float | BRUSH_RADIUS_MIN = 10.0f |
| static constexpr float | BRUSH_RADIUS_MAX = 500.0f |
| static constexpr float | BRUSH_RADIUS_DEFAULT = 50.0f |
| static constexpr float | BRUSH_RADIUS_DELTA = 10.0f |
| static constexpr float | CP_RADIUS_LINE = 8.0f |
| static constexpr float | CP_RADIUS_CLOSING = 2.5f * CP_RADIUS_LINE |
Protected Attributes | |
| bool | _enabled |
| PixelSelectionType | _type |
| PixelSelectionModifierType | _modifier |
| bool | _active |
| bool | _notifyDuringSelection |
| float | _brushRadius |
| QPoint | _mousePosition |
| QVector< QPoint > | _mousePositions |
| int | _mouseButtons |
| QPixmap | _shapePixmap |
| QPixmap | _areaPixmap |
| bool | _preventContextMenu |
| bool | _aborted |
| QColor | _mainColor |
| QColor | _fillColor |
| QBrush | _areaBrush |
| QPen | _penLineForeGround |
| QPen | _penLineBackGround |
| QPen | _penControlPoint |
| QPen | _penClosingPoint |
Static Protected Attributes | |
| static const std::int32_t | LAZY_UPDATE_INTERVAL = 10 |
Pixel selection tool class
Class for pixel selection using various tools (e.g. brush, rectangle and lasso) It handles mouse/keyboard events to switch between tools and perform the selection itself It draws an overlay of the selection shape _shapePixmap and the selected area _areaPixmap
| hdps::util::PixelSelectionTool::PixelSelectionTool | ( | QWidget * | targetWidget, |
| const bool & | enabled = true |
||
| ) |
Constructor
| targetWidget | Target widget on which the pixel selection tool operates |
| enabled | Whether the tool is enabled or not |
|
signal |
Signals that the selection area changed
|
signal |
Signals that the brush radius has changed
|
signal |
Signals that the selection process has ended
|
override |
Listens to the events of target
| target | Target object to watch for events |
| event | Event that occurred |
|
inline |
Get the pixmap overlay that contains the selected pixels
| float hdps::util::PixelSelectionTool::getBrushRadius | ( | ) | const |
Get brush radius
| QColor hdps::util::PixelSelectionTool::getMainColor | ( | ) | const |
Get main drawing color
| PixelSelectionModifierType hdps::util::PixelSelectionTool::getModifier | ( | ) | const |
Get the current pixel selection modifier
|
inline |
Get the pixmap overlay that contains the selection tool visualization
| PixelSelectionType hdps::util::PixelSelectionTool::getType | ( | ) | const |
Get the current pixel selection type
|
inline |
Get whether the selection process is aborted
|
inline |
Get whether the selection process is cBurrently active
| bool hdps::util::PixelSelectionTool::isEnabled | ( | ) | const |
Get whether the tool is enabled or not
| bool hdps::util::PixelSelectionTool::isNotifyDuringSelection | ( | ) | const |
Get whether notifications should be fired continuously or only at the end of selection
|
signal |
Signals that the selection modifier has changed
|
signal |
Signals that the notify during selection property has changed
| void hdps::util::PixelSelectionTool::setBrushRadius | ( | const float & | brushRadius | ) |
Set brush radius
| brushRadius | Brush radius |
| void hdps::util::PixelSelectionTool::setChanged | ( | ) |
Trigger signals
| void hdps::util::PixelSelectionTool::setEnabled | ( | const bool & | enabled | ) |
Set whether the tool is enabled or not
| enabled | Whether the tool is enabled or not |
| void hdps::util::PixelSelectionTool::setMainColor | ( | const QColor & | mainColor | ) |
Set main drawing color
| color | Drawing color |
| void hdps::util::PixelSelectionTool::setModifier | ( | const PixelSelectionModifierType & | modifier | ) |
Set the current pixel selection modifier
| modifier | Pixel selection modifier |
| void hdps::util::PixelSelectionTool::setNotifyDuringSelection | ( | const bool & | notifyDuringSelection | ) |
Set whether notifications should be fired continuously or only at the end of selection
| notifyDuringSelection | Whether notifications should be fired continuously or only at the end of selection |
| void hdps::util::PixelSelectionTool::setType | ( | const PixelSelectionType & | type | ) |
Set the current pixel selection type
| type | Pixel selection type |
|
signal |
Signals that the selection shape changed
|
signal |
Signals that the selection process has started
|
signal |
Signals that the type has changed
| void hdps::util::PixelSelectionTool::update | ( | ) |
Updates the pixel selection tool (wraps internal paint method)
|
protected |
Whether to prevent a context menu
|
protected |
Current selection modifier
|
protected |
Selection area fill color (based on main color)
|
protected |
Pixmap for the selection tool shape
|
protected |
Whether the selection is published continuously or at the end
|
protected |
|
protected |
Main drawing color
|
protected |
|
protected |
Current selection type
|
protected |
Recorded mouse positions
|
protected |
Brush radius
|
protected |
Current mouse position
|
protected |
Whether the selection process is active
|
protected |
Control point pen
|
protected |
Background pen
|
protected |
Foreground pen
|
protected |
Selection area brush
|
protected |
Pixmap for the selection area
|
protected |
State of the left, middle and right mouse buttons
|
protected |
Whether the tool is enabled or not
|
staticconstexpr |
Maximum radius
|
staticconstexpr |
Default radius
|
staticconstexpr |
Minimum radius
|
staticconstexpr |
Closing point pen (e.g. for finishing polygon selection)
|
staticconstexpr |
Radius of line control points
|
staticconstexpr |
Radius increment
|
staticprotected |
Whether the selection process was aborted