Dali 3D User Interface Engine
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
Dali::Internal::SceneGraph::ConstraintBase Class Referenceabstract

An abstract base class for Constraints. More...

#include <scene-graph-constraint-base.h>

Inheritance diagram for Dali::Internal::SceneGraph::ConstraintBase:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::SceneGraph::ConstraintBase:
Collaboration graph
[legend]

Public Types

typedef
Dali::Constraint::RemoveAction 
RemoveAction
 

Public Member Functions

 ConstraintBase (PropertyOwnerContainer &ownerContainer)
 Constructor. More...
 
virtual ~ConstraintBase ()
 Virtual destructor. More...
 
void OnConnect ()
 Initialize the constraint. More...
 
void SetRemoveAction (RemoveAction action)
 Set the remove action. More...
 
RemoveAction GetRemoveAction () const
 Retrieve the remove action that will happen when the constraint is removed. More...
 
virtual void Apply (BufferIndex updateBufferIndex)=0
 Constrain the associated scene object. More...
 

Static Public Member Functions

static unsigned int GetCurrentInstanceCount ()
 Helper for internal test cases; only available for debug builds. More...
 
static unsigned int GetTotalInstanceCount ()
 Helper for internal test cases; only available for debug builds. More...
 

Protected Attributes

RemoveAction mRemoveAction
 
bool mFirstApply: 1
 
bool mDisconnected: 1
 

Private Member Functions

void StartObservation ()
 Helper to start observing property owners. More...
 
void StopObservation ()
 Helper to stop observing property owners. More...
 
virtual void PropertyOwnerConnected (PropertyOwner &owner)
 Called when the observable object is connected to the scene graph. More...
 
virtual void PropertyOwnerDisconnected (BufferIndex bufferIndex, PropertyOwner &owner)
 Called when the observable object is disconnected from the scene graph. More...
 
virtual void PropertyOwnerDestroyed (PropertyOwner &owner)
 Called shortly before the observable object is destroyed. More...
 
virtual void ResetDefaultProperties (BufferIndex updateBufferIndex)
 Called after ResetToBaseValues; derived classes should reset any default properties. More...
 
virtual void OnDisconnect ()=0
 Notify the derived class to disconnect from property owners. More...
 

Private Attributes

PropertyOwnerContainer mObservedOwners
 A set of pointers to each observed object. Not owned. More...
 

Detailed Description

An abstract base class for Constraints.

This can be used to constrain a property of a scene-object, after animations have been applied.

Definition at line 51 of file scene-graph-constraint-base.h.

Member Typedef Documentation

Definition at line 55 of file scene-graph-constraint-base.h.

Constructor & Destructor Documentation

Dali::Internal::SceneGraph::ConstraintBase::ConstraintBase ( PropertyOwnerContainer ownerContainer)

Constructor.

Definition at line 35 of file scene-graph-constraint-base.cpp.

Dali::Internal::SceneGraph::ConstraintBase::~ConstraintBase ( )
virtual

Virtual destructor.

Definition at line 47 of file scene-graph-constraint-base.cpp.

References mDisconnected, and StopObservation().

Here is the call graph for this function:

Member Function Documentation

virtual void Dali::Internal::SceneGraph::ConstraintBase::Apply ( BufferIndex  updateBufferIndex)
pure virtual

Constrain the associated scene object.

Parameters
[in]updateBufferIndexThe current update buffer index.

Implemented in Dali::Internal::SceneGraph::Constraint< PropertyType, PropertyAccessorType >.

Referenced by Dali::Internal::SceneGraph::ConstrainPropertyOwner().

Here is the caller graph for this function:

unsigned int Dali::Internal::SceneGraph::ConstraintBase::GetCurrentInstanceCount ( )
static

Helper for internal test cases; only available for debug builds.

Returns
The current number of Constraint instances in existence.

Definition at line 64 of file scene-graph-constraint-base.cpp.

RemoveAction Dali::Internal::SceneGraph::ConstraintBase::GetRemoveAction ( ) const
inline

Retrieve the remove action that will happen when the constraint is removed.

.0

Returns
The remove-action.

Definition at line 89 of file scene-graph-constraint-base.h.

References mRemoveAction.

unsigned int Dali::Internal::SceneGraph::ConstraintBase::GetTotalInstanceCount ( )
static

Helper for internal test cases; only available for debug builds.

Returns
The total number of Constraint instances created during the Dali core lifetime.

Definition at line 73 of file scene-graph-constraint-base.cpp.

void Dali::Internal::SceneGraph::ConstraintBase::OnConnect ( )
inline

Initialize the constraint.

This should by called by a scene-object, when the constraint is connected.

Definition at line 71 of file scene-graph-constraint-base.h.

References mDisconnected, and StartObservation().

Referenced by Dali::Internal::SceneGraph::PropertyOwner::ApplyConstraint().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void Dali::Internal::SceneGraph::ConstraintBase::OnDisconnect ( )
privatepure virtual

Notify the derived class to disconnect from property owners.

Implemented in Dali::Internal::SceneGraph::Constraint< PropertyType, PropertyAccessorType >.

Referenced by PropertyOwnerDestroyed(), and PropertyOwnerDisconnected().

Here is the caller graph for this function:

virtual void Dali::Internal::SceneGraph::ConstraintBase::PropertyOwnerConnected ( PropertyOwner owner)
inlineprivatevirtual

Called when the observable object is connected to the scene graph.

Parameters
[in]ownerA reference to the connected PropertyOwner

Implements Dali::Internal::SceneGraph::PropertyOwner::Observer.

Definition at line 143 of file scene-graph-constraint-base.h.

virtual void Dali::Internal::SceneGraph::ConstraintBase::PropertyOwnerDestroyed ( PropertyOwner owner)
inlineprivatevirtual

Called shortly before the observable object is destroyed.

Note
Cleanup should be done in both this and PropertyOwnerDisconnected as PropertyOwnerDisconnected may not be called (i.e. when shutting down).

Implements Dali::Internal::SceneGraph::PropertyOwner::Observer.

Definition at line 167 of file scene-graph-constraint-base.h.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::End(), Dali::Vector< T, IsTrivialType >::Erase(), mDisconnected, mObservedOwners, OnDisconnect(), and StopObservation().

Here is the call graph for this function:

virtual void Dali::Internal::SceneGraph::ConstraintBase::PropertyOwnerDisconnected ( BufferIndex  bufferIndex,
PropertyOwner owner 
)
inlineprivatevirtual

Called when the observable object is disconnected from the scene graph.

Parameters
[in]currentBufferIndexThe buffer to reset.
[in]ownerA reference to the disconnected PropertyOwner

Implements Dali::Internal::SceneGraph::PropertyOwner::Observer.

Definition at line 150 of file scene-graph-constraint-base.h.

References mDisconnected, OnDisconnect(), and StopObservation().

Here is the call graph for this function:

void Dali::Internal::SceneGraph::ConstraintBase::ResetDefaultProperties ( BufferIndex  updateBufferIndex)
privatevirtual

Called after ResetToBaseValues; derived classes should reset any default properties.

Parameters
[in]currentBufferIndexThe buffer to reset.

Definition at line 59 of file scene-graph-constraint-base.cpp.

References DALI_ASSERT_DEBUG.

void Dali::Internal::SceneGraph::ConstraintBase::SetRemoveAction ( RemoveAction  action)
inline

Set the remove action.

Constraint::Bake will "bake" a value when fully-applied.

In case of Constraint::Discard, the constrained value will be discarded, when the constraint is removed. The default value is Constraint::Bake. .0

Parameters
[in]actionThe remove-action.

Definition at line 81 of file scene-graph-constraint-base.h.

References mRemoveAction.

Referenced by Dali::Internal::Constraint< PropertyType >::ConnectConstraint(), Dali::Internal::Constraint< float >::ConnectConstraint(), and Dali::Internal::SceneGraph::SetRemoveActionMessage().

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::ConstraintBase::StartObservation ( )
inlineprivate

Helper to start observing property owners.

Definition at line 117 of file scene-graph-constraint-base.h.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::End(), and mObservedOwners.

Referenced by OnConnect().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::SceneGraph::ConstraintBase::StopObservation ( )
inlineprivate

Helper to stop observing property owners.

Definition at line 129 of file scene-graph-constraint-base.h.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::Clear(), Dali::Vector< T, IsTrivialType >::End(), and mObservedOwners.

Referenced by PropertyOwnerDestroyed(), PropertyOwnerDisconnected(), and ~ConstraintBase().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool Dali::Internal::SceneGraph::ConstraintBase::mDisconnected
protected
bool Dali::Internal::SceneGraph::ConstraintBase::mFirstApply
protected

Definition at line 204 of file scene-graph-constraint-base.h.

PropertyOwnerContainer Dali::Internal::SceneGraph::ConstraintBase::mObservedOwners
private

A set of pointers to each observed object. Not owned.

Definition at line 209 of file scene-graph-constraint-base.h.

Referenced by PropertyOwnerDestroyed(), StartObservation(), and StopObservation().

RemoveAction Dali::Internal::SceneGraph::ConstraintBase::mRemoveAction
protected

The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali