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

Public Member Functions

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

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

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 ( std::ostream & ss) const
overridevirtual

Reimplemented from 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:
  • pickingevent.h