#include <SofaScene.h>
A sofa scene graph with simulation functions. More...
A sofa scene graph with simulation functions.
There are methods to initialize and update the visual models, but rendering must be performed externally, see e.g. class SofaGL.
The typical life cycle is:
loadPlugins( list of plugin names ); setScene( scenegraph ); or open(filename) initVisual() [ your main loop: ] step(dt); updateVisual(); [ use a SofaGL object to display the simulated objects ]
Protected Attributes | |
simulation::Node::SPtr | _groot |
root of the scene More... | |
simulation::Node * | _iroot |
root of the interactors, child of _groot More... | |
Public Member Functions | |
SofaScene () | |
Initialize Sofa. More... | |
virtual | ~SofaScene () |
void | loadPlugins (const std::vector< std::string > &plugins) |
load the given plugin More... | |
void | open (const std::string &fileName) |
Load a scene file. The previous scene graph, if any, is deleted. More... | |
void | setScene (simulation::Node *graph) |
Set the scene graph. The previous scene graph, if any, is deleted. More... | |
void | printGraph () |
Print the scene graph on the standard ouput, for debugging. More... | |
void | step (SReal dt) |
Integrate time by one step and update the Sofa scene. More... | |
void | reset () |
restart from the beginning More... | |
void | getBoundingBox (SReal *xmin, SReal *xmax, SReal *ymin, SReal *ymax, SReal *zmin, SReal *zmax) |
Compute the bounding box of the simulated objects. More... | |
void | initVisual () |
To do once before rendering a scene, typically at initialization time. More... | |
void | updateVisual () |
Update the visual models. To do after animating and before rendering. More... | |
Developer API | |
To be used to create new functionalities. | |
simulation::Node * | groot () |
Root of the simulated scene. More... | |
simulation::Node * | iroot () |
Root of the interactors, set as child of groot. More... | |
void | insertInteractor (Interactor *) |
Do not use this directly. Use Interactor::attach, which calls this. More... | |
|
protected |
root of the scene
|
protected |
root of the interactors, child of _groot
sofa::simplegui::SofaScene::SofaScene | ( | ) |
Initialize Sofa.
|
inlinevirtual |
void sofa::simplegui::SofaScene::getBoundingBox | ( | SReal * | xmin, |
SReal * | xmax, | ||
SReal * | ymin, | ||
SReal * | ymax, | ||
SReal * | zmin, | ||
SReal * | zmax | ||
) |
Compute the bounding box of the simulated objects.
xmin | min coordinate in the X direction |
xmax | max coordinate in the X direction |
ymin | etc. |
ymax | |
zmin | |
zmax |
simulation::Node * sofa::simplegui::SofaScene::groot | ( | ) |
Root of the simulated scene.
void sofa::simplegui::SofaScene::initVisual | ( | ) |
To do once before rendering a scene, typically at initialization time.
void sofa::simplegui::SofaScene::insertInteractor | ( | Interactor * | interactor | ) |
Do not use this directly. Use Interactor::attach, which calls this.
|
inline |
Root of the interactors, set as child of groot.
void sofa::simplegui::SofaScene::loadPlugins | ( | const std::vector< std::string > & | plugins | ) |
load the given plugin
plugins | names of the plugins |
void sofa::simplegui::SofaScene::open | ( | const std::string & | fileName | ) |
Load a scene file. The previous scene graph, if any, is deleted.
fileName | Scene file to load |
void sofa::simplegui::SofaScene::printGraph | ( | ) |
Print the scene graph on the standard ouput, for debugging.
void sofa::simplegui::SofaScene::reset | ( | ) |
restart from the beginning
void sofa::simplegui::SofaScene::setScene | ( | simulation::Node * | graph | ) |
Set the scene graph. The previous scene graph, if any, is deleted.
graph | the scene to simulate |
void sofa::simplegui::SofaScene::step | ( | SReal | dt | ) |
Integrate time by one step and update the Sofa scene.
void sofa::simplegui::SofaScene::updateVisual | ( | ) |
Update the visual models. To do after animating and before rendering.