/******************************************************************************
** Copyright (c) 2019 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/
#pragma once

//! \file DtCDBModelRangeTable.h
//! \brief DtCDBModelRangeTable
//! \ingroup osgdb_osgearth_model_cdb

#include <string>
#include <map>

#include <osgearth_cdb_utils/DtCDBDatasetInfo.h>

namespace makVrv { namespace oe { namespace CDB {
   //! \brief Create a type for the lod paging map
   typedef std::map<int, float> LodMap;

   //! \brief CDB Model Tile paging range
   //! \ingroup osgdb_osgearth_model_cdb
   class DtCDBModelRangeTable
   {
   public:
      //! \brief CTOR
      DtCDBModelRangeTable();
      //! \brief DTOR
      ~DtCDBModelRangeTable();
      //! \brief set the switch range of a lod
      void setRange(int lod, float fRange);
      //! \brief get the switch range of a lod
      float getRange(int lod) const;
   private:
      //! \brief Table with LOd switch paging distance 
      LodMap myModelRangeTable;
   };


   //! \brief Possible list of map that can contain specific paging values for specific datasets
   typedef std::map<DatasetInfo, LodMap> DatasetsModelRangeTable;

   //! \brief CDB Model Tile paging range class utility to read xml file
   //! \ingroup osgdb_osgearth_model_cdb
   class DtCDBModelPagingDistanceConfigUtils
   {
   public:
      //! \brief   Load paging distance confif from Model_PagingDistance.xml
      static void loadFromXML(DtCDBModelRangeTable& modelRangeTable, DatasetsModelRangeTable& datasetsModelRangeTable, const std::string& filename);
   };

}}}