AnimationServices Class Reference
[Services]

Manages animation controllers within the application. More...

#include <AnimationServices.h>

Inheritance diagram for AnimationServices:

Inheritance graph

List of all members.

Public Member Functions

virtual AnimationControllercreateAnimationController (const std::string &name, FrameType frameType)=0
virtual bool hasAnimationController (const std::string &name) const =0
virtual AnimationControllergetAnimationController (const std::string &name) const =0
virtual const std::vector
< AnimationController * > & 
getAnimationControllers () const =0
virtual unsigned int getNumAnimationControllers () const =0
virtual void setCurrentAnimationController (AnimationController *pController)=0
virtual AnimationControllergetCurrentAnimationController () const =0
virtual bool renameAnimationController (AnimationController *pController, const std::string &newName)=0
virtual void destroyAnimationController (AnimationController *pController)=0
virtual std::string frameToString (const AnimationFrame &frame, FrameType frameType) const =0

Static Public Member Functions

static const std::string & signalControllerCreated ()
static const std::string & signalControllerDestroyed ()

Protected Member Functions

virtual ~AnimationServices ()


Detailed Description

Manages animation controllers within the application.

This class provides the capability to create and destroy animation controllers. A pointer to this class can be obtained by creating a Service<AnimationServices> instance.

This subclass of Subject will notify upon the following conditions:

See also:
AnimationController

Definition at line 38 of file AnimationServices.h.


Constructor & Destructor Documentation

virtual AnimationServices::~AnimationServices (  )  [protected, virtual]

This class will be destroyed during application close.

Plug-ins do not need to destroy it.

Definition at line 225 of file AnimationServices.h.


Member Function Documentation

static const std::string& AnimationServices::signalControllerCreated (  )  [static]

Emitted with any<AnimationController*> when an animation controller is created.

Definition at line 45 of file AnimationServices.h.

static const std::string& AnimationServices::signalControllerDestroyed (  )  [static]

Emitted with any<AnimationController*> when an animation controller is destroyed.

Definition at line 51 of file AnimationServices.h.

virtual AnimationController* AnimationServices::createAnimationController ( const std::string &  name,
FrameType  frameType 
) [pure virtual]

Creates a new animation controller.

This method creates a new animation controller with the given name and frame type. The controller name must be unique within the application.

Parameters:
name The animation controller name. This name cannot be empty and must be unique for all controllers in the application.
frameType The frame type for the animation controller. Once the controller is created, the frame type cannot be changed.
Returns:
A pointer to the new animation controller. NULL is returned if an animation controller of the given name already exists, regardless of the frame type.
Subject Notifications:
This method will notify signalControllerCreated() with any<AnimationController*> if the controller is successfully created.

virtual bool AnimationServices::hasAnimationController ( const std::string &  name  )  const [pure virtual]

Queries whether an animation controller with a given name exists.

Parameters:
name The controller name.
Returns:
Returns true if an animation controller with the given name exists, otherwise returns false.

virtual AnimationController* AnimationServices::getAnimationController ( const std::string &  name  )  const [pure virtual]

Returns the animation controller with a given name.

Parameters:
name The controller name.
Returns:
A pointer to the existing animation controller with the given name. NULL is returned if no animation controller exists with the given name.

virtual const std::vector<AnimationController*>& AnimationServices::getAnimationControllers (  )  const [pure virtual]

Retrieves all animation controllers.

Returns:
A vector of animation controller pointers. The returned vector should not be modified. To change the vector contents, call createAnimationController() and destroyAnimationController() instead.

virtual unsigned int AnimationServices::getNumAnimationControllers (  )  const [pure virtual]

Returns the current number of animation controllers.

This is a convenience method that is identical to getAnimationControllers().size().

Returns:
The current number of animation controllers.

virtual void AnimationServices::setCurrentAnimationController ( AnimationController pController  )  [pure virtual]

Sets the current animation controller on the Animation toolbar.

This method is a convenience method that calls AnimationToolBar::setAnimationController() passing in the given controller.

Parameters:
pController The animation controller to activate on the Animation toolbar.
See also:
AnimationToolBar::setAnimationController()

virtual AnimationController* AnimationServices::getCurrentAnimationController (  )  const [pure virtual]

Returns the current animation controller on the Animation toolbar.

This method is a convenience method that calls AnimationToolBar::getAnimationController().

Returns:
A pointer to the current animation controller on the Animation toolbar.
See also:
AnimationToolBar::getAnimationController()

virtual bool AnimationServices::renameAnimationController ( AnimationController pController,
const std::string &  newName 
) [pure virtual]

Sets a new name for an animation controller.

Parameters:
pController The animation controller to rename.
newName The new name for the controller. The name cannot be the same as the name of any existing controller.
Returns:
Returns true if the controller was successfully renamed. Returns false if newName is empty or if an existing controller already has this name.
Subject Notifications:
This method will notify AnimationController::signalRenamed() with boost::any<std::string> if the name is successfully set on the controller.

virtual void AnimationServices::destroyAnimationController ( AnimationController pController  )  [pure virtual]

Destroys an existing animation controller.

This method destroys the given animation controller and all of the animations that it contains.

Parameters:
pController The animation controller to destroy.
Subject Notifications:
This method will notify signalControllerDestroyed() with any<AnimationController*> after the animation controller has removed but before the it is deleted.
See also:
Animation

virtual std::string AnimationServices::frameToString ( const AnimationFrame frame,
FrameType  frameType 
) const [pure virtual]

Returns a frame value as a formatted string.

Parameters:
frame The animation frame containing the value to convert to a string.
frameType The frame type that specifies the format of the returned string.
Returns:
Returns a formatted string based on the frame type containing the frame value as follows:
Frame Type Format Description
FRAME_ID "n" One-based numeric frame number
FRAME_TIME "yyyy/MM/dd hh:mm:ss.zzz" Year, month, day, hours, minutes, seconds, and milliseconds
FRAME_ELAPSED_TIME "hh:mm:ss.zzz" Hours, minutes, seconds, and milliseconds
An empty string is returned if frameType is invalid or if frameType is FRAME_TIME or FRAME_ELAPSED_TIME and the value has not been set.


Software Development Kit - Opticks 4.9.0 Build 16218