40 m_pModelVisitor(NULL),
42 m_renderRate(renderRate),
48 throw std::invalid_argument(
"stepSize is not positive");
52 throw std::invalid_argument(
"renderRate is less than stepSize");
62 assert(!m_initialized);
65 tgSimView::~tgSimView()
81 std::invalid_argument(
"The view already belongs to a simulation.");
108 void tgSimView::setup()
113 m_initialized =
true;
117 assert(m_initialized);
120 void tgSimView::teardown()
124 m_initialized =
false;
128 assert(!m_initialized);
142 std::cout <<
"SimView::run("<<steps<<
")" << std::endl;
145 double totalTime = 0.0;
146 for (
int i = 0; i < steps; i++) {
160 void tgSimView::render()
const
180 void tgSimView::reset()
201 throw std::invalid_argument(
"stepSize is not positive");
212 assert((stepSize <= 0.0) || (
m_stepSize == stepSize));
215 bool tgSimView::invariant()
const
void bindToWorld(tgWorld &world)
void bindToSimulation(tgSimulation &simulation)
tgModelVisitor * m_pModelVisitor
void releaseFromSimulation()
tgWorld & getWorld() const
Contains the definition of class tgSimulation $Id$.
void setRenderRate(double renderRate)
Contains the definition of interface class tgModelVisitor.
void setStepSize(double stepSize)
tgSimulation * m_pSimulation
Contains the definition of class tgSimView $Id$.
tgSimView(tgWorld &world, double stepSize=1.0/120.0, double renderRate=1.0/60.0)
void step(double dt) const