#ifndef VERTEXARRAY_H
#define VERTEXARRAY_H

#include <vector>

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


using nsUtility::PI;
using nsUtility::Index3I;
using nsUtility::Vertex3F;
using nsUtility::Vector3F;

namespace nsSceneGraph {

// forward declaration
class SceneGraphVisitor;


class VertexArray : public GraphNode
{
	friend class SceneGraphVisitor;
	friend class GlCompileVisitor;
	friend class GlCompileFlatVisitor;
	friend class GlCompileSmoothVisitor;
	friend class GlUncompileVisitor;

	private:
		std::vector<Vertex3F> vertexArray;
		std::vector<Index3I> vertexIndex;

		std::vector<Vector3F> normalArray;
		std::vector<Index3I> normalIndex;

		bool normalPerVertex;

	public:
		void addVertexArrayEntry(double x, double y, double z);
		void addVertexIndexEntry(int x, int y, int z);

		void addNormalArrayEntry(double x, double y, double z);
		void addNormalIndexEntry(int x, int y, int z);

		void setNormalPerVertex(bool status);

		int action(SceneGraphVisitor *visitor);

		GraphNode *duplicate(void);

		std::vector<Vertex3F> getVertexArray(void);
		std::vector<Index3I> getVertexIndex(void);

		VertexArray(void);
		~VertexArray(void);
};


}

#endif

