Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvGraphicAnimator Class Reference

Named property class. More...

#include <ilviews/util/animator.h>

Inheritance diagram for IlvGraphicAnimator:
IlvAnimator IlvNamedProperty IlvValueInterface

Public Member Functions

 IlvGraphicAnimator (IlSymbol *name, IlvAnimationMode mode=IlvAnimationForward, IlUInt period=100, IlBoolean useApply=IlTrue)
 Constructor. More...
 
void addTo (IlvGraphic *graphic)
 Connects the animator with a given graphic object. More...
 
virtual void animate ()
 Called to animate the animator. More...
 
IlvGraphicgetGraphic () const
 Returns the graphic object connected with the animator. More...
 
virtual void initReDraws () const
 Called to begin a redraw session. More...
 
virtual void invalidateRegion () const
 Called to invalidate the area affected by the animator. More...
 
virtual void reDrawViews () const
 Called to finish a redraw session. More...
 
void removeFrom (IlvGraphic *graphic)
 Disconnects the animator from the given graphic object. More...
 
virtual void stateChanged (IlUInt newState, IlUInt oldState)
 Called by IlvAnimator::changeState each time the animator state changes. More...
 
void useApply (IlBoolean value)
 Specifies to the animator whether to use "applyTo" functions. More...
 
IlBoolean usesApply () const
 Returns a Boolean indicating whether the animator will use "applyToObject" functions. More...
 
- Public Member Functions inherited from IlvAnimator
 IlvAnimator (IlSymbol *name, IlvAnimationMode mode=IlvAnimationForward, IlUInt period=100)
 Constructor. More...
 
void changeState (IlUInt state, IlBoolean redraw=IlTrue)
 Changes the animator state. More...
 
IlvAnimationMode getAnimationMode () const
 Returns the animation mode of the animator. More...
 
IlUInt getPeriod () const
 Returns the animation period of the animator. More...
 
IlUInt getState () const
 Returns the animator state. More...
 
virtual IlUInt getStatesCount () const =0
 Returns the number of states of the animator. More...
 
virtual IlBoolean isLastState (IlUInt state) const
 Returns a Boolean value indicating whether the specified state is the last one. More...
 
virtual IlUInt nextState (IlUInt state) const
 Returns the animator state that must be set after a given state. More...
 
virtual void reDraw () const
 Called to redraw the animator. More...
 
void setAnimationMode (IlvAnimationMode mode)
 Sets the animation mode of the animator. More...
 
void setAnimationMode (IlvAnimationMode mode, IlUInt period)
 Sets the animation mode and the period of the animator. More...
 
void setState (IlUInt state)
 Sets the animator state. More...
 
- Public Member Functions inherited from IlvNamedProperty
 IlvNamedProperty (const IlvNamedProperty &source)
 Constructor. More...
 
 IlvNamedProperty (IlSymbol *)
 Constructor. More...
 
IlvNamedPropertycopy () const =0
 Copies the property. More...
 
const char * getName () const
 Gets the name of the property. More...
 
IlSymbolgetSymbol () const
 Gets the name of the property. More...
 
virtual IlBoolean isPersistent () const
 Specifies whether the property must save itself. More...
 
void write (IlvOutputFile &stream) const =0
 Saves the description of the property. More...
 
- Public Member Functions inherited from IlvValueInterface
virtual IlBoolean applyValue (const IlvValue &value)
 Apply an accessor. More...
 
virtual IlBoolean changeValue (const IlvValue &val)
 Changes the value of an accessor. More...
 
virtual IlBoolean changeValues (const IlvValue *values, IlUShort count=0)
 Changes several accessor values simultaneously. More...
 
virtual void getAccessors (const IlSymbol *const **names, const IlvValueTypeClass *const **types, IlUInt &count) const
 Retrieves the list of available accessors of an object. More...
 
virtual IlvValuequeryValue (IlvValue &val) const
 Retrieves an accessor value. More...
 
virtual void queryValues (IlvValue *values, IlUShort count) const
 Retrieves multiple accessor values simultaneously. More...
 

Static Public Member Functions

static IlvGraphicAnimatorGet (const IlvGraphic *graphic, const IlSymbol *name)
 Returns the animator connected with a graphic object given its name. More...
 
static IlvGraphicAnimatorRemoveFrom (IlvGraphic *graphic, const IlSymbol *name)
 Removes the menu item group from the specified abstract menu. More...
 

Additional Inherited Members

- Public Types inherited from IlvAnimator
enum  IlvAnimationMode {
  IlvAnimationNone, IlvAnimationForward, IlvAnimationBackward, IlvAnimationForwardOnce,
  IlvAnimationBackwardOnce
}
 This enumeration defines the possible values for the animation mode of an IlvAnimator object. More...
 
- Public Attributes inherited from IlvNamedProperty
IlvNamedProperty *IlvInputFilestream
 Reads an instance of the property class. More...
 

Detailed Description

Named property class.

Library: views

IlvGraphicAnimator is a subclass of IlvAnimator that deals with animation of IlvGraphic objects.

See also
IlvBitmapAnimator

Constructor & Destructor Documentation

◆ IlvGraphicAnimator()

IlvGraphicAnimator::IlvGraphicAnimator ( IlSymbol name,
IlvAnimationMode  mode = IlvAnimationForward,
IlUInt  period = 100,
IlBoolean  useApply = IlTrue 
)

Constructor.

Initializes a new instance of the IlvGraphicAnimator class. The animator will start when it is connected to any object.

Parameters
nameThe animator name.
modeThe animation mode.
periodThe animator period.
useApplyA Boolean value specifying whether the animator will use "applyToObject" functions.

Member Function Documentation

◆ addTo()

void IlvGraphicAnimator::addTo ( IlvGraphic graphic)

Connects the animator with a given graphic object.

Does nothing if the graphic object already has a named property with the same symbol as this.

Parameters
graphicThe graphic object.
See also
GetAnimator(), removeFrom()

◆ animate()

virtual void IlvGraphicAnimator::animate ( )
virtual

Called to animate the animator.

The default implementation calls IlvAnimator::changeState with the result of IlvAnimator::nextState as new state, and with redraw set to IlTrue.

See also
getState(), nextState(), setState(), changeState()

Reimplemented from IlvAnimator.

◆ Get()

static IlvGraphicAnimator* IlvGraphicAnimator::Get ( const IlvGraphic graphic,
const IlSymbol name 
)
static

Returns the animator connected with a graphic object given its name.

Parameters
graphicThe graphic object.
nameThe animator name.
Returns
The animator named name connected with graphic.
See also
addTo(), removeFrom()

◆ getGraphic()

IlvGraphic* IlvGraphicAnimator::getGraphic ( ) const

Returns the graphic object connected with the animator.

Returns
The graphic object connected with this animator.

◆ initReDraws()

virtual void IlvGraphicAnimator::initReDraws ( ) const
virtual

Called to begin a redraw session.

You must redefine this method in a subclass.

See also
reDraw(), invalidateRegion(), reDrawViews()

Implements IlvAnimator.

◆ invalidateRegion()

virtual void IlvGraphicAnimator::invalidateRegion ( ) const
virtual

Called to invalidate the area affected by the animator.

You must redefine this method in a subclass.

See also
reDraw(), initReDraws(), reDrawViews()

Implements IlvAnimator.

◆ reDrawViews()

virtual void IlvGraphicAnimator::reDrawViews ( ) const
virtual

Called to finish a redraw session.

You must redefine this method in a subclass.

See also
reDraw(), initReDraws(), invalidateRegion()

Implements IlvAnimator.

◆ removeFrom()

void IlvGraphicAnimator::removeFrom ( IlvGraphic graphic)

Disconnects the animator from the given graphic object.

Parameters
graphicThe graphic object.
See also
GetAnimator(), addTo()

◆ RemoveFrom()

static IlvGraphicAnimator* IlvGraphicAnimator::RemoveFrom ( IlvGraphic graphic,
const IlSymbol name 
)
static

Removes the menu item group from the specified abstract menu.

Parameters
graphicThe abstract menu.
nameThe group name.
See also
Get(), addTo()

◆ stateChanged()

virtual void IlvGraphicAnimator::stateChanged ( IlUInt  newState,
IlUInt  oldState 
)
virtual

Called by IlvAnimator::changeState each time the animator state changes.

The default implementation does nothing.

Parameters
newStateThe new animator state.
oldStateThe previous animator state.
See also
getState(), nextState(), changeState()

Reimplemented from IlvAnimator.

◆ useApply()

void IlvGraphicAnimator::useApply ( IlBoolean  value)

Specifies to the animator whether to use "applyTo" functions.

See the description of IlvAnimator::useApply for more details.

See also
IlvGraphicHolder::applyToObject, useApply()

◆ usesApply()

IlBoolean IlvGraphicAnimator::usesApply ( ) const

Returns a Boolean indicating whether the animator will use "applyToObject" functions.

The default value for this setting is IlTrue. It means that the animate call is encapsulated in a call to IlvGraphicHolder::applyToObject. This makes it possible to move the graphic object encapsulated in this animator without calling applyToObject yourself. However, if you know that the animator will not move the object, you can disable this feature to improve performance.

Returns
A Boolean indicating whether the animator will use "applyToObject" functions.
See also
IlvGraphicHolder::applyToObject, useApply()