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

#ifndef XiMapUtilFH
#define XiMapUtilFH
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
#include <vcl.h>
#include "XiClient.hpp"
#include "XiServer.hpp"
#include "CDSNodeF.h"
#include "CDSLinkF.h"
#include "CDSServiceLinkF.h"
#include "CDSRoadF.h"
//---------------------------------------------------------------------------
#define GIS_XGAP                0.00015     // CCTV, RSE좌표가 같으므로 보정
//---------------------------------------------------------------------------

class TXiMapUtil
{
public:
    TXiMapUtil(TXiClient *AXiClient);
    virtual ~TXiMapUtil();

    TXiClient   *FXiClient;

    void MovePoint      (double AdX, double AdY, double AdValue = 0.02);
    void MoveLink       (String    ALinkId);
    void MoveLink       (TItsLink *ALink);
    void MoveServiceLink(String           AServiceLinkId);
    void MoveServiceLink(TItsServiceLink *AServiceLink);
    void MoveRoad       (String    ARoadId);
    void MoveRoad       (TItsRoad *ARoad);

    static void ClearPath      (TXiClient *AXiClient); 
    static void MovePoint      (TXiClient *AXiClient, double AdX, double AdY, double AdValue = 0.02);
    static void MoveNode       (TXiClient *AXiClient, String    ANodeId);
    static void MoveNode       (TXiClient *AXiClient, TItsNode *ANode);
    static void MoveLink       (TXiClient *AXiClient, String    ALinkId);
    static void MoveLink       (TXiClient *AXiClient, TItsLink *ALink);
    static void MoveServiceLink(TXiClient *AXiClient, String           AServiceLinkId);
    static void MoveServiceLink(TXiClient *AXiClient, TItsServiceLink *AServiceLink);
    static void MoveRoad       (TXiClient *AXiClient, String    ARoadId);
    static void MoveRoad       (TXiClient *AXiClient, TItsRoad *ARoad);

    static void SelectLinkByPos(TXiServer *AXiServer, TXiClient *AXiClient, int ALayerIdx, int X, int Y, String &ALinkId);
    static void SelectLinkByPos2(TXiServer *AXiServer, TXiClient *AXiClient, int ALayerIdx, double X, double Y);
    static void SelectLinkById(TXiServer *AXiServer, TXiClient *AXiClient, int ALayerIdx, String ALinkId);

    __property TXiClient *XiClient = {read = FXiClient };
};
//---------------------------------------------------------------------------
//extern TXiMapUtil *XiMapUtil;
//---------------------------------------------------------------------------

#endif

