mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53: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:
@@ -18,19 +18,17 @@ namespace generator
|
||||
{
|
||||
// CrossMwmOsmWaysCollector ------------------------------------------------------------------------
|
||||
|
||||
CrossMwmOsmWaysCollector::CrossMwmOsmWaysCollector(
|
||||
std::string intermediateDir, AffiliationInterfacePtr affiliation)
|
||||
: m_intermediateDir(std::move(intermediateDir)), m_affiliation(std::move(affiliation))
|
||||
{
|
||||
}
|
||||
CrossMwmOsmWaysCollector::CrossMwmOsmWaysCollector(std::string intermediateDir, AffiliationInterfacePtr affiliation)
|
||||
: m_intermediateDir(std::move(intermediateDir))
|
||||
, m_affiliation(std::move(affiliation))
|
||||
{}
|
||||
|
||||
std::shared_ptr<CollectorInterface> CrossMwmOsmWaysCollector::Clone(IDRInterfacePtr const &) const
|
||||
{
|
||||
return std::make_shared<CrossMwmOsmWaysCollector>(m_intermediateDir, m_affiliation);
|
||||
}
|
||||
|
||||
void CrossMwmOsmWaysCollector::CollectFeature(feature::FeatureBuilder const & fb,
|
||||
OsmElement const & element)
|
||||
void CrossMwmOsmWaysCollector::CollectFeature(feature::FeatureBuilder const & fb, OsmElement const & element)
|
||||
{
|
||||
if (element.m_type != OsmElement::EntityType::Way)
|
||||
return;
|
||||
@@ -84,26 +82,18 @@ void CrossMwmOsmWaysCollector::CollectFeature(feature::FeatureBuilder const & fb
|
||||
// And belongs to both. So we consider such segment as cross mwm segment.
|
||||
// So the condition that segment certainly lies inside of mwm is:
|
||||
// both points inside and both points belong to only this mwm.
|
||||
if (prevPointIn && curPointIn &&
|
||||
pointsAffiliationsNumber[i] == 1 && pointsAffiliationsNumber[i - 1] == 1)
|
||||
{
|
||||
if (prevPointIn && curPointIn && pointsAffiliationsNumber[i] == 1 && pointsAffiliationsNumber[i - 1] == 1)
|
||||
continue;
|
||||
}
|
||||
|
||||
bool forwardIsEnter;
|
||||
if (prevPointIn != curPointIn)
|
||||
{
|
||||
forwardIsEnter = curPointIn;
|
||||
}
|
||||
else if (pointsAffiliationsNumber[i - 1] != 1)
|
||||
forwardIsEnter = curPointIn;
|
||||
else if (pointsAffiliationsNumber[i] != 1)
|
||||
forwardIsEnter = !prevPointIn;
|
||||
else
|
||||
{
|
||||
if (pointsAffiliationsNumber[i - 1] != 1)
|
||||
forwardIsEnter = curPointIn;
|
||||
else if (pointsAffiliationsNumber[i] != 1)
|
||||
forwardIsEnter = !prevPointIn;
|
||||
else
|
||||
UNREACHABLE();
|
||||
}
|
||||
UNREACHABLE();
|
||||
prevPointIn = curPointIn;
|
||||
crossMwmSegments.emplace_back(i - 1 /* segmentId */, forwardIsEnter);
|
||||
}
|
||||
@@ -171,8 +161,8 @@ void CrossMwmOsmWaysCollector::CrossMwmInfo::Dump(CrossMwmInfo const & info, std
|
||||
}
|
||||
|
||||
// static
|
||||
std::set<CrossMwmOsmWaysCollector::CrossMwmInfo>
|
||||
CrossMwmOsmWaysCollector::CrossMwmInfo::LoadFromFileToSet(std::string const & path)
|
||||
std::set<CrossMwmOsmWaysCollector::CrossMwmInfo> CrossMwmOsmWaysCollector::CrossMwmInfo::LoadFromFileToSet(
|
||||
std::string const & path)
|
||||
{
|
||||
std::ifstream input(path);
|
||||
if (!input)
|
||||
|
||||
Reference in New Issue
Block a user