COPASI API  4.16.103
CQCopasiAnimation.cpp
Go to the documentation of this file.
1 // Copyright (C) 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
8 
10  mEntries(),
11  mpDataModel(NULL),
12  mMode(CQCopasiAnimation::Global),
13  mNumSteps(0)
14 {}
15 
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 }
28 
29 std::vector<CQEffectDescription*>& CQCopasiAnimation::getEntries()
30 {
31  return mEntries;
32 }
33 
35 {
36  return mNumSteps;
37 }
38 
40 {
41  std::vector<CQEffectDescription*>::iterator it = mEntries.begin();
42 
43  while (it != mEntries.end())
44  {
45  (*it)->removeFromScene(scene);
46  ++it;
47  }
48 }
49 
50 void CQCopasiAnimation::getScales(std::vector<qreal>& scales, int step) //= 0;
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 }
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 }
73 
75 {
76  return mMode;
77 }
78 
80 {
81  mMode = mode;
82 }
ScaleMode getScaleMode() const
virtual int getNumSteps()
virtual void removeFromScene(CQLayoutScene &scene)
virtual void getScales(std::vector< qreal > &scales, int step)
void setScaleMode(ScaleMode mode)
std::vector< CQEffectDescription * > & getEntries()
std::vector< CQEffectDescription * > mEntries
virtual void applyToScene(CQLayoutScene &scene, int step)