X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Mesh.cxx;h=4119c5fba0735eeec5c70d5342465522c6db1801;hb=57cd3cc56534d233d9555650065507ff7f0972af;hp=4b3444adf88aac5c6ce8302169e94421adc00d10;hpb=43ce5a9126b4f313e2f199fa920d8876defc2d6b;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 4b3444adf..4119c5fba 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -536,6 +536,10 @@ int SMESH_Mesh::MEDToMesh(const char* theFileName, const char* theMeshName) MESSAGE("MEDToMesh - _myMeshDS->NbFaces() = "<<_myMeshDS->NbFaces()); MESSAGE("MEDToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes()); } +#ifdef _DEBUG_ + SMESH_ComputeErrorPtr er = myReader.GetError(); + if ( er && !er->IsOK() ) cout << er->myComment << endl; +#endif // Reading groups (sub-meshes are out of scope of MED import functionality) list aGroupNames = myReader.GetGroupNamesAndTypes(); @@ -675,8 +679,8 @@ SMESH_Mesh::AddHypothesis(const TopoDS_Shape & aSubShape, // shape - bool isAlgo = ( anHyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO ); - int event = isAlgo ? SMESH_subMesh::ADD_ALGO : SMESH_subMesh::ADD_HYP; + bool isAlgo = ( anHyp->GetType() != SMESHDS_Hypothesis::PARAM_ALGO ); + SMESH_subMesh::algo_event event = isAlgo ? SMESH_subMesh::ADD_ALGO : SMESH_subMesh::ADD_HYP; SMESH_Hypothesis::Hypothesis_Status ret = subMesh->AlgoStateEngine(event, anHyp); @@ -751,8 +755,8 @@ SMESH_Hypothesis::Hypothesis_Status // shape - bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO ); - int event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP; + bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO ); + SMESH_subMesh::algo_event event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP; SMESH_subMesh *subMesh = GetSubMesh(aSubShape); @@ -1117,7 +1121,7 @@ throw(SALOME_Exception) //================================================================================ /*! - * \brief Return submeshes of groups containing the given sub-shape + * \brief Return sub-meshes of groups containing the given sub-shape */ //================================================================================ @@ -1131,8 +1135,8 @@ SMESH_Mesh::GetGroupSubMeshesContaining(const TopoDS_Shape & aSubShape) const if ( !subMesh ) return found; - // submeshes of groups have max IDs, so search from the map end -SMESH_subMeshIteratorPtr smIt( _subMeshHolder->GetIterator( /*reverse=*/true ) ); + // sub-meshes of groups have max IDs, so search from the map end + SMESH_subMeshIteratorPtr smIt( _subMeshHolder->GetIterator( /*reverse=*/true ) ); while ( smIt->more() ) { SMESH_subMesh* sm = smIt->next(); SMESHDS_SubMesh * ds = sm->GetSubMeshDS(); @@ -1158,6 +1162,12 @@ SMESH_subMeshIteratorPtr smIt( _subMeshHolder->GetIterator( /*reverse=*/true ) ) found.push_back( mainSM ); } } + else // issue 0023068 + { + if ( SMESH_subMesh * mainSM = GetSubMeshContaining(1) ) + if ( mainSM->GetSubShape().ShapeType() == TopAbs_COMPOUND ) + found.push_back( mainSM ); + } return found; } //======================================================================= @@ -1328,7 +1338,7 @@ bool SMESH_Mesh::HasModificationsToDiscard() const // return true if the next Compute() will be partial and // existing but changed elements may prevent successful re-compute bool hasComputed = false, hasNotComputed = false; -SMESH_subMeshIteratorPtr smIt( _subMeshHolder->GetIterator() ); + SMESH_subMeshIteratorPtr smIt( _subMeshHolder->GetIterator() ); while ( smIt->more() ) { const SMESH_subMesh* aSubMesh = smIt->next(); @@ -1343,6 +1353,8 @@ SMESH_subMeshIteratorPtr smIt( _subMeshHolder->GetIterator() ); hasNotComputed = true; if ( hasComputed && hasNotComputed) return true; + + default:; } } if ( NbNodes() < 1 ) @@ -1783,10 +1795,10 @@ int SMESH_Mesh::NbBiQuadQuadrangles() const throw(SALOME_Exception) */ //================================================================================ -int SMESH_Mesh::NbPolygons() const throw(SALOME_Exception) +int SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const throw(SALOME_Exception) { Unexpect aCatch(SalomeException); - return _myMeshDS->GetMeshInfo().NbPolygons(); + return _myMeshDS->GetMeshInfo().NbPolygons(order); } //================================================================================ @@ -2004,7 +2016,7 @@ SMESH_Group* SMESH_Mesh::AddGroup (SMESHDS_GroupBase* groupDS) throw(SALOME_Exce bool SMESH_Mesh::SynchronizeGroups() { - int nbGroups = _mapGroup.size(); + size_t nbGroups = _mapGroup.size(); const set& groups = _myMeshDS->GetGroups(); set::const_iterator gIt = groups.begin(); for ( ; gIt != groups.end(); ++gIt )