//---------------------------------------------------------------------------

#ifndef CDSLayerFH
#define CDSLayerFH
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

#include <Classes.hpp>
#include <ADODB.hpp>
#include <DB.hpp>
#include "ITSLibF.h"
#include "ITSDbF.h"
//---------------------------------------------------------------------------

/*
*  LAYER class
*/
class TItsLayer
{
public:
    TItsLayer();
    TItsLayer(bool AUse, int AZOOM, String ALINK_TYPE, int ALEVL, bool ADefault);
    virtual ~TItsLayer();
    void Clear();

private:

public:
    bool    Use;
    int     ZOOM;
    String  LINK_TYPE;
    int     LEVL;
    bool    Default;

public:
};
//---------------------------------------------------------------------------

class TItsVrtx
{
public:
    TItsVrtx()  {};
    ~TItsVrtx() {};

private:

public:
    String ID;
    String X_CRDN_ARR;
    String Y_CRDN_ARR;

public:
};
//---------------------------------------------------------------------------

class TItsVrtxList
{
public:
    TItsVrtxList()  {};
    ~TItsVrtxList() {};

private:

public:
    int    ZOOM;
    TItsMap<String, TItsVrtx*> FLists;

public:
};
//---------------------------------------------------------------------------

class TLayerIdx
{
public:
    TLayerIdx(String ALayerType, int ALayerIdx, int AVisible)
    {
        Type  = ALayerType;
        Index = ALayerIdx;
        Visible = AVisible;
    }
    ~TLayerIdx() {};

private:

public:
    String Type;
    int    Index;
    int    Visible;
    String arrObj;

};
//---------------------------------------------------------------------------

/*
* Layer Manager
*/
class TItsLayerManager
{
public:
    TItsLayerManager();
    virtual ~TItsLayerManager();

public:

    TItsMap<String, TLayerIdx*>    FFacilityLayers;
    TItsMap<String, TItsLayer*>    FLists;
    TItsMap<int,    TItsVrtxList*> FVrtxs;

public:
    bool LoadFromDb(TADOConnection *ADbConn=NULL);

    int GetLayerIndex(String ALayerType);
    String GetLayerType(int ALayerIndex);

    int GetDefaultLinkLayer();
    int GetDefaultIfscLayer();
    int GetDefaultRoadLayer();
};
//---------------------------------------------------------------------------
extern TItsLayerManager *ItsLayerManager;
//---------------------------------------------------------------------------

#endif
