#ifndef SCENEGRAPHBUILDER_H
#define SCENEGRAPHBUILDER_H

#include <map>
#include <stack>

#include "GraphNode.h"
#include "Group.h"
#include "Material.h"
#include "Transform.h"
#include "VertexArray.h"


using nsUtility::CStringCompare;

enum
{
	SCENE_GRAPH_BUILDER_OK,
	SCENE_GRAPH_BUILDER_KO
};

namespace nsSceneGraph {

class SceneGraphBuilder
{
	private:
		std::stack<GraphNode *> nodeStack;
		std::map<const char *, GraphNode *, CStringCompare> defUseDictionary;

	public:
		SceneGraphBuilder(void);
		~SceneGraphBuilder(void);

		int addNewNode(GraphNode *node);
		int finishNode(void);

		GraphNode *getCurrentNode(void);
		GraphNode *getSceneGraph(void);

		int addNodeReference(const char *name);
		int resolveNodeReference(const char *name);
};


}

#endif

