Skip to content
Snippets Groups Projects
Verified Commit 9b496d47 authored by Mohcine Chraibi's avatar Mohcine Chraibi
Browse files

distinguish between absolute geometry files

parent 4702b7bb
No related branches found
No related tags found
No related merge requests found
Pipeline #19135 passed
......@@ -765,8 +765,10 @@ bool MainWindow::addPedestrianGroup(int groupID,QString fileName)
if(! SaxParser::parseGeometryJPS(geometry_file,geometry)) {
int res = QMessageBox::warning(this, "Errors in Geometry. Continue Parsing?",
"JuPedSim has detected an error in the supplied geometry.\n"
"<"
+geometry_file+
">"
"The simulation will likely fail using this geometry.\n"
"Also make sure to validate your file.\n"
"More information are provided in the log file:\n"
+SystemSettings::getLogfile()+
"\n\nShould I try to parse and display what I can?"
......
......@@ -678,16 +678,21 @@ bool SaxParser::parseGeometryJPS(QString fileName, GeometryFactory& geoFac)
Debug::Messages( "Enter SaxParser::parseGeometryJPS with filename <%s>",fileName.toStdString().c_str());
double captionsColor=0;//red
if(!fileName.endsWith(".xml",Qt::CaseInsensitive)) return false;
QDir fileDir(fileName);
QString wd;
QDir dir(wd);
SystemSettings::getWorkingDirectory(wd);
QString s = dir.relativeFilePath(fileName);
fileName=wd + QDir::separator() + s;
if(!fileName.endsWith(".xml",Qt::CaseInsensitive)) return false;
if(!fileDir.isAbsolute())
{
QString s = dir.relativeFilePath(fileName);
fileName=wd + QDir::separator() + s;
}
// QString = QDir::cleanPath(wd + QDir::separator() + fileName);
Debug::Messages("filename: <%s)", fileName.toStdString().c_str());
Debug::Messages("wd: <%s>",wd.toStdString().c_str());
Building* building = new Building();
string geometrypath = fileName.toStdString();
// read the geometry
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment