123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "XiMapUtilF.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- //---------------------------------------------------------------------------
- //TXiMapUtil *XiMapUtil = NULL;
- //---------------------------------------------------------------------------
- TXiMapUtil::TXiMapUtil(TXiClient *AXiClient)
- {
- FXiClient = AXiClient;
- }
- //---------------------------------------------------------------------------
- TXiMapUtil::~TXiMapUtil()
- {
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MovePoint(double AdX, double AdY, double AdValue)
- {
- if (!FXiClient)
- return;
- FXiClient->Start(DDRect(AdX - AdValue,
- AdX + AdValue,
- AdY - AdValue,
- AdY + AdValue));
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveLink(String ALinkId)
- {
- TItsLink *pLink = ItsLinkManager->FLists.Find(ALinkId);
- MoveLink(pLink);
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveLink(TItsLink *ALink)
- {
- FXiClient->ClearPathInfo();
- if (!ALink) return;
- TArrInt vObjIDxs;
- TDDPoints pts;
- TDDRect objmbr;
- TDDLineStyle Linestyle;
- TStringList *Linkids = new TStringList();
- int nLayerIndex = FXiClient->XiMapServer->GetLayerIndex("GD_LINK_LV7.dvf");
- if (nLayerIndex < 0) return;
- Linkids->Add(ALink->LINK_ID);
- Linkids->Add(ALink->LINK_ID);
- TDDRect DDRect_Move;
- DDRect_Move.MinX = 200;
- DDRect_Move.MaxX = 0;
- DDRect_Move.MinY = 50;
- DDRect_Move.MaxY = 0;
- try
- {
- if (FXiClient->XiMapServer->Get_MultiAtt(nLayerIndex, "SD_LINK_ID", Linkids, vObjIDxs))
- {
- for(int i = 0; i < vObjIDxs.High; i++)
- {
- pts = FXiClient->XiMapServer->Get_NstObj(nLayerIndex, vObjIDxs[i], objmbr);
- if (vObjIDxs[i] == -1)
- continue;
- Linestyle.PenWidth = 4;
- Linestyle.PenColor = clPurple;
- Linestyle.OutLineType = true;
- Linestyle.ArrowType = false;
- FXiClient->ADDPathInfo(TDDPolyLine(pts), "--=", 1, 1, Linestyle);
- if (DDRect_Move.MinX > objmbr.MinX)
- DDRect_Move.MinX = objmbr.MinX;
- if (DDRect_Move.MaxX < objmbr.MaxX)
- DDRect_Move.MaxX = objmbr.MaxX;
- if (DDRect_Move.MinY > objmbr.MinY)
- DDRect_Move.MinY = objmbr.MinY;
- if (DDRect_Move.MaxY < objmbr.MaxY)
- DDRect_Move.MaxY = objmbr.MaxY;
- }
- DDRect_Move.MinX -= 0.002;
- DDRect_Move.MaxX += 0.002;
- DDRect_Move.MinY -= 0.002;
- DDRect_Move.MaxY += 0.002;
- FXiClient->ExtentDraw(DDRect_Move);
- }
- }
- catch(...)
- {
- }
- delete Linkids;
- FXiClient->ReDraw();
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveServiceLink(String AServiceLinkId)
- {
- TItsServiceLink *ServiceLink = ItsServiceLinkManager->FLists.Find(AServiceLinkId);
- MoveServiceLink(ServiceLink);
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveServiceLink(TItsServiceLink *AServiceLink)
- {
- FXiClient->ClearPathInfo();
- if (!AServiceLink)
- return;
- TArrInt vObjIDxs;
- TDDPoints pts;
- TDDRect objmbr;
- TDDLineStyle Linestyle;
- TStringList *Linkids = new TStringList();
- int nLayerIndex = FXiClient->XiMapServer->GetLayerIndex("GD_LINK_LV6.dvf");
- if (nLayerIndex < 0) return;
- Linkids->Add(AServiceLink->IFSC_ID);
- Linkids->Add(AServiceLink->IFSC_ID);
- TDDRect DDRect_Move;
- DDRect_Move.MinX = 200;
- DDRect_Move.MaxX = 0;
- DDRect_Move.MinY = 50;
- DDRect_Move.MaxY = 0;
- try
- {
- if (FXiClient->XiMapServer->Get_MultiAtt(nLayerIndex, "SD_LINK_ID", Linkids, vObjIDxs))
- {
- for(int i = 0; i < vObjIDxs.High; i++)
- {
- pts = FXiClient->XiMapServer->Get_NstObj(nLayerIndex, vObjIDxs[i], objmbr);
- if (vObjIDxs[i] == -1)
- continue;
- Linestyle.PenWidth = 4;
- Linestyle.PenColor = clPurple;
- Linestyle.OutLineType = true;
- Linestyle.ArrowType = false;
- FXiClient->ADDPathInfo(TDDPolyLine(pts), "--=", 1, 1, Linestyle);
- if (DDRect_Move.MinX > objmbr.MinX)
- DDRect_Move.MinX = objmbr.MinX;
- if (DDRect_Move.MaxX < objmbr.MaxX)
- DDRect_Move.MaxX = objmbr.MaxX;
- if (DDRect_Move.MinY > objmbr.MinY)
- DDRect_Move.MinY = objmbr.MinY;
- if (DDRect_Move.MaxY < objmbr.MaxY)
- DDRect_Move.MaxY = objmbr.MaxY;
- }
- DDRect_Move.MinX -= 0.002;
- DDRect_Move.MaxX += 0.002;
- DDRect_Move.MinY -= 0.002;
- DDRect_Move.MaxY += 0.002;
- FXiClient->ExtentDraw(DDRect_Move);
- }
- }
- catch(...)
- {
- }
- delete Linkids;
- FXiClient->ReDraw();
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveRoad(String ARoadId)
- {
- TItsRoad *pRoad = ItsRoadManager->FLists.Find(ARoadId);
- MoveRoad(pRoad);
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveRoad(TItsRoad *ARoad)
- {
- FXiClient->ClearPathInfo();
- if (!ARoad)
- return;
- TArrInt vObjIDxs;
- TDDPoints pts;
- TDDRect objmbr;
- TDDLineStyle Linestyle;
- TStringList *Linkids = new TStringList();
- int nLayerIndex = FXiClient->XiMapServer->GetLayerIndex("GD_LINK_LV5.dvf");
- if (nLayerIndex < 0) return;
- Linkids->Add(ARoad->ROAD_ID);
- Linkids->Add(ARoad->ROAD_ID);
- TDDRect DDRect_Move;
- DDRect_Move.MinX = 200;
- DDRect_Move.MaxX = 0;
- DDRect_Move.MinY = 50;
- DDRect_Move.MaxY = 0;
- try
- {
- if (FXiClient->XiMapServer->Get_MultiAtt(nLayerIndex, "SD_LINK_ID", Linkids, vObjIDxs))
- {
- for(int i = 0; i < vObjIDxs.High; i++)
- {
- pts = FXiClient->XiMapServer->Get_NstObj(nLayerIndex, vObjIDxs[i], objmbr);
- if (vObjIDxs[i] == -1)
- continue;
- Linestyle.PenWidth = 4;
- Linestyle.PenColor = clPurple;
- Linestyle.OutLineType = true;
- Linestyle.ArrowType = false;
- FXiClient->ADDPathInfo(TDDPolyLine(pts), "--=", 1, 1, Linestyle);
- if (DDRect_Move.MinX > objmbr.MinX)
- DDRect_Move.MinX = objmbr.MinX;
- if (DDRect_Move.MaxX < objmbr.MaxX)
- DDRect_Move.MaxX = objmbr.MaxX;
- if (DDRect_Move.MinY > objmbr.MinY)
- DDRect_Move.MinY = objmbr.MinY;
- if (DDRect_Move.MaxY < objmbr.MaxY)
- DDRect_Move.MaxY = objmbr.MaxY;
- }
- DDRect_Move.MinX -= 0.002;
- DDRect_Move.MaxX += 0.002;
- DDRect_Move.MinY -= 0.002;
- DDRect_Move.MaxY += 0.002;
- FXiClient->ExtentDraw(DDRect_Move);
- }
- }
- catch(...)
- {
- }
- delete Linkids;
- FXiClient->ReDraw();
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::ClearPath(TXiClient *AXiClient)
- {
- if (!AXiClient)
- return;
- AXiClient->ClearUserDrawPolyGon();
- AXiClient->ClearPathInfo();
- AXiClient->ReDraw();
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MovePoint(TXiClient *AXiClient, double AdX, double AdY, double AdValue)
- {
- if (!AXiClient)
- return;
- AXiClient->Start(DDRect(AdX - AdValue,
- AdX + AdValue,
- AdY - AdValue,
- AdY + AdValue));
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveNode(TXiClient *AXiClient, String ANodeId)
- {
- TItsNode *pNode = ItsNodeManager->FLists.Find(ANodeId);
- MoveNode(AXiClient, pNode);
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveNode(TXiClient *AXiClient, TItsNode *ANode)
- {
- if (!AXiClient)
- return;
- AXiClient->ClearPathInfo();
- if (!ANode)
- return;
- TDDPoint tdpPoint;
- try {
- tdpPoint.X = StrToFloat(ANode->X_CRDN); //X 좌표
- tdpPoint.Y = StrToFloat(ANode->Y_CRDN); //Y 좌표
- } catch(...) { return; }
- AXiClient->MoveExtentDraw(tdpPoint);
- AXiClient->LevelView(7);
- AXiClient->CreateDrawFocusRectThread(tdpPoint, 4);
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveLink(TXiClient *AXiClient, String ALinkId)
- {
- TItsLink *pLink = ItsLinkManager->FLists.Find(ALinkId);
- MoveLink(AXiClient, pLink);
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveLink(TXiClient *AXiClient, TItsLink *ALink)
- {
- if (!AXiClient)
- return;
- AXiClient->ClearPathInfo();
- if (!ALink)
- return;
- TArrInt vObjIDxs;
- TDDPoints pts;
- TDDRect objmbr;
- TDDLineStyle Linestyle;
- TStringList *Linkids = new TStringList();
- int nLayerIndex = AXiClient->XiMapServer->GetLayerIndex("GD_LINK_LV7.dvf");
- if (nLayerIndex < 0) return;
- Linkids->Add(ALink->LINK_ID);
- Linkids->Add(ALink->LINK_ID);
- TDDRect DDRect_Move;
- DDRect_Move.MinX = 200;
- DDRect_Move.MaxX = 0;
- DDRect_Move.MinY = 50;
- DDRect_Move.MaxY = 0;
- try
- {
- if (AXiClient->XiMapServer->Get_MultiAtt(nLayerIndex, "SD_LINK_ID", Linkids, vObjIDxs))
- {
- for(int i = 0; i < vObjIDxs.High; i++)
- {
- pts = AXiClient->XiMapServer->Get_NstObj(nLayerIndex, vObjIDxs[i], objmbr);
- if (vObjIDxs[i] == -1)
- continue;
- Linestyle.PenWidth = 4;
- Linestyle.PenColor = clPurple;
- Linestyle.OutLineType = true;
- Linestyle.ArrowType = false;
- AXiClient->ADDPathInfo(TDDPolyLine(pts), "--=", 1, 1, Linestyle);
- if (DDRect_Move.MinX > objmbr.MinX)
- DDRect_Move.MinX = objmbr.MinX;
- if (DDRect_Move.MaxX < objmbr.MaxX)
- DDRect_Move.MaxX = objmbr.MaxX;
- if (DDRect_Move.MinY > objmbr.MinY)
- DDRect_Move.MinY = objmbr.MinY;
- if (DDRect_Move.MaxY < objmbr.MaxY)
- DDRect_Move.MaxY = objmbr.MaxY;
- }
- DDRect_Move.MinX -= 0.002;
- DDRect_Move.MaxX += 0.002;
- DDRect_Move.MinY -= 0.002;
- DDRect_Move.MaxY += 0.002;
- AXiClient->ExtentDraw(DDRect_Move);
- }
- }
- catch(...)
- {
- }
- delete Linkids;
- AXiClient->ReDraw();
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveServiceLink(TXiClient *AXiClient, String AServiceLinkId)
- {
- TItsServiceLink *ServiceLink = ItsServiceLinkManager->FLists.Find(AServiceLinkId);
- MoveServiceLink(AXiClient, ServiceLink);
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveServiceLink(TXiClient *AXiClient, TItsServiceLink *AServiceLink)
- {
- if (!AXiClient)
- return;
- AXiClient->ClearPathInfo();
- if (!AServiceLink)
- return;
- TArrInt vObjIDxs;
- TDDPoints pts;
- TDDRect objmbr;
- TDDLineStyle Linestyle;
- TStringList *Linkids = new TStringList();
- int nLayerIndex = AXiClient->XiMapServer->GetLayerIndex("GD_LINK_LV6.dvf");
- if (nLayerIndex < 0) return;
- Linkids->Add(AServiceLink->IFSC_ID);
- Linkids->Add(AServiceLink->IFSC_ID);
- TDDRect DDRect_Move;
- DDRect_Move.MinX = 200;
- DDRect_Move.MaxX = 0;
- DDRect_Move.MinY = 50;
- DDRect_Move.MaxY = 0;
- try
- {
- if (AXiClient->XiMapServer->Get_MultiAtt(nLayerIndex, "SD_LINK_ID", Linkids, vObjIDxs))
- {
- for(int i = 0; i < vObjIDxs.High; i++)
- {
- pts = AXiClient->XiMapServer->Get_NstObj(nLayerIndex, vObjIDxs[i], objmbr);
- if (vObjIDxs[i] == -1)
- continue;
- Linestyle.PenWidth = 4;
- Linestyle.PenColor = clPurple;
- Linestyle.OutLineType = true;
- Linestyle.ArrowType = false;
- AXiClient->ADDPathInfo(TDDPolyLine(pts), "--=", 1, 1, Linestyle);
- if (DDRect_Move.MinX > objmbr.MinX)
- DDRect_Move.MinX = objmbr.MinX;
- if (DDRect_Move.MaxX < objmbr.MaxX)
- DDRect_Move.MaxX = objmbr.MaxX;
- if (DDRect_Move.MinY > objmbr.MinY)
- DDRect_Move.MinY = objmbr.MinY;
- if (DDRect_Move.MaxY < objmbr.MaxY)
- DDRect_Move.MaxY = objmbr.MaxY;
- }
- DDRect_Move.MinX -= 0.002;
- DDRect_Move.MaxX += 0.002;
- DDRect_Move.MinY -= 0.002;
- DDRect_Move.MaxY += 0.002;
- AXiClient->ExtentDraw(DDRect_Move);
- }
- }
- catch(...)
- {
- }
- delete Linkids;
- AXiClient->ReDraw();
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveRoad(TXiClient *AXiClient, String ARoadId)
- {
- TItsRoad *pRoad = ItsRoadManager->FLists.Find(ARoadId);
- MoveRoad(AXiClient, pRoad);
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::MoveRoad(TXiClient *AXiClient, TItsRoad *ARoad)
- {
- if (!AXiClient)
- return;
- AXiClient->ClearPathInfo();
- if (!ARoad)
- return;
- TArrInt vObjIDxs;
- TDDPoints pts;
- TDDRect objmbr;
- TDDLineStyle Linestyle;
- TStringList *Linkids = new TStringList();
- int nLayerIndex = AXiClient->XiMapServer->GetLayerIndex("GD_LINK_LV5.dvf");
- if (nLayerIndex < 0) return;
- Linkids->Add(ARoad->ROAD_ID);
- Linkids->Add(ARoad->ROAD_ID);
- TDDRect DDRect_Move;
- DDRect_Move.MinX = 200;
- DDRect_Move.MaxX = 0;
- DDRect_Move.MinY = 50;
- DDRect_Move.MaxY = 0;
- try
- {
- if (AXiClient->XiMapServer->Get_MultiAtt(nLayerIndex, "SD_LINK_ID", Linkids, vObjIDxs))
- {
- for(int i = 0; i < vObjIDxs.High; i++)
- {
- pts = AXiClient->XiMapServer->Get_NstObj(nLayerIndex, vObjIDxs[i], objmbr);
- if (vObjIDxs[i] == -1)
- continue;
- Linestyle.PenWidth = 4;
- Linestyle.PenColor = clPurple;
- Linestyle.OutLineType = true;
- Linestyle.ArrowType = false;
- AXiClient->ADDPathInfo(TDDPolyLine(pts), "--=", 1, 1, Linestyle);
- if (DDRect_Move.MinX > objmbr.MinX)
- DDRect_Move.MinX = objmbr.MinX;
- if (DDRect_Move.MaxX < objmbr.MaxX)
- DDRect_Move.MaxX = objmbr.MaxX;
- if (DDRect_Move.MinY > objmbr.MinY)
- DDRect_Move.MinY = objmbr.MinY;
- if (DDRect_Move.MaxY < objmbr.MaxY)
- DDRect_Move.MaxY = objmbr.MaxY;
- }
- DDRect_Move.MinX -= 0.002;
- DDRect_Move.MaxX += 0.002;
- DDRect_Move.MinY -= 0.002;
- DDRect_Move.MaxY += 0.002;
- AXiClient->ExtentDraw(DDRect_Move);
- }
- }
- catch(...)
- {
- }
- delete Linkids;
- AXiClient->ReDraw();
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::SelectLinkByPos(TXiServer *AXiServer, TXiClient *AXiClient, int ALayerIdx, int X, int Y, String &ALinkId)
- {
- TDDPoints ddptsArea;
- ALinkId = "";
- try
- {
- TDVAInfo DVAInfo;
- TStringList *slstGeo = new TStringList();
- TStringList *slFldName = new TStringList();
- TStringList *slFldValue = new TStringList();
- AXiServer->GetDVAInfo(ALayerIdx, DVAInfo);
- TShpType shpType = AXiServer->GetShpType(ALayerIdx);
- if (AXiServer->ShpObjInfo2(X, Y, ALayerIdx, slFldName, slFldValue, slstGeo))
- {
- if (slstGeo->Count)
- {
- ddptsArea.Length = 0;
- if (slstGeo->Strings[0] == "POLYGON")
- {
- ddptsArea.Length = 0;
- ALinkId = slFldValue->Strings[1];
- if (shpType == iLine) // polyline shape
- {
- TStringList *slDel = new TStringList();
- TStringList *slPos = new TStringList();
- slDel->Clear();
- slDel->Delimiter = '/';
- slDel->DelimitedText = slstGeo->Strings[3];
- ddptsArea.Length = slDel->Count+1;
- int nCnt = 0;
- for (int ii = 0; ii < slDel->Count; ii++)
- {
- slPos->Clear();
- slPos->Delimiter = '|';
- slPos->DelimitedText = slDel->Strings[ii];
- for (int jj = 0; jj < slPos->Count; jj++)
- {
- if (!(jj % 2))
- {
- ddptsArea[nCnt].X = slPos->Strings[jj].ToDouble();
- }
- else
- {
- ddptsArea[nCnt].Y = slPos->Strings[jj].ToDouble();
- nCnt++;
- }
- }
- ddptsArea[nCnt].X = ddptsArea[nCnt-1].X;
- ddptsArea[nCnt].Y = ddptsArea[nCnt-1].Y;
- }
- delete slDel;
- delete slPos;
- }
- else // polygon shape
- {
- AnsiString strLnkID = "SD_LINK_ID";
- TStringList *linkids;
- TArrInt vObjIdxs;
- TDDRect objMBR;
- linkids = new TStringList( );
- linkids->Add(AnsiString(ALinkId));
- linkids->Add(AnsiString("2100031100")); // 아이템이 1개 이상이어야 검색이됨
- if (AXiServer->Get_MultiAtt(ALayerIdx, strLnkID, linkids, vObjIdxs))
- {
- for ( int i = 0; i < vObjIdxs.High ; i++ )
- {
- if ( vObjIdxs[i] == -1 )
- continue;
- ddptsArea = AXiServer->Get_NstObj(ALayerIdx, vObjIdxs[i], objMBR);
- break;
- }
- }
- delete linkids;
- }
- }
- }
- }
- delete slstGeo;
- delete slFldName;
- delete slFldValue;
- }
- catch(...)
- {
- }
- if (ddptsArea.Length > 0)
- {
- TDDPolygonStyle dpgStyle;
- dpgStyle.BrushStyle = bsCross;
- dpgStyle.BrushColor = clWhite;
- dpgStyle.LineStyle.PenWidth = 2;
- dpgStyle.LineStyle.PenStyle = psSolid;
- dpgStyle.LineStyle.PenMode = pmMask;
- dpgStyle.LineStyle.PenColor = clBlue;
- dpgStyle.LineStyle.OutLineType = true;
- AXiClient->ADDUserDrawPolyGon(ddptsArea, "", dpgStyle);
- }
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::SelectLinkByPos2(TXiServer *AXiServer, TXiClient *AXiClient, int ALayerIdx, double X, double Y)
- {
- TDDPoints ddptsArea;
- try
- {
- TDVAInfo DVAInfo;
- TStringList *slstGeo = new TStringList();
- TStringList *slFldName = new TStringList();
- TStringList *slFldValue = new TStringList();
- AXiServer->GetDVAInfo(ALayerIdx, DVAInfo);
- TShpType shpType = AXiServer->GetShpType(ALayerIdx);
- if (AXiServer->ShpObjInfo2(X, Y, ALayerIdx, slFldName, slFldValue, slstGeo))
- {
- if (slstGeo->Count)
- {
- ddptsArea.Length = 0;
- if (slstGeo->Strings[0] == "POLYGON")
- {
- ddptsArea.Length = 0;
- if (shpType == iLine) // polyline shape
- {
- TStringList *slDel = new TStringList();
- TStringList *slPos = new TStringList();
- slDel->Clear();
- slDel->Delimiter = '/';
- slDel->DelimitedText = slstGeo->Strings[3];
- ddptsArea.Length = slDel->Count+1;
- int nCnt = 0;
- for (int ii = 0; ii < slDel->Count; ii++)
- {
- slPos->Clear();
- slPos->Delimiter = '|';
- slPos->DelimitedText = slDel->Strings[ii];
- for (int jj = 0; jj < slPos->Count; jj++)
- {
- if (!(jj % 2))
- {
- ddptsArea[nCnt].X = slPos->Strings[jj].ToDouble();
- }
- else
- {
- ddptsArea[nCnt].Y = slPos->Strings[jj].ToDouble();
- nCnt++;
- }
- }
- ddptsArea[nCnt].X = ddptsArea[nCnt-1].X;
- ddptsArea[nCnt].Y = ddptsArea[nCnt-1].Y;
- }
- delete slDel;
- delete slPos;
- }
- }
- }
- }
- delete slstGeo;
- delete slFldName;
- delete slFldValue;
- }
- catch(...)
- {
- }
- if (ddptsArea.Length > 0)
- {
- TDDPolygonStyle dpgStyle;
- dpgStyle.BrushStyle = bsCross;
- dpgStyle.BrushColor = clWhite;
- dpgStyle.LineStyle.PenWidth = 2;
- dpgStyle.LineStyle.PenStyle = psSolid;
- dpgStyle.LineStyle.PenMode = pmMask;
- dpgStyle.LineStyle.PenColor = clBlue;
- dpgStyle.LineStyle.OutLineType = true;
- AXiClient->ADDUserDrawPolyGon(ddptsArea, "", dpgStyle);
- }
- }
- //---------------------------------------------------------------------------
- void TXiMapUtil::SelectLinkById(TXiServer *AXiServer, TXiClient *AXiClient, int ALayerIdx, String ALinkId)
- {
- TDDRect objmbr;
- TDDPoints pts;
- TStringList *Linkids = NULL;
- TArrInt vObjIDxs;
- try
- {
- Linkids = new TStringList();
- Linkids->Add(ALinkId);
- Linkids->Add(ALinkId);
- if (AXiServer->Get_MultiAtt(ALayerIdx, "SD_LINK_ID", Linkids, vObjIDxs))
- {
- for(int ii = 0; ii < vObjIDxs.High; ii++)
- {
- if (vObjIDxs[ii] == -1)
- {
- continue;
- }
- pts = AXiServer->Get_NstObj(ALayerIdx, vObjIDxs[ii], objmbr);
- TDDLineStyle Linestyle;
- Linestyle.PenWidth = 4;
- Linestyle.PenColor = clPurple;
- Linestyle.OutLineType = true;
- Linestyle.ArrowType = true;
- AXiClient->ADDPathInfo(TDDPolyLine(pts), "", 0, 0, Linestyle);
- }
- }
- }
- __finally
- {
- if (Linkids) delete Linkids;
- }
- }
- //---------------------------------------------------------------------------
|