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

SoCallback — provides custom behavior during actions

Action Behavior

SoGLRenderAction,SoBoundingBoxAction,SoPickAction
          Calls the specified callback function for all actions.

Description

       This  node provides a general mechanism for inserting callback functions into a scene graph. The callback
       function registered with the node is called each time the node is traversed while  performing  any  scene
       graph  action.  The  callback  function is passed a pointer to the action being performed and a user data
       pointer registered with the callback function. You can use this node to  make  nonstandard  OpenGL  calls
       while rendering. If you do, be careful not to interfere with Inventor's use of OpenGL.

       If  you  use  a  callback node for GL rendering, you should be careful to follow render caching rules. If
       your callback node can make different rendering calls each time it is traversed, it cannot be cached.  In
       such a case, the node should invalidate any open caches, as in the following example:

          voidmyCallbackFunc(void*d,SoAction*action){if(action->isOfType(SoGLRenderAction::getClassTypeId())){//MakemycustomGLcalls((MyClass*)d)->myRender();//InvalidatethestatesothatacacheisnotmadeSoCacheElement::invalidate(action->getState());}}

File Format/Defaults

Callback{}

Inherits From

       SoBase > SoFieldContainer > SoNode > SoCallback

Methods

SoCallback()
          Creates a callback node with default settings.

     voidsetCallback(SoCallbackCB*func,void*userData=NULL)
          Sets  pointer to callback function and user data. By default, the function pointer in the node is NULL
          and does nothing.

     staticSoTypegetClassTypeId()
          Returns type identifier for this class.

Name

       SoCallback — provides custom behavior during actions

See Also

SoAction,SoCallbackAction,SoEventCallbackSoCallback(3IV)()

Synopsis

#include<Inventor/nodes/SoCallback.h>typedefvoidSoCallbackCB(void*userData,SoAction*action)

          Methods from class SoCallback:

                         SoCallback()voidsetCallback(SoCallbackCB*func,void*userData=NULL)staticSoTypegetClassTypeId()

          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