mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-11 16:19:16 +05:00
Fix CRASH after mesh.RemoveGroupWithContents( group_of_other_mesh )
This commit is contained in:
parent
734c82522e
commit
8a0ae20732
@ -239,6 +239,9 @@ int SMDS_ElementFactory::FromVtkToSmds( vtkIdType vtkID )
|
|||||||
|
|
||||||
void SMDS_ElementFactory::Free( const SMDS_MeshElement* e )
|
void SMDS_ElementFactory::Free( const SMDS_MeshElement* e )
|
||||||
{
|
{
|
||||||
|
if ( e != FindElement( e->GetID() ))
|
||||||
|
SALOME_Exception("SMDS_ElementFactory::Free(): element of other mesh");
|
||||||
|
|
||||||
if ( !myVtkIDs.empty() )
|
if ( !myVtkIDs.empty() )
|
||||||
{
|
{
|
||||||
size_t id = e->GetID() - 1;
|
size_t id = e->GetID() - 1;
|
||||||
|
@ -2391,8 +2391,9 @@ namespace
|
|||||||
// if ( !myLinks[i].IsInternal() )
|
// if ( !myLinks[i].IsInternal() )
|
||||||
// myLinks[ i ].myFace = cutterFace;
|
// myLinks[ i ].myFace = cutterFace;
|
||||||
// else
|
// else
|
||||||
myLinks[ i ].ReplaceCoplanar( newEdge );
|
myLinks[ i ].ReplaceCoplanar( newEdge );
|
||||||
myLinks[ i+1 ].ReplaceCoplanar( newEdge );
|
if ( myLinks[i].IsInternal() && i+1 < myLinks.size() )
|
||||||
|
myLinks[ i+1 ].ReplaceCoplanar( newEdge );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
i += myLinks[i].IsInternal();
|
i += myLinks[i].IsInternal();
|
||||||
|
@ -1104,6 +1104,10 @@ void SMESH_Mesh_i::RemoveGroup( SMESH::SMESH_GroupBase_ptr theGroup )
|
|||||||
if ( !aGroup )
|
if ( !aGroup )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if ( aGroup->GetMeshServant() != this )
|
||||||
|
THROW_SALOME_CORBA_EXCEPTION( "RemoveGroup(): group does not belong to this mesh",
|
||||||
|
SALOME::BAD_PARAM );
|
||||||
|
|
||||||
SALOMEDS::SObject_wrap aGroupSO = _gen_i->ObjectToSObject( theGroup );
|
SALOMEDS::SObject_wrap aGroupSO = _gen_i->ObjectToSObject( theGroup );
|
||||||
if ( !aGroupSO->_is_nil() )
|
if ( !aGroupSO->_is_nil() )
|
||||||
{
|
{
|
||||||
@ -1138,6 +1142,11 @@ void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup
|
|||||||
if ( theGroup->_is_nil() )
|
if ( theGroup->_is_nil() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
SMESH_GroupBase_i* groupImpl = SMESH::DownCast< SMESH_GroupBase_i* >( theGroup );
|
||||||
|
if ( !groupImpl || groupImpl->GetMeshServant() != this )
|
||||||
|
THROW_SALOME_CORBA_EXCEPTION( "RemoveGroupWithContents(): group does not belong to this mesh",
|
||||||
|
SALOME::BAD_PARAM);
|
||||||
|
|
||||||
vector<int> nodeIds; // to remove nodes becoming free
|
vector<int> nodeIds; // to remove nodes becoming free
|
||||||
bool isNodal = ( theGroup->GetType() == SMESH::NODE );
|
bool isNodal = ( theGroup->GetType() == SMESH::NODE );
|
||||||
if ( !isNodal && !theGroup->IsEmpty() )
|
if ( !isNodal && !theGroup->IsEmpty() )
|
||||||
|
Loading…
Reference in New Issue
Block a user