mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -44,10 +44,8 @@ void FillSegmentInfo(vector<double> const & times, vector<RouteSegment> & routeS
|
||||
}
|
||||
}
|
||||
|
||||
void ReconstructRoute(DirectionsEngine & engine, IndexRoadGraph const & graph,
|
||||
base::Cancellable const & cancellable,
|
||||
vector<geometry::PointWithAltitude> const & path, vector<double> const & times,
|
||||
Route & route)
|
||||
void ReconstructRoute(DirectionsEngine & engine, IndexRoadGraph const & graph, base::Cancellable const & cancellable,
|
||||
vector<geometry::PointWithAltitude> const & path, vector<double> const & times, Route & route)
|
||||
{
|
||||
if (path.empty())
|
||||
{
|
||||
@@ -80,10 +78,7 @@ Segment ConvertEdgeToSegment(NumMwmIds const & numMwmIds, Edge const & edge)
|
||||
if (edge.IsFake())
|
||||
{
|
||||
if (edge.HasRealPart())
|
||||
{
|
||||
return Segment(kFakeNumMwmId, FakeFeatureIds::kIndexGraphStarterId, edge.GetFakeSegmentId(),
|
||||
true /* forward */);
|
||||
}
|
||||
return Segment(kFakeNumMwmId, FakeFeatureIds::kIndexGraphStarterId, edge.GetFakeSegmentId(), true /* forward */);
|
||||
|
||||
return Segment();
|
||||
}
|
||||
@@ -98,13 +93,13 @@ bool SegmentCrossesRect(m2::Segment2D const & segment, m2::RectD const & rect)
|
||||
{
|
||||
double constexpr kEps = 1e-6;
|
||||
bool isSideIntersected = false;
|
||||
rect.ForEachSide([&segment, &isSideIntersected](m2::PointD const & a, m2::PointD const & b) {
|
||||
rect.ForEachSide([&segment, &isSideIntersected](m2::PointD const & a, m2::PointD const & b)
|
||||
{
|
||||
if (isSideIntersected)
|
||||
return;
|
||||
|
||||
m2::Segment2D const rectSide(a, b);
|
||||
isSideIntersected =
|
||||
m2::Intersect(segment, rectSide, kEps).m_type != m2::IntersectionResult::Type::Zero;
|
||||
isSideIntersected = m2::Intersect(segment, rectSide, kEps).m_type != m2::IntersectionResult::Type::Zero;
|
||||
});
|
||||
|
||||
return isSideIntersected;
|
||||
@@ -119,10 +114,8 @@ bool RectCoversPolyline(IRoadGraph::PointWithAltitudeVec const & junctions, m2::
|
||||
return rect.IsPointInside(junctions.front().GetPoint());
|
||||
|
||||
for (auto const & junction : junctions)
|
||||
{
|
||||
if (rect.IsPointInside(junction.GetPoint()))
|
||||
return true;
|
||||
}
|
||||
|
||||
// No point of polyline |junctions| lays inside |rect| but may be segments of the polyline
|
||||
// cross |rect| borders.
|
||||
@@ -136,8 +129,8 @@ bool RectCoversPolyline(IRoadGraph::PointWithAltitudeVec const & junctions, m2::
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CheckGraphConnectivity(Segment const & start, bool isOutgoing, bool useRoutingOptions,
|
||||
size_t limit, WorldGraph & graph, set<Segment> & marked)
|
||||
bool CheckGraphConnectivity(Segment const & start, bool isOutgoing, bool useRoutingOptions, size_t limit,
|
||||
WorldGraph & graph, set<Segment> & marked)
|
||||
{
|
||||
queue<Segment> q;
|
||||
q.push(start);
|
||||
|
||||
Reference in New Issue
Block a user