![]() |
Number5
Visualisierung 2 Project - Florian Schober (0828151, f.schober@live.com), Andreas Walch (0926780, walch.andreas89@gmail.com)
|
#include <SceneGraph.hpp>
Public Member Functions | |
bool const | hasSceneChanged () |
SceneGraph (Application *app) | |
~SceneGraph () | |
template<typename t_obj > | |
t_obj & | add (t_obj *object) |
void | remove (ISceneObject *&object) |
object_list::iterator | begin () |
object_list::iterator | end () |
void | draw (DrawArgs &args) |
void | update (double time, double timeDelta) |
id_t | createId () |
void | deleteId (id_tid) |
void | reset () |
Private Types | |
typedef set< ISceneObject * > | object_list |
Private Attributes | |
object_list | m_objects |
Application * | m_app |
bool | m_hasSceneChanged |
SceneGraph manages the applications scene-graph. Objects that are registered will be hosted by this object (i.e. delteted on removal).
Definition at line 9 of file SceneGraph.hpp.
|
private |
Definition at line 11 of file SceneGraph.hpp.
SceneGraph | ( | Application * | app | ) |
Constructs an empty scene-graph.
app | The global application |
Definition at line 4 of file SceneGraph.cpp.
~SceneGraph | ( | ) |
Destructs the scene-graph and deletes all hostes objects
Definition at line 9 of file SceneGraph.cpp.
|
inline |
Registeres an objects to the scene-graph. From now on this object is hosted by the scene-graph.
object | The object to be registered |
Definition at line 42 of file SceneGraph.hpp.
SceneGraph::object_list::iterator begin | ( | ) |
Accessor to the scene-graphs begin-iterator
Definition at line 22 of file SceneGraph.cpp.
|
inlineinherited |
Creates a new id (or pops an unused one) and returns it.
Definition at line 28 of file IdCache.hpp.
|
inlineinherited |
Gives back the passed id.
Definition at line 41 of file IdCache.hpp.
void draw | ( | DrawArgs & | args | ) |
Draws all objects
args | The DrawArgs that should be used for this rendering |
Definition at line 41 of file SceneGraph.cpp.
SceneGraph::object_list::iterator end | ( | ) |
Accessor to the scene-graphs end-iterator
Definition at line 26 of file SceneGraph.cpp.
|
inline |
Accessor to a bool indicating wheter the scene-graph has changed since the last frame
Definition at line 22 of file SceneGraph.hpp.
void remove | ( | ISceneObject *& | object | ) |
Removes an object from the scene-graph and deletes it. The passed pointer is set to nullptr.
object | The object to be removed |
Definition at line 13 of file SceneGraph.cpp.
|
inlineinherited |
Resets its state to default. All used/unused ids will be forgotten.
Definition at line 50 of file IdCache.hpp.
void update | ( | double | time, |
double | timeDelta | ||
) |
Updates every object in the scene-graph (calls its update-member). Detects wheter the scene-graph has changed.
time | The absolute frame-time |
timeDelta | The time since the last frame |
Definition at line 31 of file SceneGraph.cpp.
|
private |
The global application
Definition at line 14 of file SceneGraph.hpp.
|
private |
A bool indicating wheter the scene-graph has changed since the last frame
Definition at line 15 of file SceneGraph.hpp.
|
private |
List of objects in the scene-graph
Definition at line 13 of file SceneGraph.hpp.