From f95be2abe08c527ba7aa5ae0436da19036593387 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 13 Oct 2011 06:35:00 +0000 Subject: [PATCH] 0021106: EDF 1691 SMESH: MEsh.Group(SubShape) fails on Shells Forbid 3D mesh on the SHELL --- src/SMESH/SMESH_Gen.cxx | 2 +- src/SMESH/SMESH_subMesh.cxx | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 8b2840eb1..e76cc8997 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -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; diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 8a04a26c1..7f766cc43 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -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 ) { -- 2.39.2