mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 17:50:34 +05:00
Task #3134: Improve the relation between SHAPER and SMESH
Fix pb that sub-mesh loses hypotheses if topology changes
This commit is contained in:
parent
50dabfbfdf
commit
230046ed89
@ -2098,10 +2098,13 @@ TopoDS_Shape SMESH_Mesh_i::newGroupShape( TGeomGroupData & groupData, int how )
|
|||||||
CORBA::Object_var geomObj = _gen_i->SObjectToObject( geomSO );
|
CORBA::Object_var geomObj = _gen_i->SObjectToObject( geomSO );
|
||||||
GEOM::GEOM_Object_var geom = GEOM::GEOM_Object::_narrow( geomObj );
|
GEOM::GEOM_Object_var geom = GEOM::GEOM_Object::_narrow( geomObj );
|
||||||
newShape = _gen_i->GeomObjectToShape( geom );
|
newShape = _gen_i->GeomObjectToShape( geom );
|
||||||
|
if ( !newShape.IsNull() )
|
||||||
|
{
|
||||||
CORBA::String_var entry = geom->GetStudyEntry();
|
CORBA::String_var entry = geom->GetStudyEntry();
|
||||||
groupData._groupEntry = entry.in();
|
groupData._groupEntry = entry.in();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// get geom group
|
// get geom group
|
||||||
@ -2431,9 +2434,11 @@ void SMESH_Mesh_i::CheckGeomModif( bool isBreakLink )
|
|||||||
std::map< std::set<int>, int >::iterator ii2i = ii2iMap.find( data->_indices );
|
std::map< std::set<int>, int >::iterator ii2i = ii2iMap.find( data->_indices );
|
||||||
if ( ii2i != ii2iMap.end() )
|
if ( ii2i != ii2iMap.end() )
|
||||||
oldID = ii2i->second;
|
oldID = ii2i->second;
|
||||||
|
if ( old2newIDs.count( oldID ))
|
||||||
|
continue;
|
||||||
|
|
||||||
int how = ( isBreakLink || !sameTopology ) ? IS_BREAK_LINK : MAIN_TRANSFORMED;
|
int how = ( isBreakLink || !sameTopology ) ? IS_BREAK_LINK : MAIN_TRANSFORMED;
|
||||||
TopoDS_Shape newShape = newGroupShape( *data, how );
|
newShape = newGroupShape( *data, how );
|
||||||
if ( !newShape.IsNull() )
|
if ( !newShape.IsNull() )
|
||||||
{
|
{
|
||||||
if ( meshDS->ShapeToIndex( newShape ) > 0 ) // a group reduced to one sub-shape
|
if ( meshDS->ShapeToIndex( newShape ) > 0 ) // a group reduced to one sub-shape
|
||||||
@ -2444,8 +2449,13 @@ void SMESH_Mesh_i::CheckGeomModif( bool isBreakLink )
|
|||||||
newShape = compound;
|
newShape = compound;
|
||||||
}
|
}
|
||||||
int newID = _impl->GetSubMesh( newShape )->GetId();
|
int newID = _impl->GetSubMesh( newShape )->GetId();
|
||||||
if ( oldID && oldID != newID )
|
if ( oldID /*&& oldID != newID*/ )
|
||||||
old2newIDs.insert( std::make_pair( oldID, newID ));
|
old2newIDs.insert( std::make_pair( oldID, newID ));
|
||||||
|
if ( data->_indices.size() == 1 )
|
||||||
|
{
|
||||||
|
oldID = *data->_indices.begin();
|
||||||
|
old2newIDs.insert( std::make_pair( oldID, newID ));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2456,9 +2466,11 @@ void SMESH_Mesh_i::CheckGeomModif( bool isBreakLink )
|
|||||||
std::map< int, int >::iterator o2n = old2newIDs.find( sID );
|
std::map< int, int >::iterator o2n = old2newIDs.find( sID );
|
||||||
if ( o2n != old2newIDs.end() )
|
if ( o2n != old2newIDs.end() )
|
||||||
sID = o2n->second;
|
sID = o2n->second;
|
||||||
else if ( sID != 1 )
|
else if ( !sameTopology && sID != 1 )
|
||||||
continue;
|
continue;
|
||||||
const TopoDS_Shape& s = meshDS->IndexToShape( sID );
|
const TopoDS_Shape& s = meshDS->IndexToShape( sID );
|
||||||
|
if ( s.IsNull() )
|
||||||
|
continue;
|
||||||
const THypList& hyps = ids2Hyps[i].second;
|
const THypList& hyps = ids2Hyps[i].second;
|
||||||
THypList::const_iterator h = hyps.begin();
|
THypList::const_iterator h = hyps.begin();
|
||||||
for ( ; h != hyps.end(); ++h )
|
for ( ; h != hyps.end(); ++h )
|
||||||
@ -2490,7 +2502,7 @@ void SMESH_Mesh_i::CheckGeomModif( bool isBreakLink )
|
|||||||
for ( ; o2n != old2newIDs.end(); ++o2n )
|
for ( ; o2n != old2newIDs.end(); ++o2n )
|
||||||
{
|
{
|
||||||
int newID = o2n->second, oldID = o2n->first;
|
int newID = o2n->second, oldID = o2n->first;
|
||||||
if ( !_mapSubMesh.count( oldID ))
|
if ( newID == oldID || !_mapSubMesh.count( oldID ))
|
||||||
continue;
|
continue;
|
||||||
if ( newID > 0 )
|
if ( newID > 0 )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user