GpsDrawMap.h
上传用户:yffx2008
上传日期:2014-10-12
资源大小:12414k
文件大小:9k
源码类别:

交通/航空行业

开发平台:

Visual C++

  1. // GpsDrawMap.h: interface for the CGpsDrawMap class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_GPSDRAWMAP_H__87EBC361_5E1C_11D8_B7C7_00E01808A228__INCLUDED_)
  5. #define AFX_GPSDRAWMAP_H__87EBC361_5E1C_11D8_B7C7_00E01808A228__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. //Others class head file include
  10. #include "GpsFatStruct.h"
  11. #include "GpsPoint.h"
  12. #include "RoadPoint.h"
  13. #include "SmallRoadStruct.h"
  14. #include "GpsRoadStruct.h"
  15. #include "CurrMapInfo.h"
  16. #include "GpsLinkStruct.h"
  17. #include "GpsRoadCrossPoint.h"
  18. #include "GpsColorBlock.h"
  19. #include "GpsSignObject.h"
  20. #include "GpsAreaLibStruct.h"
  21. #include "BmpProc.h"
  22. #include "Color.h"
  23. #include "BRCrossStruct.h"
  24. #include "GpsBusLine.h"
  25. #include "MakeDef.h"
  26. struct BR_CROSS
  27. {
  28. CBRCrossStruct m_StartCross;
  29. CBRCrossStruct m_EndCross;
  30. bool m_bEnable;
  31. bool m_bHaveSpoint;
  32. };
  33. struct SHOW_SIGN
  34. {
  35. BYTE bShowBuilding;
  36. BYTE bShowHotel;
  37. BYTE bShowCompany;
  38. BYTE bShowAmuse;
  39. BYTE bShowPlaceName;
  40. BYTE bShowGovern;
  41. BYTE bShowTraffic;
  42. BYTE bShowShopping;
  43. BYTE bShowEducation;
  44. BYTE bShowHospital;
  45. BYTE bShowBureau;
  46. BYTE bShowOil;
  47. };
  48. class CGpsDrawMap  
  49. {
  50. public:
  51. CGpsDrawMap();
  52. virtual ~CGpsDrawMap();
  53. //varable
  54. public:
  55. CGpsFatStruct m_cFatStruct;
  56. CCurrMapInfo m_cCurrMapInfo;
  57. ChangeTriangle m_WndTriangle;
  58. CGpsSignObject pDispOneSign;
  59. COLORREF SaveInvalidRectColor[40][40];
  60. CObList mLinkList;
  61. CObList mSaveRecePointList;
  62. CObList mSaveBRList;
  63. CObList mSaveBusLineList;
  64. CObList mSaveTempList1;
  65. CObList mSaveTempList2;
  66. CString SaveGpsCarPath[25];
  67. CColor m_cColor;
  68. CView *m_pCurrView;
  69. BYTE *FileContent,gCurrMapLevel,m_PointWidth;
  70. BYTE m_byZoomCoeffic;
  71. SHOW_SIGN m_ShowSign;
  72. BR_CROSS gBRcross;
  73. //function
  74. public:
  75. void DrawFatMap(CDC *pDC);
  76. void ClearMemberVar();
  77. void InitDrawMap();
  78. void CopyStr2Arr(CString Str,char Arr[],BYTE ArrLen);
  79. void CopyEquaLenArr(char *SrcArr,char *DstArr,BYTE CpyLen);
  80. void ClearBYTEArr(char *Array,long ArrLen);
  81. long GetGpsFatBuf();
  82. void GetGpsFatInfo();
  83. long GetFourBNum(BYTE *BUF,long BufPos);
  84. short GetTwoBNum(BYTE *BUF,long BufPos);
  85. BYTE GetOneBNum(BYTE *BUF,long BufPos);
  86. long GetLinkLibAddr(char *pLinkName);
  87. BYTE CompareTwoArr(char *pArr1,char *pArr2);
  88. void GetLenArray(BYTE *pTarget,BYTE Len,BYTE *Buf,long BufPos);
  89. long GetLinkList(CObList *pLinkList,BYTE MapLevel);
  90. void GetLibInfo(BYTE *Buf,long InfoAddr,char *FileName,long *StartAddr,long *EndAddr);
  91. void GetLinkLibThreePoint(BYTE * BUF,long StartAddr,ChangeTriangle * ThreePoint);
  92. void GetCurrMapInfo(CGpsLinkStruct *pLinkStruct,CCurrMapInfo *MapInfo);
  93. void RefreshMapWnd();
  94. void CovertNEXY(CGpsPoint * cmpoint, ChangeNormal change, bool NE2XY);
  95. void CalculateCoeffNEXY(ChangeTriangle Triangle1,
  96.    ChangeTriangle Triangle2,
  97.    ChangeNormal *Change);
  98. bool GetDataLib(char *DataLibName);
  99. long GetDataLibAddr(char *DataLibName);
  100. long GetColorBList(CObList *ColorBList,long StartAddr);
  101. long GetRoadPlainPoint(CObList *RoadList,long StartAddr);
  102. long GetRoadCrossPoint(CObList *CrossList,long StartAddr);
  103. void GetPointNE(BYTE *BUF,long *BufPos,double *gx,double *gy);
  104. void DrawColorBlock(CObList *ColorBList,CDC * MemDC);
  105. void DrawOneBlock(CObList * PointList,CPen * CurrPen,CDC * MemDC);
  106. long GetMinX(long *pDataXY,long PointCount,long MinX);
  107. void GetDrawPoint(long line_p[], int minX1, int minX2, long *Result);
  108. void DrawTriangle(long *bian1, long *bian2,CPen * CurrPen,CDC * MemDC);
  109. void DrawLine(long SX, long SY, long EX, long EY, 
  110.  int  LineCount,CPen * CurrPen,CDC * MemDC);
  111. void DrawRoad(CObList *RoadList,CDC *pDC);
  112. void DrawRoadName(CObList *RoadList,CDC *pDC);
  113. void DrawOneRoadName(CObList * TempList,CString RoadName,CDC * MemDC);
  114. void ReDraw(CDC *pDC);
  115. void ClearLinkList(CObList *pLinkList);
  116. bool GetCurrLinkLib(CObList *LinkList,CGpsLinkStruct *pLink,double gx,double gy);
  117. bool CheckPointInMap(double gx,double gy,ChangeTriangle *TmpTri);
  118. bool CompareTri(ChangeTriangle TmpTri1,ChangeTriangle TmpTri2);
  119. double CovertNE(long lTemp);
  120. long CovertToLongNE(double dTemp);
  121. bool SaveRecePoint(double gx,double gy,CDC *pDC,CString strVehicleNO = "");
  122. void ClearPointList(CObList *PointList);
  123. void DrawGpsCar(CDC *pDC,double Course);
  124. CPoint GetRoadMidPoint(CObList *RoadList);
  125. BYTE GetChrCount(CString RoadName);
  126. void DrawStr(CDC *pDC,CPoint point,CString Name);
  127. long CalcTwoPointDist(CPoint sp,CPoint ep);
  128. long CalcPointsDist(CObList *TempList,bool ByNE = false);
  129. CPoint CalcOneLinePoint(CPoint sp,CPoint ep,long WordPos,long Bevel);
  130. CString GetCarByDirection(double Course);
  131. void DrawEllipse(CDC *pDC);
  132. BYTE IsValidNE(double gx,double gy);
  133. BYTE CheckMapIsChange(double gx,double gy);
  134. void RedrawInvalidRect(CRect cRect,CDC * pDC,bool Flag);
  135. void ClearSaveInvalidRectColor();
  136. CString GetMapInfoByNE(double gx,double gy,BYTE SignType,BYTE InfoType);
  137. long GetSignLibAddr(char *SignLibName);
  138. bool GetSignLib(char *SignLibName,CObList *SignList,bool Del = true);
  139. BYTE GetSignList(CObList *SignList,long StartAddr,bool Del);
  140. bool GetSignObjectList(CObList *SignList,long &StartAddr,BYTE SignObject_Bytes,
  141.   BYTE SignType,bool IsCompany,bool Del,CString IconName = "");
  142. CString SearchRoad(const CPoint point,CString &RoadSn);
  143. long DistanceToLine(long SY, long SX, long EY, long EX, long NY, long NX);
  144. BYTE PointOnLineNE(long SY, long SX, long EY, long EX, long NY, long NX, long K);
  145. void SwapTwoVar(long &a, long &b);
  146. long CalcPointToOneRoadDist(CPoint point,CSmallRoadStruct *pSmall);
  147. void DrawSignLib(CDC *pDC);
  148. void DrawOneSignPoint(CDC *pDC);
  149. void GetView(CView *pView);
  150. void DrawIcon(CDC *pDC,CPoint point,CString IconName);
  151. CString GetCurrDir();
  152. bool ShowSignLib();
  153. void FreshWnd();
  154. void SearchSign();
  155. void WriteCross(CGpsRoadCrossPoint *pCross,CString FileName);
  156. void WriteBRcross(CBRCrossStruct *pBRCross,CString FileName);
  157. void WritePathToTxt(CObList *PathList);
  158. long alculateDist(CPoint SP,CPoint EP);
  159. short BR_SaveOnePath(CGpsRoadCrossPoint *StartPoint,
  160.  CGpsRoadCrossPoint *EndPoint,
  161.  CObList *RoadList,CObList *CrossList,CObList *SavePathList);
  162. bool BRCrossInList(CBRCrossStruct *pBRCross,CObList *CrossList);
  163. bool HaveSaveOneRoadSn(CGpsRoadCrossPoint *pCross1,CGpsRoadCrossPoint *pCross2);
  164. bool CheckCrossSame(CGpsRoadCrossPoint *pC1,CGpsRoadCrossPoint *pC2);
  165. bool GetMinDistPoint(CObList *CrossList,CBRCrossStruct *MinCross);
  166. bool SaveInitBRCross(CObList *CrossList,CObList *DstList);
  167. long CalculateOneRoadVD(CObList *PlainList);
  168. long CalculateTwoPointDistance(CPoint PrevP,CPoint CurrP);
  169. long CalcCrossDistInRoadSn(CGpsRoadCrossPoint *StartPoint,
  170.   CGpsRoadCrossPoint *EndPoint,
  171.   CObList *RoadList,CString RoadSn);
  172. long CalcCrossVectorDist(CGpsRoadCrossPoint *StartPoint,
  173. CGpsRoadCrossPoint *EndPoint,
  174. CObList *RoadList);
  175. bool GetOneBRCrossPoint(CPoint point,CObList *RoadList,CObList *CrossList,
  176.    CString Sn,CBRCrossStruct *pDstCross,CObList *SavePoint);
  177. bool RoadSnInCross(CString RoadSn,CGpsRoadCrossPoint *pCross);
  178. bool GetOneRoadPoint(CObList *RoadList,CString RoadSn,CGpsRoadStruct *DstRoad);
  179. bool SimilarCross(CGpsRoadCrossPoint *C1,CGpsRoadCrossPoint *C2);
  180. bool IsInvalidSn(CString RoadSn);
  181. bool GetOneRoadPlain(CGpsRoadCrossPoint *pCross1,
  182.     CGpsRoadCrossPoint *pCross2,
  183. CObList *RoadList,CString RoadSn,CObList *DstList);
  184. bool GetPointInListEx(CPoint point,CString RoadSn,CObList *CrossList,CGpsRoadCrossPoint *pPoint,BYTE Bound);
  185. void DrawLineEx(CDC *pDC,CObList *TempList);
  186. bool DrawBetweenCross(CGpsRoadCrossPoint *pPrevCross,CGpsRoadCrossPoint *pCross,CObList *RoadList,CDC *pDC);
  187. void DrawBetweenBRCrossLine(CDC *pDC,CObList *SaveBRCrossList);
  188. void CalculateBRroadPath(CPoint point);
  189. bool SearchSignByPoint(CPoint point,CPoint &Ret);
  190. void DispShootPic(CDC *pDC,CPoint point,CString PicPath);
  191. bool CalcNE2XY(double gx,double gy,long &x,long &y);
  192. void ErasePrevPoint(CDC *pDC,long x,long y);
  193. void GetAreaLibList(CObList *AreaList);
  194. void ClearStrArr(CString StrArr[],long Count);
  195. void MoveScrollBar(long x,long y);
  196. void ReCalcPointXY(CObList *PointList);
  197. void ReCalcColorBXY(CObList *ColorBList);
  198. void ReCalcRoadXY(CObList *RoadList);
  199. void CalcAllPointXY();
  200. void ZoomDown();
  201. void ZoomUp();
  202. void DispOtherLevelMap();
  203. void GetCarXY(int &nx,int &ny); //获取显示车位置
  204. void MapDrawLineWidth(CDC *pDC, long SX, long SY, long EX, long EY, BYTE MapLineWidth,CPen *Pen);
  205. void MapDrawRoad(CDC *pDC, long SX, long SY, long EX, long EY, BYTE RoadWide,CPen *CurrPen);
  206. bool CompanySimilarStr(CString Str1,CString Str2);
  207. void SearchSignByInput();
  208. void DrawSignByName(CString SignName);
  209. };
  210. #endif // !defined(AFX_GPSDRAWMAP_H__87EBC361_5E1C_11D8_B7C7_00E01808A228__INCLUDED_)