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>" \ .ngmenu.file add command -label "Load Mesh..." -accelerator "<l><m>" \
-command { -command {
set types { set types {
{"Mesh file" {.vol} } } {"Mesh file" {.vol .vol.gz} } }
set file [tk_getOpenFile -filetypes $types -defaultextension ".vol"] set file [tk_getOpenFile -filetypes $types -defaultextension ".vol"]
if {$file != ""} { if {$file != ""} {
AddRecentMeshFile $file; AddRecentMeshFile $file;

View File

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