OpenCMISS-Zinc C++ API Documentation
Public Member Functions | Protected Attributes | List of all members
OpenCMISS::Zinc::Lightmodule Class Reference

Module managing all light objects. More...

#include <light.hpp>

Public Member Functions

 Lightmodule (cmzn_lightmodule_id in_lightmodule_id)
 
 Lightmodule (const Lightmodule &lightModule)
 
Lightmoduleoperator= (const Lightmodule &lightModule)
 
bool isValid () const
 
cmzn_lightmodule_id getId () const
 
Light createLight ()
 
Lightiterator createLightiterator ()
 
Light findLightByName (const char *name)
 
int beginChange ()
 
int endChange ()
 
Light getDefaultLight ()
 
int setDefaultLight (const Light &light)
 
Light getDefaultAmbientLight ()
 
int setDefaultAmbientLight (const Light &light)
 

Protected Attributes

cmzn_lightmodule_id id
 

Detailed Description

Module managing all light objects.

Module managing all light objects. It maintains separate default lights for directional head-lights and for ambient lights (background lighting from all directions), which are automatically added to new scene viewers.

Member Function Documentation

int OpenCMISS::Zinc::Lightmodule::beginChange ( )
inline

Begin caching or increment cache level for this light module. Call this function before making multiple changes to minimise number of change messages sent to clients. Must remember to end_change after completing changes. Can be nested.

See also
Lightmodule::endChange
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
Light OpenCMISS::Zinc::Lightmodule::createLight ( )
inline

Create a new light, initialised with default settings. Following creation, the caller is expected to set the type and settings such as colour, direction and/or position as appropriate for the type.

Returns
Handle to new light, or NULL/invalid handle on failure.
Lightiterator OpenCMISS::Zinc::Lightmodule::createLightiterator ( )
inline

Create a light iterator object for iterating through the lights in the light module, in alphabetical order of name. The iterator initially points at the position before the first light, so the first call to the iterator next() method returns the first light and advances the iterator. The iterator becomes invalid if lights are added, removed or renamed while in use.

See also
Lightiterator::next

lights are to be iterated over.

Returns
Handle to light iterator, or NULL/invalid handle on failure.
int OpenCMISS::Zinc::Lightmodule::endChange ( )
inline

Decrement cache level or end caching of changes for the light module. Call light module begin change method before making multiple changes and call this afterwards. When change level is restored to zero, cached change messages are sent out to clients.

See also
Lightmodule::beginChange
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
Light OpenCMISS::Zinc::Lightmodule::findLightByName ( const char *  name)
inline

Find the light with the specified name, if any.

Parameters
nameThe name of the light.
Returns
Handle to light, or NULL/invalid handle if not found or failed.
Light OpenCMISS::Zinc::Lightmodule::getDefaultAmbientLight ( )
inline

Get the default ambient light to be used in new scene viewers. If none, one is automatically created with RGB colour value of [0.2, 0.2, 0.2]. Note that the colour of this light and the default light sum to 1.0 to ensure colours of graphics are not oversaturated with default settings.

Returns
Handle to default ambient light, or NULL/invalid handle if none or failed.
Light OpenCMISS::Zinc::Lightmodule::getDefaultLight ( )
inline

Get the default light to be used in sceneviewer. If there is none, a default directional light is automatically created with RGB value of [0.8, 0.8, 0.8] and [0.0, -0.5, -1.0] for its direction i.e. into the screen and slightly down. Note that the colour of this light and the default ambient light sum to 1.0 to ensure colours of graphics are not oversaturated with default settings.

Returns
Handle to default light, or NULL/invalid handle if none or failed.
cmzn_lightmodule_id OpenCMISS::Zinc::Lightmodule::getId ( ) const
inline

Return the C handle of the Lightmodule object.

Returns
C handle of Lightmodule if this objects is valid, 0 otherwise.
bool OpenCMISS::Zinc::Lightmodule::isValid ( ) const
inline

Check if this is a valid Lightmodule object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Lightmodule::setDefaultAmbientLight ( const Light light)
inline

Set the default ambient light, this default ambient light will be used by any scene viewers created afterward.

Parameters
lightThe light to set as default ambient light.
Returns
OpenCMISS::Zinc::OK on success otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Lightmodule::setDefaultLight ( const Light light)
inline

Set the default light, this default light will be used by any sceneviewer created afterward. Typically this is expected to be a directional light; not expected to be of ambient type.

Parameters
lightThe light to set as the default light.
Returns
OpenCMISS::Zinc::OK on success otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.

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