#ifndef CMODEL_HPP
#define CMODEL_HPP

#include "Material/SMaterial.hpp"
#include "Mesh/CMesh.hpp"

#include <vector>
#include <glm/glm.hpp>

/**
 * @brief Class representing a 3D model.
 */
class CModel {
private:
	/**
	 * @brief The meshes, a vector which contains all the meshes of the object.
	 */
	std::vector<CMesh*> m_meshes;

	/**
	 * @brief A boolean representing the loading state of the model.
	 */
	bool m_loaded;

public:

	/**
	 * @brief CModel's default constructor, disabled.
	 */
	CModel(void) = delete;

	/**
	 * @brief CModel constructor.
	 * @param meshes : The list of the meshes of the object.
	 */
	CModel(std::vector<CMesh*> meshes);

	/**
	 * @brief CModel's destructor.
	 */
	~CModel(void);

	/**
	 * @brief Load the model in the GPU.
	 */
	void load(void);

	/**
	 * @brief Render the model on the screen.
	 * @param[in] model The transform of the object.
	 * @param[in] view The view of the object.
	 * @param[in] projection The projection of the object.
	 * @param[in] lightPos The light's position.
	 * @param[in] intensity The light's intensity.
	 */
	void draw(glm::mat4 model, glm::mat4 view, glm::mat4 projection, glm::vec3 lightPos, float intensity);

	/**
	 * @brief Getter to the meshes of the model.
	 * @return A vector which represent the list of meshes of the model, it's a direct reference to the member m_meshes.
	 */
	std::vector<CMesh*>& getMeshes(void);

	/**
	 * @brief Setter to the meshes.
	 * @param[in] meshes The list of meshes to set to the model.
	 */
	void setMeshes(std::vector<CMesh*> meshes);

	/**
	 * @brief Getter to m_loaded member, say if the model is loaded or not.
	 * @return A boolean representing the state of the model, loaded or not.
	 */
	bool isLoaded(void);
	
};

#endif