autogetOWFlag=[&environment]()->bool{boolokConv;intflag=environment.value("DUMPGEOOVERWRITE").toInt(&okConv,10);return(okConv&&1==flag)?true:false;};// convert the "0"/"1" env var string to bool with a lambda
// auto getOWFlag = [&environment]() -> bool { bool okConv; int flag = environment.value("DUMPGEOFORCEOVERWRITE").toInt(&okConv, 10); return (okConv && 1==flag) ? true : false; }; // convert the "0"/"1" env var string to bool with a lambda
VP1Msg::message("Removing the existing dump file ("+path+")...");
QFilefile(path);
if(user_forceOverwrite){
VP1Msg::message("Removing the existing dump file ("+fileName+")...");
QFilefile(fileName);
file.remove();
}elseif(!user_overwrite){
VP1Msg::messageWarningAllRed("The output file ("+path+") is already present in the current folder, but you don't use the '-f' flag to overwrite it. The program will be stopped. Please remove or move the existing file to another folder, or use the '-f' flag to replace it.");
}elseif(!user_forceOverwrite){
VP1Msg::messageWarningAllRed("The output file ("+fileName+") is already present in the current folder, but you don't use the '-f' flag to overwrite it. The program will be stopped. Please remove or move the existing file to another folder, or use the '-f' flag to replace it.");
throw"existing output file";
}
}
// open the DB connection
GMDBManagerdb(path.toStdString());
GMDBManagerdb(fileName.toStdString());
// check the DB connection
if(db.checkIsDBOpen())
...
...
@@ -223,7 +298,12 @@ void GeoExporter::init()
std::cout<<"Dumping the GeoModel geometry to the DB file..."<<std::endl;
// Dump the tree volumes into a DB
GeoModelIO::WriteGeoModeldumpGeoModelGraph(db);// init the GeoModel node action
world->exec(&dumpGeoModelGraph);// visit all GeoModel nodes