platforms have pointer to subroom (not id)

parent 2a289188
......@@ -743,15 +743,14 @@ double Simulation::RunBody(double maxSimTime)
bool Simulation::correctGeometry(std::shared_ptr<Building> building, std::string trainType, Point TrackStart, Point TrackEnd)
{
std::cout << "enter with train " << trainType.c_str() << "\n";
int subroomId = -1;
//auto platforms = building->GetPlatforms();
auto mytrack = building->GetTrackWalls(TrackStart, TrackEnd, subroomId);
if(mytrack.empty())
SubRoom * subroom;
auto mytrack = building->GetTrackWalls(TrackStart, TrackEnd, subroom);
if(mytrack.empty() || subroom == nullptr)
return false;
std::cout << "subroom: " << subroomId << "\n";
//auto subroom = building->GetSubRoomByID(subroomId);
auto train = building->GetTrainTypes().at(trainType);
auto doors = train->doors;
// std::vector<std::pair<PointWall, pointWall > >
......@@ -782,6 +781,8 @@ bool Simulation::correctGeometry(std::shared_ptr<Building> building, std::string
}
else if(w1 == w2)
{
subroom->RemoveWall(w1);
//building->TempRemoveWalls()
// use function we have in correct geometry
}
else // disjoint
......
......@@ -48,14 +48,12 @@
typedef std::pair<Point, Wall> PointWall;
// train schedules: Trains get deleted and added.
//std::vector<Wall> TempAddedWalls;
//std::vector<Wall> TempRemovedWalls;
struct Platform
{
int id;
int rid;
int sid;
SubRoom * sub;
std::map<int, std::vector<Wall> > tracks;
};
......@@ -121,6 +119,11 @@ private:
public:
/// constructor
Building();
std::vector<Wall> TempAddedWalls;
std::vector<Wall> TempRemovedWalls;
std::vector<Transition> TempAddedDoors;
bool resetTempVectors();
// Building(const std::string &, const std::string &, RoutingEngine &, PedDistributor &, double);
Building(Configuration* config, PedDistributor& pedDistributor);
......@@ -253,7 +256,7 @@ public:
const std::map<int, std::shared_ptr<Platform> >& GetPlatforms() const;
const std::vector<Wall> GetTrackWalls(Point TrackStart, Point TrackEnd, int & subroomId) const;
const std::vector<Wall> GetTrackWalls(Point TrackStart, Point TrackEnd, SubRoom * subroom) const;
const std::vector<std::pair<PointWall, PointWall > > GetIntersectionPoints(const std::vector<Transition> doors, const std::vector<Wall>) const;
// ------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment