?? nrstpath.h
字號(hào):
#pragma once
//-----------------------------------------------------------------------------------------
struct PathNode
{
short nSegNumber;
CString* szRoutineName;
CString* szFromStationName;
CString* szToStationName;
};
//-----------------------------------------------------------------------------------------
struct Routine // 一條公交線路
{
short nFlag; // 0:雙向;1:上行;2:下行
short nStationNumber; // 包含的公交站點(diǎn)的數(shù)目
CString szRoutineName; // 公交線路名稱
CString* szStaionName; // 包含的公交站點(diǎn)名稱數(shù)組
};
//-----------------------------------------------------------------------------------------
struct Node // 表示某一節(jié)點(diǎn)
{
short nNodeNumber; // 數(shù)目
short* nRoutineOrder; // 線路順序數(shù)組
short* nStationOrder; // 站點(diǎn)順序數(shù)組
};
//-----------------------------------------------------------------------------------------
struct Station // 表示某一站點(diǎn)
{
CString szStationName; // 站點(diǎn)名稱
short nRoutineNumber; // 經(jīng)過該站點(diǎn)的公交線路的數(shù)目
short* pnRoutineID; // 經(jīng)過該站點(diǎn)的各條公交線路的ID數(shù)組
short* pnOrder; // 本站點(diǎn)在各條公交線路中站點(diǎn)號(hào)數(shù)組
};
//-----------------------------------------------------------------------------------------
class CNrstPath
{
public:
CNrstPath(void);
~CNrstPath(void);
private:
int m_nTimeLimit; // 循環(huán)次數(shù)閾值
Routine* m_pRoutine; // 最短路徑包含的線路數(shù)組
Station* m_pStations; // 最短路徑包含的站點(diǎn)數(shù)組
short m_nRCount; // 路線條數(shù)
short m_nSCount; // 站點(diǎn)個(gè)數(shù)
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);
};
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -