#include <string.h>
#include <Inventor/SbLinear.h>


#ifndef _MESH
#define _MESH
class Mesh {
private:
public:
	// Constructor
	Mesh();

	SbVec3f* meshVertexArray;
	SbVec3f* meshNormalArray;
	SbVec2f* meshTexcoordsArray;
	int* triangleVertices;						// all triangles, indices to VertexArray, seperated by "-1"
	int* triangleNormals;							// indices to NormalArray, seperated by "-1". Normal per vertex
	int* triangleTextures;						// indices to TexcoordsArray, seperated by "-1"
	SbVec3f* meshTriangleNormArray;		// Triangle normals (of the face, one normal per triangle)
	
	int* tetIndexArray;								//Index mesh_vertex -> Tetra
	SbVec4f* baryCoordArray;					//Barycentric coordinates of meshvertices
	
	int nofMeshVertices;
	int nofMeshTexcoords;
	int nofMeshNormals;
	int nofMeshTriangles;

	float		diffmat[4];								//diffusive part of the material
	
	// FUNCTIONS
	bool LoadMesh(char * filename);		// Load a mesh from an Wavefront obj file.
	void UpdateFaceNormals();					// Re-Calculate for each face the normal
	void Render();

};

#endif