sparkle::Scene Class Reference
[Sparkle Library]

Scene manager. More...

#include <scene.h>

List of all members.

Public Member Functions

 Scene ()
 Scene (std::string fileName)
 ~Scene ()
void loadFile (std::string fileName)
void saveScene (std::string fileName)
void addObject (SceneObject *newObject)
void setName (std::string newName)
std::string name () const

Protected Member Functions

ShapeloadShape (TiXmlElement *shapeElement)
void loadGroup (TiXmlElement *groupElement)
void loadNodesEdges (TiXmlElement *NodeEdgeElement, Shape *ownerShape)

Protected Attributes

std::string sceneName
std::vector< SceneObject * > objects


Detailed Description

Scene manager.

Controls what everything does.


Constructor & Destructor Documentation

Scene::Scene  ) 
 

Creates an empty scene

Scene::Scene std::string  fileName  ) 
 

Load a scene from file

Parameters:
fileName File name

Scene::~Scene  ) 
 

Destructor


Member Function Documentation

void Scene::loadFile std::string  fileName  ) 
 

Load a scene from file

Parameters:
fileName Local path to the file

void Scene::saveScene std::string  fileName  ) 
 

Save a scene to file

Parameters:
fileName Local path to the file

void Scene::addObject SceneObject newObject  ) 
 

Add an object to the scene.

Parameters:
newObject Reference to the new object
                Scene *scene = new Scene();
                
                Shape *shape = new Shape();
                Square square(50);
                
                scene->addObject(shape);
                scene->addObject(&square);

void sparkle::Scene::setName std::string  newName  )  [inline]
 

Set the name of the scene

Parameters:
newName New name

std::string sparkle::Scene::name  )  const [inline]
 

Returns:
The name of the scene

Shape * Scene::loadShape TiXmlElement *  shapeElement  )  [protected]
 

Parse an XML element of type <shape> (or <square> etc.) and add it properly to the scene

Parameters:
shapeElement A TiXmlElement refering to the shape
Returns:
The newly created shape

void Scene::loadGroup TiXmlElement *  groupElement  )  [protected]
 

Parse an XML element of type <group> and add it properly to the scene

Parameters:
groupElement A TiXmlElement refering to the group

void Scene::loadNodesEdges TiXmlElement *  NodeEdgeElement,
Shape ownerShape
[protected]
 

Parse an XML element of type <node> (or <edge> etc.) and add it properly to the shape (or square etc.)

Parameters:
NodeEdgeElement A TiXmlElement node/edge
ownerShape A TiXmlElement refering to the shape owning the node/edge


Member Data Documentation

std::string sparkle::Scene::sceneName [protected]
 

Name of scene

std::vector<SceneObject*> sparkle::Scene::objects [protected]
 

Shapes in scene


Hosted by SourceForge.net Logo Generated on Sat Sep 16 01:51:09 2006 for Sparkle by Doxygen 1.4.6.