Commit 1780bf6a authored by Arne Graf's avatar Arne Graf

FF-filename stripped of directories -> ..

parent e92dc1cf
......@@ -289,13 +289,14 @@ void DirectionFloorfield::Init(Building* building, double stepsize, double thres
//implement mechanic, that can read-in an existing floorfield (from a previous run)
string s = building->GetGeometryFilename();
s.erase(s.find_last_of(".", string::npos)); // delete ending
s.erase(0, s.find_last_of("/")+1); // delete directories before filename (espacially "..")
string FF_filename = (building->GetProjectRootDir() + "FF_" + s + "_" + std::to_string(threshold) + ".vtk").c_str();
std::ifstream test(FF_filename);
if (test.good()) {
Log->Write("INFO: \tRead Floor field from file <" + FF_filename + ">");
Log->Write("INFO: \tRead Floorfield from file <" + FF_filename + ">");
ffviafm = new FloorfieldViaFM(FF_filename);
} else {
Log->Write("INFO: \tWrite Floor field to file <" + FF_filename + ">");
Log->Write("INFO: \tWrite Floorfield to file <" + FF_filename + ">");
ffviafm = new FloorfieldViaFM(building, stepsize, stepsize, threshold, useDistancMap, FF_filename);
}
initDone = true;
......
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