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

Handles object interaction in images. More...

#include <inviwo/core/interaction/events/pickingevent.h>

+ Inheritance diagram for inviwo::PickingEvent:

Public Member Functions

virtual PickingEventclone () const override
 
uvec2 getCanvasSize () const
 
size_t getCurrentGlobalPickingId () const
 
std::pair< bool, size_t > getCurrentLocalPickingId () const
 
double getDeltaDepth () const
 
dvec2 getDeltaPosition () const
 
double getDeltaPressedDepth () const
 
dvec2 getDeltaPressedPosition () const
 
double getDepth () const
 
InteractionEventgetEvent () const
 
template<typename EventType >
EventType * getEventAs () const
 
size_t getGlobalPickingId () const
 
PickingHoverState getHoverState () const
 
bool getMovedSincePressed (double deltaDistance=3.0) const
 
dvec3 getNDC () const
 
size_t getPickedId () const
 
const PickingActiongetPickingAction () const
 
dvec2 getPosition () const
 
double getPressedDepth () const
 
size_t getPressedGlobalPickingId () const
 
std::pair< bool, size_t > getPressedLocalPickingId () const
 
dvec3 getPressedNDC () const
 
dvec2 getPressedPosition () const
 
PickingPressItem getPressItem () const
 
PickingPressItems getPressItems () const
 
PickingPressState getPressState () const
 
double getPreviousDepth () const
 
size_t getPreviousGlobalPickingId () const
 
std::pair< bool, size_t > getPreviousLocalPickingId () const
 
dvec3 getPreviousNDC () const
 
dvec2 getPreviousPosition () const
 
PickingState getState () const
 
const InteractionEvent::ToolTipCallback & getToolTipCallback () const
 
dvec3 getWorldSpaceDeltaAtPressDepth (const Camera &camera) const
 
virtual uint64_t hash () const override
 
void invoke (Processor *p)
 
KeyModifiers modifiers () const
 
PickingEventoperator= (const PickingEvent &)
 
 PickingEvent (const PickingAction *pickingAction, InteractionEvent *event, PickingState state, PickingPressState pressState, PickingPressItem pressItem, PickingHoverState hoverState, PickingPressItems pressedState, size_t pickedGlobalId, size_t currentGlobalId, size_t pressedGlobalId, size_t previousGlobalId, dvec3 pressedNDC, dvec3 previousNDC)
 
 PickingEvent (const PickingAction *pickingAction, std::unique_ptr< InteractionEvent > event, PickingState state, PickingPressState pressState, PickingPressItem pressItem, PickingHoverState hoverState, PickingPressItems pressedState, size_t pickedGlobalId, size_t currentGlobalId, size_t pressedGlobalId, size_t previousGlobalId, dvec3 pressedNDC, dvec3 previousNDC)
 
 PickingEvent (const PickingEvent &)
 
virtual void print (fmt::memory_buffer &buff) const override
 
void setToolTip (std::string_view tooltip) const
 
void showContextMenu (std::span< ContextMenuEntry > entries, ContextMenuCategories categories=ContextMenuCategory::Callback)
 
- Public Member Functions inherited from inviwo::Event
template<typename EventType >
EventType * getAs ()
 
template<typename EventType >
const EventType * getAs () const
 
const std::vector< Processor * > & getVisitedProcessors () const
 
bool hasBeenUsed () const
 
bool hasVisitedProcessor (Processor *) const
 
bool markAsUnused ()
 
bool markAsUsed ()
 
void markAsVisited (const Event &)
 
bool markAsVisited (Processor *)
 
bool setUsed (bool isUsed)
 
virtual bool shouldPropagateTo (Inport *inport, Processor *processor, Outport *source)
 

Static Public Member Functions

static constexpr uint64_t chash ()
 

Additional Inherited Members

- Protected Member Functions inherited from inviwo::Event
 Event (const Event &rhs)=default
 
Eventoperator= (const Event &that)=default
 

Detailed Description

Handles object interaction in images.

See also
PickingManager

Member Function Documentation

◆ clone()

virtual PickingEvent * inviwo::PickingEvent::clone ( ) const
overridevirtual

Implements inviwo::Event.

◆ getCanvasSize()

uvec2 inviwo::PickingEvent::getCanvasSize ( ) const

The size of the canvas where the event occurred.

◆ getCurrentGlobalPickingId()

size_t inviwo::PickingEvent::getCurrentGlobalPickingId ( ) const

Returns the current global picking index of the object at the current position

◆ getCurrentLocalPickingId()

std::pair< bool, size_t > inviwo::PickingEvent::getCurrentLocalPickingId ( ) const

Returns the current local picking index If the global index belongs to a different picking action {false, 0} is returned.

◆ getDeltaDepth()

double inviwo::PickingEvent::getDeltaDepth ( ) const

Returns the delta of the previous and current depth;

◆ getDeltaPosition()

dvec2 inviwo::PickingEvent::getDeltaPosition ( ) const

Returns the delta of the previous and current position;

◆ getDeltaPressedDepth()

double inviwo::PickingEvent::getDeltaPressedDepth ( ) const

Returns the delta of the press depth and current depth;

◆ getDeltaPressedPosition()

dvec2 inviwo::PickingEvent::getDeltaPressedPosition ( ) const

Returns the delta of the press position and current position;

◆ getDepth()

double inviwo::PickingEvent::getDepth ( ) const

Returns the current normalized depth

◆ getGlobalPickingId()

size_t inviwo::PickingEvent::getGlobalPickingId ( ) const

Returns the global picking index of the object currently being picked. this id does not change while an item is being pressed even if the position is no longer on the item.

◆ getMovedSincePressed()

bool inviwo::PickingEvent::getMovedSincePressed ( double deltaDistance = 3.0) const

Returns true if the distance between the pressed position and current position in screen coordinates is larger than deltaDistance or the current picking ID is different to the pressed one.

See also
getCurrentGlobalPickingId, getPressedGlobalPickingId, getDeltaPressedPosition

◆ getNDC()

dvec3 inviwo::PickingEvent::getNDC ( ) const

Returns the normalized device coordinates. Position and depth normalized to the range of (-1,1) In in a left handed coordinate system. The lower left near will be (-1,-1,-1) And the upper right far (1,1,1)

◆ getPickedId()

size_t inviwo::PickingEvent::getPickedId ( ) const

Returns the local picking index of the object currently being picked. this id does not change while an item is being pressed even if the position is no longer on the item.

◆ getPosition()

dvec2 inviwo::PickingEvent::getPosition ( ) const

Returns the current normalized position

◆ getPressedDepth()

double inviwo::PickingEvent::getPressedDepth ( ) const

Returns the normalized depth of the initial press

◆ getPressedGlobalPickingId()

size_t inviwo::PickingEvent::getPressedGlobalPickingId ( ) const

Returns the pressed global picking index

◆ getPressedLocalPickingId()

std::pair< bool, size_t > inviwo::PickingEvent::getPressedLocalPickingId ( ) const

Returns the pressed local picking index If the global index belongs to a different picking action {false, 0} is returned.

◆ getPressedPosition()

dvec2 inviwo::PickingEvent::getPressedPosition ( ) const

Returns the normalized position of the initial press

◆ getPreviousDepth()

double inviwo::PickingEvent::getPreviousDepth ( ) const

Returns the previous normalized depth

◆ getPreviousGlobalPickingId()

size_t inviwo::PickingEvent::getPreviousGlobalPickingId ( ) const

Returns the previous global picking index

◆ getPreviousLocalPickingId()

std::pair< bool, size_t > inviwo::PickingEvent::getPreviousLocalPickingId ( ) const

Returns the previous local picking index If the global index belongs to a different picking action {false, 0} is returned.

◆ getPreviousPosition()

dvec2 inviwo::PickingEvent::getPreviousPosition ( ) const

Returns the previous normalized position

◆ getWorldSpaceDeltaAtPressDepth()

dvec3 inviwo::PickingEvent::getWorldSpaceDeltaAtPressDepth ( const Camera & camera) const

Return the {curr.x, curr.y. press.z} - {prev.x, prev.y, press.z} transformed into world space using the given camera. This is useful when dragging an object in the screen plane.

◆ hash()

virtual uint64_t inviwo::PickingEvent::hash ( ) const
overridevirtual

Implements inviwo::Event.

◆ print()

virtual void inviwo::PickingEvent::print ( fmt::memory_buffer & buff) const
overridevirtual

Implements inviwo::Event.

◆ setToolTip()

void inviwo::PickingEvent::setToolTip ( std::string_view tooltip) const

Display a tool tip using the optionally set tool tip callback. If no tool tip callback is set, the function does nothing. The supported formation depends on the used back end, but simple html is usually supported. Calling the function with an empty sting will hide any existing tool tip.

◆ showContextMenu()

void inviwo::PickingEvent::showContextMenu ( std::span< ContextMenuEntry > entries,
ContextMenuCategories categories = ContextMenuCategory::Callback )

Show a context menu at the current mouse position. The custom menu entries are added before any other default actions based on categories. When any of the custom menu actions in the entries is triggered, a ContexMenuEvent with the corresponding entry ID will be propagated through the processor network.

Parameters
entrieslist of custom menu items
categoriesdetermines which menu actions should be included in the context menu
See also
ContextMenuCategories

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