COPASI API  4.16.103
Public Types | Public Member Functions | Protected Attributes | List of all members
CQCopasiAnimation Class Referenceabstract

#include <CQCopasiAnimation.h>

Inheritance diagram for CQCopasiAnimation:
Inheritance graph
[legend]
Collaboration diagram for CQCopasiAnimation:
Collaboration graph
[legend]

Public Types

enum  ScaleMode { Global, Individual }
 

Public Member Functions

virtual void applyToScene (CQLayoutScene &scene, int step)
 
 CQCopasiAnimation ()
 
std::vector
< CQEffectDescription * > & 
getEntries ()
 
virtual int getNumSteps ()
 
ScaleMode getScaleMode () const
 
virtual void getScales (std::vector< qreal > &scales, int step)
 
virtual void initialize (const CCopasiDataModel &model)=0
 
virtual void removeFromScene (CQLayoutScene &scene)
 
void setScaleMode (ScaleMode mode)
 
virtual ~CQCopasiAnimation ()
 

Protected Attributes

std::vector
< CQEffectDescription * > 
mEntries
 
ScaleMode mMode
 
int mNumSteps
 
const CCopasiDataModelmpDataModel
 

Detailed Description

Definition at line 16 of file CQCopasiAnimation.h.

Member Enumeration Documentation

Enumerator
Global 
Individual 

Definition at line 19 of file CQCopasiAnimation.h.

Constructor & Destructor Documentation

CQCopasiAnimation::CQCopasiAnimation ( )

Definition at line 9 of file CQCopasiAnimation.cpp.

9  :
10  mEntries(),
11  mpDataModel(NULL),
13  mNumSteps(0)
14 {}
std::vector< CQEffectDescription * > mEntries
const CCopasiDataModel * mpDataModel
CQCopasiAnimation::~CQCopasiAnimation ( )
virtual

Definition at line 16 of file CQCopasiAnimation.cpp.

References mEntries.

17 {
18  std::vector<CQEffectDescription*>::iterator it = mEntries.begin();
19 
20  while (it != mEntries.end())
21  {
22  delete *it;
23  ++it;
24  }
25 
26  mEntries.clear();
27 }
std::vector< CQEffectDescription * > mEntries

Member Function Documentation

void CQCopasiAnimation::applyToScene ( CQLayoutScene scene,
int  step 
)
virtual

Definition at line 61 of file CQCopasiAnimation.cpp.

References getScales(), and mEntries.

Referenced by CQAnimationWindow::slotShowStep().

62 {
63  std::vector<qreal> scales; getScales(scales, step);
64 
65  if (scales.size() != mEntries.size())
66  return;
67 
68  for (size_t i = 0; i < scales.size(); ++i)
69  {
70  mEntries[i]->applyToScene(scene, scales[i]);
71  }
72 }
virtual void getScales(std::vector< qreal > &scales, int step)
std::vector< CQEffectDescription * > mEntries
std::vector< CQEffectDescription * > & CQCopasiAnimation::getEntries ( )

Definition at line 29 of file CQCopasiAnimation.cpp.

References mEntries.

Referenced by CQAnimationSettingsEditor::initFrom().

30 {
31  return mEntries;
32 }
std::vector< CQEffectDescription * > mEntries
int CQCopasiAnimation::getNumSteps ( )
virtual

Definition at line 34 of file CQCopasiAnimation.cpp.

References mNumSteps.

Referenced by CQAnimationWindow::setAnimation(), and CQAnimationWindow::slotShowStep().

35 {
36  return mNumSteps;
37 }
CQCopasiAnimation::ScaleMode CQCopasiAnimation::getScaleMode ( ) const

Definition at line 74 of file CQCopasiAnimation.cpp.

References mMode.

Referenced by CQAnimationSettingsEditor::initFrom().

75 {
76  return mMode;
77 }
void CQCopasiAnimation::getScales ( std::vector< qreal > &  scales,
int  step 
)
virtual

Reimplemented in QTimeCourseAnimation, QFluxModeAnimation, and QConservedSpeciesAnimation.

Definition at line 50 of file CQCopasiAnimation.cpp.

References mEntries.

Referenced by applyToScene().

51 {
52  scales.clear();
53  std::vector<CQEffectDescription*>::iterator it = mEntries.begin();
54 
55  while (it != mEntries.end())
56  {
57  scales.push_back(step / 100.0);
58  ++it;
59  }
60 }
std::vector< CQEffectDescription * > mEntries
virtual void CQCopasiAnimation::initialize ( const CCopasiDataModel model)
pure virtual
void CQCopasiAnimation::removeFromScene ( CQLayoutScene scene)
virtual

Definition at line 39 of file CQCopasiAnimation.cpp.

References mEntries.

Referenced by CQAnimationWindow::setAnimation().

40 {
41  std::vector<CQEffectDescription*>::iterator it = mEntries.begin();
42 
43  while (it != mEntries.end())
44  {
45  (*it)->removeFromScene(scene);
46  ++it;
47  }
48 }
std::vector< CQEffectDescription * > mEntries
void CQCopasiAnimation::setScaleMode ( CQCopasiAnimation::ScaleMode  mode)

Definition at line 79 of file CQCopasiAnimation.cpp.

References mMode.

Referenced by CQAnimationSettingsEditor::saveTo().

80 {
81  mMode = mode;
82 }

Member Data Documentation

std::vector<CQEffectDescription*> CQCopasiAnimation::mEntries
protected
ScaleMode CQCopasiAnimation::mMode
protected

Definition at line 38 of file CQCopasiAnimation.h.

Referenced by getScaleMode(), QTimeCourseAnimation::getScales(), and setScaleMode().

int CQCopasiAnimation::mNumSteps
protected
const CCopasiDataModel* CQCopasiAnimation::mpDataModel
protected

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