Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members Related Pages Search
Animator Class ReferenceThis class provides an interface for animating a graph.
More...
#include <animator.h>
Inheritance diagram for Animator:
[legend]List of all members.
|
Public Methods |
| Animator () |
virtual | ~Animator () |
virtual void | load_key (const char *key, const char *value) |
int | setAnimationMin (double) |
| Sets the value that the animation begins at and returns to after the end of a loop.
|
int | setAnimationMax (double) |
| Sets the maximum value the animation will reach before ending.
|
int | setAnimationStep (double) |
| Sets the step of each animation.
|
int | setAnimationSpeed (int) |
| Sets the speed between each frame in the animation in milliseconds ( 1000 ms = 1 sec ).
|
double | getAnimationMin () const |
| Returns the value that the animation begins at and returns to after the end of a loop.
|
double | getAnimationMax () const |
| Returns the maximum value the animation will reach before ending.
|
double | getAnimationStep () const |
| Returns the step of each animation.
|
int | getAnimationSpeed () const |
| Returns the speed of the graph in milliseconds.
|
void | setAnimationFrame (double n) |
| Sets the value of the the animator to the given number.
|
double | animatorValue () const |
| Subclasses should use this function to get the current stage of the animation in order to produce the animation.
|
void | play () |
| Begins to play the animation and will loop until pause() or stop() is called.
|
void | stop () |
| Stops a playing animation and resets the current animator value to the minimum.
|
void | pause () |
| Stops a playing animation, but unlike stop(), the current animator value remains what is was.
|
void | saveAsMovie () |
| Save the complete animation as a movie.
|
bool | displayAnimatorValue () |
void | setDisplayAnimatorValue (bool b) |
Protected Methods |
virtual void | nextFrameReady ()=0 |
| Classes that implement this class need to implement this function.
|
void | nextFrame () |
| This function should be called after every timer timeout.
|
void | initializeAnimator (QObject *) |
| Call this function before using the animation interface.
|
bool | isSaving () const |
Detailed Description
This class provides an interface for animating a graph.
- Author:
-
Fungmeista
- Note:
-
Because the QTimer class uses signals/slots, subclasses currently must include a slotNextFrame() slot that calls this class's nextFrame() function. The Animator class itself cannot contain signals/slots, because this would require it to be a QObject subclass. If it were a QObject subclass, QObject subclasses would not be able to inherit it ( Multiple inheritance clashes ). This is an instance when using callbacks would be better than signals/slots... anyways, I'm looking for other workarounds :-)
Also, don't forget to call initialize() before using this class.
Definition at line 37 of file animator.h.
Member Function Documentation
void Animator::initializeAnimator |
( |
QObject * |
|
) |
[protected] |
|
|
Call this function before using the animation interface.
It should be given a pointer to this class's subclass. This function connects the timeout() signal of the QTimer class used to the slotNextFrame() slot of the given class.
Definition at line 39 of file animator.cpp. |
virtual void Animator::nextFrameReady |
( |
|
) |
[protected, pure virtual] |
|
|
Stops a playing animation, but unlike stop(), the current animator value remains what is was.
Calling play() will continue the animation from where it left off.
Definition at line 84 of file animator.cpp.
References play(). |
void Animator::saveAsMovie |
( |
|
) |
|
|
|
Save the complete animation as a movie.
- Note:
-
Just a stub for now
Definition at line 159 of file animator.cpp. |
The documentation for this class was generated from the following files:
|