6 #include "VectorMathDecl.h"
7 #include "Navigation.h"
12 #include "ParsedNavGraph.h"
26 const std::vector<Eegeo::v3>::const_iterator verticesBegin,
27 const std::vector<Eegeo::v3>::const_iterator verticesEnd,
28 const std::vector<u16>::const_iterator connectionsToIndicesBegin,
29 const std::vector<u16>::const_iterator connectionsToIndicesEnd,
30 const std::vector<u16>::const_iterator connectionsFromIndicesBegin,
31 const std::vector<u16>::const_iterator connectionsFromIndicesEnd,
34 RoadDirection direction,
35 u8 roughSpeedLimitInKph,
36 FunctionalRoadClass::Type roadClass = FunctionalRoadClass::NotApplicable
39 const std::vector<Eegeo::v3>& GetVertices()
const {
return m_vertices; }
40 const std::vector<int>& GetConnectionsToIndices()
const {
return m_connectionsToIndices; }
41 const std::vector<int>& GetConnectionsFromIndices()
const {
return m_connectionsFromIndices; }
42 float GetHalfWidth()
const {
return m_halfWidth; }
43 u8 GetAverageSpeedInKph()
const {
return m_averageSpeedInKph; }
44 RoadDirection GetRoadDirection()
const {
return m_direction; }
45 u8 GetRoughSpeedLimitInKph()
const {
return m_roughSpeedLimitInKph; }
46 int GetVertexCount()
const {
return static_cast<int>(m_vertices.size()); }
47 const FunctionalRoadClass::Type GetFunctionalRoadClass()
const {
return m_functionalRoadClass; }
52 bool IsConnectedAtStart(
const NavigationGraphRoad& road,
const std::vector<NavigationGraphRoad*>& roads)
const;
53 bool IsConnectedAtEnd(
const NavigationGraphRoad& road,
const std::vector<NavigationGraphRoad*>& roads)
const;
62 const bool HasConnectionToCell()
const {
return m_connectionToCell != NULL; }
63 const bool HasConnectionFromCell()
const {
return m_connectionFromCell != NULL; }
66 const bool HasConnectionTo() {
return HasConnectionToCell() || !GetConnectionsToIndices().empty(); }
67 const bool HasConnectionFrom() {
return HasConnectionFromCell() || !GetConnectionsFromIndices().empty(); }
68 const bool IsActualDeadEnd(
bool forwardsDirection) {
69 return (!HasConnectionTo() && forwardsDirection) ||
70 (!HasConnectionFrom() && !forwardsDirection);
73 bool IsBoundaryVertexOrDeadEnd(
int vertexIndex)
const;
77 void DisableVertex(
int index);
78 void EnableVertex(
int index);
79 bool IsVertexEnabled(
int index)
const;
80 bool HasDisabledVertices()
const;
83 bool AreConnectionsValid(
const NavigationGraph& navGraph,
const std::vector<int>& connectionIndices)
const;
85 const std::vector<Eegeo::v3> m_vertices;
86 const std::vector<int> m_connectionsToIndices;
87 const std::vector<int> m_connectionsFromIndices;
88 const float m_halfWidth;
89 const u8 m_averageSpeedInKph;
90 const RoadDirection m_direction;
91 const u8 m_roughSpeedLimitInKph;
92 const Resources::Roads::FunctionalRoadClass::Type m_functionalRoadClass;
94 std::vector<int> m_disabledVertexIndices;