Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
JPScore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
92
Issues
92
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JuPedSim
JPScore
Commits
cbc2ee1d
Verified
Commit
cbc2ee1d
authored
Jun 02, 2019
by
Mohcine Chraibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug while erasing from vectors
parent
21fa2fcc
Pipeline
#21051
passed with stages
in 9 minutes and 18 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
22 deletions
+26
-22
geometry/Building.cpp
geometry/Building.cpp
+26
-22
No files found.
geometry/Building.cpp
View file @
cbc2ee1d
...
...
@@ -530,11 +530,17 @@ bool Building::resetGeometry(std::shared_ptr<TrainTimeTable> tab)
// for(auto wall: walls )
// std::cout << wall.toString() << "\n";
// }
// getc(stdin);
// remove temp added walls
auto
tempWalls
=
TempAddedWalls
[
tab
->
id
];
for
(
auto
wall
:
tempWalls
)
for
(
auto
it
=
tempWalls
.
begin
();
it
!=
tempWalls
.
end
();
)
{
auto
wall
=
*
it
;
if
(
it
!=
tempWalls
.
end
())
{
tempWalls
.
erase
(
it
);
}
for
(
auto
platform
:
_platforms
)
{
// auto tracks = platform.second->tracks;
...
...
@@ -542,17 +548,18 @@ bool Building::resetGeometry(std::shared_ptr<TrainTimeTable> tab)
subroom_id
=
platform
.
second
->
sid
;
// auto room = this->GetAllRooms().at(room_id);
SubRoom
*
subroom
=
this
->
GetAllRooms
().
at
(
room_id
)
->
GetAllSubRooms
().
at
(
subroom_id
).
get
();
// std::cout << "----\n";
// for(auto subWall: subroom->GetAllWalls())
// std::cout << ">> "<< subWall.toString() << "\n";
// std::cout << "----\n";
for
(
auto
subWall
:
subroom
->
GetAllWalls
())
{
if
(
subWall
==
wall
)
{
// if everything goes right, then we should enter this
// if. We already erased from tempWalls!
subroom
->
RemoveWall
(
wall
);
// std::cout << KGRN << "RESET REMOVE wall " << wall.toString() << "\n" << RESET;
auto
it
=
std
::
find
(
tempWalls
.
begin
(),
tempWalls
.
end
(),
wall
);
if
(
it
!=
tempWalls
.
end
())
{
tempWalls
.
erase
(
it
);
}
}
//if
}
//subroom
}
//platforms
...
...
@@ -561,8 +568,13 @@ bool Building::resetGeometry(std::shared_ptr<TrainTimeTable> tab)
/* // add remove walls */
auto
tempRemovedWalls
=
TempRemovedWalls
[
tab
->
id
];
for
(
auto
wall
:
tempRemovedWalls
)
for
(
auto
it
=
tempRemovedWalls
.
begin
();
it
!=
tempRemovedWalls
.
end
();
)
{
auto
wall
=
*
it
;
if
(
it
!=
tempRemovedWalls
.
end
())
{
tempRemovedWalls
.
erase
(
it
);
}
for
(
auto
platform
:
_platforms
)
{
auto
tracks
=
platform
.
second
->
tracks
;
...
...
@@ -578,11 +590,6 @@ bool Building::resetGeometry(std::shared_ptr<TrainTimeTable> tab)
{
subroom
->
AddWall
(
wall
);
// std::cout << KGRN << "ADD BACK wall " << wall.toString() << "\n" << RESET;
auto
it
=
std
::
find
(
tempRemovedWalls
.
begin
(),
tempRemovedWalls
.
end
(),
wall
);
if
(
it
!=
tempRemovedWalls
.
end
())
{
tempRemovedWalls
.
erase
(
it
);
}
}
}
}
...
...
@@ -592,9 +599,13 @@ bool Building::resetGeometry(std::shared_ptr<TrainTimeTable> tab)
/* // remove added doors */
auto
tempDoors
=
TempAddedDoors
[
tab
->
id
];
for
(
auto
door
:
tempDoors
)
for
(
auto
it
=
tempDoors
.
begin
();
it
!=
tempDoors
.
end
();
)
{
auto
door
=
*
it
;
if
(
it
!=
tempDoors
.
end
())
{
tempDoors
.
erase
(
it
);
}
for
(
auto
platform
:
_platforms
)
{
auto
tracks
=
platform
.
second
->
tracks
;
...
...
@@ -608,14 +619,7 @@ bool Building::resetGeometry(std::shared_ptr<TrainTimeTable> tab)
// Trnasitions are added to subrooms and building!!
subroom
->
RemoveTransition
(
subTrans
);
this
->
RemoveTransition
(
subTrans
);
// std::cout << KGRN << "RESET remove door " << door.toString() << "\n" << RESET;
auto
it
=
std
::
find
(
tempDoors
.
begin
(),
tempDoors
.
end
(),
door
);
if
(
it
!=
tempDoors
.
end
())
{
tempDoors
.
erase
(
it
);
}
}
}
...
...
Write
Preview
Markdown
is supported
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