/* -*- c++ -*-
 *
 * Copyright (C) 2004 Mekensleep
 *
 *	Mekensleep
 *	24 rue vieille du temple
 *	75004 Paris
 *       licensing@mekensleep.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * Authors:
 *  Loic Dachary <loic@gnu.org>
 *
 */

#ifndef _DYNAMICCALCOREMODEL_H
#define _DYNAMICCALCOREMODEL_H

#include <map>
#include <string>

#include <osgCal/Export>
#include <cal3d/cal3d.h>

class OSGCAL_EXPORT DynamicCalCoreModel : public CalCoreModel {
public:
  typedef std::map<std::string, int> Name2Id;
  typedef std::map<std::string,std::string> Name2Filename;

  DynamicCalCoreModel();
  virtual ~DynamicCalCoreModel();

  int loadCoreAnimation(const std::string& strFilename, const std::string& name);
  int unloadCoreAnimation(int coreAnimationId);
  int unloadCoreAnimation(const std::string& name);
  int getCoreAnimationId(const std::string& name);
  const Name2Id& getAnimationName2CoreAnimationId(void) const { return m_animation2id; }
  const Name2Filename& getAnimationName2Filename(void) const { return m_animationName2Filename; }

  int loadCoreMesh(const std::string& strFilename, const std::string& name);
  int unloadCoreMesh(int coreMeshId);
  int unloadCoreMesh(const std::string& name);
  int getCoreMeshId(const std::string& name);
  int getCoreMeshId(CalCoreMesh* mesh);
  const Name2Id& getMeshName2CoreMeshId(void) const { return m_mesh2id; }
  const Name2Filename& getMeshName2Filename(void) const { return m_meshName2Filename; }

  int loadCoreMaterial(const std::string& strFilename, const std::string& name);
  int getCoreMaterialId(const std::string& name);
  const Name2Id& getMaterialName2CoreMaterialId(void) const { return m_material2id; }
  const Name2Filename& getMaterialName2Filename(void) const { return m_materialName2Filename; }

protected:
  Name2Filename m_meshName2Filename;
  Name2Id m_mesh2id;
  Name2Filename m_animationName2Filename;
  Name2Id m_animation2id;
  Name2Filename m_materialName2Filename;
  Name2Id m_material2id;
};

#endif // _DYNAMICCALCOREMODEL_H
