World Class Reference
[World]

Contains multiple Item, Solver and general properties such as time. More...

#include <world.h>

Inheritance diagram for World:

Object List of all members.

Public Types

typedef std::vector< Item * > ItemList
typedef std::vector< Body * > BodyList
typedef std::vector< Force * > ForceList

Public Member Functions

 World ()
 World (const World &world)
 ~World ()
Worldoperator= (const World &world)
void clear ()
double time () const
void setTime (double t)
double timeScale () const
void setTimeScale (double timeScale)
void addItem (Item *item)
void removeItem (Item *item)
void deleteItem (Item *item)
int itemIndex (const Item *item) const
const ItemListitems () const
const BodyListbodies () const
const ForceListforces () const
Solversolver () const
void setSolver (Solver *solver)
SolverremoveSolver ()
void doCalcFn ()
bool doEvolve (double delta)
const QString & name () const
void setName (const QString &name)

Detailed Description

Contains multiple Item, Solver and general properties such as time.

Todo:
Redesign to avoid variable copying (scatter/gatherVariables)


Member Typedef Documentation

typedef std::vector<Item*> ItemList

List of pointers to Item

typedef std::vector<Body*> BodyList

List of pointers to Body

typedef std::vector<Force*> ForceList

List of pointers to Force


Constructor & Destructor Documentation

Simulation speed setTimeScale World (  ) 

Constructs empty World

World ( const World world  ) 

Constructs a copy of world (deep copy)

~World (  ) 

Destroys World and all objects which belongs to it


Member Function Documentation

World & operator= ( const World world  ) 

Assignment operator (deep copy)

void clear (  ) 

Clear world (removes all items, solver and resets time)

double time (  )  const [inline]

Get current time

void setTime ( double  t  )  [inline]

Set current time

double timeScale (  )  const [inline]

Get simulation speed scale

void setTimeScale ( double  timeScale  )  [inline]

Set simulation speed scale

void addItem ( Item item  ) 

Add new item to the world

void removeItem ( Item item  ) 

Remove item from the world (you should delete item youself)

void deleteItem ( Item item  )  [inline]

Delete item from the world (it actually deletes item)

int itemIndex ( const Item item  )  const

Finds item in items()

const ItemList& items (  )  const [inline]

Get list of all items in the World

const BodyList& bodies (  )  const [inline]

Get list of all bodies in the World

const ForceList& forces (  )  const [inline]

Get list of all forces in the World

Solver* solver (  )  const [inline]

Get current solver

void setSolver ( Solver solver  ) 

Set new solver (and delete the old one)

Solver * removeSolver (  ) 

Get current solver and remove it from world

void doCalcFn (  ) 

Calculate all forces

bool doEvolve ( double  delta  ) 

Integrate.

Parameters:
delta Integration interval
Returns:
true on success, false on failure (too big local error)
Todo:
Provide error message

const QString& name (  )  const [inline, inherited]

Returns name of the object

void setName ( const QString &  name  )  [inline, inherited]

Set name of the object


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 14:23:38 2007 for StepCore by  doxygen 1.5.1