Open Inventor Reference
SoPointLightDragger Class Reference

Sun-shaped icon you can translate in 3D by dragging with the mouse. More...

#include <Inventor/draggers/SoPointLightDragger.h>

Inheritance diagram for SoPointLightDragger:
SoDragger SoInteractionKit SoBaseKit SoNode SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoPointLightDragger ()
 Constructor.

Static Public Member Functions

static void initClass ()
 initialize the class

Public Attributes

SoSFVec3f translation

Protected Member Functions

virtual SbBool setUpConnections (SbBool onOff, SbBool doItAlways=FALSE)
 detach/attach any sensors, callbacks, and/or field connections.
virtual void setDefaultOnNonWritingFields ()
 Called by the SoBaseKit::write() method.
virtual ~SoPointLightDragger ()

Static Protected Member Functions

static void fieldSensorCB (void *, SoSensor *)
static void valueChangedCB (void *, SoDragger *)

Protected Attributes

SoFieldSensorfieldSensor
 This sensor will watch the topSeparator part.

Detailed Description

SoPointLightDragger is a dragger that looks like a point light source, can be translated in three directions, and has a translation field that always reflects its position in local space. The point light dragger also has a special material part which can be used to make it take on the color of a light source.

Remember: This is not a light source! It just looks like one. If you want to move a light with this dragger, you can either:

[a] Use an SoPointLightManip, which is subclassed from SoLight. It creates one of these draggers and uses it as the interface to change the location of its light source (see the SoPointLightManip reference page). The manipulator also edits the material part of this dragger to match the color of light the manipulator is producing.

[b] Use a field-to-field connection to connect the location of a light source from this dragger's translation field.

This dragger contains an SoDragPointDragger, which you drag through 3-space using an integrated set of linear and planar draggers. (For detailed information on how to use SoDragPointDragger, see its reference page.) The point light dragger sets the planar translation parts of this dragPoint dragger with a new default that looks like a shining sun emanating rays of light (okay, so use your imagination).

By changing the material part you can change the color of the sun shape, because the default part contains no SoMaterial nodes. This fact enables the SoPointLightManip (not the dragger, the manipulator) to color its dragger to match the color of the light it is emanating. Recall that a point light manip is derived from SoLight and creates a point light dragger to provide an interface and geometrical presence on screen. The manipulator also has a color field; when the light color changes, it changes the material part of its dragger so that they match.

You can change the parts in any instance of this dragger using setPart().

The default part geometries are defined as resources for this SoPointLightDragger class. They are detailed in the Dragger Resources section of the online reference page for this class. You can make your program use different default resources for the parts by copying the file /usr/share/data/draggerDefaults/pointLightDragger.iv into your own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to that directory.

File Format/Default
See Also
SoInteractionKit, SoDragger, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoSpotLightDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger

Definition at line 183 of file SoPointLightDragger.h.


Constructor & Destructor Documentation

SoPointLightDragger::SoPointLightDragger ( )
virtual SoPointLightDragger::~SoPointLightDragger ( ) [protected, virtual]

Member Function Documentation

static void SoPointLightDragger::fieldSensorCB ( void *  ,
SoSensor  
) [static, protected]

Reimplemented from SoInteractionKit.

static void SoPointLightDragger::initClass ( ) [static]

Reimplemented from SoDragger.

virtual void SoPointLightDragger::setDefaultOnNonWritingFields ( ) [protected, virtual]

Draggers don't want to write out fields if they have default vals.

sets isActive to default if default and not connected.

Looks for fields named: 'rotation' with value SbRotation::identity() 'translation' with value (0,0,0) 'center' with value (0,0,0) 'scaleFactor' with value (1,1,1) and sets them to default if they are not connected from a field. (most draggers are missing at least some of these, but thats okay)

Then calls the method for SoInteractionKit.

NOTE: Parts which are set to default may still wind up writing to file if, for example, they lie on a path.

Reimplemented from SoDragger.

virtual SbBool SoPointLightDragger::setUpConnections ( SbBool  onOff,
SbBool  doItAlways = FALSE 
) [protected, virtual]

Also set geometry of childDraggers to be our default instead of their regular default, using our resources. Called by: start/end of SoBaseKit::readInstance and on new copy by: start/end of SoBaseKit::copy. Classes that redefine must call setUpConnections(TRUE,TRUE) at end of constructor. Returns the state of the node when this was called.

Reimplemented from SoInteractionKit.

static void SoPointLightDragger::valueChangedCB ( void *  ,
SoDragger  
) [static, protected]

Member Data Documentation

If the part changes to a new node, then the fields of the old part will be disconnected and the fields of the new part will be connected. Connections are made from/to the renderCaching, boundingBoxCaching, renderCulling and pickCulling fields. This way, the SoInteractionKit can be treated from the outside just like a regular SoSeparator node. Setting the fields will affect caching and culling, even though the topSeparator takes care of it. oldTopSep keeps track of the part for comparison.

Reimplemented from SoInteractionKit.

Definition at line 205 of file SoPointLightDragger.h.


The documentation for this class was generated from the following file: