ufe 5.5
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
|
Abstract base class for light interface. More...
#include <light.h>
Classes | |
class | AreaInterface |
class | ConeInterface |
struct | ConeProps |
class | DirectionalInterface |
class | SphereInterface |
struct | SphereProps |
Public Types | |
enum | Type { Invalid , Directional , Point , Spot , Area , Sphere , Cylinder , Disk , Dome } |
typedef std::shared_ptr< Light > | Ptr |
using | IntensityUndoableCommand = SetFloatUndoableCommand |
using | ColorUndoableCommand = SetColor3fUndoableCommand |
using | ShadowEnableUndoableCommand = SetBoolUndoableCommand |
using | ShadowColorUndoableCommand = SetColor3fUndoableCommand |
using | DiffuseUndoableCommand = SetFloatUndoableCommand |
using | SpecularUndoableCommand = SetFloatUndoableCommand |
using | AngleUndoableCommand = SetFloatUndoableCommand |
using | SpherePropsUndoableCommand = SetValueUndoableCommand< const SphereProps & > |
using | ConePropsUndoableCommand = SetValueUndoableCommand< const ConeProps & > |
using | NormalizeUndoableCommand = SetBoolUndoableCommand |
Public Member Functions | |
Light () | |
Constructor. More... | |
Light (const Light &)=default | |
Default copy constructor. More... | |
virtual | ~Light () |
Destructor. More... | |
virtual const Path & | path () const =0 |
virtual SceneItem::Ptr | sceneItem () const =0 |
virtual Type | type () const =0 |
virtual IntensityUndoableCommand::Ptr | intensityCmd (float li)=0 |
virtual void | intensity (float li) |
virtual float | intensity () const =0 |
virtual ColorUndoableCommand::Ptr | colorCmd (float r, float g, float b)=0 |
virtual void | color (float r, float g, float b) |
virtual Color3f | color () const =0 |
virtual ShadowEnableUndoableCommand::Ptr | shadowEnableCmd (bool se)=0 |
virtual void | shadowEnable (bool se) |
virtual bool | shadowEnable () const =0 |
virtual ShadowColorUndoableCommand::Ptr | shadowColorCmd (float r, float g, float b)=0 |
virtual void | shadowColor (float r, float g, float b) |
virtual Color3f | shadowColor () const =0 |
virtual DiffuseUndoableCommand::Ptr | diffuseCmd (float ld)=0 |
virtual void | diffuse (float ld) |
virtual float | diffuse () const =0 |
virtual SpecularUndoableCommand::Ptr | specularCmd (float ls)=0 |
virtual void | specular (float ls) |
virtual float | specular () const =0 |
std::shared_ptr< DirectionalInterface > | directionalInterface () |
std::shared_ptr< SphereInterface > | sphereInterface () |
std::shared_ptr< ConeInterface > | coneInterface () |
std::shared_ptr< AreaInterface > | areaInterface () |
Static Public Member Functions | |
static Ptr | light (const SceneItem::Ptr &item) |
static bool | addObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static bool | removeObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static std::size_t | nbObservers (const SceneItem::Ptr &item) |
static bool | hasObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static bool | hasObservers (const Path &path) |
static bool | hasObservers (Rtid runTimeId) |
static void | notify (const Path &path) |
Protected Member Functions | |
virtual std::shared_ptr< DirectionalInterface > | directionalInterfaceImpl ()=0 |
virtual std::shared_ptr< SphereInterface > | sphereInterfaceImpl ()=0 |
virtual std::shared_ptr< ConeInterface > | coneInterfaceImpl ()=0 |
virtual std::shared_ptr< AreaInterface > | areaInterfaceImpl ()=0 |
Abstract base class for light interface.
This base class defines the interface that runtimes can implement for lights.
The Light interface provides members that are common to all light types. To access interfaces that are appropriate for different light types, the Light interface provides accessors to sub-interfaces:
For example, the SphereInterface is available for Light::Spot and Light::Point types.
To determine the transform of a light, attach a transform3d interface to the scene item, or to the first ancestor scene item which is a Transform3d.
Each operation has two calls, one with undo capability, and one without. Providing undo capability typically involves code complexity, and using undo capability incurs runtime cost in processing and memory. Therefore, non- interactive use of this interface should use calls without undo capability.
As with the rest of UFE, observation is done through the Observer Pattern. Observers can be added to an individual scene item, to be notified when an object's transformation changes.
To avoid the memory-consuming "one proxy object per scene object" approach, Light interface objects should be obtained and used within a local scope, and not stored. Light interfaces should be considered stateless, and can be bound to new selection items.
using Ufe::Light::ConePropsUndoableCommand = SetValueUndoableCommand<const ConeProps &> |
typedef std::shared_ptr<Light> Ufe::Light::Ptr |
using Ufe::Light::SpherePropsUndoableCommand = SetValueUndoableCommand<const SphereProps &> |
enum Ufe::Light::Type |
Ufe::Light::Light | ( | ) |
Constructor.
|
default |
Default copy constructor.
|
virtual |
Destructor.
|
static |
std::shared_ptr< AreaInterface > Ufe::Light::areaInterface | ( | ) |
Retrieve the area interface for the light
|
protectedpure virtual |
|
pure virtual |
Retrieve the color for the light
|
inlinevirtual |
|
pure virtual |
Create an undoable command to set the color. The command is not executed.
r | Red component of the new color value. |
g | Green component of the new color value. |
b | Blue component of the new color value. |
std::shared_ptr< ConeInterface > Ufe::Light::coneInterface | ( | ) |
Retrieve the cone interface for the light
|
protectedpure virtual |
|
pure virtual |
Retrieve the diffuse for the light
|
inlinevirtual |
|
pure virtual |
Create an undoable command to set the diffuse. The command is not executed.
ld | the new diffuse value. |
std::shared_ptr< DirectionalInterface > Ufe::Light::directionalInterface | ( | ) |
Retrieve the directional interface for the light
|
protectedpure virtual |
|
static |
|
static |
path | Path to verify if being observed. |
|
static |
Helper query for runtimes, to determine if any path they are responsible for is being observed.
runTimeId | runtime Id to find observers on. |
|
pure virtual |
Retrieve the intensity for the light
|
inlinevirtual |
|
pure virtual |
Create an undoable command to set the intensity. The command is not executed.
li | the new intensity value. |
|
static |
Convenience method that calls the Ufe::LightHandler::light() method on the Light handler for the item. Returns a null pointer if the argument is null, is an empty path or if the item does not support the Light interface.
|
static |
|
static |
Notify all observers of the item with this path. If no observer exists, does nothing.
path | Path to use on the notify action. |
|
static |
|
pure virtual |
|
pure virtual |
Retrieve the shadow color for the light
|
inlinevirtual |
|
pure virtual |
Create an undoable command to set the shadow color. The command is not executed.
r | Red component of the new shadow color value. |
g | Green component of the new shadow color value. |
b | Blue component of the new shadow color value. |
|
pure virtual |
Retrieve the shadow enable flag
|
inlinevirtual |
|
pure virtual |
Create an undoable command to set the shadow enable flag. The command is not executed.
se | the new shadow enable flag value. |
|
pure virtual |
Retrieve the specular for the light
|
inlinevirtual |
|
pure virtual |
Create an undoable command to set the specular. The command is not executed.
ls | the new specular value. |
std::shared_ptr< SphereInterface > Ufe::Light::sphereInterface | ( | ) |
Retrieve the sphere interface for the light
|
protectedpure virtual |
|
pure virtual |