casa
5.7.0-16
|
Animation controller for WorldCanvasHolders. More...
#include <Animator.h>
Public Types | |
enum | NextMode { NEXT_FORWARD, NEXT_BACKWARD, NEXT_ROCKANDROLL } |
Defines the way the Animator calculates the Z coordinate of the next frame in the sequence. More... | |
enum | MatchMode { MATCH_INDEX, MATCH_WORLD, MATCH_LIST_ONLY } |
Defines wheter the sequence is defined using the index in the sequence or by the world coordinate of the 'Z-axis' (the "zValue" or "zIndex" used by the WorldCanvasHolders and the DisplayDatas), or only by the AttributeBuffers. More... | |
enum | UpdateMode { UPDATE_DIRECT, UPDATE_BLINK } |
Decides whether the Z coordinate should be changed according to the NextMode before each update or not. More... | |
Public Member Functions | |
Animator () | |
Constructor. More... | |
virtual | ~Animator () |
Destrutor. More... | |
virtual void | nextCoord () |
Go to next Z coordinate in sequence. More... | |
virtual void | prevCoord () |
Go to previous Z coordinate in sequence. More... | |
virtual void | gotoCoord (casacore::Double zCoord) |
Go to Z coordinate zCoord. More... | |
virtual void | setStep (casacore::uInt zIncrement) |
Set increment in the Z coordinate for the movie. More... | |
virtual void | setStep (casacore::Double zIncrement) |
virtual void | setTolerance (casacore::uInt tolerance) |
Set the tolerance in the Z coordinate. More... | |
virtual void | setTolerance (casacore::Double tolerance) |
virtual void | setMinAndMaxCoord (casacore::Double zMin, casacore::Double zMax) |
Set the minimum and maximum Z coordinate for the movie. More... | |
virtual void | setMatchMode (Animator::MatchMode match) |
Set whether "zIndex", "zValue" or none of the two should be written additionally to the AttributeBuffers. More... | |
virtual void | setNextMode (Animator::NextMode mode) |
Set the way the increments are done, ie. More... | |
virtual void | setUpdateMode (Animator::UpdateMode mode) |
Set whether an increment should be done before each update (UPDATE_DIRECT or UPDATE_BLINK) More... | |
virtual void | setUpdateInterval (casacore::Double interval) |
Set update interval of movie in milliseconds. More... | |
virtual void | setBlinkRestrictions (std::list< void * > *attBuffers) |
Set the list of additional Attributes that the Animator places on the WorldCanvasHolders before each update. More... | |
virtual void | clearBlinkRestrictions () |
Remove the casacore::List with AttributeBuffers. More... | |
virtual void | startMovie () |
Stop and start movie. More... | |
virtual void | stopMovie () |
virtual casacore::uInt | getMovieLength () |
Return the length of the movie. More... | |
virtual casacore::Int | getCurrentPosition () |
Return the current position in the movie. More... | |
virtual void | reset () |
Reset the Animator. More... | |
virtual void | addWorldCanvasHolder (WorldCanvasHolder *newHolder) |
Add a WorldCanvasHolder to the list controlled by this Animator. More... | |
virtual void | removeWorldCanvasHolder (WorldCanvasHolder &holder) |
Remove a WorldCanvasHolder from the list controlled by this Animator. More... | |
virtual void | operator() (const WCRefreshEvent &ev) |
Refresh event handler - just used to see if resetCoordinates was set. More... | |
Private Member Functions | |
void | computeNextCoord (casacore::Int addOrSubtract) |
Compute, based on the UPDATE_MODE and NEXT_MODE, the Z coordinate of the new frame to display (ie. More... | |
void | increment (casacore::Int &number, casacore::Int addOrSubtract) |
Helper routine for computeNewCoord(). More... | |
void | decrement (casacore::Int &number, casacore::Int addOrSubtract) |
Helper routine for computeNewCoord(). More... | |
void | increment (casacore::Double &number, casacore::Int addOrSubtract) |
Helper routine for computeNewCoord(). More... | |
void | decrement (casacore::Double &number, casacore::Int addOrSubtract) |
Helper routine for computeNewCoord(). More... | |
void | writeRestrictions () |
Write the necessary Attributes to all the WorldCanvasHolders. More... | |
void | refresh () |
Invoke refresh() on all the WorldCanvasHolders registered with the Animator. More... | |
casacore::Int | listLen () |
Return the number of AttributeBuffers in the casacore::List of AttributeBuffer. More... | |
Private Attributes | |
std::list< void * > | holderList |
casacore::List of WorldCanvasHolders More... | |
std::list< void * > * | attBufList |
casacore::List of the AttributeBuffers More... | |
casacore::Double | minCoord |
parameters of movies More... | |
casacore::Double | maxCoord |
casacore::Double | movieStep |
Increment for computing currentCoord. More... | |
casacore::Double | coordTolerance |
State variables Tolerance for coordinate Restriction. More... | |
casacore::Double | currentCoord |
Current Z coordiante. More... | |
Animator::MatchMode | matchMode |
the MatchMode More... | |
Animator::NextMode | nextMode |
the NextMode More... | |
Animator::UpdateMode | updateMode |
The UpdateMode. More... | |
casacore::Double | updateInterval |
and the interval of the timer More... | |
casacore::Int | numberInList |
The number of the AttributeBuffer to use. More... | |
casacore::Int | movieDirection |
In which direction the movie is currently going. More... | |
AnimatorRefEH * | itsAnimatorRefEH |
refresh event handler More... | |
Animation controller for WorldCanvasHolders.
Public interface
An Animator animates animations
TBW
First example is making a simple movie of all the channels in a data cube
Second example is that we want to blink between channel 20 of the previous cube and an optical image
The third example is to run movies, selected on world coordinates on two WorldCanvasHolders in synch:
To allow for easy control of movies, possibly synchonous on more than one WorldCanvas, as well as lay the basis for the userinterface for this, a central class is needed that controls sequences of DisplayData.
Definition at line 285 of file Animator.h.
Defines wheter the sequence is defined using the index in the sequence or by the world coordinate of the 'Z-axis' (the "zValue" or "zIndex" used by the WorldCanvasHolders and the DisplayDatas), or only by the AttributeBuffers.
Enumerator | |
---|---|
MATCH_INDEX |
casacore::Sequence is defined by writing Attribute "zIndex" with the value of the Z coordinate to WorldCanvasHolders, plus the ones from the casacore::List of AttributeBuffers. This is the default |
MATCH_WORLD |
casacore::Sequence is defined by writing Attribute "zValue"with the value of the Z coordinate to WorldCanvasHolders, plus the ones from the casacore::List of AttributeBuffers |
MATCH_LIST_ONLY |
Only the Attributes from the casacore::List of AttributeBuffers are written. |
Definition at line 311 of file Animator.h.
Defines the way the Animator calculates the Z coordinate of the next frame in the sequence.
This defines the behaviour of the member nextCoord().
Definition at line 292 of file Animator.h.
Decides whether the Z coordinate should be changed according to the NextMode before each update or not.
Definition at line 327 of file Animator.h.
casa::Animator::Animator | ( | ) |
Constructor.
|
virtual |
Destrutor.
|
virtual |
Add a WorldCanvasHolder to the list controlled by this Animator.
|
virtual |
Remove the casacore::List with AttributeBuffers.
|
private |
Compute, based on the UPDATE_MODE and NEXT_MODE, the Z coordinate of the new frame to display (ie.
the new currentCoord). If the updateMode == UPDATE_BLINK, nothing happens. If the updateMode == UPDATE_DIRECT, the value of currentCoord is incremented or decremented with the absolute value of movieStep, depending in whether the next_Mode is NEXT_FORWARD, NEXT_BACKWARD or NEXT_ROCKANDROLL and whether the new value goes outside the bounds set by minCoord and maxCoord.
|
private |
Helper routine for computeNewCoord().
The inverse of increment(casacore::Int&, casacore::Int)
|
private |
Helper routine for computeNewCoord().
The inverse of increment(casacore::Double&, casacore::Int)
|
virtual |
Return the current position in the movie.
This is really a bad thing, but needed in the interim for the viewer.
|
virtual |
Return the length of the movie.
In UpdateMode UPDATE_DIRECT this is the number of frames that follow from the minimum and maximum Z coordiante and the step. In UPDATE_BLINK mode this is the length of the casacore::List of AttributeBuffers set on the Animator using setBlinkAttributes
|
virtual |
Go to Z coordinate zCoord.
|
private |
Helper routine for computeNewCoord().
If addOrSubtract > 0, 1 is added to number, if addOrSubtract < 0, 1 is subtracted
|
private |
Helper routine for computeNewCoord().
If addOrSubtract > 0, movieStep is added to number, if addOrSubtract < 0, movieStep is subtracted
|
private |
Return the number of AttributeBuffers in the casacore::List of AttributeBuffer.
|
virtual |
Go to next Z coordinate in sequence.
|
virtual |
Refresh event handler - just used to see if resetCoordinates was set.
If so, then we should partially reset the animator.
|
virtual |
Go to previous Z coordinate in sequence.
|
private |
|
virtual |
Remove a WorldCanvasHolder from the list controlled by this Animator.
|
virtual |
Reset the Animator.
This will set the minimum coordiante to 0, the maximum to the number of elements registered with the WorldCanvasHolders, the step to 1.0 and the update mode to MATCH_INDEX
Referenced by casa::AniPosEH::resetAnimator().
|
virtual |
Set the list of additional Attributes that the Animator places on the WorldCanvasHolders before each update.
|
virtual |
Set whether "zIndex", "zValue" or none of the two should be written additionally to the AttributeBuffers.
|
virtual |
Set the minimum and maximum Z coordinate for the movie.
|
virtual |
Set the way the increments are done, ie.
it defines the action of nextCoord() (options NEXT_FORWARD, NEXT_BACKWARD, UPDATE_ROCKANDROLL)
|
virtual |
Set increment in the Z coordinate for the movie.
|
virtual |
|
virtual |
Set the tolerance in the Z coordinate.
|
virtual |
|
virtual |
Set update interval of movie in milliseconds.
|
virtual |
Set whether an increment should be done before each update (UPDATE_DIRECT or UPDATE_BLINK)
|
virtual |
Stop and start movie.
|
virtual |
|
private |
Write the necessary Attributes to all the WorldCanvasHolders.
The content of one of the registered AttributeBuffer is always written. If the updateMode == UPDATE_DIRECT the n-th AttributeBuffer is written, where n is the sequence number of the frame, based on minCoord and movieStep. If the updateMode == UPDATE_BLINK the Animator just loops through the list of AttributeBuffers based on numberInList. If MatchMode == MATCH_INDEX also an Attribute is written with name "zIndex" and with the value of currentCoord. If MatchMode == MATCH_COORD also an Attribute is written with name "zValue" and with the value of currentCoord.
|
private |
casacore::List of the AttributeBuffers
Definition at line 430 of file Animator.h.
|
private |
State variables Tolerance for coordinate Restriction.
Definition at line 441 of file Animator.h.
|
private |
Current Z coordiante.
Definition at line 443 of file Animator.h.
|
private |
casacore::List of WorldCanvasHolders
Definition at line 427 of file Animator.h.
|
private |
refresh event handler
Definition at line 506 of file Animator.h.
|
private |
the MatchMode
Definition at line 445 of file Animator.h.
|
private |
Definition at line 434 of file Animator.h.
|
private |
parameters of movies
Definition at line 433 of file Animator.h.
|
private |
In which direction the movie is currently going.
Definition at line 458 of file Animator.h.
|
private |
|
private |
the NextMode
Definition at line 447 of file Animator.h.
|
private |
The number of the AttributeBuffer to use.
Computed by computeNewCoord() Has to be casacore::Int, not casacore::uInt! (because I sometimes subtract 1!)
Definition at line 455 of file Animator.h.
|
private |
and the interval of the timer
Definition at line 451 of file Animator.h.
|
private |
The UpdateMode.
Definition at line 449 of file Animator.h.