For IMP 16155: use BRep_Tool::IsClosed() instead of TopoDS_Shape::Closed().

This commit is contained in:
jfa 2008-10-02 06:43:10 +00:00
parent 591c0c3f5c
commit 27ea448bbb
2 changed files with 5 additions and 3 deletions

View File

@ -513,7 +513,8 @@ bool SMESH_subMesh::CanAddHypothesis(const SMESH_Hypothesis* theHypothesis) cons
int aShapeDim = SMESH_Gen::GetShapeDim(_subShape); int aShapeDim = SMESH_Gen::GetShapeDim(_subShape);
if (aHypDim == 3 && aShapeDim == 3) { if (aHypDim == 3 && aShapeDim == 3) {
// check case of open shell // check case of open shell
if (_subShape.ShapeType() == TopAbs_SHELL && !_subShape.Closed()) //if (_subShape.ShapeType() == TopAbs_SHELL && !_subShape.Closed())
if (_subShape.ShapeType() == TopAbs_SHELL && !BRep_Tool::IsClosed(_subShape))
return false; return false;
} }
if ( aHypDim <= aShapeDim ) if ( aHypDim <= aShapeDim )

View File

@ -65,6 +65,7 @@
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <TopoDS_Shell.hxx> #include <TopoDS_Shell.hxx>
#include <TopExp_Explorer.hxx> #include <TopExp_Explorer.hxx>
#include <BRep_Tool.hxx>
// IDL includes // IDL includes
#include <SALOMEconfig.h> #include <SALOMEconfig.h>
@ -509,7 +510,7 @@ void SMESHGUI_MeshOp::selectionDone()
shapeDim = (shapeDim < 2) ? 2 : shapeDim; shapeDim = (shapeDim < 2) ? 2 : shapeDim;
TopoDS_Shape aShape; TopoDS_Shape aShape;
if (GEOMBase::GetShape(aGeomVar, aShape)) { if (GEOMBase::GetShape(aGeomVar, aShape)) {
if (aShape.Closed()) if (/*aShape.Closed()*/BRep_Tool::IsClosed(aShape))
shapeDim = 3; shapeDim = 3;
} }
} }
@ -527,7 +528,7 @@ void SMESHGUI_MeshOp::selectionDone()
//shapeDim = 3; // Bug 0016155: EDF PAL 447: If the shape is a Shell, disable 3D tab //shapeDim = 3; // Bug 0016155: EDF PAL 447: If the shape is a Shell, disable 3D tab
shapeDim = (shapeDim < 2) ? 2 : shapeDim; shapeDim = (shapeDim < 2) ? 2 : shapeDim;
for (; exp.More() && shapeDim == 2; exp.Next()) { for (; exp.More() && shapeDim == 2; exp.Next()) {
if (exp.Current().Closed()) if (/*exp.Current().Closed()*/BRep_Tool::IsClosed(exp.Current()))
shapeDim = 3; shapeDim = 3;
} }
} }