// Author: Juan Carlos De Abreu (jcabreur@gmail.com)
//
// This file define a class to manage the geometries in the app.

#ifndef MODEL_MODEL_MANAGEMENT_H__
#define MODEL_MODEL_MANAGEMENT_H__

#include "map"

#include "../global.h"
#include "Model.h"
#include "../Base/Singleton.h"
#include "../Base/Memory/SmartPointer.h"

BEGIN_TEG_NAMESPACE();

// Macro to load a model in the app.
#define LOAD_MODEL(path) ModelManagement::GetInstance().load(path)

class ModelManagement : public Singleton<ModelManagement> {
 public:
  // ModelManagement constructor and destructor.
  ModelManagement();
  ~ModelManagement();

  // Method to load a geometry in the app.
  SmartPointer<IModel> load(const _TCHAR* lpszPathName);

  // Method free all geometries resources.
  void release();
 
 private:
  // ModelManagement attributes, models in the app.
  std::map< std::tstring, SmartPointer<IModel> > models_;
  DISALLOW_COPY_AND_ASSIGN(ModelManagement);
};

END_TEG_NAMESPACE();

#endif  // MODEL_MODEL_MANAGEMENT_H__
