Format all C++ and Java code via clang-format

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-08-17 14:32:37 +07:00
parent 9f0290c0ec
commit bfffa1fff4
2169 changed files with 56441 additions and 64188 deletions

View File

@@ -10,9 +10,9 @@ namespace routing
using namespace std;
NearestEdgeFinder::NearestEdgeFinder(m2::PointD const & point, IsEdgeProjGood const & isEdgeProjGood)
: m_point(point), m_isEdgeProjGood(isEdgeProjGood)
{
}
: m_point(point)
, m_isEdgeProjGood(isEdgeProjGood)
{}
void NearestEdgeFinder::AddInformationSource(IRoadGraph::FullRoadInfo const & roadInfo)
{
@@ -26,8 +26,7 @@ void NearestEdgeFinder::AddInformationSource(IRoadGraph::FullRoadInfo const & ro
ASSERT_GREATER(count, 1, ());
for (size_t i = 1; i < count; ++i)
{
m2::ParametrizedSegment<m2::PointD> segment(junctions[i - 1].GetPoint(),
junctions[i].GetPoint());
m2::ParametrizedSegment<m2::PointD> segment(junctions[i - 1].GetPoint(), junctions[i].GetPoint());
m2::PointD const closestPoint = segment.ClosestPointTo(m_point);
double const squaredDist = m_point.SquaredLength(closestPoint);
@@ -48,8 +47,7 @@ void NearestEdgeFinder::AddInformationSource(IRoadGraph::FullRoadInfo const & ro
geometry::PointWithAltitude const & segEnd = junctions[idx];
geometry::Altitude const startAlt = segStart.GetAltitude();
geometry::Altitude const endAlt = segEnd.GetAltitude();
m2::ParametrizedSegment<m2::PointD> segment(junctions[idx - 1].GetPoint(),
junctions[idx].GetPoint());
m2::ParametrizedSegment<m2::PointD> segment(junctions[idx - 1].GetPoint(), junctions[idx].GetPoint());
m2::PointD const closestPoint = segment.ClosestPointTo(m_point);
double const segLenM = mercator::DistanceOnEarth(segStart.GetPoint(), segEnd.GetPoint());
@@ -62,8 +60,7 @@ void NearestEdgeFinder::AddInformationSource(IRoadGraph::FullRoadInfo const & ro
{
double const distFromStartM = mercator::DistanceOnEarth(segStart.GetPoint(), closestPoint);
ASSERT_LESS_OR_EQUAL(distFromStartM, segLenM, (roadInfo.m_featureId));
projPointAlt =
startAlt + static_cast<geometry::Altitude>((endAlt - startAlt) * distFromStartM / segLenM);
projPointAlt = startAlt + static_cast<geometry::Altitude>((endAlt - startAlt) * distFromStartM / segLenM);
}
res.m_fid = roadInfo.m_featureId;
@@ -80,10 +77,8 @@ void NearestEdgeFinder::AddInformationSource(IRoadGraph::FullRoadInfo const & ro
void NearestEdgeFinder::MakeResult(vector<EdgeProjectionT> & res, size_t maxCountFeatures)
{
sort(m_candidates.begin(), m_candidates.end(), [](Candidate const & r1, Candidate const & r2)
{
return r1.m_squaredDist < r2.m_squaredDist;
});
sort(m_candidates.begin(), m_candidates.end(),
[](Candidate const & r1, Candidate const & r2) { return r1.m_squaredDist < r2.m_squaredDist; });
res.clear();
res.reserve(maxCountFeatures);
@@ -114,7 +109,7 @@ void NearestEdgeFinder::AddResIf(Candidate const & candidate, bool forward, size
geometry::PointWithAltitude const & start = forward ? candidate.m_segStart : candidate.m_segEnd;
geometry::PointWithAltitude const & end = forward ? candidate.m_segEnd : candidate.m_segStart;
Edge const edge = Edge::MakeReal(candidate.m_fid, forward, candidate.m_segId, start,end);
Edge const edge = Edge::MakeReal(candidate.m_fid, forward, candidate.m_segId, start, end);
EdgeProjectionT const edgeProj(edge, candidate.m_projPoint);
if (m_isEdgeProjGood && !m_isEdgeProjGood(edgeProj))
return;