📄 nrstpath.h
字号:
#pragma once
//-----------------------------------------------------------------------------------------
struct PathNode
{
short nSegNumber;
CString* szRoutineName;
CString* szFromStationName;
CString* szToStationName;
};
//-----------------------------------------------------------------------------------------
struct Routine // 一条公交线路
{
short nFlag; // 0:双向;1:上行;2:下行
short nStationNumber; // 包含的公交站点的数目
CString szRoutineName; // 公交线路名称
CString* szStaionName; // 包含的公交站点名称数组
};
//-----------------------------------------------------------------------------------------
struct Node // 表示某一节点
{
short nNodeNumber; // 数目
short* nRoutineOrder; // 线路顺序数组
short* nStationOrder; // 站点顺序数组
};
//-----------------------------------------------------------------------------------------
struct Station // 表示某一站点
{
CString szStationName; // 站点名称
short nRoutineNumber; // 经过该站点的公交线路的数目
short* pnRoutineID; // 经过该站点的各条公交线路的ID数组
short* pnOrder; // 本站点在各条公交线路中站点号数组
};
//-----------------------------------------------------------------------------------------
class CNrstPath
{
public:
CNrstPath(void);
~CNrstPath(void);
private:
int m_nTimeLimit; // 循环次数阈值
Routine* m_pRoutine; // 最短路径包含的线路数组
Station* m_pStations; // 最短路径包含的站点数组
short m_nRCount; // 路线条数
short m_nSCount; // 站点个数
public:
void Build();
short BuildRoutine(Routine* pRoutine);
short BuildStationIndex(Routine* pAllRoutines,short nSize, Station* pStations);
void Search(CString sz1, CString sz2, CList<PathNode, PathNode&>* array);
short Search(Routine* pAllRoutines, short nSize, Station* pStations,
short nSCount, CString szFrom, CString szTo,
CList<PathNode, PathNode&>* pResPath);
short HasStation(Routine theRoutine, CString szStation, short nSearchFrom, short nFlag);
short SearchStation(Station* pStations, short nSCount, CString theName);
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -