Salome HOME
fix algo state message when Hexahedron(i,j,k) assigned to a compound
authoreap <eap@opencascade.com>
Thu, 3 May 2007 14:05:52 +0000 (14:05 +0000)
committereap <eap@opencascade.com>
Thu, 3 May 2007 14:05:52 +0000 (14:05 +0000)
of non-block shapes

src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_subMesh.cxx
src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
src/SMESHGUI/SMESH_msg_en.po
src/StdMeshers/StdMeshers_Hexa_3D.cxx

index 3c34f2e63ef77685268dade7d3f02e6b4c8c672a..f3f25d9e254209160f6c6bcdabcd190f69c59485 100644 (file)
@@ -322,7 +322,11 @@ static bool checkMissing(SMESH_Gen*                aGen,
       if ( status == SMESH_Hypothesis::HYP_BAD_PARAMETER ) {
         INFOS( "ERROR: hypothesis of " << (IsGlobalHypothesis ? "Global " : "Local ")
                << "<" << algo->GetName() << "> has a bad parameter value");
-        errName = SMESH_Hypothesis::HYP_BAD_PARAMETER;
+        errName = status;
+      } else if ( status == SMESH_Hypothesis::HYP_BAD_GEOMETRY ) {
+        INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ")
+               << "<" << algo->GetName() << "> assigned to mismatching geometry");
+        errName = status;
       } else {
         INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ")
                << "<" << algo->GetName() << "> misses some hypothesis");
index 89fd80c5aec3aca5c8fb4b7b0face2ab99581371..66ec1d36afcd07ccdad5e588e7d2c723b1d5394c 100644 (file)
@@ -5712,7 +5712,7 @@ SMESH_MeshEditor::Sew_Error
     {
       nodeGroupsToMerge.push_back( list<const SMDS_MeshNode*>() );
       nodeGroupsToMerge.back().push_back( *nIt[1] ); // to keep
-      nodeGroupsToMerge.back().push_back( *nIt[0] ); // tp remove
+      nodeGroupsToMerge.back().push_back( *nIt[0] ); // to remove
     }
   }
   else {
index 3af8072816c5befef88feff24429a594018483dc..ef34015fe1b2805d8b0c6711ad7b3a527380596c 100644 (file)
@@ -1604,7 +1604,7 @@ bool SMESH_subMesh::CheckComputeError(SMESH_Algo* theAlgo)
 
     // Show error
     SMESH_Comment text;
-    text << theAlgo->GetName() << " failed on subshape " << _Id << " with error ";
+    text << theAlgo->GetName() << " failed on subshape #" << _Id << " with error ";
     if (_computeError->IsCommon() )
       text << _computeError->CommonName();
     else
@@ -1615,11 +1615,12 @@ bool SMESH_subMesh::CheckComputeError(SMESH_Algo* theAlgo)
 #ifdef _DEBUG_
     cout << text << endl;
     // Show vertices location of a failed shape
-    cout << "Subshape vertices (first 10):" << endl;
     TopTools_IndexedMapOfShape vMap;
     TopExp::MapShapes( _subShape, TopAbs_VERTEX, vMap );
+    cout << "Subshape vertices " << ( vMap.Extent()>10 ? "(first 10):" : ":") << endl;
     for ( int iv = 1; iv <= vMap.Extent() && iv < 11; ++iv ) {
       gp_Pnt P( BRep_Tool::Pnt( TopoDS::Vertex( vMap( iv ) )));
+      cout << "#" << _father->GetMeshDS()->ShapeToIndex( vMap( iv )) << " ";
       cout << P.X() << " " << P.Y() << " " << P.Z() << " " << endl;
     }
 #else
index 8f40e2b85a59da7a0d28f61dc1e0ce79b4e48334..a21492653776950e56f21e5714ba25f8310dad67 100644 (file)
@@ -598,6 +598,7 @@ namespace SMESH{
           CASE2MESSAGE( HYP_MISSING );
           CASE2MESSAGE( HYP_NOTCONFORM );
           CASE2MESSAGE( HYP_BAD_PARAMETER );
+          CASE2MESSAGE( HYP_BAD_GEOMETRY );
         default: continue;
         }
       // apply args to message:
index 651f492ee5d9b322544f012b102bc80eff8d5646..11592208ca066db51c12c7ee48484a9b15df991e 100644 (file)
@@ -1328,6 +1328,9 @@ msgstr "Hypothesis of %3 %2D algorithm \"%1\" has a bad parameter value"
 msgid "STATE_HYP_NOTCONFORM"
 msgstr "%3 %2D algorithm \"%1\" would produce not conform mesh: global \"Not Conform Mesh Allowed\" hypotesis is missing"
 
+msgid "STATE_HYP_BAD_GEOMETRY"
+msgstr "%3 %2D algorithm \"%1\" is assigned to geometry mismatching its expectation"
+
 msgid "GLOBAL_ALGO"
 msgstr "Global"
 
index 80cd6caeb1973e8e309f56e9a914a13586655980..a92e94b84d0c6a73c5ea9c65fc10f34bf61530a5 100644 (file)
@@ -122,7 +122,9 @@ bool StdMeshers_Hexa_3D::CheckHypothesis
   int nbFaces = 0;
   for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next())
     if ( ++nbFaces > 6 )
-      return false;
+      break;
+  if ( nbFaces != 6 )
+    return false;
 
   aStatus = SMESH_Hypothesis::HYP_OK;
   return true;