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() )
{
size_t id = e->GetID() - 1;
// if ( !myLinks[i].IsInternal() )
// myLinks[ i ].myFace = cutterFace;
// else
- myLinks[ i ].ReplaceCoplanar( newEdge );
- myLinks[ i+1 ].ReplaceCoplanar( newEdge );
+ myLinks[ i ].ReplaceCoplanar( newEdge );
+ if ( myLinks[i].IsInternal() && i+1 < myLinks.size() )
+ myLinks[ i+1 ].ReplaceCoplanar( newEdge );
return;
}
i += myLinks[i].IsInternal();
if ( !aGroup )
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 );
if ( !aGroupSO->_is_nil() )
{
if ( theGroup->_is_nil() )
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
bool isNodal = ( theGroup->GetType() == SMESH::NODE );
if ( !isNodal && !theGroup->IsEmpty() )