The Scene class represents a 3D scene as a flat collection of 3D objects. More...
#include <scene.h>
Public Member Functions | |
| Scene () | |
| const vector< Object > & | objects () const |
| vector< Object > & | objects () |
| void | addObject (Object &) |
| void | clear () |
| int | selectedObject () const |
| void | setSelectedObject (int index) |
| void | computeBoundingBox () |
| Box | boundingBox () const |
A scene is basically a vector of 3D objects.
| Scene::Scene | ( | ) |
Constructs an empty scene.
| void Scene::addObject | ( | Object & | o | ) |
Adds an object to the scene.
| Box Scene::boundingBox | ( | ) | const |
Returns the value of the bounding box property. This property is undefined unless boundingBox() has been called for this scene.
| void Scene::clear | ( | ) |
Clears the scene.
| void Scene::computeBoundingBox | ( | ) |
Recomputes the bounding box of the scene, as the bounding box of its objects.
| const vector< Object > & Scene::objects | ( | ) | const |
Returns a constant reference (read-only) to the vector of objects forming the scene.
| vector< Object > & Scene::objects | ( | ) |
Returns a reference to the vector of objects forming the scene. VAR
| int Scene::selectedObject | ( | ) | const |
If an object is selected, returns the index of that selected object (from 0 to number of objects - 1). Otherwise returns -1.
| void Scene::setSelectedObject | ( | int | index | ) |
Sets the selected object by indicating its index. Only one object can be seleted at any given time.
| index | is the position of the selected object in the vector of objects. |