Definition at line 52 of file tgSimViewGraphics.h.
tgSimViewGraphics::tgSimViewGraphics |
( |
tgWorld & |
world, |
|
|
double |
stepSize = 1.0/120.0 , |
|
|
double |
renderRate = 1.0/60.0 |
|
) |
| |
The only constructor.
- Parameters
-
[in] | world | a reference to the tgWorld being simulated. |
[in] | stepSize | the time interval for advancing the simulation; std::invalid_argument is thrown if not positive |
[in] | renderRate | the time interval for updating the graphics; std::invalid_argument is thrown if less than stepSize |
- Exceptions
-
std::invalid_argument | if stepSize is not positive or renderRate is less than stepSize |
- Todo:
- figure out a good time to delete this
Definition at line 35 of file tgSimViewGraphics.cpp.
void tgSimView::bindToSimulation |
( |
tgSimulation & |
simulation | ) |
|
|
protectedinherited |
Called by a constructor of friend class tgSimulation when an instance of this class is passed as argument to the constructor. Cache a back pointer to the tgSimulation
- Parameters
-
[in,out] | simulation | a reference to the tgSimulation being constructed |
- Exceptions
-
std::invalid_argument | if the tgSimView already has a back pointer. |
Definition at line 76 of file tgSimView.cpp.
void tgSimView::bindToWorld |
( |
tgWorld & |
world | ) |
|
|
protectedinherited |
double tgSimView::getRenderRate |
( |
| ) |
const |
|
inlineinherited |
Return the interval in seconds at which the graphics are rendered.
- Returns
- the interval in seconds at which the graphics are rendered
Definition at line 101 of file tgSimView.h.
double tgSimView::getStepSize |
( |
| ) |
const |
|
inlineinherited |
Return the interval in seconds at which the graphics are rendered.
- Returns
- the interval in seconds at which the graphics are rendered
Definition at line 116 of file tgSimView.h.
bool tgSimView::isInitialzed |
( |
| ) |
const |
|
inlineprotectedinherited |
void tgSimView::releaseFromSimulation |
( |
| ) |
|
|
protectedinherited |
void tgSimViewGraphics::run |
( |
| ) |
|
|
inlinevirtual |
Run until user stops - currently the same as run(steps) due to use of GLUT
Reimplemented from tgSimView.
Definition at line 78 of file tgSimViewGraphics.h.
void tgSimViewGraphics::run |
( |
int |
steps | ) |
|
|
virtual |
void tgSimView::setRenderRate |
( |
double |
renderRate | ) |
|
|
inherited |
Set the interval in seconds at which the graphics are to be rendered. It is set to the minimum of the renderRate argument and the current step size.
- Parameters
-
[in] | renderRate | the interval in seconds at which the graphics are to be rendered |
Definition at line 189 of file tgSimView.cpp.
void tgSimView::setStepSize |
( |
double |
stepSize | ) |
|
|
inherited |
Set the interval in seconds at which the simulation is advanced. The render rate is adjusted to be no less than stepSize.
- Parameters
-
[in] | stepSize | the interval in seconds at which the simulation is advanced; std::invalid_argument is thrown if stepSize is not positive |
- Exceptions
-
std::invalid_argument | if stepSize is not positive |
Definition at line 197 of file tgSimView.cpp.
void tgSimViewGraphics::setup |
( |
| ) |
|
|
virtual |
Return a reference to the tgWorld being simulated.
- Returns
- a reference to the tgWorld being simulated
Definition at line 64 of file tgSimView.h.
An object that knows how to visit the various models for rendering or data logging.
- Note
- This is a pointer to avoid #including the header file.
Definition at line 162 of file tgSimView.h.
A back pointer to the simulation that owns this view. Made protected to allow tgSimulatorWithGraphics to inherit it. The constructor initializes it to NULL and it becomes non-NULL when added to a simulation.
Definition at line 155 of file tgSimView.h.
double tgSimView::m_renderRate |
|
protectedinherited |
The interval in seconds at which the graphics are rendered. It must be be greater than or equal to m_stepSize.
Definition at line 175 of file tgSimView.h.
double tgSimView::m_renderTime |
|
protectedinherited |
The time in seconds when the next render should be. It must be non-negative.
Definition at line 181 of file tgSimView.h.
double tgSimView::m_stepSize |
|
protectedinherited |
The interval in seconds at which the simulation is advanced. It must be positive and it must be less than or equal to m_renderRate.
Definition at line 169 of file tgSimView.h.
The documentation for this class was generated from the following files: