Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Worlds
[libstage]


Typedefs

typedef _stg_world stg_world_t
typedef int(* stg_property_callback_t )(stg_model_t *mod, char *name, void *data, size_t len, void *userdata)
typedef void(* stg_property_storage_func_t )(struct stg_property *prop, void *data, size_t len)

Functions

stg_world_tstg_world_create (stg_id_t id, const char *token, int sim_interval, int real_interval, double ppm, double width, double height)
stg_world_tstg_world_create_from_file (const char *worldfile_path)
void stg_world_destroy (stg_world_t *world)
void stg_world_stop (stg_world_t *world)
void stg_world_start (stg_world_t *world)
int stg_world_update (stg_world_t *world, int sleepflag)
void stg_world_load (stg_world_t *mod)
void stg_world_save (stg_world_t *mod)
void stg_world_print (stg_world_t *world)
void stg_world_set_interval_real (stg_world_t *world, unsigned int val)
void stg_world_set_interval_sim (stg_world_t *world, unsigned int val)
stg_model_tstg_world_get_model (stg_world_t *world, stg_id_t mid)
stg_model_tstg_world_model_name_lookup (stg_world_t *world, const char *name)
void stg_world_add_property_callback (stg_world_t *world, char *propname, stg_property_callback_t callback, void *userdata)
void stg_world_remove_property_callback (stg_world_t *world, char *propname, stg_property_callback_t callback)
void stg_model_add_property_toggles (stg_model_t *mod, const char *propname, stg_property_callback_t callback_on, void *arg_on, stg_property_callback_t callback_off, void *arg_off, const char *label, int enabled)
int stg_model_fig_clear_cb (stg_model_t *mod, void *data, size_t len, void *userp)

Detailed Description

Implements a world - a collection of models and a matrix.

Typedef Documentation

typedef struct _stg_world stg_world_t
 

opaque data structure implementing a world

typedef int(* stg_property_callback_t)(stg_model_t *mod, char *name, void *data, size_t len, void *userdata)
 

typedef void(* stg_property_storage_func_t)(struct stg_property *prop, void *data, size_t len)
 


Function Documentation

stg_world_t* stg_world_create stg_id_t  id,
const char *  token,
int  sim_interval,
int  real_interval,
double  ppm,
double  width,
double  height
 

Create a new world, to be configured and populated by user code

stg_world_t* stg_world_create_from_file const char *  worldfile_path  ) 
 

Create a new world as described in the worldfile [worldfile_path]

void stg_world_destroy stg_world_t world  ) 
 

Destroy a world and everything it contains

void stg_world_stop stg_world_t world  ) 
 

Stop the world clock

void stg_world_start stg_world_t world  ) 
 

Start the world clock

int stg_world_update stg_world_t world,
int  sleepflag
 

Run one simulation step. Returns 0 if all is well, or a positive error code

void stg_world_load stg_world_t mod  ) 
 

configure the world by reading from the current world file

void stg_world_save stg_world_t mod  ) 
 

save the state of the world to the current world file

void stg_world_print stg_world_t world  ) 
 

print human-readable information about the world on stdout

void stg_world_set_interval_real stg_world_t world,
unsigned int  val
 

Set the duration in milliseconds of each simulation update step

void stg_world_set_interval_sim stg_world_t world,
unsigned int  val
 

Set the real time in intervals that Stage should attempt to take for each simulation update step. If Stage has too much computation to do, it might take longer than this.

stg_model_t* stg_world_get_model stg_world_t world,
stg_id_t  mid
 

get a model pointer from its ID

stg_model_t* stg_world_model_name_lookup stg_world_t world,
const char *  name
 

get a model pointer from its name

void stg_world_add_property_callback stg_world_t world,
char *  propname,
stg_property_callback_t  callback,
void *  userdata
 

install a property callback on every model in the world that has this property

void stg_world_remove_property_callback stg_world_t world,
char *  propname,
stg_property_callback_t  callback
 

remove a property callback from every model in the world that has this property

void stg_model_add_property_toggles stg_model_t mod,
const char *  propname,
stg_property_callback_t  callback_on,
void *  arg_on,
stg_property_callback_t  callback_off,
void *  arg_off,
const char *  label,
int  enabled
 

add an item to the View menu that will automatically install and remove a callback when the item is toggled

int stg_model_fig_clear_cb stg_model_t mod,
void *  data,
size_t  len,
void *  userp
 


Generated on Thu Aug 4 13:08:48 2005 for Stage by  doxygen 1.4.3-20050530