simulation Class Reference

#include <simulation.hpp>

Inheritance diagram for simulation:

Inheritance graph
[legend]
Collaboration diagram for simulation:

Collaboration graph
[legend]

List of all members.


Detailed Description

Encapsulates a simulation.

Definition at line 54 of file simulation.hpp.


Public Member Functions

void cleanup ()
 This is called at the end of the simulation.
void draw ()
 This is called to draw the frame. It may be called concurrently with update(), which is updating the next frame while the current one is being drawn.
contextget_context ()
bool handle_event (sg_event &e)
 This is called to pass events to the scene graph after they have been left unhandled by the UI.
void init ()
 This is called at the beginning of a simulation. It will initialize all the nodes in the scene graph.
bool is_running () const
void pre_draw ()
 This is called at the beginning of each frame. It records drawing information for all the nodes in the scene graph.
 simulation (const data::config_record &sim_config, platform::display *console, context *sim_context, scenegraph::node *scenery)
void update ()
 This is called to update the scene graph. It may be called concurrently with draw(), which is drawing the previous frame.
 ~simulation ()

Private Member Functions

void cleanup_context ()
void cleanup_node (scenegraph::node *n)
bool handle_event (sg_event &e, node *n)
void init_context ()
void init_node (scenegraph::node *n)
void update_context ()
void update_node (scenegraph::node *n)

Private Attributes

platform::displayconsole
 The game's single console.
data::simple_array< gsgl::real_tframe_deltas
platform::fontinfo_font
data::list< node * > non_scenery_nodes
 These get removed from the scene graph & deleted when the simulation ends.
node::pre_draw_rec pre_rec
bool running
nodescenery
 The root node of the simulation scene graph.
contextsim_context
time_t start_time
gsgl::real_t time_scale
freeviewview
 The main view node.

Constructor & Destructor Documentation

simulation ( const data::config_record sim_config,
platform::display console,
context sim_context,
scenegraph::node scenery 
)

~simulation (  ) 

Definition at line 163 of file simulation.cpp.

References simulation::info_font, and simulation::non_scenery_nodes.


Member Function Documentation

void cleanup (  ) 

This is called at the end of the simulation.

Definition at line 333 of file simulation.cpp.

References simulation::cleanup_context(), simulation::cleanup_node(), and simulation::scenery.

Referenced by application::unload_and_quit_simulation().

void cleanup_context (  )  [private]

Definition at line 242 of file simulation.cpp.

Referenced by simulation::cleanup().

void cleanup_node ( scenegraph::node n  )  [private]

Definition at line 427 of file simulation.cpp.

References assert, node::cleanup(), node::get_children(), and simulation::sim_context.

Referenced by simulation::cleanup().

void draw (  ) 

context* get_context (  )  [inline]

Definition at line 83 of file simulation.hpp.

Referenced by application::run().

bool handle_event ( sg_event e,
node n 
) [private]

bool handle_event ( sg_event e  ) 

void init (  ) 

This is called at the beginning of a simulation. It will initialize all the nodes in the scene graph.

Definition at line 247 of file simulation.cpp.

References simulation::init_context(), simulation::init_node(), and simulation::scenery.

Referenced by application::load_and_run_simulation().

void init_context (  )  [private]

void init_node ( scenegraph::node n  )  [private]

Definition at line 398 of file simulation.cpp.

References assert, node::get_children(), node::init(), and simulation::sim_context.

Referenced by simulation::init().

bool is_running (  )  const [inline]

Definition at line 82 of file simulation.hpp.

Referenced by application::run().

void pre_draw (  ) 

This is called at the beginning of each frame. It records drawing information for all the nodes in the scene graph.

Definition at line 257 of file simulation.cpp.

References node::pre_draw_scene(), simulation::pre_rec, and simulation::sim_context.

Referenced by application::run().

void update (  ) 

This is called to update the scene graph. It may be called concurrently with draw(), which is drawing the previous frame.

Definition at line 321 of file simulation.cpp.

References context::delta_tick, context::frame, simulation::frame_deltas, simulation::scenery, simulation::sim_context, simulation::time_scale, simulation::update_context(), and simulation::update_node().

Referenced by application::run().

void update_context (  )  [private]

void update_node ( scenegraph::node n  )  [private]


Member Data Documentation

The game's single console.

Definition at line 59 of file simulation.hpp.

Referenced by simulation::draw(), simulation::init_context(), and simulation::update_context().

Definition at line 71 of file simulation.hpp.

Referenced by simulation::draw(), simulation::simulation(), and simulation::update().

These get removed from the scene graph & deleted when the simulation ends.

Definition at line 63 of file simulation.hpp.

Referenced by simulation::simulation(), and simulation::~simulation().

Definition at line 73 of file simulation.hpp.

Referenced by simulation::draw(), and simulation::pre_draw().

bool running [private]

Definition at line 57 of file simulation.hpp.

Referenced by simulation::handle_event().

node* scenery [private]

context* sim_context [private]

time_t start_time [private]

Definition at line 67 of file simulation.hpp.

Referenced by simulation::init_context(), and simulation::simulation().

freeview* view [private]


The documentation for this class was generated from the following files:

Generated on Sat Mar 1 13:50:07 2008 for Periapsis Project by  doxygen 1.5.5