forked from organicmaps/organicmaps
OsrmMappingTypes refactoring.
This commit is contained in:
parent
803e85ea59
commit
7924ce5b21
2 changed files with 4 additions and 3 deletions
|
@ -59,8 +59,7 @@ bool FtSeg::Merge(FtSeg const & other)
|
|||
if (other.m_fid != m_fid)
|
||||
return false;
|
||||
|
||||
bool const dir = other.m_pointEnd > other.m_pointStart;
|
||||
if (dir != (m_pointEnd > m_pointStart))
|
||||
if (IsForward() != other.IsForward())
|
||||
return false;
|
||||
|
||||
auto const s1 = min(m_pointStart, m_pointEnd);
|
||||
|
@ -72,7 +71,7 @@ bool FtSeg::Merge(FtSeg const & other)
|
|||
{
|
||||
m_pointStart = min(s1, s2);
|
||||
m_pointEnd = max(e1, e2);
|
||||
if (!dir)
|
||||
if (!other.IsForward())
|
||||
swap(m_pointStart, m_pointEnd);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -57,6 +57,8 @@ namespace OsrmMappingTypes
|
|||
|
||||
bool IsIntersect(FtSeg const & other) const;
|
||||
|
||||
bool IsForward() const { return m_pointEnd > m_pointStart; }
|
||||
|
||||
bool IsValid() const
|
||||
{
|
||||
return m_fid != kInvalidFid;
|
||||
|
|
Loading…
Add table
Reference in a new issue