SoSpotLightManip Class |
Spotlight node with 3D interface for editing location, direction, and beam width.
Namespace: OIV.Inventor.Manips
The SoSpotLightManip type exposes the following members.
Name | Description | |
---|---|---|
SoSpotLightManip | Constructor. |
Name | Description | |
---|---|---|
AffectsState | Returns true if a node has an effect on the state during traversal. | |
Callback | (Overrides SoLightCallback(SoCallbackAction).) | |
Copy | Calls Copy(false). (Inherited from SoNode.) | |
Copy(Boolean) | Creates and returns an exact copy of the node. | |
CopyFieldValues(SoFieldContainer) | Calls CopyFieldValues(fc, false). (Inherited from SoFieldContainer.) | |
CopyFieldValues(SoFieldContainer, Boolean) | Copies the contents of fc's fields into this object's fields. | |
Dispose |
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.) | |
Distribute | (Inherited from SoNode.) | |
DoAction | (Overrides SoLightDoAction(SoAction).) | |
EnableNotify | Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false). | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
FieldsAreEqual | Returns true if this object's fields are exactly equal to fc's fields. | |
Get | Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
GetAllFields | Returns a list of fields, including the eventIn's and eventOut's. | |
GetAlternateRep | This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type). | |
GetBoundingBox | (Overrides SoNodeGetBoundingBox(SoGetBoundingBoxAction).) | |
GetDragger | Returns the dragger being used by this manipulator. | |
GetEventIn | Returns a the eventIn with the given name. | |
GetEventOut | Returns the eventOut with the given name. | |
GetField | Returns a the field of this object whose name is fieldName. | |
GetFieldName | Returns the name of the given field in the fieldName argument. | |
GetFields | Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetMatrix | (Overrides SoNodeGetMatrix(SoGetMatrixAction).) | |
GetName | Returns the name of an instance. | |
GetPrimitiveCount | (Inherited from SoNode.) | |
GetRenderEngineMode | Returns the supported Render engine mode. | |
GetRenderUnitID | (Inherited from SoNode.) | |
GetStringName | (Inherited from SoBase.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GLRender | (Overrides SoSpotLightGLRender(SoGLRenderAction).) | |
GLRenderBelowPath | (Inherited from SoNode.) | |
GLRenderInPath | (Inherited from SoNode.) | |
GLRenderOffPath | (Inherited from SoNode.) | |
GrabEventsCleanup | (Inherited from SoNode.) | |
GrabEventsSetup | (Inherited from SoNode.) | |
HandleEvent | (Overrides SoNodeHandleEvent(SoHandleEventAction).) | |
HasDefaultValues | Returns true if all of the object's fields have their default values. | |
IsBoundingBoxIgnoring | This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored. | |
IsNotifyEnabled | Notification is the process of telling interested objects that this object has changed. | |
IsOverride | Returns the state of the override flag. | |
IsSynchronizable | Gets the ScaleViz synchronizable state of this object. | |
Pick | (Overrides SoNodePick(SoPickAction).) | |
RayPick | (Inherited from SoNode.) | |
ReplaceManip | Replaces the tail of the path, which must be this manipulator, with the given OIV.Inventor.Nodes.SoSpotLight node. | |
ReplaceNode | Replaces the tail of the path with this manipulator. | |
Search | (Overrides SoNodeSearch(SoSearchAction).) | |
Set | 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. | |
SetName | (Inherited from SoBase.) | |
SetOverride | Turns the override flag on or off. | |
SetSynchronizable | Sets this to be a ScaleViz synchronizable object. | |
SetToDefaults | Sets all fields in this object to their default values. | |
ToString |
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.) | |
Touch | Marks an instance as modified, simulating a change to it. | |
Write | (Overrides SoNodeWrite(SoWriteAction).) |
Name | Description | |
---|---|---|
color | Light source illumination color. | |
cutOffAngle | Angle (in radians) outside of which intensity is zero, measured from the center axis of the cone to an edge. | |
direction | Principal direction of illumination (center axis of cone). | |
dropOffRate | Rate of intensity drop-off per change in angle from primary direction: 0 = constant intensity, 1 = very sharp drop-off. | |
intensity | Illumination intensity of light source. | |
IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) | |
location | Location of the source. | |
on | Determines whether the source is active or inactive. | |
UserData |
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.) |
OIV.Inventor.Manips.SoSpotLightManip is the base class for all OIV.Inventor.Nodes.SoSpotLight nodes that have a built-in 3D user interface (this is the only such class provided with the Open Inventor toolkit). Since it is derived from OIV.Inventor.Nodes.SoSpotLight, any changes to its fields result in a change of lighting for nodes that follow it in the scene graph. In this case, the interface edits the location , direction , and cutOffAngle fields. Also, the color of the manipulator's geometry will reflect the color of the light (but you can not edit the color using this manipulator).
Typically, you will want to replace a regular OIV.Inventor.Nodes.SoSpotLight with an OIV.Inventor.Manips.SoSpotLightManip (as when the user selects a light to be edited), or vice versa (as when the user is done moving the light and the interface should go away). Use the OIV.Inventor.Manips.SoSpotLightManip.ReplaceNode(OIV.Inventor.SoPath) method to insert a manipulator into a scene graph, and the OIV.Inventor.Manips.SoSpotLightManip.ReplaceManip(OIV.Inventor.SoPath, OIV.Inventor.Nodes.SoSpotLight) method to remove it when done.
The OIV.Inventor.Manips.SoSpotLightManip utilizes an OIV.Inventor.Draggers.SoSpotLightDragger to provide a 3D interface. However, the manipulator differs from the dragger; it lights other objects in the scene because, as an OIV.Inventor.Nodes.SoSpotLight, it alters the state. The fields values and movement of the dragger, on the other hand, affect only the dragger itself. To find out more about how the interface works and what each part will do, see the reference page for OIV.Inventor.Draggers.SoSpotLightDragger. The interfaces of the dragger and the manipulator are identical.
The OIV.Inventor.Manips.SoSpotLightManip utilizes its dragger by adding it as a hidden child. When an action is applied to the manipulator, such as rendering or handling events, the manipulator first traverses the dragger, and then the manipulator adds its lighting parameters to the state. When you click-drag-release over the manipulator, it passes these events down to the dragger, which moves as a result ("I can't <B> help </B> it, I'm a dragger!").
The manipulator maintains consistency between the fields of the dragger and its own fields. Let's say you use the mouse to widen the cone of the dragger . Callbacks insure that the cutOffAngle field of the manipulator will change by the same amount, thus changing the lighting of nodes which follow in the scene graph. Similarly, if you set the cutOffAngle field of the OIV.Inventor.Manips.SoSpotLightManip, the manipulator will widen the beam of the dragger accordingly.
Because the dragger is a hidden child, you can see the dragger on screen and interact with it, but the dragger does not show up when you write the manipulator to file. Also, any OIV.Inventor.SoPath will end at the manipulator. (See the Actions section of this reference page for a complete description of when the dragger is traversed).
You can get this dragger from the manipulator using the OIV.Inventor.Manips.SoSpotLightManip.GetDragger() method. You will need to do this if you want to change the geometry of a manipulator, since the geometry actually belongs to the dragger.
SpotLightManip {
on | true |
intensity | 1 |
color | 1 1 1 |
location | 0 0 1 |
direction | 0 0 -1 |
dropOffRate | 0 |
cutOffAngle | 0.785398 |
OIV.Inventor.Actions.SoGLRenderAction, OIV.Inventor.Actions.SoCallbackAction, OIV.Inventor.Actions.SoGetBoundingBoxAction, OIV.Inventor.Actions.SoGetMatrixAction, OIV.Inventor.Actions.SoHandleEventAction, OIV.Inventor.Actions.SoRayPickAction First, traverses the dragger the way an OIV.Inventor.Nodes.SoGroup would. All draggers place themselves in space, but leave the current transformation unchanged when finished. Then the OIV.Inventor.Manips.SoSpotLightManip adds a spotlight to the state, just like its base class, OIV.Inventor.Nodes.SoSpotLight.
OIV.Inventor.Actions.SoSearchAction Searches just like an OIV.Inventor.Nodes.SoSpotLight. Does not search the dragger, which is a hidden child.
OIV.Inventor.Actions.SoWriteAction Writes out just like an OIV.Inventor.Nodes.SoSpotLight. Does not write the dragger, which is a hidden child. If you really need to write valuable information about the dragger, such as customized geometry, you can retrieve the dragger with the OIV.Inventor.Manips.SoSpotLightManip.GetDragger() method and then write it out separately.