From 8f7ba2e37395fc00e0d5bb2284931e97b6d5d540 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 25 May 2009 11:32:47 +0000 Subject: [PATCH] 0020145: EDF 666 SMESH: Modifications of GEOM groups are not taken into account enable Load() in case if meshed geom group has changed --- src/SMESH_I/SMESH_Gen_i.cxx | 47 +++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 25f62dee3..07192d1cb 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -1350,6 +1350,8 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, SMESH_Mesh_i* meshServant = dynamic_cast( GetServant( theMesh ).in() ); ASSERT( meshServant ); if ( meshServant ) { + // NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation" + meshServant->CheckGeomGroupModif(); // get local TopoDS_Shape TopoDS_Shape myLocShape; if(theMesh->HasShapeToMesh()) @@ -3518,8 +3520,13 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, { int smID = smIDs[ i ]; if ( smID == 0 ) continue; - ASSERT( smID <= maxID ); const SMDS_MeshElement* elem = *iE; + if( smID >= maxID ) { + // corresponding subshape no longer exists: maybe geom group has been edited + if ( myNewMeshImpl->HasShapeToMesh() ) + mySMESHDSMesh->RemoveElement( elem ); + continue; + } // get or create submesh SMESHDS_SubMesh* & sm = subMeshes[ smID ]; if ( ! sm ) { @@ -3624,28 +3631,28 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, for ( int iNode = 0; iNode < nbNodes; iNode++ ) { const SMDS_MeshNode* node = mySMESHDSMesh->FindNode( aNodeIDs[ iNode ]); - ASSERT( node ); + if ( !node ) continue; // maybe removed while Loading() if geometry changed SMDS_PositionPtr aPos = node->GetPosition(); - ASSERT( aPos ) - if ( onFace ) { - // ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_FACE );-- issue 20182 - // -- Most probably a bad study was saved when there were - // not fixed bugs in SMDS_MeshInfo - if ( aPos->GetTypeOfPosition() == SMDS_TOP_FACE ) { - SMDS_FacePosition* fPos = const_cast - ( static_cast( aPos.get() )); - fPos->SetUParameter( aUPos[ iNode ]); - fPos->SetVParameter( aVPos[ iNode ]); - } + ASSERT( aPos ); + if ( onFace ) { + // ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_FACE );-- issue 20182 + // -- Most probably a bad study was saved when there were + // not fixed bugs in SMDS_MeshInfo + if ( aPos->GetTypeOfPosition() == SMDS_TOP_FACE ) { + SMDS_FacePosition* fPos = const_cast + ( static_cast( aPos.get() )); + fPos->SetUParameter( aUPos[ iNode ]); + fPos->SetVParameter( aVPos[ iNode ]); } - else { - // ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE );-- issue 20182 - if ( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE ) { - SMDS_EdgePosition* fPos = const_cast - ( static_cast( aPos.get() )); - fPos->SetUParameter( aUPos[ iNode ]); - } + } + else { + // ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE );-- issue 20182 + if ( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE ) { + SMDS_EdgePosition* fPos = const_cast + ( static_cast( aPos.get() )); + fPos->SetUParameter( aUPos[ iNode ]); } + } } } if ( aEids ) delete [] aEids; -- 2.39.2