logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SoEventCallback — node which invokes callbacks for events

Description

SoEventCallback will invoke application supplied callback functions during SoHandleEventAction traversal.
       Methods  allow  the application to specify which Inventor events should trigger callbacks, and which path
       must be picked, if any, for the callback invocation to occur. The application callback  is  able  to  get
       information about the event and the pick detail, and may grab events, release events, and set whether the
       event was handled.

       If  you  register  more than one callback function in an SoEventCallback node, all the callback functions
       will be invoked when an event occurs, even if one of the callbacks handles the  event.  However,  if  the
       event is handled by any of the callback functions, no other node in the scene graph will see the event.

File Format/Defaults

EventCallback{}

Inherits From

       SoBase > SoFieldContainer > SoNode > SoEventCallback

Methods

staticSoTypegetClassTypeId()
          Return the type id for the SoEventCallback class.

                            SoEventCallback()
          Constructor creates an event callback node with no event interest and a NULL path.

     voidsetPath(SoPath*path)constSoPath*getPath()
          Set  and  get  the  path which must be picked in order for the callbacks to be invoked. If the path is
          NULL, the callbacks will be invoked for every interesting event, as specified  by  addEventCallback(),
          regardless of what is picked. The setPath() method makes its own copy of the passed path.

     voidaddEventCallback(SoTypeeventType,SoEventCallbackCB*f,void*userData=NULL)voidremoveEventCallback(SoTypeeventType,SoEventCallbackCB*f,void*userData=NULL)
          Specifies  the  callback functions to be invoked for different event types. When invoked, the callback
          function will be passed the userData, along with a pointer to this SoEventCallback node. For  example,
          passing SoMouseButtonEvent::getClassTypeId()  means callbacks will be invoked only when a mouse button
          is pressed or released. Passing SoEvent::getClassTypeId() for the eventType will cause the callback to
          be invoked for every event which passes through this event callback node.

     SoHandleEventAction*getAction()const
          Returns  the  SoHandleEventAction  currently  traversing this node, or NULL if traversal is not taking
          place. This should be called only from callback functions.

     constSoEvent*getEvent()const
          Returns the event currently being handled, or NULL if traversal is not taking place.  This  should  be
          called only from callback functions.

     constSoPickedPoint*getPickedPoint()const
          Returns  pick  information  during  SoHandleEventAction  traversal, or NULL if traversal is not taking
          place. This should be called only from callback functions.

     voidsetHandled()
          Tells the node the event was handled. The callback function is responsible  for  setting  whether  the
          event  was  handled  or  not.  If  there  is  more  than  one  callback  function  registered  with an
          SoEventCallback node, all of them will be invoked, regardless of whether one has handled the event  or
          not. This should be called only from callback functions.

     SbBoolisHandled()const
          Returns whether the event has been handled. This should be called only from callback functions.

     voidgrabEvents()voidreleaseEvents()
          Tells  the  event  callback  node  to  grab  events or release the grab. While grabbing, the node will
          consume all events; however, each callback function will only be invoked for events of interest.

Name

       SoEventCallback — node which invokes callbacks for events

See Also

SoInteraction,SoSelection,SoHandleEventAction,SoDraggerSoEventCallback(3IV)()

Synopsis

#include<Inventor/nodes/SoEventCallback.h>typedefvoidSoEventCallbackCB(void*userData,SoEventCallback*node)

          Methods from class SoEventCallback:

     staticSoTypegetClassTypeId()SoEventCallback()voidsetPath(SoPath*path)constSoPath*getPath()voidaddEventCallback(SoTypeeventType,SoEventCallbackCB*f,void*userData=NULL)voidremoveEventCallback(SoTypeeventType,SoEventCallbackCB*f,void*userData=NULL)SoHandleEventAction*getAction()constconstSoEvent*getEvent()constconstSoPickedPoint*getPickedPoint()constvoidsetHandled()SbBoolisHandled()constvoidgrabEvents()voidreleaseEvents()

          Methods from class SoNode:

     voidsetOverride(SbBoolstate)SbBoolisOverride()constSoNode*copy(SbBoolcopyConnections=FALSE)constvirtualSbBoolaffectsState()conststaticSoNode*getByName(constSbName&name)staticintgetByName(constSbName&name,SoNodeList&list)

          Methods from class SoFieldContainer:

     voidsetToDefaults()SbBoolhasDefaultValues()constSbBoolfieldsAreEqual(constSoFieldContainer*fc)constvoidcopyFieldValues(constSoFieldContainer*fc,SbBoolcopyConnections=FALSE)SbBoolset(constchar*fieldDataString)voidget(SbString&fieldDataString)virtualintgetFields(SoFieldList&resultList)constvirtualSoField*getField(constSbName&fieldName)constSbBoolgetFieldName(constSoField*field,SbName&fieldName)constSbBoolisNotifyEnabled()constSbBoolenableNotify(SbBoolflag)

          Methods from class SoBase:

     voidref()voidunref()constvoidunrefNoDelete()constvoidtouch()virtualSoTypegetTypeId()constSbBoolisOfType(SoTypetype)constvirtualvoidsetName(constSbName&name)virtualSbNamegetName()const

See Also