📄 carnaviview.h
字号:
// CarNaviView.h : interface of the CCarNaviView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CARNAVIVIEW_H__AE84E6DB_7D7C_4017_A409_36DE5BEC27BC__INCLUDED_)
#define AFX_CARNAVIVIEW_H__AE84E6DB_7D7C_4017_A409_36DE5BEC27BC__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "MyPathAnalyst.h"
class CCarNaviView : public CView
{
protected: // create from serialization only
CCarNaviView();
DECLARE_DYNCREATE(CCarNaviView)
// Attributes
public:
CCarNaviDoc* GetDocument();
//{{地图显示相关
public:
CSeMapWnd m_MapWnd; //显示管理
bool m_bFileOpened; //地图是否打开
//}}地图显示相关
//===============================================================================
//{{GPS接收、显示相关
public:
CSeGPS m_GPSReceiver; //GPS接受器
bool m_bGPSOpened; //GPS是否打开
CSeGPSData m_GPSData; //GPS数据, 包括经纬度、速度、方向等信息
CSeGPSSatelliteData m_GPSSatData[12]; //GPS卫星数据, 包括方位角、高度角、卫星编号、信号强度
CPoint m_pntGPS; //GPS定位数据
bool m_bShowGPSonMap; //是否在地图的相应位置上显示GPS点
void DrawGPSonMap( CDC *pDC ); //简单绘制一个"红色方块"来表现。
//}}GPS接收、显示相关
//===============================================================================
//{{路径分析相关
public:
CMyPathAnalyst m_PathAnalyst; //路径分析类
CPoint m_pntFrom; //出发地坐标点
CPoint m_pntTo; //目的地坐标点
CDWordArray m_arrArcIDs; //分析结果1: 路径经过的路段 ID 集合
CDWordArray m_arrNodeIDs; //分析结果2: 路径经过的节点 ID 集合
double m_dPathTotalLength; //分析结果3: 路径长度, 可能是小时(最快模式),也可能是米(最短模式)
bool PathAnalysing();
void PathAnalyseInit( long nMode );
//是否显示 出发地 和 目的地
bool m_bShowPathFromnToPoint;
//简单绘制一个"紫红方块"来表示出发地
//简单绘制一个"蓝色方块"来表示目的地
void DrawPathFromnToPoint( CDC *pDC );
//}}路径分析相关
//===============================================================================
//{{导航相关相关
public:
CSePathNavigator m_Navigator; //导航分析类
bool m_bNaviReal; //真实导航
bool m_bNaviSimulate; //模拟导航
long m_nCurArcID; //当前所在的路段ID
double m_dDistanceToTurn; //到下一个拐弯点的距离, 单位为米
double m_dAngleToTurn; //下一个拐弯点的偏转角度, 单位为度, 左转为负, 右转为正
long m_nNextArcID; //下一个路段ID, 如果当前在最后一条路上, 则这个值为 -1
double m_dDistanceToNext; //到下一个路段的距离, 单位为米
double m_dAngleToNext; //下一个路段的偏转角度, 单位为度, 左转为负, 右转为正
long m_nNextNodeID; //下一个节点ID,
CArray < CPoint, CPoint& > m_arrSimulatePoints; //模拟导航的坐标点串
long m_nGPSPointCount; //模拟导航的坐标点数
long m_nGPSPointIndex; //当前坐标点 索引
void StartNavigate(); //开始导航, 包括导航初始化
void NaviReal(); //真实导航
void NaviSimulate(); //模拟导航
//导航处理, 被 NaviReal 和 NaviSimulate 调用
bool Navigate( CPoint& pntCar, double dBearing );
//导航信息, 在此简单用一个字符串来表示, 具体应用中, 可以用各种图标来表示
CString m_strNaviInfo;
//}}导航相关相关
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCarNaviView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CCarNaviView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CCarNaviView)
afx_msg void OnFileOpen();
afx_msg void OnFileClose();
afx_msg void OnMapPan();
afx_msg void OnMapRefresh();
afx_msg void OnMapViewentire();
afx_msg void OnMapZoomin();
afx_msg void OnMapZoomout();
afx_msg void OnNaviReal();
afx_msg void OnNaviSimulate();
afx_msg void OnPathFast();
afx_msg void OnPathFrom();
afx_msg void OnPathShortest();
afx_msg void OnPathTo();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnGpsOpen();
afx_msg void OnGpsClose();
afx_msg void OnGpsShowData();
afx_msg void OnGpsShowOnMap();
afx_msg void OnGpsShowSatStatus();
afx_msg void OnUpdateGpsShowOnMap(CCmdUI* pCmdUI);
afx_msg void OnUpdateNaviReal(CCmdUI* pCmdUI);
afx_msg void OnUpdateNaviSimulate(CCmdUI* pCmdUI);
afx_msg void OnPathRemove();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in CarNaviView.cpp
inline CCarNaviDoc* CCarNaviView::GetDocument()
{ return (CCarNaviDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CARNAVIVIEW_H__AE84E6DB_7D7C_4017_A409_36DE5BEC27BC__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -