ManiVault 1.0.0
A Flexible and Extensible Visual Analytics Framework for High-Dimensional Data
Loading...
Searching...
No Matches
hdps::util::PixelSelectionTool Class Reference

#include <PixelSelectionTool.h>

Inheritance diagram for hdps::util::PixelSelectionTool:

Signals

void typeChanged (const PixelSelectionType &type)
 
void modifierChanged (const PixelSelectionModifierType &modifier)
 
void notifyDuringSelectionChanged (const bool &notifyDuringSelection)
 
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 &notifyDuringSelection)
 
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
 

Detailed Description

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

Author
Thomas Kroes

Constructor & Destructor Documentation

◆ PixelSelectionTool()

hdps::util::PixelSelectionTool::PixelSelectionTool ( QWidget *  targetWidget,
const bool &  enabled = true 
)

Constructor

Parameters
targetWidgetTarget widget on which the pixel selection tool operates
enabledWhether the tool is enabled or not

Member Function Documentation

◆ areaChanged

void hdps::util::PixelSelectionTool::areaChanged ( )
signal

Signals that the selection area changed

◆ brushRadiusChanged

void hdps::util::PixelSelectionTool::brushRadiusChanged ( const float &  brushRadius)
signal

Signals that the brush radius has changed

◆ ended

void hdps::util::PixelSelectionTool::ended ( )
signal

Signals that the selection process has ended

◆ eventFilter()

bool hdps::util::PixelSelectionTool::eventFilter ( QObject *  target,
QEvent *  event 
)
override

Listens to the events of target

Parameters
targetTarget object to watch for events
eventEvent that occurred

◆ getAreaPixmap()

QPixmap hdps::util::PixelSelectionTool::getAreaPixmap ( )
inline

Get the pixmap overlay that contains the selected pixels

◆ getBrushRadius()

float hdps::util::PixelSelectionTool::getBrushRadius ( ) const

Get brush radius

◆ getMainColor()

QColor hdps::util::PixelSelectionTool::getMainColor ( ) const

Get main drawing color

◆ getModifier()

PixelSelectionModifierType hdps::util::PixelSelectionTool::getModifier ( ) const

Get the current pixel selection modifier

◆ getShapePixmap()

QPixmap hdps::util::PixelSelectionTool::getShapePixmap ( )
inline

Get the pixmap overlay that contains the selection tool visualization

◆ getType()

PixelSelectionType hdps::util::PixelSelectionTool::getType ( ) const

Get the current pixel selection type

◆ isAborted()

bool hdps::util::PixelSelectionTool::isAborted ( ) const
inline

Get whether the selection process is aborted

Returns
Boolean indicating whether the selection process is aborted

◆ isActive()

bool hdps::util::PixelSelectionTool::isActive ( ) const
inline

Get whether the selection process is cBurrently active

Returns
Boolean indicating whether the selection process is currently active

◆ isEnabled()

bool hdps::util::PixelSelectionTool::isEnabled ( ) const

Get whether the tool is enabled or not

◆ isNotifyDuringSelection()

bool hdps::util::PixelSelectionTool::isNotifyDuringSelection ( ) const

Get whether notifications should be fired continuously or only at the end of selection

◆ modifierChanged

void hdps::util::PixelSelectionTool::modifierChanged ( const PixelSelectionModifierType modifier)
signal

Signals that the selection modifier has changed

◆ notifyDuringSelectionChanged

void hdps::util::PixelSelectionTool::notifyDuringSelectionChanged ( const bool &  notifyDuringSelection)
signal

Signals that the notify during selection property has changed

◆ setBrushRadius()

void hdps::util::PixelSelectionTool::setBrushRadius ( const float &  brushRadius)

Set brush radius

Parameters
brushRadiusBrush radius

◆ setChanged()

void hdps::util::PixelSelectionTool::setChanged ( )

Trigger signals

◆ setEnabled()

void hdps::util::PixelSelectionTool::setEnabled ( const bool &  enabled)

Set whether the tool is enabled or not

Parameters
enabledWhether the tool is enabled or not

◆ setMainColor()

void hdps::util::PixelSelectionTool::setMainColor ( const QColor &  mainColor)

Set main drawing color

Parameters
colorDrawing color

◆ setModifier()

void hdps::util::PixelSelectionTool::setModifier ( const PixelSelectionModifierType modifier)

Set the current pixel selection modifier

Parameters
modifierPixel selection modifier

◆ setNotifyDuringSelection()

void hdps::util::PixelSelectionTool::setNotifyDuringSelection ( const bool &  notifyDuringSelection)

Set whether notifications should be fired continuously or only at the end of selection

Parameters
notifyDuringSelectionWhether notifications should be fired continuously or only at the end of selection

◆ setType()

void hdps::util::PixelSelectionTool::setType ( const PixelSelectionType type)

Set the current pixel selection type

Parameters
typePixel selection type

◆ shapeChanged

void hdps::util::PixelSelectionTool::shapeChanged ( )
signal

Signals that the selection shape changed

◆ started

void hdps::util::PixelSelectionTool::started ( )
signal

Signals that the selection process has started

◆ typeChanged

void hdps::util::PixelSelectionTool::typeChanged ( const PixelSelectionType type)
signal

Signals that the type has changed

◆ update()

void hdps::util::PixelSelectionTool::update ( )

Updates the pixel selection tool (wraps internal paint method)

Member Data Documentation

◆ _aborted

bool hdps::util::PixelSelectionTool::_aborted
protected

Whether to prevent a context menu

◆ _active

bool hdps::util::PixelSelectionTool::_active
protected

Current selection modifier

◆ _areaBrush

QBrush hdps::util::PixelSelectionTool::_areaBrush
protected

Selection area fill color (based on main color)

◆ _areaPixmap

QPixmap hdps::util::PixelSelectionTool::_areaPixmap
protected

Pixmap for the selection tool shape

◆ _brushRadius

float hdps::util::PixelSelectionTool::_brushRadius
protected

Whether the selection is published continuously or at the end

◆ _enabled

bool hdps::util::PixelSelectionTool::_enabled
protected

◆ _fillColor

QColor hdps::util::PixelSelectionTool::_fillColor
protected

Main drawing color

◆ _mainColor

QColor hdps::util::PixelSelectionTool::_mainColor
protected

◆ _modifier

PixelSelectionModifierType hdps::util::PixelSelectionTool::_modifier
protected

Current selection type

◆ _mouseButtons

int hdps::util::PixelSelectionTool::_mouseButtons
protected

Recorded mouse positions

◆ _mousePosition

QPoint hdps::util::PixelSelectionTool::_mousePosition
protected

Brush radius

◆ _mousePositions

QVector<QPoint> hdps::util::PixelSelectionTool::_mousePositions
protected

Current mouse position

◆ _notifyDuringSelection

bool hdps::util::PixelSelectionTool::_notifyDuringSelection
protected

Whether the selection process is active

◆ _penClosingPoint

QPen hdps::util::PixelSelectionTool::_penClosingPoint
protected

Control point pen

◆ _penControlPoint

QPen hdps::util::PixelSelectionTool::_penControlPoint
protected

Background pen

◆ _penLineBackGround

QPen hdps::util::PixelSelectionTool::_penLineBackGround
protected

Foreground pen

◆ _penLineForeGround

QPen hdps::util::PixelSelectionTool::_penLineForeGround
protected

Selection area brush

◆ _preventContextMenu

bool hdps::util::PixelSelectionTool::_preventContextMenu
protected

Pixmap for the selection area

◆ _shapePixmap

QPixmap hdps::util::PixelSelectionTool::_shapePixmap
protected

State of the left, middle and right mouse buttons

◆ _type

PixelSelectionType hdps::util::PixelSelectionTool::_type
protected

Whether the tool is enabled or not

◆ BRUSH_RADIUS_DEFAULT

constexpr float hdps::util::PixelSelectionTool::BRUSH_RADIUS_DEFAULT = 50.0f
staticconstexpr

Maximum radius

◆ BRUSH_RADIUS_DELTA

constexpr float hdps::util::PixelSelectionTool::BRUSH_RADIUS_DELTA = 10.0f
staticconstexpr

Default radius

◆ BRUSH_RADIUS_MAX

constexpr float hdps::util::PixelSelectionTool::BRUSH_RADIUS_MAX = 500.0f
staticconstexpr

Minimum radius

◆ BRUSH_RADIUS_MIN

constexpr float hdps::util::PixelSelectionTool::BRUSH_RADIUS_MIN = 10.0f
staticconstexpr

Closing point pen (e.g. for finishing polygon selection)

◆ CP_RADIUS_CLOSING

constexpr float hdps::util::PixelSelectionTool::CP_RADIUS_CLOSING = 2.5f * CP_RADIUS_LINE
staticconstexpr

Radius of line control points

◆ CP_RADIUS_LINE

constexpr float hdps::util::PixelSelectionTool::CP_RADIUS_LINE = 8.0f
staticconstexpr

Radius increment

◆ LAZY_UPDATE_INTERVAL

const std::int32_t hdps::util::PixelSelectionTool::LAZY_UPDATE_INTERVAL = 10
staticprotected

Whether the selection process was aborted


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