COPASI API  4.16.103
Private Member Functions | List of all members
QConservedSpeciesAnimation Class Reference
Inheritance diagram for QConservedSpeciesAnimation:
Inheritance graph
[legend]
Collaboration diagram for QConservedSpeciesAnimation:
Collaboration graph
[legend]

Private Member Functions

virtual void getScales (std::vector< qreal > &scales, int step)
 
virtual void initialize (const CCopasiDataModel &dataModel)
 

Additional Inherited Members

- Public Types inherited from CQCopasiAnimation
enum  ScaleMode { Global, Individual }
 
- Public Member Functions inherited from CQCopasiAnimation
virtual void applyToScene (CQLayoutScene &scene, int step)
 
 CQCopasiAnimation ()
 
std::vector
< CQEffectDescription * > & 
getEntries ()
 
virtual int getNumSteps ()
 
ScaleMode getScaleMode () const
 
virtual void removeFromScene (CQLayoutScene &scene)
 
void setScaleMode (ScaleMode mode)
 
virtual ~CQCopasiAnimation ()
 
- Protected Attributes inherited from CQCopasiAnimation
std::vector
< CQEffectDescription * > 
mEntries
 
ScaleMode mMode
 
int mNumSteps
 
const CCopasiDataModelmpDataModel
 

Detailed Description

Definition at line 35 of file CQAnimationWindow.cpp.

Member Function Documentation

virtual void QConservedSpeciesAnimation::getScales ( std::vector< qreal > &  scales,
int  step 
)
inlineprivatevirtual

Reimplemented from CQCopasiAnimation.

Definition at line 55 of file CQAnimationWindow.cpp.

References CMoiety::getEquation(), CCopasiDataModel::getModel(), CModel::getMoieties(), CQCopasiAnimation::mEntries, CQCopasiAnimation::mNumSteps, CQCopasiAnimation::mpDataModel, and CCopasiVector< T >::size().

56  {
57  if (mpDataModel == NULL) return;
58 
59  const CModel& model = *mpDataModel->getModel();
60  const CCopasiVector< CMoiety > & moieties = model.getMoieties();
61  mNumSteps = moieties.size();
62 
63  if (moieties.size() <= (size_t)step) return;
64 
65  const CMoiety* moiety = moieties[step];
66  const std::vector<std::pair< C_FLOAT64, CMetab * > > &eqn = moiety->getEquation();
67  std::map<std::string, double> cnValueMap;
68  std::vector<std::pair< C_FLOAT64, CMetab * > >::const_iterator it = eqn.begin();
69 
70  while (it != eqn.end())
71  {
72  cnValueMap[(*it).second->getCN()] = (*it).first;
73  ++it;
74  }
75 
76  for (size_t i = 0; i < mEntries.size(); ++i)
77  scales.push_back(cnValueMap[mEntries[i]->getCN()]);
78  }
virtual size_t size() const
const std::vector< std::pair< C_FLOAT64, CMetab * > > & getEquation() const
Definition: CMoiety.cpp:267
const CCopasiVector< CMoiety > & getMoieties() const
Definition: CModel.cpp:1163
std::vector< CQEffectDescription * > mEntries
const CCopasiDataModel * mpDataModel
Definition: CModel.h:50
virtual void QConservedSpeciesAnimation::initialize ( const CCopasiDataModel dataModel)
inlineprivatevirtual

Implements CQCopasiAnimation.

Definition at line 37 of file CQAnimationWindow.cpp.

References CCopasiVector< T >::begin(), CCopasiVector< T >::end(), CModel::getMetabolites(), CCopasiDataModel::getModel(), CModel::getMoieties(), CQCopasiAnimation::mEntries, CQCopasiAnimation::mNumSteps, CQCopasiAnimation::mpDataModel, and CCopasiVector< T >::size().

38  {
39  mpDataModel = &dataModel;
40  const CModel& model = *dataModel.getModel();
41  const CCopasiVector< CMetab > & metabs = model.getMetabolites();
43 
44  while (it != metabs.end())
45  {
46  mEntries.push_back(new CQEffectDescription((*it)->getCN()));
47  ++it;
48  }
49 
50  // initialize number of steps
51  const CCopasiVector< CMoiety > & moieties = model.getMoieties();
52  mNumSteps = moieties.size();
53  }
const CCopasiVector< CMetab > & getMetabolites() const
Definition: CModel.cpp:1051
virtual size_t size() const
iterator begin()
const CCopasiVector< CMoiety > & getMoieties() const
Definition: CModel.cpp:1163
iterator end()
std::vector< CQEffectDescription * > mEntries
const CCopasiDataModel * mpDataModel
Definition: CModel.h:50

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