GpsDrawMap.h
上传用户:yffx2008
上传日期:2014-10-12
资源大小:12414k
文件大小:9k
- // GpsDrawMap.h: interface for the CGpsDrawMap class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_GPSDRAWMAP_H__87EBC361_5E1C_11D8_B7C7_00E01808A228__INCLUDED_)
- #define AFX_GPSDRAWMAP_H__87EBC361_5E1C_11D8_B7C7_00E01808A228__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- //Others class head file include
- #include "GpsFatStruct.h"
- #include "GpsPoint.h"
- #include "RoadPoint.h"
- #include "SmallRoadStruct.h"
- #include "GpsRoadStruct.h"
- #include "CurrMapInfo.h"
- #include "GpsLinkStruct.h"
- #include "GpsRoadCrossPoint.h"
- #include "GpsColorBlock.h"
- #include "GpsSignObject.h"
- #include "GpsAreaLibStruct.h"
- #include "BmpProc.h"
- #include "Color.h"
- #include "BRCrossStruct.h"
- #include "GpsBusLine.h"
- #include "MakeDef.h"
- struct BR_CROSS
- {
- CBRCrossStruct m_StartCross;
- CBRCrossStruct m_EndCross;
- bool m_bEnable;
- bool m_bHaveSpoint;
- };
- struct SHOW_SIGN
- {
- BYTE bShowBuilding;
- BYTE bShowHotel;
- BYTE bShowCompany;
- BYTE bShowAmuse;
- BYTE bShowPlaceName;
- BYTE bShowGovern;
- BYTE bShowTraffic;
- BYTE bShowShopping;
- BYTE bShowEducation;
- BYTE bShowHospital;
- BYTE bShowBureau;
- BYTE bShowOil;
- };
- class CGpsDrawMap
- {
- public:
- CGpsDrawMap();
- virtual ~CGpsDrawMap();
- //varable
- public:
- CGpsFatStruct m_cFatStruct;
- CCurrMapInfo m_cCurrMapInfo;
- ChangeTriangle m_WndTriangle;
- CGpsSignObject pDispOneSign;
- COLORREF SaveInvalidRectColor[40][40];
- CObList mLinkList;
- CObList mSaveRecePointList;
- CObList mSaveBRList;
- CObList mSaveBusLineList;
- CObList mSaveTempList1;
- CObList mSaveTempList2;
- CString SaveGpsCarPath[25];
- CColor m_cColor;
- CView *m_pCurrView;
- BYTE *FileContent,gCurrMapLevel,m_PointWidth;
- BYTE m_byZoomCoeffic;
- SHOW_SIGN m_ShowSign;
- BR_CROSS gBRcross;
- //function
- public:
- void DrawFatMap(CDC *pDC);
- void ClearMemberVar();
- void InitDrawMap();
- void CopyStr2Arr(CString Str,char Arr[],BYTE ArrLen);
- void CopyEquaLenArr(char *SrcArr,char *DstArr,BYTE CpyLen);
- void ClearBYTEArr(char *Array,long ArrLen);
- long GetGpsFatBuf();
- void GetGpsFatInfo();
- long GetFourBNum(BYTE *BUF,long BufPos);
- short GetTwoBNum(BYTE *BUF,long BufPos);
- BYTE GetOneBNum(BYTE *BUF,long BufPos);
- long GetLinkLibAddr(char *pLinkName);
- BYTE CompareTwoArr(char *pArr1,char *pArr2);
- void GetLenArray(BYTE *pTarget,BYTE Len,BYTE *Buf,long BufPos);
- long GetLinkList(CObList *pLinkList,BYTE MapLevel);
- void GetLibInfo(BYTE *Buf,long InfoAddr,char *FileName,long *StartAddr,long *EndAddr);
- void GetLinkLibThreePoint(BYTE * BUF,long StartAddr,ChangeTriangle * ThreePoint);
- void GetCurrMapInfo(CGpsLinkStruct *pLinkStruct,CCurrMapInfo *MapInfo);
- void RefreshMapWnd();
- void CovertNEXY(CGpsPoint * cmpoint, ChangeNormal change, bool NE2XY);
- void CalculateCoeffNEXY(ChangeTriangle Triangle1,
- ChangeTriangle Triangle2,
- ChangeNormal *Change);
- bool GetDataLib(char *DataLibName);
- long GetDataLibAddr(char *DataLibName);
- long GetColorBList(CObList *ColorBList,long StartAddr);
- long GetRoadPlainPoint(CObList *RoadList,long StartAddr);
- long GetRoadCrossPoint(CObList *CrossList,long StartAddr);
- void GetPointNE(BYTE *BUF,long *BufPos,double *gx,double *gy);
- void DrawColorBlock(CObList *ColorBList,CDC * MemDC);
- void DrawOneBlock(CObList * PointList,CPen * CurrPen,CDC * MemDC);
- long GetMinX(long *pDataXY,long PointCount,long MinX);
- void GetDrawPoint(long line_p[], int minX1, int minX2, long *Result);
- void DrawTriangle(long *bian1, long *bian2,CPen * CurrPen,CDC * MemDC);
- void DrawLine(long SX, long SY, long EX, long EY,
- int LineCount,CPen * CurrPen,CDC * MemDC);
- void DrawRoad(CObList *RoadList,CDC *pDC);
- void DrawRoadName(CObList *RoadList,CDC *pDC);
- void DrawOneRoadName(CObList * TempList,CString RoadName,CDC * MemDC);
- void ReDraw(CDC *pDC);
- void ClearLinkList(CObList *pLinkList);
- bool GetCurrLinkLib(CObList *LinkList,CGpsLinkStruct *pLink,double gx,double gy);
- bool CheckPointInMap(double gx,double gy,ChangeTriangle *TmpTri);
- bool CompareTri(ChangeTriangle TmpTri1,ChangeTriangle TmpTri2);
- double CovertNE(long lTemp);
- long CovertToLongNE(double dTemp);
- bool SaveRecePoint(double gx,double gy,CDC *pDC,CString strVehicleNO = "");
- void ClearPointList(CObList *PointList);
- void DrawGpsCar(CDC *pDC,double Course);
- CPoint GetRoadMidPoint(CObList *RoadList);
- BYTE GetChrCount(CString RoadName);
- void DrawStr(CDC *pDC,CPoint point,CString Name);
- long CalcTwoPointDist(CPoint sp,CPoint ep);
- long CalcPointsDist(CObList *TempList,bool ByNE = false);
- CPoint CalcOneLinePoint(CPoint sp,CPoint ep,long WordPos,long Bevel);
- CString GetCarByDirection(double Course);
- void DrawEllipse(CDC *pDC);
- BYTE IsValidNE(double gx,double gy);
- BYTE CheckMapIsChange(double gx,double gy);
- void RedrawInvalidRect(CRect cRect,CDC * pDC,bool Flag);
- void ClearSaveInvalidRectColor();
- CString GetMapInfoByNE(double gx,double gy,BYTE SignType,BYTE InfoType);
- long GetSignLibAddr(char *SignLibName);
- bool GetSignLib(char *SignLibName,CObList *SignList,bool Del = true);
- BYTE GetSignList(CObList *SignList,long StartAddr,bool Del);
- bool GetSignObjectList(CObList *SignList,long &StartAddr,BYTE SignObject_Bytes,
- BYTE SignType,bool IsCompany,bool Del,CString IconName = "");
- CString SearchRoad(const CPoint point,CString &RoadSn);
- long DistanceToLine(long SY, long SX, long EY, long EX, long NY, long NX);
- BYTE PointOnLineNE(long SY, long SX, long EY, long EX, long NY, long NX, long K);
- void SwapTwoVar(long &a, long &b);
- long CalcPointToOneRoadDist(CPoint point,CSmallRoadStruct *pSmall);
- void DrawSignLib(CDC *pDC);
- void DrawOneSignPoint(CDC *pDC);
- void GetView(CView *pView);
- void DrawIcon(CDC *pDC,CPoint point,CString IconName);
- CString GetCurrDir();
- bool ShowSignLib();
- void FreshWnd();
- void SearchSign();
- void WriteCross(CGpsRoadCrossPoint *pCross,CString FileName);
- void WriteBRcross(CBRCrossStruct *pBRCross,CString FileName);
- void WritePathToTxt(CObList *PathList);
- long alculateDist(CPoint SP,CPoint EP);
- short BR_SaveOnePath(CGpsRoadCrossPoint *StartPoint,
- CGpsRoadCrossPoint *EndPoint,
- CObList *RoadList,CObList *CrossList,CObList *SavePathList);
- bool BRCrossInList(CBRCrossStruct *pBRCross,CObList *CrossList);
- bool HaveSaveOneRoadSn(CGpsRoadCrossPoint *pCross1,CGpsRoadCrossPoint *pCross2);
- bool CheckCrossSame(CGpsRoadCrossPoint *pC1,CGpsRoadCrossPoint *pC2);
- bool GetMinDistPoint(CObList *CrossList,CBRCrossStruct *MinCross);
- bool SaveInitBRCross(CObList *CrossList,CObList *DstList);
- long CalculateOneRoadVD(CObList *PlainList);
- long CalculateTwoPointDistance(CPoint PrevP,CPoint CurrP);
- long CalcCrossDistInRoadSn(CGpsRoadCrossPoint *StartPoint,
- CGpsRoadCrossPoint *EndPoint,
- CObList *RoadList,CString RoadSn);
- long CalcCrossVectorDist(CGpsRoadCrossPoint *StartPoint,
- CGpsRoadCrossPoint *EndPoint,
- CObList *RoadList);
- bool GetOneBRCrossPoint(CPoint point,CObList *RoadList,CObList *CrossList,
- CString Sn,CBRCrossStruct *pDstCross,CObList *SavePoint);
- bool RoadSnInCross(CString RoadSn,CGpsRoadCrossPoint *pCross);
- bool GetOneRoadPoint(CObList *RoadList,CString RoadSn,CGpsRoadStruct *DstRoad);
- bool SimilarCross(CGpsRoadCrossPoint *C1,CGpsRoadCrossPoint *C2);
- bool IsInvalidSn(CString RoadSn);
- bool GetOneRoadPlain(CGpsRoadCrossPoint *pCross1,
- CGpsRoadCrossPoint *pCross2,
- CObList *RoadList,CString RoadSn,CObList *DstList);
- bool GetPointInListEx(CPoint point,CString RoadSn,CObList *CrossList,CGpsRoadCrossPoint *pPoint,BYTE Bound);
- void DrawLineEx(CDC *pDC,CObList *TempList);
- bool DrawBetweenCross(CGpsRoadCrossPoint *pPrevCross,CGpsRoadCrossPoint *pCross,CObList *RoadList,CDC *pDC);
- void DrawBetweenBRCrossLine(CDC *pDC,CObList *SaveBRCrossList);
- void CalculateBRroadPath(CPoint point);
- bool SearchSignByPoint(CPoint point,CPoint &Ret);
- void DispShootPic(CDC *pDC,CPoint point,CString PicPath);
- bool CalcNE2XY(double gx,double gy,long &x,long &y);
- void ErasePrevPoint(CDC *pDC,long x,long y);
- void GetAreaLibList(CObList *AreaList);
- void ClearStrArr(CString StrArr[],long Count);
- void MoveScrollBar(long x,long y);
- void ReCalcPointXY(CObList *PointList);
- void ReCalcColorBXY(CObList *ColorBList);
- void ReCalcRoadXY(CObList *RoadList);
- void CalcAllPointXY();
- void ZoomDown();
- void ZoomUp();
- void DispOtherLevelMap();
- void GetCarXY(int &nx,int &ny); //获取显示车位置
- void MapDrawLineWidth(CDC *pDC, long SX, long SY, long EX, long EY, BYTE MapLineWidth,CPen *Pen);
- void MapDrawRoad(CDC *pDC, long SX, long SY, long EX, long EY, BYTE RoadWide,CPen *CurrPen);
- bool CompanySimilarStr(CString Str1,CString Str2);
- void SearchSignByInput();
- void DrawSignByName(CString SignName);
- };
- #endif // !defined(AFX_GPSDRAWMAP_H__87EBC361_5E1C_11D8_B7C7_00E01808A228__INCLUDED_)