Open CASCADE Technology 7.8.2.dev
|
Class represents a basic animation class. AIS_Animation can be used as: More...
#include <AIS_Animation.hxx>
Public Member Functions | |
AIS_Animation (const TCollection_AsciiString &theAnimationName) | |
Creates empty animation. | |
virtual | ~AIS_Animation () |
Destruct object, clear arguments. | |
const TCollection_AsciiString & | Name () const |
Animation name. | |
Standard_Real | StartPts () const |
void | SetStartPts (const Standard_Real thePtsStart) |
Sets time limits for animation in the animation timeline. | |
Standard_Real | Duration () const |
void | UpdateTotalDuration () |
Update total duration considering all animations on timeline. | |
Standard_Boolean | HasOwnDuration () const |
Return true if duration is defined. | |
Standard_Real | OwnDuration () const |
void | SetOwnDuration (const Standard_Real theDuration) |
Defines duration of the animation. | |
void | Add (const Handle< AIS_Animation > &theAnimation) |
Add single animation to the timeline. | |
void | Clear () |
Clear animation timeline - remove all animations from it. | |
Handle< AIS_Animation > | Find (const TCollection_AsciiString &theAnimationName) const |
Return the child animation with the given name. | |
Standard_Boolean | Remove (const Handle< AIS_Animation > &theAnimation) |
Remove the child animation. | |
Standard_Boolean | Replace (const Handle< AIS_Animation > &theAnimationOld, const Handle< AIS_Animation > &theAnimationNew) |
Replace the child animation. | |
void | CopyFrom (const Handle< AIS_Animation > &theOther) |
Clears own children and then copy child animations from another object. Copy also Start Time and Duration values. | |
const NCollection_Sequence< Handle< AIS_Animation > > & | Children () const |
Return sequence of child animations. | |
virtual void | StartTimer (const Standard_Real theStartPts, const Standard_Real thePlaySpeed, const Standard_Boolean theToUpdate, const Standard_Boolean theToStopTimer=Standard_False) |
Start animation with internally defined timer instance. Calls Start() internally. | |
virtual Standard_Real | UpdateTimer () |
Update single frame of animation, update timer state. | |
Standard_Real | ElapsedTime () const |
Return elapsed time. | |
const Handle< Media_Timer > & | Timer () const |
Return playback timer. | |
void | SetTimer (const Handle< Media_Timer > &theTimer) |
Set playback timer. | |
virtual void | Start (const Standard_Boolean theToUpdate) |
Start animation. This method changes status of the animation to Started. This status defines whether animation is to be performed in the timeline or not. | |
virtual void | Pause () |
Pause the process timeline. | |
virtual void | Stop () |
Stop animation. This method changed status of the animation to Stopped. This status shows that animation will not be performed in the timeline or it is finished. | |
bool | IsStopped () |
Check if animation is to be performed in the animation timeline. | |
virtual Standard_Boolean | Update (const Standard_Real thePts) |
Update single frame of animation, update timer state. | |
Public Member Functions inherited from Standard_Transient | |
Standard_Transient () | |
Empty constructor. | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. | |
virtual | ~Standard_Transient () |
Destructor must be virtual. | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. | |
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
Returns a true value if this is an instance of Type. | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. | |
Standard_Boolean | IsKind (const opencascade::handle< Standard_Type > &theType) const |
Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
Standard_Transient * | This () const |
Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. | |
Standard_Integer | GetRefCount () const noexcept |
Get the reference counter of this object. | |
void | IncrementRefCounter () noexcept |
Increments the reference counter of this object. | |
Standard_Integer | DecrementRefCounter () noexcept |
Decrements the reference counter of this object; returns the decremented value. | |
virtual void | Delete () const |
Memory deallocator for transient classes. | |
Protected Types | |
enum | AnimationState { AnimationState_Started , AnimationState_Stopped , AnimationState_Paused } |
Defines animation state. More... | |
Protected Member Functions | |
virtual void | updateWithChildren (const AIS_AnimationProgress &thePosition) |
Process one step of the animation according to the input time progress, including all children. Calls also update() to update own animation. | |
virtual void | update (const AIS_AnimationProgress &theProgress) |
Update the own animation to specified position - should be overridden by sub-class. | |
Protected Attributes | |
Handle< Media_Timer > | myTimer |
TCollection_AsciiString | myName |
animation name | |
NCollection_Sequence< Handle< AIS_Animation > > | myAnimations |
sequence of child animations | |
AnimationState | myState |
animation state - started, stopped of paused | |
Standard_Real | myPtsStart |
time of start in the timeline | |
Standard_Real | myOwnDuration |
duration of animation excluding children | |
Standard_Real | myChildrenDuration |
duration of animation including children | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. | |
Static Public Member Functions inherited from Standard_Transient | |
static constexpr const char * | get_type_name () |
Returns a type descriptor about this object. | |
static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
Returns type descriptor of Standard_Transient class. | |
Class represents a basic animation class. AIS_Animation can be used as:
Note, that AIS_Animation::StartTimer() defines a timer calculating an elapsed time, not a multimedia timer executing Viewer updates at specific intervals! Application should avoid using implicit and immediate Viewer updates to ensure that AIS_Animation::UpdateTimer() is called before each redrawing of a Viewer content. Redrawing logic should be also managed at application level for managing a smooth animation (by defining a multimedia timer provided by used GUI framework executing updates at desired framerate, or as continuous redraws in loop).
|
protected |
AIS_Animation::AIS_Animation | ( | const TCollection_AsciiString & | theAnimationName | ) |
Creates empty animation.
|
virtual |
Destruct object, clear arguments.
void AIS_Animation::Add | ( | const Handle< AIS_Animation > & | theAnimation | ) |
Add single animation to the timeline.
theAnimation | input animation |
|
inline |
Return sequence of child animations.
void AIS_Animation::Clear | ( | ) |
Clear animation timeline - remove all animations from it.
void AIS_Animation::CopyFrom | ( | const Handle< AIS_Animation > & | theOther | ) |
Clears own children and then copy child animations from another object. Copy also Start Time and Duration values.
|
inline |
|
inline |
Return elapsed time.
Handle< AIS_Animation > AIS_Animation::Find | ( | const TCollection_AsciiString & | theAnimationName | ) | const |
Return the child animation with the given name.
|
inline |
Return true if duration is defined.
|
inline |
Check if animation is to be performed in the animation timeline.
|
inline |
Animation name.
|
inline |
|
virtual |
Pause the process timeline.
Standard_Boolean AIS_Animation::Remove | ( | const Handle< AIS_Animation > & | theAnimation | ) |
Remove the child animation.
Standard_Boolean AIS_Animation::Replace | ( | const Handle< AIS_Animation > & | theAnimationOld, |
const Handle< AIS_Animation > & | theAnimationNew ) |
Replace the child animation.
|
inline |
Defines duration of the animation.
|
inline |
Sets time limits for animation in the animation timeline.
|
inline |
Set playback timer.
|
virtual |
Start animation. This method changes status of the animation to Started. This status defines whether animation is to be performed in the timeline or not.
theToUpdate | call Update() method |
|
inline |
|
virtual |
Start animation with internally defined timer instance. Calls Start() internally.
Note, that this method initializes a timer calculating an elapsed time (presentation timestamps within AIS_Animation::UpdateTimer()), not a multimedia timer executing Viewer updates at specific intervals! Viewer redrawing should be managed at application level, so that AIS_Animation::UpdateTimer() is called once right before each redrawing of a Viewer content.
theStartPts | starting timer position (presentation timestamp) |
thePlaySpeed | playback speed (1.0 means normal speed) |
theToUpdate | flag to update defined animations to specified start position |
theToStopTimer | flag to pause timer at the starting position |
|
virtual |
Stop animation. This method changed status of the animation to Stopped. This status shows that animation will not be performed in the timeline or it is finished.
|
inline |
Return playback timer.
|
virtual |
Update single frame of animation, update timer state.
thePts | [in] the time moment within [0; Duration()] |
|
inlineprotectedvirtual |
Update the own animation to specified position - should be overridden by sub-class.
Reimplemented in AIS_AnimationAxisRotation, AIS_AnimationCamera, and AIS_AnimationObject.
|
virtual |
Update single frame of animation, update timer state.
void AIS_Animation::UpdateTotalDuration | ( | ) |
Update total duration considering all animations on timeline.
|
protectedvirtual |
Process one step of the animation according to the input time progress, including all children. Calls also update() to update own animation.
|
protected |
sequence of child animations
|
protected |
duration of animation including children
|
protected |
animation name
|
protected |
duration of animation excluding children
|
protected |
time of start in the timeline
|
protected |
animation state - started, stopped of paused
|
protected |