Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoSpotLightDragger Class Reference

Spotlight shaped dragger that allows you to change position, direction, and width of the beam. More...

#include <Inventor/draggers/SoSpotLightDragger.h>

+ Inheritance diagram for SoSpotLightDragger:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
virtual const SoNodekitCataloggetNodekitCatalog () const
 Returns the SoNodekitCatalog for this instance.
 
 SoSpotLightDragger ()
 Constructor.
 
- Public Member Functions inherited from SoDragger
void addStartCallback (SoDraggerCB *f, void *userData=NULL)
 Adds start callback.
 
void removeStartCallback (SoDraggerCB *f, void *userData=NULL)
 Removes start callback.
 
void addMotionCallback (SoDraggerCB *f, void *userData=NULL)
 Adds motion callback.
 
void removeMotionCallback (SoDraggerCB *f, void *userData=NULL)
 Removes motion callback.
 
void addFinishCallback (SoDraggerCB *f, void *userData=NULL)
 Adds finish callback.
 
void removeFinishCallback (SoDraggerCB *f, void *userData=NULL)
 Removes finish callback.
 
void addValueChangedCallback (SoDraggerCB *f, void *userData=NULL)
 Adds value-changed callback.
 
void removeValueChangedCallback (SoDraggerCB *f, void *userData=NULL)
 Removes value-changed callback.
 
void setMinGesture (int pixels)
 Sets the number of pixels of movement required to initiate a constraint gesture.
 
void setMinGesture (float pixels)
 Float version of setMinGesture.
 
int getMinGesture () const
 Gets the number of pixels of movement required to initiate a constraint gesture.
 
float getMinGestureFloat () const
 Float version of getMinGesture.
 
SbBool enableValueChangedCallbacks (SbBool newVal)
 You can temporarily disable a dragger's valueChangedCallbacks.
 
void setTrackerDirectMode (TrackerDirectMode mode=DEFAULT)
 Sets the tracker direct mode for this dragger (see description above).
 
TrackerDirectMode getTrackerDirectMode () const
 Get the current tracker direct mode for this dragger.
 
void setMotionMatrix (const SbMatrix &newMatrix)
 Set the motion matrix.
 
const SbMatrixgetMotionMatrix ()
 Get the motion matrix.
 
- Public Member Functions inherited from SoInteractionKit
virtual SbBool setPartAsPath (const SbName &partName, SoPath *surrogatePath)
 Sets any public part in the interaction kit as a "surrogate" path instead.
 
virtual SbBool affectsState () const
 Returns TRUE if a node has an effect on the state during traversal.
 
- Public Member Functions inherited from SoBaseKit
 SoBaseKit ()
 Constructor.
 
virtual SoNodegetPart (const SbName &partName, SbBool makeIfNeeded)
 Searches the nodekit catalog (and those of all nested nodekits) for the part named partName.
 
template<typename PartType >
PartType * getPart (const SbName &partName)
 Like getPart(const SbName&,SbBool) but casts the returned part to the specified type and sets the makeIfNeeded parameter to TRUE.
 
template<typename PartType >
PartType * checkPart (const SbName &partName)
 Like getPart(const SbName&,SbBool) but casts the returned part to the specified type and sets the makeIfNeeded parameter to FALSE.
 
SbString getPartString (const SoBase *part)
 Given a node or a path to a node, checks if the part exists in the nodekit, in a nested nodekit, or an element of a list part.
 
virtual SoNodeKitPathcreatePathToPart (const SbName &partName, SbBool makeIfNeeded, const SoPath *pathToExtend=NULL)
 Returns a path that begins at this nodekit and ends at partName.
 
virtual SbBool setPart (const SbName &partName, SoNode *newPart)
 Inserts the given node (not a copy) as the new part specified by partName.
 
SoNONUNICODE SbBool set (char *nameValuePairListString)
 This function allows field values of parts (nodes) to be set in several different parts simultaneously.
 
SbBool set (const SbString &nameValuePairListString)
 This function allows field values of parts (nodes) to be set in several different parts simultaneously.
 
SoNONUNICODE SbBool set (const char *partNameString, const char *parameterString)
 This function allows field values of parts (nodes) to be set.
 
SbBool set (const SbString &partNameString, const SbString &parameterString)
 This function allows field values of parts (nodes) to be set.
 
- Public Member Functions inherited from SoNode
virtual void setOverride (const SbBool state)
 Turns the override flag on or off.
 
virtual SbBool isOverride () const
 Returns the state of the override flag.
 
virtual SoNodecopy (SbBool copyConnections=FALSE) const
 Creates and returns an exact copy of the node.
 
virtual void touch ()
 Marks an instance as modified, simulating a change to it.
 
- Public Member Functions inherited from SoFieldContainer
void setToDefaults ()
 Sets all fields in this object to their default values.
 
SbBool hasDefaultValues () const
 Returns TRUE if all of the object's fields have their default values.
 
SbBool fieldsAreEqual (const SoFieldContainer *fc) const
 Returns TRUE if this object's fields are exactly equal to fc's fields.
 
void copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE)
 Copies the contents of fc's fields into this object's fields.
 
SoNONUNICODE SbBool set (const char *fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
SbBool set (const SbString &fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
void get (SbString &fieldDataString)
 Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.
 
virtual int getFields (SoFieldList &list) const
 Appends references to all of this object's fields to resultList, and returns the number of fields appended.
 
virtual int getAllFields (SoFieldList &list) const
 Returns a list of fields, including the eventIn's and eventOut's.
 
virtual SoFieldgetField (const SbName &fieldName) const
 Returns a the field of this object whose name is fieldName.
 
virtual SoFieldgetEventIn (const SbName &fieldName) const
 Returns a the eventIn with the given name.
 
virtual SoFieldgetEventOut (const SbName &fieldName) const
 Returns the eventOut with the given name.
 
SbBool getFieldName (const SoField *field, SbName &fieldName) const
 Returns the name of the given field in the fieldName argument.
 
SbBool enableNotify (SbBool flag)
 Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE).
 
SbBool isNotifyEnabled () const
 Notification is the process of telling interested objects that this object has changed.
 
virtual void setUserData (void *data)
 Sets application data.
 
void * getUserData (void) const
 Gets user application data.
 
- Public Member Functions inherited from SoBase
virtual SbName getName () const
 Returns the name of an instance.
 
virtual void setName (const SbName &name)
 Sets the name of an instance.
 
void setSynchronizable (const bool b)
 Sets this to be a ScaleViz synchronizable object.
 
bool isSynchronizable () const
 Gets the ScaleViz synchronizable state of this object.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 
- Public Member Functions inherited from SoGetView
 SoGetView ()
 Default constructor.
 
virtual ~SoGetView ()
 
virtual SbBool getViewportIsEnabled () const
 Returns TRUE if SoGetView functionalities are enabled, FALSE otherwise.
 
virtual const SbVec2f getViewportOrigin () const
 Returns SbViewportRegion origin.
 
virtual const SbVec2f getViewportSize () const
 Returns SbViewportRegion size.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static const SoNodekitCataloggetClassNodekitCatalog ()
 Returns the SoNodekitCatalog for this class.
 
- Static Public Member Functions inherited from SoDragger
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static const SoNodekitCataloggetClassNodekitCatalog ()
 Returns the SoNodekitCatalog for this class.
 
static void setMinScale (float newMinScale)
 Sets the smallest scale that any dragger will write.
 
static float getMinScale ()
 Gets the smallest scale that any dragger will write.
 
static void setInitialTrackerDirectMode (TrackerDirectMode mode=DEFAULT)
 Set the initial tracker direct mode for draggers not yet created.
 
static TrackerDirectMode getInitialTrackerDirectMode ()
 Get the initial tracker direct mode.
 
- Static Public Member Functions inherited from SoInteractionKit
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static const SoNodekitCataloggetClassNodekitCatalog ()
 Returns the SoNodekitCatalog for this class.
 
- Static Public Member Functions inherited from SoBaseKit
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static const SoNodekitCataloggetClassNodekitCatalog ()
 Returns the SoNodekitCatalog for the class SoBaseKit.
 
static void setSearchingChildren (SbBool newVal)
 Sets if nodekit children are searched during SoSearchAction traversal.
 
static SbBool isSearchingChildren ()
 Returns TRUE if nodekit children are searched during SoSearchAction traversal.
 
- Static Public Member Functions inherited from SoNode
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static SoNodegetByName (const SbName &name)
 A node's name can be set using SoBase::setName().
 
static int getByName (const SbName &name, SoNodeList &list)
 A node's name can be set using SoBase::setName().
 
- Static Public Member Functions inherited from SoFieldContainer
static SoType getClassTypeId ()
 Returns the type of this class.
 
- Static Public Member Functions inherited from SoBase
static SoType getClassTypeId ()
 Returns type identifier for this class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Public Attributes

SoSFRotation rotation
 Orientation of the rotating part (an arrow by default).
 
SoSFVec3f translation
 Position of the dragger.
 
SoSFFloat angle
 Angle between center and edge of beam.
 
- Public Attributes inherited from SoDragger
SoSFBool isActive
 TRUE when mouse is down and dragging, else FALSE.
 
SoSFBool enableCallbacks
 If set to FALSE, motion, start and finish callbacks are disabled.
 
- Public Attributes inherited from SoInteractionKit
SoSFEnum boundingBoxCaching
 Set bounding box caching mode.
 
SoSFEnum renderCulling
 Set render culling mode.
 
SoSFEnum pickCulling
 Set pick caching mode.
 
SoDEPRECATED SoSFEnum renderCaching
 Set render caching mode.
 
- Public Attributes inherited from SoBaseKit
SoSFBool boundingBoxIgnoring
 Whether to ignore this node during bounding box traversal.
 

Additional Inherited Members

- Public Types inherited from SoDragger
enum  TrackerDirectMode {
  NONE ,
  MOVE ,
  ROTATE ,
  FREE ,
  DEFAULT
}
 Tracker direct mode. More...
 
typedef void SoDraggerCB(void *userData, SoDragger *dragger)
 Used in defining the callback function lists.
 
- Public Types inherited from SoInteractionKit
enum  CacheEnabled {
  OFF ,
  ON ,
  AUTO
}
 Possible values for caching. More...
 

Detailed Description

Spotlight shaped dragger that allows you to change position, direction, and width of the beam.

SoSpotLightDragger is a composite dragger. It is shaped like a beam of light emanating from a sun-like ball. An arrow runs along the axis of the beam and extends past the end of the beam.

When you click and drag the beam, it opens and closes with an umbrella-like motion. The angle between the center and edge of the beam is stored in the angle field of this dragger; setting the angle field causes the beam to widen or narrow in response. The spotlight dragger does not use a standard dragger class to execute this motion. More details are given later in this section.

Dragging the arrow rotates it around the sun, and the beam moves with it. The arrow is an SoRotateSphericalDragger that controls the rotation field. See the reference page for SoDirectionalLightDragger, which works the same way, for details.

The sun-shape can be dragged to translate all three pieces together through 3-space. Its movement controls the translation field and works exactly as described in the reference pages for SoDirectionalLightDragger and SoPointLightDragger (which goes into more detail).

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

  • Use an SoSpotLightManip, which is subclassed from SoLight. It creates an SoSpotLightDragger and uses it as the interface to change the location , direction , and cutOffAngle of its light source (see the SoSpotLightManip reference page). The manip also edits the material part of this dragger to match the color of light the manip is producing.
  • Connect the angle field of this dragger to the cutOffAngle field of an SoSpotLight with a field-to-field connection.

See the SoPointLightDragger and SoDirectionalLightDragger reference pages for other ways to control light parameters with the rotation and translation fields.

This class creates its own projector and handles mouse events to do its own dragging of the beam angle. When the mouse picks a point on the beam, that point is dragged in a circle just like in an SoRotateDiscDragger, but the plane of the disc is re-defined every time a drag is initiated. Imagine placing the metal tip of a compass at the apex of the cone and the pencil tip at the picked point. If you swing an arc through the central axis of the cone, you will be drawing the arc used to drag the beam open and closed.

The beam is opened and closed not by rotating, but by scaling. The dragger scales the beam-cone so that the height and radius change to move the picked point along the circle. Then the angle field is calculated from the height and radius.

You can change the geometry of parts in any instance of this dragger using setPart(). The default part geometries are defined as resources for this SoSpotLightDragger class. They are detailed below in the DRAGGER RESOURCE section. You can make your program use different default resources for the parts by copying the file $OIVHOME/data/draggerDefaults/spotLightDragger.iv into your own directory, editing the file, and then setting the environment variable SO_DRAGGER_DIR to be a path to that directory.

See SoDragger for more information about using and customizing draggers, including code examples, using draggers in an immersive VR environment and using WYSIWYG draggers.

FILE FORMAT/DEFAULT

    SpotLightDragger {
    boundingBoxCaching AUTO
    renderCulling AUTO
    pickCulling AUTO
    isActive FALSE
    rotation 0 0 1 0
    translation 0 0 0
    angle 1
    callbackList NULL
    material <spotLightOverallMaterial resource>
    translator DragPointDragger { }
    rotator RotateSphericalDragger { }
    beamPlacement <spotLightBeamPlacement resource>
    beamScale Scale {
     scaleFactor 0.841471 0.841471 0.540302
    }
    beam <spotLightBeam resource>
    beamActive <spotLightBeamActive resource>
    rotator.rotator <spotLightRotatorRotator resource>
    rotator.rotatorActive <spotLightRotatorRotatorActive resource>
    rotator.feedback <spotLightRotatorFeedback resource>
    rotator.feedbackActive <spotLightRotatorFeedbackActive resource>
    translator.yzTranslator.translator <spotLightTranslatorPlaneTranslator resource>
    translator.xzTranslator.translator <spotLightTranslatorPlaneTranslator resource>
    translator.xyTranslator.translator <spotLightTranslatorPlaneTranslator resource>
    translator.yzTranslator.translatorActive <spotLightTranslatorPlaneTranslatorActive resource>
    translator.xzTranslator.translatorActive <spotLightTranslatorPlaneTranslatorActive resource>
    translator.xyTranslator.translatorActive <spotLightTranslatorPlaneTranslatorActive resource>
    translator.xTranslator.translator <spotLightTranslatorLineTranslator resource>
    translator.yTranslator.translator <spotLightTranslatorLineTranslator resource>
    translator.zTranslator.translator <spotLightTranslatorLineTranslator resource>
    translator.xTranslator.translatorActive <spotLightTranslatorLineTranslatorActive resource>
    translator.yTranslator.translatorActive <spotLightTranslatorLineTranslatorActive resource>
    translator.zTranslator.translatorActive <spotLightTranslatorLineTranslatorActive resource>
    }

DRAGGER RESOURCES

    Resource: spotLightBeam
    Part: beam
    Appearance: wireframe cone with no SoMaterial node
    Description: picking this initiates dragging of the beam angle. The beam inherits colors from the material part, just like the stationary version of the sun shape.

    Resource: spotLightBeamActive
    Part: beamActive
    Appearance: yellow wireframe cone
    Description: displayed during dragging of the beam angle.

    Resource: spotLightBeamPlacement
    Part: beamPlacement
    Appearance: translation of (0,0,-1)
    Description: This translation node moves the beam parts relative to the rest of the dragger. In this case, moving by (0,0,-1) slides the cone outward along rotator part toward its arrowhead. The distance chosen places the apex of the cone on the surface of the sun shape.

    Resource: spotLightRotatorRotator
    Part: rotator.rotator
    Appearance: white arrow that goes through the sun
    Description: picking this begins rotation of the arrow about the sun-shape

    Resource: spotLightRotatorRotatorActive
    Part: rotator.rotatorActive
    Appearance: yellow arrow that goes through the sun
    Description: displayed while the arrow is being rotated

    Resource: spotLightRotatorFeedback
    Part: rotator.feedback
    Appearance: empty Separator
    Description: this disables display of the axes that a rotateSpherical dragger uses by default

    Resource: spotLightRotatorFeedbackActive
    Part: rotator.feedbackActive
    Appearance: empty Separator
    Description: this disables display of the axes that a rotateSpherical dragger uses by default

    Resource: spotLightOverallMaterial
    Part: material
    Appearance: white. half strength emissive, half strength diffuse
    Description: sets material for the sun shape when stationary. Resource for the moving sun, spotLightTranslatorPlaneTranslatorActive, contains a yellow material for highlighting.

    Resource: spotLightTranslatorPlaneTranslator
    Parts: translator.yzTranslator.translator<BR> translator.xzTranslator.translator<BR> translator.xyTranslator.translator
    Appearance: sun shape with no material
    Description: picking these parts initiates dragging by the yz, xz, and xy planar draggers respectively.

    Resource: spotLightTranslatorPlaneTranslatorActive
    Parts: translator.yzTranslator.translatorActive<BR> translator.xzTranslator.translatorActive<BR> translator.xyTranslator.translatorActive
    Appearance: yellow sun shape
    Description: shown during planar dragging in the yz, xz, and xy planes respectively.

    Resource: spotLightTranslatorLineTranslator
    Parts: translator.xTranslator.translator<BR> translator.yTranslator.translator<BR> translator.zTranslator.translator
    Appearance: white cylinder
    Description: picking these parts initiates dragging in the x, y, and z linear draggers respectively.

    Resource: spotLightTranslatorLineTranslatorActive
    Parts: translator.xTranslator.translatorActive<BR> translator.yTranslator.translatorActive<BR> translator.zTranslator.translatorActive
    Appearance: yellow cylinder
    Description: shown during linear dragging in the x, y, and z directions respectively.

CATALOG PARTS

    All Parts
    Part Name Part Type Default Type NULL Default
    callbackList NodeKitListPart yes
    material Material yes
    translator DragPointDragger yes
    rotator RotateSphericalDragger yes
    beamPlacement Translation yes
    beamScale Scale yes
    beam Separator yes
    beamActive Separator yes

    Extra Information for List Parts from Above Table

    Part Name Container Type Possible Types
    callbackList Separator Callback, EventCallback

SEE ALSO

SoInteractionKit, SoDragger, SoCenterballDragger, SoDirectionalLightDragger, SoDragPointDragger, SoHandleBoxDragger, SoJackDragger, SoPointLightDragger, SoRotateCylindricalDragger, SoRotateDiscDragger, SoRotateSphericalDragger, SoScale1Dragger, SoScale2Dragger, SoScale2UniformDragger, SoScaleUniformDragger, SoTabBoxDragger, SoTabPlaneDragger, SoTrackballDragger, SoTransformBoxDragger, SoTransformerDragger, SoTranslate1Dragger, SoTranslate2Dragger

Definition at line 364 of file SoSpotLightDragger.h.

Constructor & Destructor Documentation

◆ SoSpotLightDragger()

SoSpotLightDragger::SoSpotLightDragger ( )

Constructor.

Member Function Documentation

◆ getClassNodekitCatalog()

static const SoNodekitCatalog * SoSpotLightDragger::getClassNodekitCatalog ( )
static

Returns the SoNodekitCatalog for this class.

◆ getClassTypeId()

static SoType SoSpotLightDragger::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getNodekitCatalog()

virtual const SoNodekitCatalog * SoSpotLightDragger::getNodekitCatalog ( ) const
virtual

Returns the SoNodekitCatalog for this instance.

Reimplemented from SoDragger.

◆ getTypeId()

virtual SoType SoSpotLightDragger::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoDragger.

Member Data Documentation

◆ angle

SoSFFloat SoSpotLightDragger::angle

Angle between center and edge of beam.

Definition at line 411 of file SoSpotLightDragger.h.

◆ rotation

SoSFRotation SoSpotLightDragger::rotation

Orientation of the rotating part (an arrow by default).

Definition at line 401 of file SoSpotLightDragger.h.

◆ translation

SoSFVec3f SoSpotLightDragger::translation

Position of the dragger.

Definition at line 406 of file SoSpotLightDragger.h.


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