X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_subMesh.cxx;h=6c484c80a20e6d9eff3ddef37a83010a4532a7c4;hb=aa5c100cf71c5a37f71c1ed3b66215e00fa95973;hp=704703404d0e8003b4fa4a9d3645f75bcba37dc8;hpb=0375a82ed429467dfdc9225a27b1992692f481db;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 704703404..6c484c80a 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1,6 +1,6 @@ -// SMESH SMESH : implementaion of SMESH idl descriptions +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // // This library is free software; you can redistribute it and/or @@ -19,13 +19,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// -// +// SMESH SMESH : implementaion of SMESH idl descriptions // File : SMESH_subMesh.cxx // Author : Paul RASCLE, EDF // Module : SMESH // $Header$ - +// #include "SMESH_subMesh.hxx" #include "SMESH_Algo.hxx" @@ -195,7 +194,7 @@ void SMESH_subMesh::SetIsAlwaysComputed(bool isAlCo) bool SMESH_subMesh::IsEmpty() const { if (SMESHDS_SubMesh * subMeshDS = ((SMESH_subMesh*)this)->GetSubMeshDS()) - return (!subMeshDS->GetNodes()->more() && !subMeshDS->GetElements()->more()); + return (!subMeshDS->NbElements() && !subMeshDS->NbNodes()); return true; } @@ -513,7 +512,8 @@ bool SMESH_subMesh::CanAddHypothesis(const SMESH_Hypothesis* theHypothesis) cons 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 && !_subShape.Closed()) + if (_subShape.ShapeType() == TopAbs_SHELL && !BRep_Tool::IsClosed(_subShape)) return false; } if ( aHypDim <= aShapeDim ) @@ -1359,7 +1359,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event) { ret = algo->Compute((*_father), shape); } - if ( !ret && _computeError->IsOK() ) // algo can set _computeError of submesh + if ( !_computeError || ( !ret && _computeError->IsOK() ) ) // algo can set _computeError of submesh _computeError = algo->GetComputeError(); } catch ( std::bad_alloc& exc ) { @@ -2077,7 +2077,8 @@ namespace { SMESH_subMesh* prepend, SMESH_subMesh* append): myIt(subIt),myAppend(append) { - myCur = prepend ? prepend : myIt->more() ? myIt->next() : 0; + myCur = prepend ? prepend : myIt->more() ? myIt->next() : append; + if ( myCur == append ) append = 0; } /// Return true if and only if there are other object in this iterator virtual bool more()