#pragma once
#include "InputLayouts.h"
#include "PosGeometry.h"
#include <vector>

struct BoundingBox
{
	D3DXVECTOR3 min;
	D3DXVECTOR3 max;
};

struct BoundingSphere
{
	D3DXVECTOR3 center;
	float radius;
};

class Geometry : public PosGeometry
{
	private:
	string name;
	BoundingBox bb;
	BoundingSphere bs;	
	bool _hasTangents;
	bool _hasBinormals;
	int nrOfTexCoords;
	vector<int> texCoordsDimensions;
	int nrOfVertices;
	float* vertexBuffer;
	int vertexDataSize;
	int alreadyAddedVertices;
	ID3D10Buffer* vbo;

	public:
	Geometry();
	void setName(string name);
	string getName();
	void setBoundingBox(float* bbMin,float* bbMax);
	void setBoundingSphere(float* bsCenter,float bsRadius);
	void setHasTangents(bool hasTangents);
	void setHasBinormals(bool hasBinormals);
	void setTextureDimensions(int nrTexCoords,int* dimensions);
	void setNumVertices(int numVertices);
	void addVertex(float* position, float* normal, float* tangent, float* binormal, float** texcoords);
	BoundingBox getBoundingBox();
	BoundingSphere getBoundingSphere();
	bool hasTangents();
	bool hasBinormals();
	int getNrOfTexCoords();
	vector<int> getTexCoordDimensions();
	int getNrOfVertices();
	void render(ID3D10EffectPass* pass);
	void createVBO(ID3D10Effect* effect);
	~Geometry();
};