Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::plot::BoxSelection Class Reference

Handles interaction for 2D rectangle selection/filtering Selection/Filtering callbacks are called when filtering changes. More...

#include <modules/plotting/interaction/boxselection.h>

Public Types

using SelectionCallbackHandle = std::shared_ptr<std::function<SelectionFunc>>
using SelectionFunc

Public Member Functions

SelectionCallbackHandle addEventCallback (std::function< SelectionFunc > callback)
 Added callbacks will be called when a box selection is initiated, updated, and finished.
 BoxSelection (const BoxSelectionProperty &boxSelectionSettings, std::function< dvec2(dvec2 p, const size2_t &dims)> screenToData, MouseButton mouseButton=MouseButton::Left, KeyModifiers modifiers=KeyModifiers(flags::none))
 Handles interaction for 2D rectangle selection/filtering The callbacks are called when filtering changes.
std::optional< std::array< dvec2, 2 > > getDragRectangle () const
 Returns (lower, upper) screen space coordinates of selection rectangle, null if not active.
auto properties ()
auto properties () const
void reset ()
 Reset the drag rectangle.

Protected Member Functions

void handleEvent (Event *event, EventProperty::State state)

Protected Attributes

std::optional< std::array< dvec2, 2 > > dataRect_
std::optional< std::array< dvec2, 2 > > dragRect_
const BoxSelectionPropertydragRectSettings_
Dispatcher< SelectionFunc > eventCallback_
EventProperty mouseBoxSelection_
std::function< dvec2(dvec2 p, const size2_t &dims)> screenToData_
 ! Selection/filtering

Detailed Description

Handles interaction for 2D rectangle selection/filtering Selection/Filtering callbacks are called when filtering changes.

The current drag rectangle is given by getDragRectangle.

The event properties returned by properties() need to be added to a processor in order for the interactions to work.

See also
DragRectangleRenderer

Member Typedef Documentation

◆ SelectionFunc

using inviwo::plot::BoxSelection::SelectionFunc
Initial value:
void(AxisRangeEventState, AxisRangeInteraction, AxisRangeInteractionMode,
std::optional<std::array<dvec2, 2>>)

Constructor & Destructor Documentation

◆ BoxSelection()

inviwo::plot::BoxSelection::BoxSelection ( const BoxSelectionProperty & boxSelectionSettings,
std::function< dvec2(dvec2 p, const size2_t &dims)> screenToData,
MouseButton mouseButton = MouseButton::Left,
KeyModifiers modifiers = KeyModifiers(flags::none) )

Handles interaction for 2D rectangle selection/filtering The callbacks are called when filtering changes.

Parameters
boxSelectionSettingsuse for selection/filtering/none
screenToDataconverts screen coordinates to (x,y) data coordinates

Member Function Documentation

◆ reset()

void inviwo::plot::BoxSelection::reset ( )

Reset the drag rectangle.

See also
getDragRectangle

The documentation for this class was generated from the following file:
  • modules/plotting/include/modules/plotting/interaction/boxselection.h