41 m_pModelVisitor(NULL),
43 m_renderRate(renderRate),
49 throw std::invalid_argument(
"stepSize is not positive");
53 throw std::invalid_argument(
"renderRate is less than stepSize");
63 assert(!m_initialized);
66 tgSimView::~tgSimView()
82 std::invalid_argument(
"The view already belongs to a simulation.");
114 m_initialized =
true;
118 assert(m_initialized);
125 m_initialized =
false;
129 assert(!m_initialized);
143 std::cout <<
"SimView::run("<<steps<<
")" << std::endl;
146 double totalTime = 0.0;
147 for (
int i = 0; i < steps; i++) {
200 throw std::invalid_argument(
"stepSize is not positive");
211 assert((stepSize <= 0.0) || (
m_stepSize == stepSize));
214 bool tgSimView::invariant()
const
void bindToWorld(tgWorld &world)
virtual void render() const
void bindToSimulation(tgSimulation &simulation)
tgModelVisitor * m_pModelVisitor
void releaseFromSimulation()
tgWorld & getWorld() const
Contains the definition of class tgSimulation.
void setRenderRate(double renderRate)
Contains the definition of interface class tgModelVisitor.
void setStepSize(double stepSize)
tgSimulation * m_pSimulation
void onVisit(const tgModelVisitor &r) const
Contains the definition of class tgSimView.
tgSimView(tgWorld &world, double stepSize=1.0/1000.0, double renderRate=1.0/60.0)
void step(double dt) const