ufe 6.5
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
Ufe::Light2 Class Referenceabstract

#include <light2.h>

Inheritance diagram for Ufe::Light2:
Collaboration diagram for Ufe::Light2:

Public Types

enum  Type { Invalid , Area }
 
typedef std::shared_ptr< Light2Ptr
 
using IntensityUndoableCommand = SetFloatUndoableCommand
 
using ColorUndoableCommand = SetColor3fUndoableCommand
 
using ShadowEnableUndoableCommand = SetBoolUndoableCommand
 
using ShadowColorUndoableCommand = SetColor3fUndoableCommand
 
using DiffuseUndoableCommand = SetFloatUndoableCommand
 
using SpecularUndoableCommand = SetFloatUndoableCommand
 

Public Member Functions

 Light2 ()
 Constructor. More...
 
 Light2 (const Light2 &)=default
 Default copy constructor. More...
 
virtual ~Light2 ()
 Destructor. More...
 
virtual const Pathpath () 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
 
Metadata Access:
virtual Value getMetadata (const std::string &key) const =0
 
virtual bool setMetadata (const std::string &key, const Value &value)=0
 
virtual UndoableCommand::Ptr setMetadataCmd (const std::string &key, const Value &value)
 
virtual bool clearMetadata (const std::string &key)=0
 
virtual UndoableCommand::Ptr clearMetadataCmd (const std::string &key)
 
virtual bool hasMetadata (const std::string &key) const =0
 Returns true if metadata key has a non-empty value. More...
 

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 Ufe::LightChanged &notification)
 

Public Attributes

std::vector< LightInterface::Ptrinterfaces
 A collection of LightInterface pointers that this light supports. More...
 

Detailed Description

Definition at line 110 of file light2.h.

Member Typedef Documentation

◆ ColorUndoableCommand

◆ DiffuseUndoableCommand

◆ IntensityUndoableCommand

◆ Ptr

typedef std::shared_ptr<Light2> Ufe::Light2::Ptr

Definition at line 113 of file light2.h.

◆ ShadowColorUndoableCommand

◆ ShadowEnableUndoableCommand

◆ SpecularUndoableCommand

Member Enumeration Documentation

◆ Type

Enumerator
Invalid 
Area 

Definition at line 115 of file light2.h.

Constructor & Destructor Documentation

◆ Light2() [1/2]

Ufe::Light2::Light2 ( )

Constructor.

◆ Light2() [2/2]

Ufe::Light2::Light2 ( const Light2 )
default

Default copy constructor.

◆ ~Light2()

virtual Ufe::Light2::~Light2 ( )
virtual

Destructor.

Member Function Documentation

◆ addObserver()

static bool Ufe::Light2::addObserver ( const SceneItem::Ptr item,
const Observer::Ptr obs 
)
static

Add observation on the argument item for Light changes.

Parameters
itemSceneItem to observe.
obsObserver to add.
Returns
True if the observer is added. Add does nothing and returns false if the observer is already present.

◆ clearMetadata()

virtual bool Ufe::Light2::clearMetadata ( const std::string &  key)
pure virtual

Clear the metadata key's value.

Parameters
[in]keyThe metadata key to clear.
Returns
True if the metadata was cleared successfully, otherwise false.

◆ clearMetadataCmd()

virtual UndoableCommand::Ptr Ufe::Light2::clearMetadataCmd ( const std::string &  key)
virtual

Return a command for undo / redo that clear the metadata. The returned command is not executed; it is up to the caller to call execute().

◆ color() [1/2]

virtual Color3f Ufe::Light2::color ( ) const
pure virtual

Retrieve the color for the light

Returns
the color value

◆ color() [2/2]

virtual void Ufe::Light2::color ( float  r,
float  g,
float  b 
)
inlinevirtual

Set the color. Default implementation uses ColorUndoableCommand.

Parameters
rred component
ggreen component
bblue component

Definition at line 287 of file light2.h.

◆ colorCmd()

virtual ColorUndoableCommand::Ptr Ufe::Light2::colorCmd ( float  r,
float  g,
float  b 
)
pure virtual

Create an undoable command to set the color. The command is not executed.

Parameters
rRed component of the new color value.
gGreen component of the new color value.
bBlue component of the new color value.
Returns
Undoable command to set the color

◆ diffuse() [1/2]

virtual float Ufe::Light2::diffuse ( ) const
pure virtual

Retrieve the diffuse for the light

Returns
the diffuse value

◆ diffuse() [2/2]

virtual void Ufe::Light2::diffuse ( float  ld)
inlinevirtual

Set the diffuse. Default implementation uses DiffuseUndoableCommand.

Parameters
ldthe new diffuse value.

Definition at line 356 of file light2.h.

◆ diffuseCmd()

virtual DiffuseUndoableCommand::Ptr Ufe::Light2::diffuseCmd ( float  ld)
pure virtual

Create an undoable command to set the diffuse. The command is not executed.

Parameters
ldthe new diffuse value.
Returns
Undoable command to set the diffuse

◆ getMetadata()

virtual Value Ufe::Light2::getMetadata ( const std::string &  key) const
pure virtual

Get the value of the metadata named key.

Parameters
[in]keyThe metadata key to query.
Returns
The value of the metadata key. If the key does not exist an empty Value is returned.

◆ hasMetadata()

virtual bool Ufe::Light2::hasMetadata ( const std::string &  key) const
pure virtual

Returns true if metadata key has a non-empty value.

◆ hasObserver()

static bool Ufe::Light2::hasObserver ( const SceneItem::Ptr item,
const Observer::Ptr obs 
)
static

Query observation on argument item for light changes.

Parameters
itemSceneItem to check if has observation.
obsObserver to query.
Returns
True if there is observation on argument item for light changes.

◆ hasObservers() [1/2]

static bool Ufe::Light2::hasObservers ( const Path path)
static
Parameters
pathPath to verify if being observed.
Returns
True if the given path is being observed.

◆ hasObservers() [2/2]

static bool Ufe::Light2::hasObservers ( Rtid  runTimeId)
static

Helper query for runtimes, to determine if any path they are responsible for is being observed.

Parameters
runTimeIdruntime Id to find observers on.
Returns
True if any path of given runtime Id are being observed.

◆ intensity() [1/2]

virtual float Ufe::Light2::intensity ( ) const
pure virtual

Retrieve the intensity for the light

Returns
the intensity value

◆ intensity() [2/2]

virtual void Ufe::Light2::intensity ( float  li)
inlinevirtual

Set the intensity. Default implementation uses IntensityUndoableCommand.

Parameters
lithe new intensity value.

Definition at line 263 of file light2.h.

◆ intensityCmd()

virtual IntensityUndoableCommand::Ptr Ufe::Light2::intensityCmd ( float  li)
pure virtual

Create an undoable command to set the intensity. The command is not executed.

Parameters
lithe new intensity value.
Returns
Undoable command to set the intensity

◆ light()

static Ptr Ufe::Light2::light ( const SceneItem::Ptr item)
static

Convenience method that calls the Ufe::Light2Handler::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.

Parameters
itemSceneItem's Light to retrieve
Returns
Light of the given SceneItem

◆ nbObservers()

static std::size_t Ufe::Light2::nbObservers ( const SceneItem::Ptr item)
static

Number of observers on the given SceneItem.

Parameters
itemSceneItem for which to count observers.
Returns
Number of observers on SceneItem.

◆ notify()

static void Ufe::Light2::notify ( const Ufe::LightChanged notification)
static

Notify all observers of the item with this path. If no observer exists, does nothing.

Parameters
notificationNotification to use on the notify action.

◆ path()

virtual const Path & Ufe::Light2::path ( ) const
pure virtual
Returns
the object's Path.

◆ removeObserver()

static bool Ufe::Light2::removeObserver ( const SceneItem::Ptr item,
const Observer::Ptr obs 
)
static

Remove observation on the argument item for Light changes.

Parameters
itemSceneItem to remove observation on.
obsObserver to remove.
Returns
True if the observer is removed. False if the observer isn't found.

◆ sceneItem()

virtual SceneItem::Ptr Ufe::Light2::sceneItem ( ) const
pure virtual
Returns
the object's SceneItem.

◆ setMetadata()

virtual bool Ufe::Light2::setMetadata ( const std::string &  key,
const Value value 
)
pure virtual

Set the metadata key's value to value.

Parameters
[in]keyThe metadata key to set.
[in]valueThe value to set.
Returns
True if the metadata was set successfully, otherwise false.

◆ setMetadataCmd()

virtual UndoableCommand::Ptr Ufe::Light2::setMetadataCmd ( const std::string &  key,
const Value value 
)
virtual

Return a command for undo / redo that sets the metadata key's value to value. The returned command is not executed; it is up to the caller to call execute().

◆ shadowColor() [1/2]

virtual Color3f Ufe::Light2::shadowColor ( ) const
pure virtual

Retrieve the shadow color for the light

Returns
the shadow color value

◆ shadowColor() [2/2]

virtual void Ufe::Light2::shadowColor ( float  r,
float  g,
float  b 
)
inlinevirtual

Set the shadow color. Default implementation uses ShadowColorUndoableCommand.

Parameters
rred component
ggreen component
bblue component

Definition at line 333 of file light2.h.

◆ shadowColorCmd()

virtual ShadowColorUndoableCommand::Ptr Ufe::Light2::shadowColorCmd ( float  r,
float  g,
float  b 
)
pure virtual

Create an undoable command to set the shadow color. The command is not executed.

Parameters
rRed component of the new shadow color value.
gGreen component of the new shadow color value.
bBlue component of the new shadow color value.
Returns
Undoable command to set the shadow color

◆ shadowEnable() [1/2]

virtual bool Ufe::Light2::shadowEnable ( ) const
pure virtual

Retrieve the shadow enable flag

Returns
the shadow enable flag value

◆ shadowEnable() [2/2]

virtual void Ufe::Light2::shadowEnable ( bool  se)
inlinevirtual

Set the shadow enable flag. Default implementation uses ShadowEnableUndoableCommand.

Parameters
sethe new shadow enable flag value.

Definition at line 309 of file light2.h.

◆ shadowEnableCmd()

virtual ShadowEnableUndoableCommand::Ptr Ufe::Light2::shadowEnableCmd ( bool  se)
pure virtual

Create an undoable command to set the shadow enable flag. The command is not executed.

Parameters
sethe new shadow enable flag value.
Returns
Undoable command to set the shadow enable flag

◆ specular() [1/2]

virtual float Ufe::Light2::specular ( ) const
pure virtual

Retrieve the specular for the light

Returns
the specular value

◆ specular() [2/2]

virtual void Ufe::Light2::specular ( float  ls)
inlinevirtual

Set the specular. Default implementation uses SpecularUndoableCommand.

Parameters
lsthe new specular value.

Definition at line 379 of file light2.h.

◆ specularCmd()

virtual SpecularUndoableCommand::Ptr Ufe::Light2::specularCmd ( float  ls)
pure virtual

Create an undoable command to set the specular. The command is not executed.

Parameters
lsthe new specular value.
Returns
Undoable command to set the specular

◆ type()

virtual Type Ufe::Light2::type ( ) const
pure virtual
Returns
the light type

Member Data Documentation

◆ interfaces

std::vector<LightInterface::Ptr> Ufe::Light2::interfaces

A collection of LightInterface pointers that this light supports.

Definition at line 249 of file light2.h.


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