1SoSpotLightDragger(3IV)() SoSpotLightDragger(3IV)()
2
3
4
6 SoSpotLightDragger — spotlight shaped dragger that allows you to change
7 position, direction, and width of the beam
8
10 SoBase > SoFieldContainer > SoNode > SoBaseKit > SoInteractionKit >
11 SoDragger > SoSpotLightDragger
12
14 #include <Inventor/draggers/SoSpotLightDragger.h>
15
16 Fields from class SoSpotLightDragger:
17
18 SoSFRotation rotation
19 SoSFVec3f translation
20 SoSFFloat angle
21
22 Fields from class SoDragger:
23
24 SoSFBool isActive
25
26 Fields from class SoInteractionKit:
27
28 SoSFEnum renderCaching
29 SoSFEnum boundingBoxCaching
30 SoSFEnum renderCulling
31 SoSFEnum pickCulling
32
33 Parts from class SoBaseKit:
34
35 (SoNodeKitListPart) callbackList
36
37 Methods from class SoSpotLightDragger:
38
39 SoSpotLightDragger()
40 static const SoNodekitCatalog *
41 getClassNodekitCatalog() const
42 static SoType getClassTypeId()
43
44 Methods from class SoDragger:
45
46 void addStartCallback(SoDraggerCB *f, void *userData =
47 NULL)
48 void removeStartCallback(SoDraggerCB *f, void *userData =
49 NULL)
50 void addMotionCallback(SoDraggerCB *f, void *userData =
51 NULL)
52 void removeMotionCallback(SoDraggerCB *f, void *userData =
53 NULL)
54 void addFinishCallback(SoDraggerCB *f, void *userData =
55 NULL)
56 void removeFinishCallback(SoDraggerCB *f, void *userData =
57 NULL)
58 void addValueChangedCallback(SoDraggerCB *f, void *user‐
59 Data = NULL)
60 void removeValueChangedCallback(SoDraggerCB *f, void
61 *userData = NULL)
62 SbBool enableValueChangedCallbacks()
63 void setMinGesture(int pixels)
64 int getMinGesture() const
65 static void setMinScale(float newMinScale)
66 static float getMinScale()
67
68 Methods from class SoInteractionKit:
69
70 virtual SbBool setPartAsPath(const SbName &partName, SoPath *surro‐
71 gatePath )
72
73 Methods from class SoBaseKit:
74
75 virtual const SoNodekitCatalog *
76 getNodekitCatalog() const
77 virtual SoNode * getPart(const SbName &partName, SbBool
78 makeIfNeeded)
79 SbString getPartString(const SoBase *part)
80 virtual SoNodeKitPath * createPathToPart(const SbName &partName, SbBool
81 makeIfNeeded, const SoPath *pathToExtend =
82 NULL)
83 virtual SbBool setPart(const SbName &partName, SoNode *newPart)
84 SbBool set(char *partName, char *parameters)
85 SbBool set(char *nameValuePairs)
86 static SbBool isSearchingChildren()
87 static void setSearchingChildren(SbBool newVal)
88
89 Methods from class SoNode:
90
91 void setOverride(SbBool state)
92 SbBool isOverride() const
93 SoNode * copy(SbBool copyConnections = FALSE) const
94 virtual SbBool affectsState() const
95 static SoNode * getByName(const SbName &name)
96 static int getByName(const SbName &name, SoNodeList &list)
97
98 Methods from class SoFieldContainer:
99
100 void setToDefaults()
101 SbBool hasDefaultValues() const
102 SbBool fieldsAreEqual(const SoFieldContainer *fc) const
103 void copyFieldValues(const SoFieldContainer *fc, SbBool
104 copyConnections = FALSE)
105 void get(SbString &fieldDataString)
106 virtual int getFields(SoFieldList &resultList) const
107 virtual SoField * getField(const SbName &fieldName) const
108 SbBool getFieldName(const SoField *field, SbName &fieldName)
109 const
110 SbBool isNotifyEnabled() const
111 SbBool enableNotify(SbBool flag)
112
113 Methods from class SoBase:
114
115 void ref()
116 void unref() const
117 void unrefNoDelete() const
118 void touch()
119 virtual SoType getTypeId() const
120 SbBool isOfType(SoType type) const
121 virtual void setName(const SbName &name)
122 virtual SbName getName() const
123
124 Macros from class SoBaseKit:
125
126 SO_GET_PART(kit, partName, partClass)
127 SO_CHECK_PART(kit, partName, partClass)
128
129
131 SoSpotLightDragger is a composite dragger. It is shaped like a beam of
132 light emanating from a sun-like ball. An arrow runs along the axis of
133 the beam and extends past the end of the beam.
134
135 When you click and drag the beam, it opens and closes with an umbrella-
136 like motion. The angle between the center and edge of the beam is
137 stored in the angle field of this dragger; setting the angle field
138 causes the beam to widen or narrow in response. The spotlight dragger
139 does not use a standard dragger class to execute this motion. More
140 details are given later in this section.
141
142 Dragging the arrow rotates it arount the sun, and the beam moves with
143 it. The arrow is an SoRotateSphericalDragger that controls the rotation
144 field. See the reference page for SoDirectionalLightDragger, which
145 works the same way, for details.
146
147 The sun-shape can be dragged to translate all three pieces together
148 through 3-space. Its movement controls the translation field and works
149 exactly as described in the reference pages for SoDirectionalLightDrag‐
150 ger and SoPointLightDragger (which goes into more detail).
151
152 Remember: This is not a light source! It just looks like one. If you
153 want to move a light with this dragger, you can do the following:
154
155 [a] Use an SoSpotLightManip, which is subclassed from SoLight. It cre‐
156 ates an SoSpotLightDragger and uses it as the interface to change the
157 location, direction, and cutOffAngle of its light source (see the
158 SoSpotLightManip man page). The manip also edits the material part of
159 this dragger to match the color of light the manip is producing.
160
161 [b] Connect the angle field of this dragger to the cutOffAngle field of
162 an SoSpotLight with a field-to-field connection.
163
164 See the SoPointLightDragger and SoDirectionalLightDragger man pages for
165 other ways to control light parameters with the rotation and transla‐
166 tion fields.
167
168 This class creates its own projector and handles mouse events to do
169 it's own dragging of the beam angle. When the mouse picks a point on
170 the beam, that point is dragged in a circle just like in an SoRotate‐
171 DiscDragger, but the plane of the disc is re-defined every time a drag
172 is initiated. Imagine placing the metal tip of a compass at the apex of
173 the cone and the pencil tip at the picked point. If you swing an arc
174 through the central axis of the cone, you will be drawing the arc used
175 to drag the beam open and closed.
176
177 The beam is opened and closed not by rotating, but by scaling. The
178 dragger scales the beam-cone so that the height and radius change to
179 move the picked point along the circle. Then the angle field is calcu‐
180 lated from the height and radius.
181
182 You can change the geometry of parts in any instance of this dragger
183 using setPart(). The default part geometries are defined as resources
184 for this SoSpotLightDragger class. They are detailed below in the DRAG‐
185 GER RESOURCE section. You can make your program use different default
186 resources for the parts by copying the file /usr/share/data/draggerDe‐
187 faults/spotLightDragger.iv into your own directory, editing the file,
188 and then setting the environment variable SO_DRAGGER_DIR to be a path
189 to that directory.
190
192 SoSFRotation rotation
193 Orientation of the rotating part (an arrow by default).
194
195 SoSFVec3f translation
196 Position of the dragger.
197
198 SoSFFloat angle
199 Angle between center and edge of beam.
200
201
203 SoSpotLightDragger()
204 Constructor.
205
206 static const SoNodekitCatalog *
207 getClassNodekitCatalog() const
208 Returns an SoNodekitCatalog for this class
209
210 static SoType getClassTypeId()
211 Returns type identifier for this class.
212
213
215 ┌────────────────────────────────────────────────────────────────┐
216 │ All parts │
217 │ NULL by │
218 │Part Name Part Type Default Type Default │
219 │ │
220 │callbackList NodeKitListPart -- yes │
221 │material Material -- yes │
222 │translator DragPointDragger -- yes │
223 │rotator RotateSphericalDragger -- yes │
224 │beamPlacement Translation -- yes │
225 │beamScale Scale -- yes │
226 │beam Separator -- yes │
227 │beamActive Separator -- yes │
228 │ │
229 └────────────────────────────────────────────────────────────────┘
230 ┌───────────────────────────────────────────────────────────────┐
231 │ Extra information for list parts from above table │
232 │ │
233 │Part Name Container Type Permissible Types │
234 │ │
235 │callbackList Separator Callback, EventCallback │
236 │ │
237 └───────────────────────────────────────────────────────────────┘
239 .in 0n+.5i
240 Resource: spotLightBeam
241 .in 0n+.5i
242 Part: beam
243 Appearance: wire-frame cone with no SoMaterial node
244 Description: picking this initiates dragging of the beam angle. The
245 beam inherits colors from the material part, just
246 like the stationary version of the sun shape.
247
248 .in 0n+.5i
249 Resource: spotLightBeamActive
250 .in 0n+.5i
251 Part: beamActive
252 Appearance: yellow wire-frame cone
253 Description: displayed during dragging of the beam angle.
254
255 .in 0n+.5i
256 Resource: spotLightBeamPlacement
257 .in 0n+.5i
258 Part: beamPlacement
259 Appearance: translation of (0,0,-1)
260 Description: This translation node moves the beam parts relative to
261 the rest of the dragger. In this case, moving by
262 (0,0,-1) slides the cone outward along rotator part
263 toward its arrow-head. The distance chosen places the
264 apex of the cone on the surface of the sun shape.
265
266 .in 0n+.5i
267 Resource: spotLightRotatorRotator
268 .in 0n+.5i
269 Part: rotator.rotator
270 Appearance: white arrow that goes through the sun
271 Description: picking this begins rotation of the arrow about the
272 sun-shape
273
274 .in 0n+.5i
275 Resource: spotLightRotatorRotatorActive
276 .in 0n+.5i
277 Part: rotator.rotatorActive
278 Appearance: yellow arrow that goes through the sun
279 Description: displayed while the arrow is being rotated
280
281 .in 0n+.5i
282 Resource: spotLightRotatorFeedback
283 .in 0n+.5i
284 Part: rotator.feedback
285 Appearance: empty Separator
286 Description: this disables display of the axes that a rotateSpheri‐
287 cal dragger uses by default
288
289 .in 0n+.5i
290 Resource: spotLightRotatorFeedbackActive
291 .in 0n+.5i
292 Part: rotator.feedbackActive
293 Appearance: empty Separator
294 Description: this disables display of the axes that a rotateSpheri‐
295 cal dragger uses by default
296
297 .in 0n+.5i
298 Resource: spotLightOverallMaterial
299 .in 0n+.5i
300 Part: material
301 Appearance: white. half strength emissive, half strength diffuse
302 Description: sets material for the sun shape when stationary.
303 Resource for the moving sun, spotLightTranslatorPlan‐
304 eTranslatorActive, contains a yellow material for
305 highlighting.
306
307 .in 0n+.5i
308 Resource: spotLightTranslatorPlaneTranslator
309 .in 0n+.5i
310 Parts: translator.yzTranslator.translator
311 translator.xzTranslator.translator
312 translator.xyTranslator.translator
313 Appearance: sun shape with no material
314 Description: picking these parts initiates dragging by the yz, xz,
315 and xy planar draggers respectively.
316
317 .in 0n+.5i
318 Resource: spotLightTranslatorPlaneTranslatorActive
319 .in 0n+.5i
320 Parts: translator.yzTranslator.translatorActive
321 translator.xzTranslator.transla‐
322 torActive
323 translator.xyTranslator.transla‐
324 torActive
325 Appearance: yellow sun shape
326 Description: shown during planar dragging in the yz, xz, and xy
327 planes respectively.
328
329 .in 0n+.5i
330 Resource: spotLightTranslatorLineTranslator
331 .in 0n+.5i
332 Parts: translator.xTranslator.translator
333 translator.yTranslator.translator
334 translator.zTranslator.translator
335 Appearance: white cylinder
336 Description: picking these parts initiates dragging in the x, y, and
337 z linear draggers respectively.
338
339 .in 0n+.5i
340 Resource: spotLightTranslatorLineTranslatorActive
341 .in 0n+.5i
342 Parts: translator.xTranslator.translatorActive
343 translator.yTranslator.transla‐
344 torActive
345 translator.zTranslator.transla‐
346 torActive
347 Appearance: yellow cylinder
348 Description: shown during linear dragging in the x, y, and z direc‐
349 tions respectively.
350
351
353 SpotLightDragger {
354 renderCaching AUTO
355 boundingBoxCaching AUTO
356 renderCulling AUTO
357 pickCulling AUTO
358 isActive FALSE
359 rotation 0 0 1 0
360 translation 0 0 0
361 angle 1
362 callbackList NULL
363 material <spotLightOverallMaterial resource>
364 translator DragPointDragger {
365 }
366
367 rotator RotateSphericalDragger {
368 }
369
370 beamPlacement <spotLightBeamPlacement resource>
371 beamScale Scale {
372 scaleFactor 0.841471 0.841471 0.540302 }
373
374 beam <spotLightBeam resource>
375 beamActive <spotLightBeamActive resource>
376 rotator.rotator <spotLightRotatorRotator resource>
377 rotator.rotatorActive <spotLightRotatorRotatorActive resource>
378 rotator.feedback <spotLightRotatorFeedback resource>
379 rotator.feedbackActive <spotLightRotatorFeedbackActive resource>
380 translator.yzTranslator.translator <spotLightTranslatorPlaneTranslator resource>
381 translator.xzTranslator.translator <spotLightTranslatorPlaneTranslator resource>
382 translator.xyTranslator.translator <spotLightTranslatorPlaneTranslator resource>
383 translator.yzTranslator.translatorActive <spotLightTranslatorPlaneTranslatorActive resource>
384 translator.xzTranslator.translatorActive <spotLightTranslatorPlaneTranslatorActive resource>
385 translator.xyTranslator.translatorActive <spotLightTranslatorPlaneTranslatorActive resource>
386 translator.xTranslator.translator <spotLightTranslatorLineTranslator resource>
387 translator.yTranslator.translator <spotLightTranslatorLineTranslator resource>
388 translator.zTranslator.translator <spotLightTranslatorLineTranslator resource>
389 translator.xTranslator.translatorActive <spotLightTranslatorLineTranslatorActive resource>
390 translator.yTranslator.translatorActive <spotLightTranslatorLineTranslatorActive resource>
391 translator.zTranslator.translatorActive <spotLightTranslatorLineTranslatorActive resource>
392 }
393
395 SoInteractionKit, SoDragger, SoCenterballDragger, SoDirectionalLight‐
396 Dragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger,
397 SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger,
398 SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger,
399 SoScale2UniformDragger, SoScaleUniformDragger, SoTabBoxDragger, SoTab‐
400 PlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformer‐
401 Dragger, SoTranslate1Dragger, SoTranslate2Dragger
402
403
404
405
406 SoSpotLightDragger(3IV)()