diff --git a/Common/OS.cpp b/Common/OS.cpp index 0b01eb789ae6655cdf285d21145ab288809f3360..e6ad140aa973de7223820ca7b6af336116912056 100644 --- a/Common/OS.cpp +++ b/Common/OS.cpp @@ -1,4 +1,4 @@ -// $Id: OS.cpp,v 1.7 2007-03-19 21:48:13 geuzaine Exp $ +// $Id: OS.cpp,v 1.8 2007-05-23 15:35:33 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -160,7 +160,7 @@ int KillProcess(int pid) return 1; } -void SystemCall(char *command) +int SystemCall(char *command) { #if defined(WIN32) STARTUPINFO suInfo; @@ -170,12 +170,13 @@ void SystemCall(char *command) Msg(INFO, "Calling '%s'", command); CreateProcess(NULL, command, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &suInfo, &prInfo); + return 0; #else if(!system(NULL)) { Msg(GERROR, "Could not find /bin/sh: aborting system call"); - return; + return 1; } Msg(INFO, "Calling '%s'", command); - system(command); + return system(command); #endif } diff --git a/Common/OS.h b/Common/OS.h index 57232f73283cb4bbc69b0366e79086d7204211d4..894bc1fae6a586b32d3b299e1ba0926eb13cc364 100644 --- a/Common/OS.h +++ b/Common/OS.h @@ -29,6 +29,6 @@ int GetProcessId(); int UnlinkFile(char *name); int StatFile(char *filename); int KillProcess(int pid); -void SystemCall(char *command); +int SystemCall(char *command); #endif diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index c47ebcb4fde82668bc284657620390b8811e5756..2f4bf54116ac0038d68c4f25e7eb141a26308b6c 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -1,4 +1,4 @@ -// $Id: GModel.cpp,v 1.41 2007-05-02 07:59:27 geuzaine Exp $ +// $Id: GModel.cpp,v 1.42 2007-05-23 15:35:33 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -494,10 +494,14 @@ void GModel::checkMeshCoherence() Msg(INFO, "Checking mesh coherence (%d elements)", numEle); + SBoundingBox3d bb = bounds(); + double lc = bb.empty() ? 1. : norm(SVector3(bb.max(), bb.min())); + double tol = CTX.geom.tolerance * lc; + // check for duplicate mesh vertices { double old_tol = MVertexLessThanLexicographic::tolerance; - MVertexLessThanLexicographic::tolerance = CTX.geom.tolerance; + MVertexLessThanLexicographic::tolerance = tol; std::set<MVertex*, MVertexLessThanLexicographic> pos; int num = 0; for(viter it = firstVertex(); it != lastVertex(); ++it) @@ -515,7 +519,7 @@ void GModel::checkMeshCoherence() // check for duplicate elements { double old_tol = MElementLessThanLexicographic::tolerance; - MElementLessThanLexicographic::tolerance = CTX.geom.tolerance; + MElementLessThanLexicographic::tolerance = tol; std::set<MElement*, MElementLessThanLexicographic> pos; int num = 0; for(eiter it = firstEdge(); it != lastEdge(); ++it) diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp index c555fd4c0971e3c10ae6f30c120d2f1b60c41ce0..8c962a83d225b3753ca83007bb8c9aeee96ed98a 100644 --- a/Parser/OpenFile.cpp +++ b/Parser/OpenFile.cpp @@ -1,4 +1,4 @@ -// $Id: OpenFile.cpp,v 1.147 2007-05-05 12:35:19 geuzaine Exp $ +// $Id: OpenFile.cpp,v 1.148 2007-05-23 15:35:33 geuzaine Exp $ // // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle // @@ -311,7 +311,8 @@ int MergeFile(char *name, int warn_if_missing) "Cancel", "Uncompress", NULL, name)){ char tmp[256]; sprintf(tmp, "gunzip -c %s > %s", name, base); - SystemCall(tmp); + if(SystemCall(tmp)) + Msg(GERROR, "Failed to uncompress `%s': check directory permissions", name); if(!strcmp(CTX.filename, name)) // this is the project file SetProjectName(base); return MergeFile(base); diff --git a/doc/TODO b/doc/TODO index b888e81e82e54ce39ca2aee88cab6f48992993f3..40f694f2b0a78cdf6be4ce2faa221154481e167d 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,4 +1,9 @@ -$Id: TODO,v 1.58 2007-05-10 22:08:06 geuzaine Exp $ +$Id: TODO,v 1.59 2007-05-23 15:35:33 geuzaine Exp $ + +******************************************************************** + +add cleanup fct to remove duplicate elements in +GModel->checkMeshCoherence ********************************************************************