Salome HOME
BUG: impossible to import a med file of size more than MAX_INT (~2.1 Gb)
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_HypothesesUtils.cxx
index dc499bd7381fe9e7db3feb31fc0cad754090bebe..fc1f8c5e2b84acaffaf20d423ed597131efadbb3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -74,7 +74,7 @@
 #endif
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -378,7 +378,7 @@ namespace SMESH
       return false;
     if ( algoData->BasicHypos.contains( hypType ))
       return true;
-    if ( algoData->OptionalHypos.contains( hypType)) {
+    if ( algoData->OptionalHypos.contains( hypType )) {
       isAuxiliary = true;
       return true;
     }
@@ -511,10 +511,14 @@ namespace SMESH
 
     return SMESH::SMESH_Hypothesis::_nil();
   }
+
   bool IsApplicable(const QString&        aHypType,
                     GEOM::GEOM_Object_ptr theGeomObject,
                     const bool            toCheckAll)
   {
+    if ( getenv("NO_LIMIT_ALGO_BY_SHAPE")) // allow a workaround for a case if
+      return true;                         // IsApplicable() returns false due to a bug
+
     HypothesisData* aHypData = GetHypothesisData(aHypType);
     QString aServLib = aHypData->ServerLibName;
     return SMESHGUI::GetSMESHGen()->IsApplicable( aHypType.toLatin1().data(),
@@ -625,7 +629,7 @@ namespace SMESH
             {
               SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
               SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
-              for( int i = 0; i < meshList.size(); i++ )
+              for( size_t i = 0; i < meshList.size(); i++ )
                 RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
             }
         }
@@ -725,7 +729,7 @@ namespace SMESH
   QString GetMessageOnAlgoStateErrors(const algo_error_array& errors)
   {
     QString resMsg; // PAL14861 = QObject::tr("SMESH_WRN_MISSING_PARAMETERS") + ":\n";
-    for ( int i = 0; i < errors.length(); ++i ) {
+    for ( size_t i = 0; i < errors.length(); ++i ) {
       const SMESH::AlgoStateError & error = errors[ i ];
       const bool hasAlgo = ( strlen( error.algoName ) != 0 );
       QString msg;