loading compressed mesh fix

This commit is contained in:
Joachim Schoeberl 2013-04-04 15:16:19 +00:00
parent bc96ff071f
commit 57ae0336da
2 changed files with 4 additions and 4 deletions

View File

@ -136,7 +136,7 @@ loadinifile;
.ngmenu.file add command -label "Load Mesh..." -accelerator "<l><m>" \
-command {
set types {
{"Mesh file" {.vol} } }
{"Mesh file" {.vol .vol.gz} } }
set file [tk_getOpenFile -filetypes $types -defaultextension ".vol"]
if {$file != ""} {
AddRecentMeshFile $file;

View File

@ -213,8 +213,7 @@ namespace netgen
{
string filename (argv[1]);
if ( (strlen (filename.c_str()) > 4) &&
strcmp (&filename[strlen (filename.c_str())-4], ".vol") != 0 )
if (filename.find(".vol") == string::npos)
{
return Ng_ImportMesh(clientData,interp,argc,argv);
}
@ -225,7 +224,8 @@ namespace netgen
try
{
istream * infile;
if (filename.substr (filename.length()-3, 3) == ".gz")
// if (filename.substr (filename.length()-3, 3) == ".gz")
if (filename.find(".vol.gz") != string::npos)
infile = new igzstream (filename.c_str());
else
infile = new ifstream (filename.c_str());