]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To calcultate global MinMax
authorapo <apo@opencascade.com>
Mon, 16 Jul 2007 06:10:38 +0000 (06:10 +0000)
committerapo <apo@opencascade.com>
Mon, 16 Jul 2007 06:10:38 +0000 (06:10 +0000)
src/VISU_I/VISU_MultiResult_i.cc

index e4832781ec48f60abd50adcfbe9d7f052856c017..538cb33fefb9d65d7a4e4f58f983ca76211107c0 100644 (file)
@@ -32,7 +32,9 @@
 #include "VISU_Convertor.hxx"
 #include "VISU_ConvertorUtils.hxx"
 
+#include "MULTIPR_Obj.hxx"
 #include "MULTIPR_API.hxx"
+#include "MULTIPR_Exceptions.hxx"
 
 #include "SALOMEDS_Tool.hxx"
 #include "HDFascii.hxx"
@@ -1095,14 +1097,31 @@ VISU::MultiResult_i
        INITMSG(MYDEBUG, "'"<<aFileName<<"'\n");
       }
     }
-    int aRes = multipr::merge(aFileNames, theMeshName.c_str(), theFieldName.c_str(), aFileName.c_str());
+    int aRes = false;
+    std::string anErrorMessage("empty mesh");
+    try {
+      INITMSG(MYDEBUG, "theMeshName = '"<<aFileName<<"'; theFieldName = '"<<theFieldName<<"'\n");
+      aRes = multipr::merge(aFileNames, theMeshName.c_str(), theFieldName.c_str(), aFileName.c_str());
+    }catch(std::exception& exc){
+      MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+      anErrorMessage = exc.what();
+    }catch(multipr::RuntimeException& exc){
+      std::ostringstream aStream;
+      exc.dump(aStream);
+      aStream<<ends;
+      MSG(MYDEBUG,"Follow exception was occured in:\n"<<aStream.str());
+      anErrorMessage = aStream.str();
+    }catch(...){
+      MSG(MYDEBUG,"Unknown exception !!!");
+    }
     INITMSGA(MYDEBUG, 0, "aRes = "<<aRes<<"\n");
     if (aRes == 0) {
-      QFile(aFileName.c_str()).remove();
-      throw std::runtime_error("empty mesh"); 
+      VISU::RemoveFile(aFileName);
+      throw std::runtime_error(anErrorMessage); 
     }
     PInput anInput(CreateConvertor(aFileName));
     anInput->BuildFields();
+    anInput->BuildMinMax();
     myRepresentation2Input[aRepresentationKey] = anInput;
     return anInput;
   }