13#ifndef SO_INTERACTION_OWNER_H
14#define SO_INTERACTION_OWNER_H
21#include <ThirdPartyWarningsDisable.h>
23#include <ThirdPartyWarningsRestore.h>
65 virtual std::string
getID()
const;
94 bool hasInteractionsOfType()
const;
114 std::list<SoInteraction*> _interactions;
117 std::list<SoInteractionOwnerListenerInterface*> _listeners;
126 std::list<SoInteraction*>::const_iterator it = _interactions.begin();
127 for(;it!=_interactions.end();it++) {
128 if ((*it)->isOfType<
T>()) {
#define SOMANAGEDINTERACTION_API
File to resolve system dependencies in View2D library.
Interface for getting notified about changes in the interaction list of an owner.
virtual void interactionAdded(SoInteractionOwner *, SoInteraction *)
This gets called when an interaction is added to the owner.
virtual ~SoInteractionOwnerListenerInterface()=default
virtual void interactionRemoved(SoInteractionOwner *, SoInteraction *)
virtual void ownerDeleted(SoInteractionOwner *)
This gets called when the owner is deleted.
friend class SoInteraction
virtual void pointerPosition(const SoPointerPosition &)
Override this if you always need to be informed of the current mouse cursor position.
void pointerPosition(SoState *state, const SoPointerPosition &pos) override
Same as below, with additional SoState argument. By default, simply calls the below version.
void pointerLeftWindow(SoState *state) override
Same as below, with additional SoState argument. By defaults, simply calls the below version.
void addCommandAction(SoCommandAction *)
~SoInteractionOwner() override
The destructor will destroy all interactions created with this object as owner.
std::list< SoInteraction * > getInteractions(SoState *state) override
Returns the list of all interactions of this provider.
bool hasInteractionsOfType() const
Same as above, but asking for a specific type of interaction.
virtual std::string getID() const
Returns the ID string for identifying the provider and its actions.
void addPointingAction(SoPointingAction *)
void addOffsetAction(SoOffsetAction *)
bool hasInteractions() const
Returns whether there are any actions defined by this owner.
void addListener(SoInteractionOwnerListenerInterface *listener)
Adds a listener object that is notified of changes in the interaction list.
void removeListener(SoInteractionOwnerListenerInterface *listener)
Removes a listener object that was notified of changes in the interaction list.
virtual void pointerLeftWindow()
This is called when the mouse cursor leaves the window.
SoInteractionOwner()
Default constructor.
virtual void objUnref()=0
virtual void pointerLeftWindow(SoState *state)=0
This is called when the mouse cursor leaves the window.
SoInteractionProvider()
Default constructor.
virtual void pointerPosition(SoState *state, const SoPointerPosition &pos)=0
Override this to always be informed of the current mouse cursor position.
SoPointerPosition manages the current position of the mouse cursor.