#ifndef GRAPHNODE_H
#define GRAPHNODE_H

#include <list>
#include <string>
#include <iostream>

#include <GL/gl.h>

#include "Utility.h"
#include "SceneGraph.h"


namespace nsSceneGraph {

// forward declaration
class SceneGraphVisitor;


class GraphNode
{
	private:
		NodeType type;
		std::string typeName;
		std::string nodeName;

		std::list<GraphNode *> children;

		bool compiled;
		int compiledDisplayList;

		bool hide;

	public:
		GraphNode(NodeType type, const char *typeName);
		virtual ~GraphNode(void);

		void addChild(GraphNode *child);
		std::list<GraphNode *>& getChildren(void);

		virtual int action(SceneGraphVisitor *visitor) = 0;

		virtual GraphNode *duplicate(void) = 0;

		void printGraph(int indent = 0);

		bool isNodeCompiled(void);
		void setCompiledStatus(bool status);
		void setCompiledDisplayList(GLuint list);
		GLuint getCompiledDisplayList(void);

		bool isNodeHidden(void);
		void hideNode(void);
		void unhideNode(void);

		void setNodeName(const char *name);
		const char *getNodeName(void);

		NodeType getType(void);
		const char *getTypeName(void);
};


}

#endif

