[Routing] Refactoring
Code style. Signed-off-by: Anton Makouski <anton.makouski@gmail.com>
This commit is contained in:
parent
1b998cd35b
commit
1d660547d7
8 changed files with 15 additions and 52 deletions
|
@ -1,20 +1,11 @@
|
|||
#include "routing/car_directions.hpp"
|
||||
|
||||
#include "routing/fake_feature_ids.hpp"
|
||||
#include "routing/road_point.hpp"
|
||||
#include "routing/router_delegate.hpp"
|
||||
#include "routing/routing_exceptions.hpp"
|
||||
#include "routing/routing_result_graph.hpp"
|
||||
#include "routing/turns.hpp"
|
||||
#include "routing/turns_generator.hpp"
|
||||
#include "routing/turns_generator_utils.hpp"
|
||||
|
||||
#include "geometry/angles.hpp"
|
||||
|
||||
#include "base/assert.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace routing
|
||||
{
|
||||
using namespace std;
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "routing/directions_engine.hpp"
|
||||
#include "routing/route.hpp"
|
||||
#include "routing/segment.hpp"
|
||||
|
||||
#include "routing_common/num_mwm_id.hpp"
|
||||
|
||||
#include "indexer/data_source.hpp"
|
||||
|
||||
#include "geometry/point_with_altitude.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "routing/directions_engine.hpp"
|
||||
|
||||
#include "routing/fake_feature_ids.hpp"
|
||||
#include "routing/routing_helpers.hpp"
|
||||
#include "routing/routing_callbacks.hpp"
|
||||
|
@ -288,6 +289,13 @@ bool DirectionsEngine::Generate(IndexRoadGraph const & graph,
|
|||
// so size of |segments| is not equal to size of |routeEdges|.
|
||||
if (!segments.empty())
|
||||
CHECK_EQUAL(segments.size(), routeEdges.size(), ());
|
||||
|
||||
|
||||
CHECK_EQUAL(
|
||||
routeGeometry.size(), path.size(),
|
||||
("routeGeometry and path have different sizes. routeGeometry size:", routeGeometry.size(),
|
||||
"path size:", path.size(), "segments size:", segments.size(), "routeEdges size:", routeEdges.size()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -398,13 +406,6 @@ RouterResultCode DirectionsEngine::MakeTurnAnnotation(IndexRoadGraph::EdgeVector
|
|||
|
||||
FixupTurns(junctions, turnsDir);
|
||||
|
||||
/*
|
||||
CHECK_EQUAL(
|
||||
routeGeometry.size(), pathSize,
|
||||
("routeGeometry and path have different sizes. routeGeometry size:", routeGeometry.size(),
|
||||
"path size:", pathSize, "segments size:", segments.size(), "routeEdges size:",
|
||||
routeEdges.size(), "resultGraph.GetSegments() size:", resultGraph.GetSegments().size()));
|
||||
*/
|
||||
return RouterResultCode::NoError;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include "geometry/point_with_altitude.hpp"
|
||||
|
||||
#include "base/assert.hpp"
|
||||
#include "base/cancellable.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
#include "routing/pedestrian_directions.hpp"
|
||||
|
||||
#include "routing/road_graph.hpp"
|
||||
#include "routing/turns_generator.hpp"
|
||||
#include "routing/turns.hpp"
|
||||
#include "routing/turns_generator_utils.hpp"
|
||||
|
||||
#include "base/assert.hpp"
|
||||
#include "base/logging.hpp"
|
||||
|
||||
#include <utility>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace routing
|
||||
{
|
||||
PedestrianDirectionsEngine::PedestrianDirectionsEngine(DataSource const & dataSource,
|
||||
|
@ -20,6 +14,7 @@ PedestrianDirectionsEngine::PedestrianDirectionsEngine(DataSource const & dataSo
|
|||
{
|
||||
}
|
||||
|
||||
using namespace std;
|
||||
using namespace turns;
|
||||
|
||||
// Angles in degrees for finding route segments with no actual forks.
|
||||
|
@ -52,6 +47,8 @@ size_t PedestrianDirectionsEngine::GetTurnDirection(IRoutingResult const & resul
|
|||
("Turn candidates should be sorted by its angle field."));
|
||||
}
|
||||
|
||||
/// @todo Proper handling of isCandidatesAngleValid == False, when we don't have angles of candidates.
|
||||
|
||||
if (nodes.candidates.size() == 0)
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "routing/directions_engine.hpp"
|
||||
#include "routing/directions_engine_helpers.hpp"
|
||||
#include "routing/loaded_path_segment.hpp"
|
||||
#include "routing/routing_result_graph.hpp"
|
||||
#include "routing/turn_candidate.hpp"
|
||||
|
||||
#include "routing_common/num_mwm_id.hpp"
|
||||
|
||||
#include "geometry/point_with_altitude.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
|
@ -21,9 +15,9 @@ public:
|
|||
PedestrianDirectionsEngine(DataSource const & dataSource, std::shared_ptr<NumMwmIds> numMwmIds);
|
||||
|
||||
protected:
|
||||
virtual size_t GetTurnDirection(IRoutingResult const & result, size_t const outgoingSegmentIndex,
|
||||
virtual size_t GetTurnDirection(turns::IRoutingResult const & result, size_t const outgoingSegmentIndex,
|
||||
NumMwmIds const & numMwmIds,
|
||||
RoutingSettings const & vehicleSettings, TurnItem & turn);
|
||||
RoutingSettings const & vehicleSettings, turns::TurnItem & turn);
|
||||
virtual void FixupTurns(std::vector<geometry::PointWithAltitude> const & junctions,
|
||||
Route::TTurns & turnsDir);
|
||||
};
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
#include "routing/turns_generator.hpp"
|
||||
#include "routing/turns_generator_utils.hpp"
|
||||
|
||||
#include "routing/turns_generator_utils.hpp"
|
||||
#include "routing/router.hpp"
|
||||
#include "platform/measurement_utils.hpp"
|
||||
|
||||
#include "indexer/ftypes_matcher.hpp"
|
||||
|
||||
#include "base/checked_cast.hpp"
|
||||
#include "base/stl_helpers.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <sstream>
|
||||
#include <numeric>
|
||||
|
||||
namespace routing
|
||||
{
|
||||
namespace turns
|
||||
|
|
|
@ -1,16 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "routing/loaded_path_segment.hpp"
|
||||
#include "routing/route.hpp"
|
||||
#include "routing/router.hpp"
|
||||
#include "routing/routing_callbacks.hpp"
|
||||
#include "routing/routing_settings.hpp"
|
||||
#include "routing/routing_result_graph.hpp"
|
||||
#include "routing/segment.hpp"
|
||||
#include "routing/turn_candidate.hpp"
|
||||
#include "routing/turns.hpp"
|
||||
#include "routing/vehicle_mask.hpp"
|
||||
|
||||
#include "traffic/traffic_info.hpp"
|
||||
|
||||
#include "routing_common/num_mwm_id.hpp"
|
||||
|
||||
|
|
Reference in a new issue