6 #include "VectorMath.h"
7 #include "TiledGraphNode.h"
8 #include "TiledGraphEdge.h"
13 #define EEGEO_GRAPHS_TILED_GRAPH_VALIDATION 0
29 const dv3& originEcef,
30 const std::vector<TiledGraphNode>& nodes,
31 const std::vector<TiledGraphEdge>& edges,
32 const std::vector<int>& incidentEdges,
33 const std::vector<int>& edgesWithExternalNodesForward,
34 const std::vector<int>& edgesWithExternalNodesReversed
38 const dv3& GetOriginEcef()
const {
return m_originEcef; }
45 const std::vector<int>& GetIncidentEdges()
const;
52 void GetIncidentEdgeIds(
const TiledGraphNodeId& nodeId, std::vector<TiledGraphEdgeId>& out_incidentEdgeIds)
const;
56 bool FindEdgeWithAttributes(
const int attributesId,
const bool attributesDirectionReversed,
TiledGraphEdgeId& out_edgeId)
const;
58 bool FindExternalEdgeWithAttributes(
const int attributesId,
const bool attributesDirectionReversed,
TiledGraphEdgeId& out_edgeId)
const;
60 void GetEdgeIdsToLink(std::vector<TiledGraphEdgeId>& out_edgeIds)
const;
62 void GetCellKeysToUnlink(std::vector<Streaming::MortonKey>& out_keys)
const;
66 bool ValidateExternalNodesExist()
const;
68 bool ValidateAllExternalNodesUnlinked()
const;
70 const std::vector<TiledGraphNode>& GetNodes()
const {
return m_nodes; }
72 const std::vector<TiledGraphEdge>& GetEdges()
const {
return m_edges; }
74 const TiledGraph* GetGraphOrNull()
const {
return m_pTiledGraph; }
89 const dv3& originEcef);
93 const dv3& originEcef,
94 const std::vector<TiledGraphNode>& nodes,
95 const std::vector<TiledGraphEdge>& edges,
96 const std::vector<int>& incidentEdges,
97 const std::vector<int>& edgesWithExternalNodesForward,
98 const std::vector<int>& edgesWithExternalNodesReversed
101 void AppendEdgeIdsToLink(
const std::vector<int>& edgesWithExternalNodes, std::vector<TiledGraphEdgeId>& out_edgeIds)
const;
103 void AppendKeysToUnlink(
const std::vector<int>& edgesWithExternalNodes, std::vector<Streaming::MortonKey>& out_keys)
const;
109 void UnlinkExternalEdgeNodes();
111 bool ValidateNodeIsInternalOrUnlinked(
const TiledGraphNodeId& nodeId)
const;
116 std::vector<TiledGraphNode> m_nodes;
117 std::vector<TiledGraphEdge> m_edges;
118 std::vector<int> m_incidentEdges;
119 std::vector<int> m_edgesWithExternalNodesForward;
120 std::vector<int> m_edgesWithExternalNodesReversed;
126 const std::vector<TiledGraphEdge>& edges
131 bool operator() (
const int edgeIndexA,
const int edgeIndexB)
const
133 const auto& edgeA = m_edges.at(edgeIndexA);
134 const auto& edgeB = m_edges.at(edgeIndexB);
135 return edgeA.AttributesId < edgeB.AttributesId;
139 const std::vector<TiledGraphEdge>& m_edges;
145 const std::vector<TiledGraphEdge>& edges
150 bool operator() (
const int edgeIndexA,
const int edgeIndexB)
const
152 const auto& edgeA = m_edges.at(edgeIndexA);
153 const auto& edgeB = m_edges.at(edgeIndexB);
154 return edgeA.AttributesId == edgeB.AttributesId;
158 const std::vector<TiledGraphEdge>& m_edges;