Debian Codegraph @

doc/man/man3/ivm/manips/SoDirectionalLightManip.ivm

raw
1 NAME SoDirectionalLightManip SoDirLtManip "" { directional light node with 3D interface for editing direction }
2
3 INCLUDE manips/SoDirectionalLightManip.h
4
5 DESC {
6 \cSoDirectionalLightManip\.
7 is the base class for all \cSoDirectionalLight\. nodes that have a built-in
8 3D user interface (this is the only such class provided with the
9 Inventor toolkit).
10 Since it is derived from \cSoDirectionalLight\., any changes to its
11 fields result in a change of lighting for nodes that
12 follow it in the scene graph.
13 In this case, the interface edits the \vdirection\. field.
14 Also, the color of the manipulator's geometry will reflect the color of the
15 light (but you cannot edit the color using this manipulator).
16 \p
17 Typically, you will want to replace a regular \cSoDirectionalLight\. with an
18 \cSoDirectionalLightManip\. (as when the user selects a light to be edited),
19 or vice versa (as when the user is done moving the light and the interface
20 should go away).
21 Use the
22 \+\mreplaceNode()\. method\.
23 \-\mSoDirLtManipReplaceNode()\. function\.
24 to insert a manipulator into a scene graph, and the
25 \+\mreplaceManip()\. method\.
26 \-\mSoDirLtManipReplaceManip()\. function\.
27 to remove it when done.
28 \p
29 The \cSoDirectionalLightManip\.
30 utilizes an \cSoDirectionalLightDragger\. to provide a 3D interface.
31 However, the manipulator differs from the dragger; it lights other objects
32 in the scene because, as an \cSoDirectionalLight\.,
33 it alters the state.
34 The field values and movement of the dragger, on the other hand, affect only
35 the dragger itself.
36 To find out more about how the interface works and what each part will do,
37 see the reference page for \cSoDirectionalLightDragger\.. The interfaces of the
38 dragger and the manipulator are identical.
39 \p
40 The \cSoDirectionalLightManip\. utilizes its dragger by adding it
41 as a hidden child. When an action is applied to the manipulator,
42 such as rendering or handling events, the manipulator first traverses the
43 dragger, and then the manipulator adds its lighting parameters to the state.
44 When you click-drag-release over the manipulator, it passes these events down
45 to the dragger, which moves as a result ("I can't \ehelp\. it, I'm a dragger!").
46 \p
47 The manipulator maintains consistency between the fields
48 of the dragger and its own fields. Let's say you use the mouse to rotate
49 the \edragger\.. Callbacks ensure that the
50 \vdirection\. field of the \emanipulator\. will change by the same
51 amount, thus changing the lighting of nodes which follow
52 in the scene graph.
53 Similarly, if you set the \vdirection\. field of the
54 \cSoDirectionalLightManip\., the manipulator will
55 orient the dragger accordingly.
56 \p
57 Because the dragger is a \ehidden\. child, you can see the dragger on screen
58 and interact with it, but the dragger
59 does not show up when you write the manipulator to file. Also, any \cSoPath\.
60 will end at the manipulator. (See the Actions section of this reference page for
61 a complete description of when the dragger is traversed).
62 \p
63 If you want to get a pointer to the dragger
64 you can get it from the manipulator using the
65 \m\+getDragger()\.\-SoDirLtManipGetDragger()\.\. method. You will need to
66 do this if you want to change the geometry of a manipulator, since the
67 geometry actually belongs to the dragger.
68 }
69
70 METHOD "" SoDirectionalLightManip() {
71 Constructor.
72 }
73
74 METHOD getDrag SoDragger *getDragger() {
75 Returns a pointer to the dragger being used by this manipulator.
76 Given this pointer, you can customize the dragger just like you would
77 any other dragger. You can change geometry using
78 the \m\+setPart()\.\-SoDragSetPart()\.\. method, or add callbacks using
79 the methods found in the \cSoDragger\. reference page.
80 }
81
82 METHOD "" SbBool replaceNode( SoPath *p ) {
83 Replaces the tail of the path with this manipulator.
84 The tail of the path must be an \cSoDirectionalLight\.
85 node (or subclass thereof).
86 If the path has a nodekit, this will try to use
87 \m\+setPart()\.\-SoBaseKitSetPart()\.\. to insert the manipulator.
88 Otherwise, the manipulator requires that the
89 next to last node in the path chain be a group.
90 \p
91 The field values from the directional light node will be copied to
92 this manipulator, and the light node will be replaced.
93 \p
94 The manipulator will not call
95 \m\+ref()\.\-SoDirLtRef()\.\. on the node it is replacing.
96 The old node will disappear if
97 it has no references other than from the input path \ap\. and its parent,
98 since this manipulator will be replacing it in both of those places.
99 Nor will the manipulator make any
100 changes to field connections of the old node.
101 The calling process is thus responsible for keeping
102 track of its own nodes and field connections.
103 }
104
105 METHOD "" SbBool replaceManip(SoPath *p, SoDirectionalLight *newOne ) const {
106 Replaces the tail of the path, which must be this manipulator,
107 with the given \cSoDirectionalLight\. node.
108 If the path has a nodekit, this will try to use
109 \m\+setPart()\.\-SoBaseKitSetPart()\.\. to insert the new node.
110 Otherwise, the manipulator requires that the
111 next to last node in the path chain be a group.
112 \p
113 The field values from the manipulator will be copied
114 to the directional light node, and the manipulator will be replaced.
115 \p
116 The manipulator will not call
117 \+\mref()\. or \munref()\.\.
118 \-\mSoDirLtRef()\. or \mSoDirLtUnref()\.\.
119 on the node which is replacing it, nor will it make any
120 changes to field connections.
121 The calling process is thus responsible for keeping
122 track of its own nodes and field connections.
123 }
124
125 METHOD "" static SoType getClassTypeId() {
126 Returns type identifier for this class.
127 }
128
129 ACTION SoGLRenderAction, SoCallbackAction,
130 SoGetBoundingBoxAction, SoGetMatrixAction,
131 SoHandleEventAction, SoRayPickAction {
132 First, traverses the dragger the way an \cSoGroup\. would. All draggers
133 place themselves in space, but leave the current transformation unchanged
134 when finished.
135 Then the \cSoDirectionalLightManip\. adds a
136 directional light to the state
137 just like its base class, \cSoDirectionalLight\..
138 }
139
140 ACTION SoSearchAction {
141 Searches just like an \cSoDirectionalLight\.. Does not search the dragger,
142 which is a hidden child.
143 }
144
145 ACTION SoWriteAction {
146 Writes out just like an \cSoDirectionalLight\.. Does not write the dragger,
147 which is a hidden child. If you really need to write valuable information
148 about the dragger, such as customized geometry, you
149 can retrieve the dragger with the
150 \m\+getDragger()\.\-SoDirLtManipGetDragger()\.\. method and then write
151 it out separately.
152 }
153
154 ALSO {
155 SoDragger,
156 SoDirectionalLight,
157 SoDirectionalLightDragger,
158 SoPointLightManip,
159 SoSpotLightManip
160 }
161