13 #define RMFVERSION_STRING "RMFFile2.0"
14 #define RMFVERSION_CURRENT 2.0
15 #define RMFVERSION_SUPPORTED 1.7 // oldest supported version
31 enum IntersectionType {
45 #define RF_SIDEWALK 0x0800
46 #define RF_PARKING 0x0400
47 #define RF_MARGIN 0x0200
48 #define RF_FORWARD 0x0080 // true if traffic flows from node 0 to 1
49 #define RF_REVERSE 0x0040 // true if traffic flows from node 1 to 0
54 #define SIDEWALK_WIDTH 1.5f
55 #define CURB_HEIGHT 0.15f
56 #define MARGIN_WIDTH 1.6f
57 #define LANE_WIDTH 3.3f
58 #define PARKING_WIDTH LANE_WIDTH
73 IntersectionType eIntersection;
92 bool operator==(
TNode &ref);
95 void Copy(
TNode* node);
97 TLink *GetLink(
int n);
98 int AddLink(
TLink *pR,
bool bStart);
99 void DetachLink(
TLink *pR,
bool bStart);
100 void DetermineLinkAngles();
101 float GetLinkAngle(
int iLinkNum);
102 void SortLinksByAngle();
103 DPoint2 GetAdjacentLinkPoint2d(
int iLinkNum);
105 int GetLinkNum(
TLink *link,
bool bStart);
106 LinkConnect &GetLinkConnect(
int iLinkNum) {
return m_connect[iLinkNum]; }
109 bool SetIntersectType(
int linkNum, IntersectionType type);
110 IntersectionType GetIntersectType(
int linkNum);
111 LightStatus GetLightStatus(
int linkNum);
112 bool SetLightStatus(
int linkNum, LightStatus light);
118 void AdjustForLights();
126 int FindLink(
int linkID);
131 std::vector<LinkConnect> m_connect;
153 bool operator==(
TLink &ref);
155 void SetNode(
int n,
TNode *pNode) { m_pNode[n] = pNode; }
156 TNode *GetNode(
int n) {
return m_pNode[n]; }
160 DPoint2 &closest,
int &linkpoint,
float &fractional,
bool bAllowEnds =
true);
164 bool IsLoop() {
return (m_pNode[0] == m_pNode[1]); }
167 virtual void SetFlag(
int flag,
bool value);
168 int GetFlag(
int flag);
172 float EstimateWidth(
bool bIncludeSidewalk =
true);
175 unsigned short m_iLanes;
176 SurfaceType m_Surface;
181 float m_fSidewalkWidth;
183 float m_fMarginWidth;
185 float m_fParkingWidth;
210 void DeleteElements();
211 DRECT GetMapExtent();
212 void ComputeExtents();
214 int NumLinks()
const;
215 int NumNodes()
const;
217 TLink *GetFirstLink() {
return m_pFirstLink; }
218 TNode *GetFirstNode() {
return m_pFirstNode; }
220 virtual TNode *NewNode() {
return new TNode; }
221 virtual TLink *NewLink() {
return new TLink; }
223 void AddNode(
TNode *pNode)
225 pNode->m_pNext = m_pFirstNode;
226 m_pFirstNode = pNode;
228 void AddLink(
TLink *pLink)
230 pLink->m_pNext = m_pFirstLink;
231 m_pFirstLink = pLink;
234 TNode *FindNodeByID(
int id);
238 int RemoveUnusedNodes();
241 void RemoveNode(
TNode *pNode);
242 void RemoveLink(
TLink *pLink);
244 bool ReadRMF(
const char *filename,
bool bHwy,
bool bPaved,
bool bDirt);
245 bool WriteRMF(
const char *filename);
251 bool m_bValidExtents;