]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
0021106: EDF 1691 SMESH: MEsh.Group(SubShape) fails on Shells
authoreap <eap@opencascade.com>
Thu, 13 Oct 2011 06:35:00 +0000 (06:35 +0000)
committereap <eap@opencascade.com>
Thu, 13 Oct 2011 06:35:00 +0000 (06:35 +0000)
   Forbid 3D mesh on the SHELL

src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_subMesh.cxx

index 8b2840eb1e5cb6d3d7983528f02fadb9b2c0e33b..e76cc89978397e4bcb7f498424ef5aee84d457ce 100644 (file)
@@ -931,7 +931,7 @@ int SMESH_Gen::GetShapeDim(const TopAbs_ShapeEnum & aShapeType)
     dim[ TopAbs_COMPOUND ]  = MeshDim_3D;
     dim[ TopAbs_COMPSOLID ] = MeshDim_3D;
     dim[ TopAbs_SOLID ]     = MeshDim_3D;
-    dim[ TopAbs_SHELL ]     = MeshDim_3D;
+    dim[ TopAbs_SHELL ]     = MeshDim_2D;
     dim[ TopAbs_FACE  ]     = MeshDim_2D;
     dim[ TopAbs_WIRE ]      = MeshDim_1D;
     dim[ TopAbs_EDGE ]      = MeshDim_1D;
index 8a04a26c19e7dcee865199c99414e96bf1c5dc56..7f766cc438377ad0b236ecb72b22e06ed663fd0c 100644 (file)
@@ -510,12 +510,13 @@ bool SMESH_subMesh::CanAddHypothesis(const SMESH_Hypothesis* theHypothesis) cons
 {
   int aHypDim   = theHypothesis->GetDim();
   int aShapeDim = SMESH_Gen::GetShapeDim(_subShape);
-  if (aHypDim == 3 && aShapeDim == 3) {
-    // check case of open shell
-    //if (_subShape.ShapeType() == TopAbs_SHELL && !_subShape.Closed())
-    if (_subShape.ShapeType() == TopAbs_SHELL && !BRep_Tool::IsClosed(_subShape))
-      return false;
-  }
+  // issue 21106. Forbid 3D mesh on the SHELL
+  // if (aHypDim == 3 && aShapeDim == 3) {
+  //   // check case of open shell
+  //   //if (_subShape.ShapeType() == TopAbs_SHELL && !_subShape.Closed())
+  //   if (_subShape.ShapeType() == TopAbs_SHELL && !BRep_Tool::IsClosed(_subShape))
+  //     return false;
+  // }
   if ( aHypDim <= aShapeDim )
     return true;
 
@@ -531,8 +532,14 @@ bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis,
                                           const TopAbs_ShapeEnum  theShapeType)
 {
   if ( theHypothesis->GetType() > SMESHDS_Hypothesis::PARAM_ALGO)
+  {
     // algorithm
-    return ( theHypothesis->GetShapeType() & (1<< theShapeType));
+    if ( theHypothesis->GetShapeType() & (1<< theShapeType))
+      // issue 21106. Forbid 3D mesh on the SHELL
+      return !( theHypothesis->GetDim() == 3 && theShapeType == TopAbs_SHELL );
+    else
+      return false;
+  }
 
   // hypothesis
   switch ( theShapeType ) {