VizKit
3.3.7
|
The VisualEnsemble is a group of all actors. More...
#include <VisualEnsemble.h>
Public Member Functions | |
VisualEnsemble () | |
The constructor. | |
~VisualEnsemble () | |
The destructor. | |
VisualEnsemble (const VisualEnsemble &other) | |
Copy constructor. | |
VisualEnsemble & | operator= (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. | |
VisualActor * | getVisualActorByName (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. |
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.
typedef std::multimap<VisualNotificationKey, VisualActor*> VizKit::VisualEnsemble::ObserverMap [private] |
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.
typedef std::vector<VisualActor*> VizKit::VisualEnsemble::VisualEnsembleActors [private] |
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.
The constructor.
The destructor.
VisualEnsemble::VisualEnsemble | ( | const VisualEnsemble & | other | ) |
Copy constructor.
void VisualEnsemble::addEnsembleMember | ( | VisualActor * | aVisualActor | ) |
Adds a VisualActor to the VisualEnsemble.
aVisualActor | A pointer to a VisualActor. |
void VisualEnsemble::copy | ( | const VisualEnsemble & | other | ) | [private] |
Copy method for assignment operator and copy constructor.
other | Another VisualEnsemble. |
void VisualEnsemble::dispatchNotification | ( | VisualNotification & | aNotification | ) |
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).
aNotification | A notification object. |
VisualActor * VisualEnsemble::getVisualActorByName | ( | const char *const | aVisualActorName | ) |
Returns a pointer to a VisualActor whose name is aVisualActorName.
aVisualActorName | The name of the visual actor. |
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).
aVisualActor | A visual actor. |
aNotificationKey | An 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).
aVisualActor | A visual actor. |
aNotificationKey | An 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.
visualPlayerState | Read-only access to the VisualPlayerState. |
Multimap of all actors of the ensemble that are registered as observers.
Current index of internal iterator.
Vector of all actors of the ensemble.