#ifndef GEOMETRY_H
#define GEOMETRY_H

namespace Salamander
{

/*
** A Geometry contains a stream of vertex state data representing the per-vertex properties for an item to draw.
** Nodes assemble visuals during the scene cache pass and send them to the renderer, which performs an optimisation pass
** and then draws them.
*/
class Geometry
{
	friend class Visual;

public:
	/*
	** Destructor.
	*/
	virtual ~Geometry();

	/*
	** Add a new type of stream to the geometry. Returns false
	** if the steam already exists.
	*/
	bool addStream(Stream& stream);

	/*
	** Return a specific stream ready for rendering.
	*/
	const Stream* getStream(const UniqueId& streamId) const;

private:
	/*
	** This constructor can only be called by friend classes, therefore, a geometry
	** can only be instantiated by a visual.
	*/
	Geometry();

private:
	/*
	** This map indexes streams based upon a UniqueId. Use StreamData::TypeId to retrieve
	** the stream of choice. Each stream should be formatted correcty to pass directly
	** to the renderer.
	*/
	typedef std::map<UniqueId, Stream*>::const_iterator StreamIterator;
	std::map<UniqueId, Stream*> streams_;
};

}

#endif // GEOMETRY_H