VizKit  3.3.7
Public Member Functions | Private Types | Private Member Functions | Private Attributes
VizKit::VisualEnsemble Class Reference

The VisualEnsemble is a group of all actors. More...

#include <VisualEnsemble.h>

List of all members.

Public Member Functions

 VisualEnsemble ()
 The constructor.
 ~VisualEnsemble ()
 The destructor.
 VisualEnsemble (const VisualEnsemble &other)
 Copy constructor.
VisualEnsembleoperator= (const VisualEnsemble &other)
 Assignment operator.
void showEnsemble (const VisualPlayerState &visualPlayerState)
 Shows the show of the ensemble.
void addEnsembleMember (VisualActor *aVisualActor)
 Adds a VisualActor to the VisualEnsemble.
void registerObserverForNotification (VisualActor *aVisualActor, const VisualNotificationKey aNotificationKey)
 Registers a VisualActor for a specific notification (event/message).
void removeObserverOfNotification (VisualActor *aVisualActor, const VisualNotificationKey aNotificationKey)
 Removes a VisualActor from the list of observers for a specific notification (event/message).
void dispatchNotification (VisualNotification &aNotification)
 The VisualEnsemble receives notifications that are passed to the actors of the ensemble.
VisualActorgetVisualActorByName (const char *const aVisualActorName)
 Returns a pointer to a VisualActor whose name is aVisualActorName.

Private Types

typedef std::vector
< VisualActor * > 
VisualEnsembleActors
 VisualEnsembleActors are collected as a vector of pointers to VisualActors.
typedef
VisualEnsembleActors::iterator 
VisualEnsembleActorsIterator
 The VisualEnsembleActorsIterator is an iterator of the VisualEnsembleActors.
typedef std::multimap
< VisualNotificationKey,
VisualActor * > 
ObserverMap
 The ObserverMap is a multimap of notifications (event types) and actors.
typedef ObserverMap::iterator ObserverMapIterator
 The ObserverMapIterator is an iterator of the ObserverMap.

Private Member Functions

void copy (const VisualEnsemble &other)
 Copy method for assignment operator and copy constructor.

Private Attributes

uint16 visualActorIterIndex
 Current index of internal iterator.
VisualEnsembleActors visualEnsembleActors
 Vector of all actors of the ensemble.
ObserverMap observerMap
 Multimap of all actors of the ensemble that are registered as observers.

Detailed Description

The VisualEnsemble is a group of all actors.

The one and only VisualEnsemble of VizKit is owned by the VisualStageControl. With its main method showEnsemble(), the VisualEnsemble calls each VisualActor to show(). The VisualEnsemble also passes VisualNotifications to VisualActors that are registered as observers.


Member Typedef Documentation

The ObserverMap is a multimap of notifications (event types) and actors.

typedef ObserverMap::iterator VizKit::VisualEnsemble::ObserverMapIterator [private]

The ObserverMapIterator is an iterator of the ObserverMap.

VisualEnsembleActors are collected as a vector of pointers to VisualActors.

typedef VisualEnsembleActors::iterator VizKit::VisualEnsemble::VisualEnsembleActorsIterator [private]

The VisualEnsembleActorsIterator is an iterator of the VisualEnsembleActors.


Constructor & Destructor Documentation

The constructor.

The destructor.

Copy constructor.


Member Function Documentation

Adds a VisualActor to the VisualEnsemble.

Parameters:
aVisualActorA pointer to a VisualActor.
Remarks:
VisualEnsemble stores the pointer to the VisualActor and deletes the memory when VisualEnsemble is destructed.
void VisualEnsemble::copy ( const VisualEnsemble other) [private]

Copy method for assignment operator and copy constructor.

Parameters:
otherAnother VisualEnsemble.

The VisualEnsemble receives notifications that are passed to the actors of the ensemble.

Notifications ensure loose connections between external processes and the VisualEnsemble. External processes can package and send a notification to the VisualEnsemble. The VisualEnsemble processes the notification and each registered actor receives the notification (event/message).

Parameters:
aNotificationA notification object.
VisualActor * VisualEnsemble::getVisualActorByName ( const char *const  aVisualActorName)

Returns a pointer to a VisualActor whose name is aVisualActorName.

Parameters:
aVisualActorNameThe name of the visual actor.
Returns:
A pointer to a VisualActor whose name is aVisualActorName or NULL if none is found.
VisualEnsemble & VisualEnsemble::operator= ( const VisualEnsemble other)

Assignment operator.

void VisualEnsemble::registerObserverForNotification ( VisualActor aVisualActor,
const VisualNotificationKey  aNotificationKey 
)

Registers a VisualActor for a specific notification (event/message).

Parameters:
aVisualActorA visual actor.
aNotificationKeyAn enum that denotes a notification.
void VisualEnsemble::removeObserverOfNotification ( VisualActor aVisualActor,
const VisualNotificationKey  aNotificationKey 
)

Removes a VisualActor from the list of observers for a specific notification (event/message).

Parameters:
aVisualActorA visual actor.
aNotificationKeyAn enum that denotes a notification.
void VisualEnsemble::showEnsemble ( const VisualPlayerState visualPlayerState)

Shows the show of the ensemble.

The show method of all active actors is called.

Parameters:
visualPlayerStateRead-only access to the VisualPlayerState.
Returns:
0 for no error. 1 if error occured.

Member Data Documentation

Multimap of all actors of the ensemble that are registered as observers.

Current index of internal iterator.

Vector of all actors of the ensemble.


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

Generated on Sun May 3 2015 20:26:31 for VizKit by doxygen 1.8.0