// File : SMESH_Mesh.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
-// $Header$
//
#include "SMESH_Mesh.hxx"
#include "SMESH_subMesh.hxx"
SMESH_Gen* theGen,
bool theIsEmbeddedMode,
SMESHDS_Document* theDocument):
- _groupId( 0 )
+ _groupId( 0 ), _nbSubShapes( 0 )
{
MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)");
_id = theLocalId;
{
INFOS("SMESH_Mesh::~SMESH_Mesh");
+ // issue 0020340: EDF 1022 SMESH : Crash with FindNodeClosestTo in a second new study
+ // Notify event listeners at least that something happens
+ if ( SMESH_subMesh * sm = GetSubMeshContaining(1))
+ sm->ComputeStateEngine( SMESH_subMesh::MESH_ENTITY_REMOVED );
+
// delete groups
std::map < int, SMESH_Group * >::iterator itg;
for (itg = _mapGroup.begin(); itg != _mapGroup.end(); itg++) {
{
_myMeshDS->ShapeToMesh(aShape);
_isShapeToMesh = true;
+ _nbSubShapes = _myMeshDS->MaxShapeIndex();
// fill _mapAncestors
int desType, ancType;
(TopAbs_ShapeEnum) ancType,
_mapAncestors );
}
+ else
+ {
+ _isShapeToMesh = false;
+ _myMeshDS->ShapeToMesh( PseudoShape() );
+ }
}
//=======================================================================
int index = _myMeshDS->ShapeToIndex(aSubShape);
// for submeshes on GEOM Group
- if ( !index && aSubShape.ShapeType() == TopAbs_COMPOUND ) {
+ if (( !index || index > _nbSubShapes ) && aSubShape.ShapeType() == TopAbs_COMPOUND ) {
TopoDS_Iterator it( aSubShape );
if ( it.More() )
index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() );