Avogadro  1.1.0
Public Slots | Signals | Public Member Functions
Avogadro::Animation Class Reference

Simple frame-based animation for Molecule primitives. More...

#include <avogadro/animation.h>

Inheritance diagram for Avogadro::Animation:
Inheritance graph
[legend]

List of all members.

Public Slots

void setFps (int fps)
void setLoopCount (int loops)
void setFrame (int i)
void setDynamicBonds (bool enable)
void start ()
void pause ()
void stop ()

Signals

void frameChanged (int)

Public Member Functions

 Animation (QObject *parent=0)
virtual ~Animation ()
void setMolecule (Molecule *molecule)
void setFrames (std::vector< std::vector< Eigen::Vector3d > * > frames)
int fps () const
int loopCount () const
int numFrames () const
bool dynamicBonds () const

Detailed Description

Simple frame-based animation for Molecule primitives.

Author:
Geoffrey R. Hutchison

The animation class supports simple frame-based animations for molecules. It can handle trajectories, vibrations, geometry optimizations and many other common molecular animations.

It assumes constant atom lists throughout. If you want more complicated animations, you can accomplish this using your own Extension.

An Animation object works by changing conformers inside a Molecule. Consequently, you can either read in the conformers from a file, or call Animation::setFrames() to set the coordinates for the animation. The latter works well for generated coordinates, for example, vibrations.


Constructor & Destructor Documentation

Constructor.

Parameters:
parentThe object parent. Should be the widget viewing the animation or a child of that widget (e.g., an Extension).

References QTimeLine::setCurveShape().

Deconstructor.


Member Function Documentation

Returns:
True if dynamic bond detection is enabled.
int Avogadro::Animation::fps ( ) const
Returns:
The number of frames per second.

Referenced by setFps().

void Avogadro::Animation::frameChanged ( int  ) [signal]

This signal is emitted when the current frame is changed (i.e. setFrame() called)

Referenced by setFrame(), start(), and stop().

Returns:
The loopCount (0 = repeat forever).

References QTimeLine::loopCount.

Returns:
The total number of frames in the animation.

References Avogadro::Molecule::numConformers().

Referenced by setFrames(), and start().

void Avogadro::Animation::pause ( ) [slot]

Pause the animation.

References QTimeLine::stop().

void Avogadro::Animation::setDynamicBonds ( bool  enable) [slot]

Enable/disable dynamic bond detection. For QM reactions for example.

void Avogadro::Animation::setFps ( int  fps) [slot]

Set the number of frames per second.

References fps().

void Avogadro::Animation::setFrame ( int  i) [slot]
void Avogadro::Animation::setFrames ( std::vector< std::vector< Eigen::Vector3d > * >  frames)

Set the frames for the animation. By default, the conformers in the molecule are used as animation frames. However, for trajectory files that don't contain any topology, it is needed to read in the the molecule topology before the trajectory. The trajectory frames can be used to call setFrames() later.

References Avogadro::Molecule::conformer(), Avogadro::Molecule::numConformers(), numFrames(), and QTimeLine::setFrameRange().

void Avogadro::Animation::setLoopCount ( int  loops) [slot]

Set the loop count. (0 = repeat forever)

References QTimeLine::setLoopCount().

void Avogadro::Animation::start ( ) [slot]
void Avogadro::Animation::stop ( ) [slot]

The documentation for this class was generated from the following files: