Component for editing directional lights. More...
#include <Inventor/Win/SoWinDirectionalLightEditor.h>
Public Types | |
typedef void | SoWinDirectionalLightEditorCB(void *userData, const SoDirectionalLight *light) |
Public Types inherited from SoWinComponent | |
typedef void | SoWinComponentCB(void *userData, SoWinComponent *comp) |
Public Member Functions | |
SoWinDirectionalLightEditor (SoWidget parent=NULL, const char *name=NULL, SbBool buildInsideParent=TRUE) | |
Constructor. | |
~SoWinDirectionalLightEditor () | |
Destructor. | |
void | attach (SoPath *pathToLight) |
Attaches the editor to a directional light. | |
void | detach () |
Detaches the editor from a directional light. | |
SbBool | isAttached () |
Returns TRUE if the editor is attached. | |
void | setLight (const SoDirectionalLight &newLight) |
Sets new light values. | |
const SoDirectionalLight & | getLight () const |
Gets the current light values. | |
void | addLightChangedCallback (SoWinDirectionalLightEditorCB *f, void *userData=NULL) |
Adds lightChanged callback. | |
void | removeLightChangedCallback (SoWinDirectionalLightEditorCB *f, void *userData=NULL) |
Removes the lightChanged callback. | |
virtual void | show () |
This shows the component. | |
virtual void | hide () |
This hides the component. | |
Public Member Functions inherited from SoWinComponent | |
SbBool | isVisible () |
Returns TRUE if this component is mapped onto the screen. | |
SoWidget | getWidget () const |
This returns the base window handle for this component. | |
SbBool | isTopLevelShell () const |
Returns TRUE if this component is a top level shell component (has its own window). | |
SoWidget | getShellWidget () const |
Returns the shell window handle (NULL if the shell hasn't been created by this component). | |
SoWidget | getParentWidget () const |
Returns the parent window handle, be it a shell or not. | |
void | setSize (const SbVec2s &size) |
Convenience routine on the window handle. | |
SbVec2s | getSize () |
Convenience routine on the window handle. | |
SbBool | setFullScreen (const SbBool enable) |
Switches the viewer into (or out of) fullscreen mode. | |
SbBool | isFullScreen () const |
Queries if the viewer is in fullscreen mode. | |
void | setFullScreenEnable (const SbBool enable) |
Enables/disables fullscreen mode. | |
SbBool | isFullScreenEnable (void) const |
Queries if it is possible to put the viewer in fullscreen mode. | |
UINT * | getDisplay () |
Included for portability only. | |
SoNONUNICODE void | setTitle (const char *newTitle) |
Sets window title. | |
void | setTitle (const SbString &newTitle) |
Sets window title. | |
SbString | getTitle () const |
Gets window title. | |
SoNONUNICODE void | setIconTitle (const char *newIconTitle) |
Included for portability only. | |
void | setIconTitle (const SbString &newIconTitle) |
Included for portability only. | |
SbString | getIconTitle () const |
Included for portability only. | |
void | setWindowCloseCallback (SoWinComponentCB *func, void *data=NULL) |
Sets which callback to call when the user closes this component (double click in the upper left corner) - by default hide() is called on this component, unless a callback is specified. | |
SbString | getWidgetName () const |
Returns the window handle name. | |
SbString | getClassName () const |
Returns the class name. | |
virtual | ~SoWinComponent () |
Destructor. | |
Public Attributes | |
SbBool | alwaysOnTop |
Public Attributes inherited from SoWinComponent | |
SbString | helpFileName |
Name of help file to open when the viewer Help button is pressed. | |
UINT | helpContextID |
The context ID of the help topic to open when the viewer Help button is pressed. | |
SbString | helpContextString |
The TopicID of the help topic to open when the viewer Help button is pressed. | |
Additional Inherited Members | |
Static Public Member Functions inherited from SoWinComponent | |
SoDEPRECATED static SoNONUNICODE void | displayHelp (const char *filename, UINT contextID) |
Static method to display the specified topic of the specified help file. | |
static SoDEPRECATED void | displayHelp (const SbString &filename, UINT contextID) |
Static method to display the specified topic of the specified help file. | |
static SoWinComponent * | getComponent (SoWidget w) |
Returns the SoWinComponent for this window handle. | |
Component for editing directional lights.
This class is used to edit an SoDirectionalLight node (color, intensity, and direction are changed). In addition to directly editing directional light nodes, the editor can also be used with callbacks which will be called whenever the light is changed. The component consists of a render area and a value slider in the main window, with controls to display a color picker. In the render area there appears a sphere representing the world, and a directional light manipulator representing the direction of the light. Picking on the manipulator and moving the mouse provides direct manipulation of the light direction. The color picker is used to edit the color, and the value slider edits the intensity.
The editor can currently be attached to only one light at a time. Attaching to two different lights will automatically detach the first one before attaching the second.
SoWinComponent, SoDirectionalLight
Definition at line 96 of file SoWinDirectionalLightEditor.h.
typedef void SoWinDirectionalLightEditorCB(void *userData, const SoDirectionalLight *light) |
Definition at line 61 of file SoWinDirectionalLightEditor.h.
SoWinDirectionalLightEditor::SoWinDirectionalLightEditor | ( | SoWidget | parent = NULL , |
const char * | name = NULL , |
||
SbBool | buildInsideParent = TRUE |
||
) |
Constructor.
SoWinDirectionalLightEditor::~SoWinDirectionalLightEditor | ( | ) |
Destructor.
|
inline |
Adds lightChanged callback.
This is an additional way of using the directional light editor, by registering a callback and setting the light.
Definition at line 256 of file SoWinDirectionalLightEditor.h.
void SoWinDirectionalLightEditor::attach | ( | SoPath * | pathToLight | ) |
Attaches the editor to a directional light.
When attached, changes made in the editor directly affect the attached light.
void SoWinDirectionalLightEditor::detach | ( | ) |
Detaches the editor from a directional light.
|
inline |
Gets the current light values.
Definition at line 131 of file SoWinDirectionalLightEditor.h.
|
virtual |
This hides the component.
It calls the appropriate unrealize or unmanage routines.
Reimplemented from SoWinComponent.
|
inline |
Returns TRUE if the editor is attached.
Definition at line 122 of file SoWinDirectionalLightEditor.h.
|
inline |
Removes the lightChanged callback.
Definition at line 262 of file SoWinDirectionalLightEditor.h.
void SoWinDirectionalLightEditor::setLight | ( | const SoDirectionalLight & | newLight | ) |
Sets new light values.
|
virtual |
This shows the component.
If this is a topLevelShell component, then show() will Realize and Map the window, else it will simply Manage the widget. In addition, show() will also pop the component window to the top and de-iconify if necessary, to make sure the component is visible by the user.
Reimplemented from SoWinComponent.
SbBool SoWinDirectionalLightEditor::alwaysOnTop |
Definition at line 155 of file SoWinDirectionalLightEditor.h.