1SoCallback(3IV)()                                            SoCallback(3IV)()
2
3
4

NAME

6       SoCallback — provides custom behavior during actions
7

INHERITS FROM

9       SoBase > SoFieldContainer > SoNode > SoCallback
10

SYNOPSIS

12       #include <Inventor/nodes/SoCallback.h>
13
14     typedef void        SoCallbackCB(void *userData, SoAction *action)
15
16          Methods from class SoCallback:
17
18                         SoCallback()
19     void                setCallback(SoCallbackCB   *func,  void  *userData  =
20                              NULL)
21     static SoType       getClassTypeId()
22
23          Methods from class SoNode:
24
25     void                setOverride(SbBool state)
26     SbBool              isOverride() const
27     SoNode *            copy(SbBool copyConnections = FALSE) const
28     virtual SbBool      affectsState() const
29     static SoNode *     getByName(const SbName &name)
30     static int          getByName(const SbName &name, SoNodeList &list)
31
32          Methods from class SoFieldContainer:
33
34     void                setToDefaults()
35     SbBool              hasDefaultValues() const
36     SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
37     void                copyFieldValues(const  SoFieldContainer  *fc,  SbBool
38                              copyConnections = FALSE)
39     SbBool              set(const char *fieldDataString)
40     void                get(SbString &fieldDataString)
41     virtual int         getFields(SoFieldList &resultList) const
42     virtual SoField *   getField(const SbName &fieldName) const
43     SbBool              getFieldName(const SoField *field, SbName &fieldName)
44                              const
45     SbBool              isNotifyEnabled() const
46     SbBool              enableNotify(SbBool flag)
47
48          Methods from class SoBase:
49
50     void                ref()
51     void                unref() const
52     void                unrefNoDelete() const
53     void                touch()
54     virtual SoType      getTypeId() const
55     SbBool              isOfType(SoType type) const
56     virtual void        setName(const SbName &name)
57     virtual SbName      getName() const
58
59

DESCRIPTION

61       This node provides a general mechanism for inserting callback functions
62       into  a  scene graph. The callback function registered with the node is
63       called each time the node is traversed while performing any scene graph
64       action.  The  callback function is passed a pointer to the action being
65       performed and a user data pointer registered with  the  callback  func‐
66       tion. You can use this node to make nonstandard OpenGL calls while ren‐
67       dering. If you do, be careful not to interfere with Inventor's  use  of
68       OpenGL.
69
70       If  you  use a callback node for GL rendering, you should be careful to
71       follow render caching rules. If your callback node can  make  different
72       rendering calls each time it is traversed, it cannot be cached. In such
73       a case, the node should invalidate any open caches, as in the following
74       example:
75
76
77
78          void
79          myCallbackFunc(void *d, SoAction *action) {
80              if (action->isOfType(SoGLRenderAction::getClassTypeId())) {
81                              // Make my custom GL calls
82                              ((MyClass *) d)->myRender();
83
84                              // Invalidate the state so that a cache is not made
85                              SoCacheElement::invalidate(action->getState());
86              }
87          }
88
89

METHODS

91                         SoCallback()
92          Creates a callback node with default settings.
93
94     void                setCallback(SoCallbackCB   *func,  void  *userData  =
95                              NULL)
96          Sets pointer to callback function and user  data.  By  default,  the
97          function pointer in the node is NULL and does nothing.
98
99     static SoType       getClassTypeId()
100          Returns type identifier for this class.
101
102

ACTION BEHAVIOR

104       SoGLRenderAction, SoBoundingBoxAction, SoPickAction
105          Calls the specified callback function for all actions.
106
107

FILE FORMAT/DEFAULTS

109       Callback {
110       }
111

SEE ALSO

113       SoAction, SoCallbackAction, SoEventCallback
114
115
116
117
118                                                             SoCallback(3IV)()
Impressum