Handles interaction for 2D rectangle selection/filtering Selection/Filtering callbacks are called when filtering changes.
More...
#include <boxselectioninteractionhandler.h>
|
using | SelectionFunc = void(const std::vector<bool>&, bool) |
| Selection/filtering-changed callback. The index of each element is given by its location (0, 1 ... n). Second argument specifies if the selection/filtering should be appended.
|
|
using | SelectionCallbackHandle = std::shared_ptr<std::function<SelectionFunc>> |
|
|
| BoxSelectionInteractionHandler (const BoxSelectionProperty &boxSelectionSettings, std::shared_ptr< const BufferBase > xAxis, std::shared_ptr< const BufferBase > yAxis, std::function< dvec2(dvec2 p, const size2_t &dims)> screenToData) |
| Handles interaction for 2D rectangle selection/filtering Selection/Filtering callbacks are called when filtering changes.
|
|
virtual void | invokeEvent (Event *event) override |
|
SelectionCallbackHandle | addSelectionChangedCallback (std::function< SelectionFunc > callback) |
| Added callbacks will be called when selection changed.
|
|
SelectionCallbackHandle | addFilteringChangedCallback (std::function< SelectionFunc > callback) |
| Added callbacks will be called when filtering changed.
|
|
void | setXAxisData (std::shared_ptr< const BufferBase > buffer) |
|
void | setYAxisData (std::shared_ptr< const BufferBase > buffer) |
|
std::optional< std::array< dvec2, 2 > > | getDragRectangle () const |
| Returns (lower, upper) screen space coordinates of selection rectangle, null if not active.
|
|
void | reset () |
| Reset the drag rectangle.
|
|
Public Member Functions inherited from inviwo::InteractionHandler |
|
void | dragRectChanged (const dvec2 &start, const dvec2 &end, bool append) |
| React to rectangle drag changes. Input is in data-space of each axis.
|
|
std::vector< bool > | boxSelect (const dvec2 &start, const dvec2 &end, const BufferBase *xAxis_, const BufferBase *yAxis_) |
|
std::vector< bool > | boxFilter (const dvec2 &start, const dvec2 &end, const BufferBase *xAxis_, const BufferBase *yAxis_) |
|
Handles interaction for 2D rectangle selection/filtering Selection/Filtering callbacks are called when filtering changes.
The current drag rectangle is given by getDragRectangle.
- See also
- DragRectangleRenderer
◆ BoxSelectionInteractionHandler()
inviwo::plot::BoxSelectionInteractionHandler::BoxSelectionInteractionHandler |
( |
const BoxSelectionProperty & | boxSelectionSettings, |
|
|
std::shared_ptr< const BufferBase > | xAxis, |
|
|
std::shared_ptr< const BufferBase > | yAxis, |
|
|
std::function< dvec2(dvec2 p, const size2_t &dims)> | screenToData ) |
Handles interaction for 2D rectangle selection/filtering Selection/Filtering callbacks are called when filtering changes.
- Parameters
-
boxSelectionSettings | use for selection/filtering/none |
xAxis | data |
yAxis | data |
screenToData | converts screen coordinates to (x,y) data coordinates |
◆ invokeEvent()
virtual void inviwo::plot::BoxSelectionInteractionHandler::invokeEvent |
( |
Event * | event | ) |
|
|
overridevirtual |
◆ reset()
void inviwo::plot::BoxSelectionInteractionHandler::reset |
( |
| ) |
|
The documentation for this class was generated from the following file:
- boxselectioninteractionhandler.h