Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
KOSMIndoorMap
Commits
6c132ab6
Commit
6c132ab6
authored
Nov 07, 2021
by
Volker Krause
Browse files
Remove the Platform::lines public member
parent
6a391dd0
Pipeline
#95383
passed with stage
in 17 seconds
Changes
5
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
autotests/platformfindertest.cpp
View file @
6c132ab6
...
...
@@ -125,8 +125,8 @@ private Q_SLOTS:
outFile
.
write
(
"
\n
"
);
outFile
.
write
(
" level: "
+
QByteArray
::
number
(
platform
.
level
())
+
"
\n
"
);
outFile
.
write
(
QByteArray
(
" mode: "
)
+
Platform
::
staticMetaObject
.
enumerator
(
0
).
valueToKey
(
platform
.
mode
())
+
"
\n
"
);
if
(
!
platform
.
lines
.
empty
())
{
outFile
.
write
(
" lines: "
+
platform
.
lines
.
join
(
QLatin1Char
(
'|'
)).
toUtf8
()
+
"
\n
"
);
if
(
!
platform
.
lines
()
.
empty
())
{
outFile
.
write
(
" lines: "
+
platform
.
lines
()
.
join
(
QLatin1Char
(
'|'
)).
toUtf8
()
+
"
\n
"
);
}
if
(
!
platform
.
sections
().
empty
())
{
outFile
.
write
(
" sections:
\n
"
);
...
...
src/map/content/platform.cpp
View file @
6c132ab6
...
...
@@ -77,6 +77,7 @@ public:
int
m_level
=
std
::
numeric_limits
<
int
>::
min
();
// INT_MIN indicates not set, needed for merging
std
::
vector
<
PlatformSection
>
m_sections
;
QByteArray
m_ifopt
;
QStringList
m_lines
;
static
void
appendSection
(
std
::
vector
<
PlatformSection
>
&
sections
,
const
Platform
&
p
,
PlatformSection
&&
sec
,
std
::
vector
<
const
OSM
::
Node
*>
&
edgePath
,
const
OSM
::
DataSet
&
dataSet
);
static
double
maxSectionDistance
(
const
Platform
&
p
,
const
std
::
vector
<
PlatformSection
>
&
sections
,
const
OSM
::
DataSet
&
dataSet
);
...
...
@@ -220,6 +221,23 @@ void Platform::setIfopt(const QByteArray &ifopt)
d
->
m_ifopt
=
ifopt
;
}
QStringList
Platform
::
lines
()
const
{
return
d
->
m_lines
;
}
void
Platform
::
setLines
(
QStringList
&&
lines
)
{
d
.
detach
();
d
->
m_lines
=
std
::
move
(
lines
);
}
QStringList
&&
Platform
::
takeLines
()
{
d
.
detach
();
return
std
::
move
(
d
->
m_lines
);
}
static
bool
conflictIfPresent
(
OSM
::
Element
lhs
,
OSM
::
Element
rhs
)
{
return
lhs
&&
rhs
&&
lhs
!=
rhs
;
...
...
@@ -479,7 +497,7 @@ Platform Platform::merge(const Platform &lhs, const Platform &rhs, const OSM::Da
// TODO
p
.
d
->
m_mode
=
std
::
max
(
lhs
.
d
->
m_mode
,
rhs
.
d
->
m_mode
);
p
.
lines
=
lhs
.
lines
.
isEmpty
()
?
std
::
move
(
rhs
.
lines
)
:
std
::
move
(
lhs
.
lines
);
p
.
d
->
m_
lines
=
lhs
.
d
->
m_
lines
.
isEmpty
()
?
std
::
move
(
rhs
.
d
->
m_
lines
)
:
std
::
move
(
lhs
.
d
->
m_
lines
);
std
::
vector
<
const
OSM
::
Node
*>
edgePath
;
std
::
vector
<
PlatformSection
>
sections
;
...
...
src/map/content/platform.h
View file @
6c132ab6
...
...
@@ -119,8 +119,10 @@ public:
QByteArray
ifopt
()
const
;
void
setIfopt
(
const
QByteArray
&
ifopt
);
// TODO - clean up once PlatformModel is ported to PlatformFinder
QStringList
lines
;
/** Names of public transport lines stopping at this platform. */
QStringList
lines
()
const
;
void
setLines
(
QStringList
&&
lines
);
QStringList
&&
takeLines
();
/** Checks if two instances refer to the same platform. */
static
bool
isSame
(
const
Platform
&
lhs
,
const
Platform
&
rhs
,
const
OSM
::
DataSet
&
dataSet
);
...
...
src/map/content/platformfinder.cpp
View file @
6c132ab6
...
...
@@ -191,10 +191,12 @@ void PlatformFinder::scanRoute(const OSM::Node& node, OSM::Element route)
if
(
lineName
.
isEmpty
())
{
continue
;
}
const
auto
it
=
std
::
lower_bound
(
p
.
lines
.
begin
(),
p
.
lines
.
end
(),
lineName
,
m_collator
);
if
(
it
==
p
.
lines
.
end
()
||
(
*
it
)
!=
lineName
)
{
p
.
lines
.
insert
(
it
,
lineName
);
auto
lines
=
p
.
takeLines
();
const
auto
it
=
std
::
lower_bound
(
lines
.
begin
(),
lines
.
end
(),
lineName
,
m_collator
);
if
(
it
==
lines
.
end
()
||
(
*
it
)
!=
lineName
)
{
lines
.
insert
(
it
,
lineName
);
}
p
.
setLines
(
std
::
move
(
lines
));
}
break
;
}
...
...
src/map/content/platformmodel.cpp
View file @
6c132ab6
...
...
@@ -93,7 +93,7 @@ QVariant PlatformModel::data(const QModelIndex &index, int role) const
case
TransportModeRole
:
return
platform
.
mode
();
case
LinesRole
:
return
platform
.
lines
;
return
platform
.
lines
()
;
case
ArrivalPlatformRole
:
return
index
.
row
()
==
m_arrivalPlatformRow
;
case
DeparturePlatformRole
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment