distinguish between absolute geometry files

parent 4702b7bb
Pipeline #19135 passed with stages
in 16 seconds
......@@ -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
......
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