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:
@@ -19,9 +19,10 @@ double AStarSubProgress::CalcDistance(ms::LatLon const & from, ms::LatLon const
|
||||
return fabs(from.m_lon - to.m_lon) + fabs(from.m_lat - to.m_lat);
|
||||
}
|
||||
|
||||
AStarSubProgress::AStarSubProgress(ms::LatLon const & start, ms::LatLon const & finish,
|
||||
double contributionCoef)
|
||||
: m_contributionCoef(contributionCoef), m_startPoint(start), m_finishPoint(finish)
|
||||
AStarSubProgress::AStarSubProgress(ms::LatLon const & start, ms::LatLon const & finish, double contributionCoef)
|
||||
: m_contributionCoef(contributionCoef)
|
||||
, m_startPoint(start)
|
||||
, m_finishPoint(finish)
|
||||
{
|
||||
ASSERT_GREATER(m_contributionCoef, 0.0, ());
|
||||
|
||||
@@ -30,8 +31,7 @@ AStarSubProgress::AStarSubProgress(ms::LatLon const & start, ms::LatLon const &
|
||||
m_backwardDistance = m_fullDistance;
|
||||
}
|
||||
|
||||
AStarSubProgress::AStarSubProgress(double contributionCoef)
|
||||
: m_contributionCoef(contributionCoef)
|
||||
AStarSubProgress::AStarSubProgress(double contributionCoef) : m_contributionCoef(contributionCoef)
|
||||
{
|
||||
ASSERT_NOT_EQUAL(m_contributionCoef, 0.0, ());
|
||||
}
|
||||
@@ -49,7 +49,7 @@ double AStarSubProgress::UpdateProgress(ms::LatLon const & current, ms::LatLon c
|
||||
|
||||
double part = 2.0 - (m_forwardDistance + m_backwardDistance) / m_fullDistance;
|
||||
part = math::Clamp(part, 0.0, 1.0);
|
||||
double const newProgress = m_contributionCoef * part;
|
||||
double const newProgress = m_contributionCoef * part;
|
||||
|
||||
m_currentProgress = std::max(newProgress, m_currentProgress);
|
||||
return m_currentProgress;
|
||||
@@ -65,7 +65,10 @@ void AStarSubProgress::Flush(double progress)
|
||||
m_currentProgress += m_contributionCoef * progress;
|
||||
}
|
||||
|
||||
double AStarSubProgress::GetMaxContribution() const { return m_contributionCoef; }
|
||||
double AStarSubProgress::GetMaxContribution() const
|
||||
{
|
||||
return m_contributionCoef;
|
||||
}
|
||||
|
||||
// AStarProgress -------------------------------------------------------------------------
|
||||
|
||||
@@ -107,18 +110,19 @@ double AStarProgress::UpdateProgress(ms::LatLon const & current, ms::LatLon cons
|
||||
double const newProgress = UpdateProgressImpl(m_subProgresses.begin(), current, end) * 100.0;
|
||||
m_lastPercentValue = std::max(m_lastPercentValue, newProgress);
|
||||
|
||||
ASSERT(m_lastPercentValue < kMaxPercent ||
|
||||
AlmostEqualAbs(m_lastPercentValue, kMaxPercent, 1e-5 /* eps */),
|
||||
ASSERT(m_lastPercentValue < kMaxPercent || AlmostEqualAbs(m_lastPercentValue, kMaxPercent, 1e-5 /* eps */),
|
||||
(m_lastPercentValue, kMaxPercent));
|
||||
|
||||
m_lastPercentValue = std::min(m_lastPercentValue, kMaxPercent);
|
||||
return m_lastPercentValue;
|
||||
}
|
||||
|
||||
double AStarProgress::GetLastPercent() const { return m_lastPercentValue; }
|
||||
double AStarProgress::GetLastPercent() const
|
||||
{
|
||||
return m_lastPercentValue;
|
||||
}
|
||||
|
||||
double AStarProgress::UpdateProgressImpl(ListItem subProgress, ms::LatLon const & current,
|
||||
ms::LatLon const & end)
|
||||
double AStarProgress::UpdateProgressImpl(ListItem subProgress, ms::LatLon const & current, ms::LatLon const & end)
|
||||
{
|
||||
if (std::next(subProgress) != m_subProgresses.end())
|
||||
return subProgress->UpdateProgress(UpdateProgressImpl(std::next(subProgress), current, end));
|
||||
|
||||
Reference in New Issue
Block a user