Refactoring PathData class

This commit is contained in:
Dennis Luxen
2013-12-08 19:10:10 +01:00
parent 2edf4906a4
commit 009f08dca3
7 changed files with 45 additions and 29 deletions
+2 -2
View File
@@ -64,7 +64,7 @@ void DescriptionFactory::SetStartSegment(const PhantomNode & sph) {
start_phantom = sph;
AppendSegment(
sph.location,
_PathData(0, sph.nodeBasedEdgeNameID, 10, sph.weight1)
PathData(0, sph.nodeBasedEdgeNameID, 10, sph.weight1)
);
}
@@ -84,7 +84,7 @@ void DescriptionFactory::SetEndSegment(const PhantomNode & tph) {
void DescriptionFactory::AppendSegment(
const FixedPointCoordinate & coordinate,
const _PathData & data
const PathData & data
) {
if(1 == pathDescription.size() && pathDescription.back().location == coordinate) {
pathDescription.back().name_id = data.name_id;
+1 -1
View File
@@ -84,7 +84,7 @@ public:
double GetBearing(const FixedPointCoordinate& C, const FixedPointCoordinate& B) const;
void AppendEncodedPolylineString(std::vector<std::string> &output) const;
void AppendUnencodedPolylineString(std::vector<std::string> &output) const;
void AppendSegment(const FixedPointCoordinate & coordinate, const _PathData & data);
void AppendSegment(const FixedPointCoordinate & coordinate, const PathData & data);
void BuildRouteSummary(const double distance, const unsigned time);
void SetStartSegment(const PhantomNode & start_phantom);
void SetEndSegment(const PhantomNode & start_phantom);
+1 -1
View File
@@ -76,7 +76,7 @@ public:
reply.content.push_back("lon=\"" + tmp + "\"></rtept>");
BOOST_FOREACH(
const _PathData & pathData,
const PathData & pathData,
rawRoute.computedShortestPath
) {
current = facade->GetCoordinateOfNode(pathData.node);
+2 -2
View File
@@ -96,7 +96,7 @@ public:
"\"status_message\": \"Found route between points\",");
//Get all the coordinates for the computed route
BOOST_FOREACH(const _PathData & path_data, raw_route_information.computedShortestPath) {
BOOST_FOREACH(const PathData & path_data, raw_route_information.computedShortestPath) {
current = facade->GetCoordinateOfNode(path_data.node);
description_factory.AppendSegment(current, path_data );
}
@@ -170,7 +170,7 @@ public:
if(raw_route_information.lengthOfAlternativePath != INT_MAX) {
alternateDescriptionFactory.SetStartSegment(phantom_nodes.startPhantom);
//Get all the coordinates for the computed route
BOOST_FOREACH(const _PathData & path_data, raw_route_information.computedAlternativePath) {
BOOST_FOREACH(const PathData & path_data, raw_route_information.computedAlternativePath) {
current = facade->GetCoordinateOfNode(path_data.node);
alternateDescriptionFactory.AppendSegment(current, path_data );
}