1SoDirectionalLightManip(3IV)() SoDirectionalLightManip(3IV)()
2
3
4
6 SoDirectionalLightManip — directional light node with 3D interface for
7 editing direction
8
10 SoBase > SoFieldContainer > SoNode > SoLight > SoDirectionalLight >
11 SoDirectionalLightManip
12
14 #include <Inventor/manips/SoDirectionalLightManip.h>
15
16 Fields from class SoDirectionalLight:
17
18 SoSFVec3f direction
19
20 Fields from class SoLight:
21
22 SoSFBool on
23 SoSFFloat intensity
24 SoSFColor color
25
26 Methods from class SoDirectionalLightManip:
27
28 SoDirectionalLightManip()
29 SoDragger * getDragger()
30 SbBool replaceNode(SoPath *p )
31 SbBool replaceManip(SoPath *p, SoDirectionalLight *newOne )
32 const
33 static SoType getClassTypeId()
34
35 Methods from class SoNode:
36
37 void setOverride(SbBool state)
38 SbBool isOverride() const
39 SoNode * copy(SbBool copyConnections = FALSE) const
40 virtual SbBool affectsState() const
41 static SoNode * getByName(const SbName &name)
42 static int getByName(const SbName &name, SoNodeList &list)
43
44 Methods from class SoFieldContainer:
45
46 void setToDefaults()
47 SbBool hasDefaultValues() const
48 SbBool fieldsAreEqual(const SoFieldContainer *fc) const
49 void copyFieldValues(const SoFieldContainer *fc, SbBool
50 copyConnections = FALSE)
51 SbBool set(const char *fieldDataString)
52 void get(SbString &fieldDataString)
53 virtual int getFields(SoFieldList &resultList) const
54 virtual SoField * getField(const SbName &fieldName) const
55 SbBool getFieldName(const SoField *field, SbName &fieldName)
56 const
57 SbBool isNotifyEnabled() const
58 SbBool enableNotify(SbBool flag)
59
60 Methods from class SoBase:
61
62 void ref()
63 void unref() const
64 void unrefNoDelete() const
65 void touch()
66 virtual SoType getTypeId() const
67 SbBool isOfType(SoType type) const
68 virtual void setName(const SbName &name)
69 virtual SbName getName() const
70
71
73 SoDirectionalLightManip is the base class for all SoDirectionalLight
74 nodes that have a built-in 3D user interface (this is the only such
75 class provided with the Inventor toolkit). Since it is derived from
76 SoDirectionalLight, any changes to its fields result in a change of
77 lighting for nodes that follow it in the scene graph. In this case, the
78 interface edits the direction field. Also, the color of the manipula‐
79 tor's geometry will reflect the color of the light (but you cannot edit
80 the color using this manipulator).
81
82 Typically, you will want to replace a regular SoDirectionalLight with
83 an SoDirectionalLightManip (as when the user selects a light to be
84 edited), or vice versa (as when the user is done moving the light and
85 the interface should go away). Use the replaceNode() method to insert
86 a manipulator into a scene graph, and the replaceManip() method to
87 remove it when done.
88
89 The SoDirectionalLightManip utilizes an SoDirectionalLightDragger to
90 provide a 3D interface. However, the manipulator differs from the drag‐
91 ger; it lights other objects in the scene because, as an SoDirectional‐
92 Light, it alters the state. The field values and movement of the drag‐
93 ger, on the other hand, affect only the dragger itself. To find out
94 more about how the interface works and what each part will do, see the
95 reference page for SoDirectionalLightDragger. The interfaces of the
96 dragger and the manipulator are identical.
97
98 The SoDirectionalLightManip utilizes its dragger by adding it as a hid‐
99 den child. When an action is applied to the manipulator, such as ren‐
100 dering or handling events, the manipulator first traverses the dragger,
101 and then the manipulator adds its lighting parameters to the state.
102 When you click-drag-release over the manipulator, it passes these
103 events down to the dragger, which moves as a result ("I can't help it,
104 I'm a dragger!").
105
106 The manipulator maintains consistency between the fields of the dragger
107 and its own fields. Let's say you use the mouse to rotate the dragger.
108 Callbacks ensure that the direction field of the manipulator will
109 change by the same amount, thus changing the lighting of nodes which
110 follow in the scene graph. Similarly, if you set the direction field of
111 the SoDirectionalLightManip, the manipulator will orient the dragger
112 accordingly.
113
114 Because the dragger is a hidden child, you can see the dragger on
115 screen and interact with it, but the dragger does not show up when you
116 write the manipulator to file. Also, any SoPath will end at the manipu‐
117 lator. (See the Actions section of this reference page for a complete
118 description of when the dragger is traversed).
119
120 If you want to get a pointer to the dragger you can get it from the
121 manipulator using the getDragger() method. You will need to do this if
122 you want to change the geometry of a manipulator, since the geometry
123 actually belongs to the dragger.
124
126 SoDirectionalLightManip()
127 Constructor.
128
129 SoDragger * getDragger()
130 Returns a pointer to the dragger being used by this manipulator.
131 Given this pointer, you can customize the dragger just like you
132 would any other dragger. You can change geometry using the setPart()
133 method, or add callbacks using the methods found in the SoDragger
134 reference page.
135
136 SbBool replaceNode(SoPath *p )
137 Replaces the tail of the path with this manipulator. The tail of the
138 path must be an SoDirectionalLight node (or subclass thereof). If
139 the path has a nodekit, this will try to use setPart() to insert the
140 manipulator. Otherwise, the manipulator requires that the next to
141 last node in the path chain be a group.
142
143 The field values from the directional light node will be copied to
144 this manipulator, and the light node will be replaced.
145
146 The manipulator will not call ref() on the node it is replacing. The
147 old node will disappear if it has no references other than from the
148 input path p and its parent, since this manipulator will be replac‐
149 ing it in both of those places. Nor will the manipulator make any
150 changes to field connections of the old node. The calling process is
151 thus responsible for keeping track of its own nodes and field con‐
152 nections.
153
154 SbBool replaceManip(SoPath *p, SoDirectionalLight *newOne )
155 const
156 Replaces the tail of the path, which must be this manipulator, with
157 the given SoDirectionalLight node. If the path has a nodekit, this
158 will try to use setPart() to insert the new node. Otherwise, the
159 manipulator requires that the next to last node in the path chain be
160 a group.
161
162 The field values from the manipulator will be copied to the direc‐
163 tional light node, and the manipulator will be replaced.
164
165 The manipulator will not call ref() or unref() on the node which is
166 replacing it, nor will it make any changes to field connections. The
167 calling process is thus responsible for keeping track of its own
168 nodes and field connections.
169
170 static SoType getClassTypeId()
171 Returns type identifier for this class.
172
173
175 SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoGetMa‐
176 trixAction, SoHandleEventAction, SoRayPickAction
177 First, traverses the dragger the way an SoGroup would. All draggers
178 place themselves in space, but leave the current transformation
179 unchanged when finished. Then the SoDirectionalLightManip adds a
180 directional light to the state just like its base class, SoDirec‐
181 tionalLight.
182
183 SoSearchAction
184 Searches just like an SoDirectionalLight. Does not search the drag‐
185 ger, which is a hidden child.
186
187 SoWriteAction
188 Writes out just like an SoDirectionalLight. Does not write the drag‐
189 ger, which is a hidden child. If you really need to write valuable
190 information about the dragger, such as customized geometry, you can
191 retrieve the dragger with the getDragger() method and then write it
192 out separately.
193
194
196 DirectionalLightManip {
197 on TRUE
198 intensity 1
199 color 1 1 1
200 direction 0 0 -1
201 }
202
204 SoDragger, SoDirectionalLight, SoDirectionalLightDragger, SoPointLight‐
205 Manip, SoSpotLightManip
206
207
208
209
210 SoDirectionalLightManip(3IV)()