46 tgSimulation::~tgSimulation()
50 for (
int i = 0; i < m_models.size(); i++)
61 throw std::invalid_argument(
"NULL pointer to tgModel");
67 m_models.push_back(pModel);
72 assert(!m_models.empty());
79 for (
int i = 0; i < m_models.size(); i++) {
80 m_models[i]->onVisit(r);
84 void tgSimulation::reset()
90 for (
int i = 0; i != m_models.size(); i++)
93 m_models[i]->setup(m_view.
world());
102 return m_view.
world();
109 throw std::invalid_argument(
"dt for step is not positive");
118 for (
int i = 0; i < m_models.size(); i++)
120 m_models[i]->step(dt);
125 void tgSimulation::teardown()
const
127 const size_t n = m_models.size();
128 for (
int i = 0; i < n; i++)
130 tgModel *
const pModel = m_models[i];
131 assert(pModel != NULL);
152 bool tgSimulation::invariant()
const
virtual void setup(tgWorld &world)
void bindToSimulation(tgSimulation &simulation)
void releaseFromSimulation()
tgWorld & getWorld() const
void addModel(tgModel *pModel)
Contains the definition of class tgModel. $Id$.
Contains the definition of class tgSimulation $Id$.
Contains the definition of class tgSimViewGraphics $Id$.
void step(double dt) const
Contains the definition of class tgWorld $Id$.
tgSimulation(tgSimView &view)
Contains the definition of class tgSimView $Id$.
void step(double dt) const