if ( ii2i != ii2iMap.end() )
oldID = ii2i->second;
- TopoDS_Shape newShape = newGroupShape( *data, isBreakLink ? IS_BREAK_LINK : MAIN_TRANSFORMED );
+ int how = ( isBreakLink || !sameTopology ) ? IS_BREAK_LINK : MAIN_TRANSFORMED;
+ TopoDS_Shape newShape = newGroupShape( *data, how );
if ( !newShape.IsNull() )
{
if ( meshDS->ShapeToIndex( newShape ) > 0 ) // a group reduced to one sub-shape
// re-assign hypotheses
for ( size_t i = 0; i < ids2Hyps.size(); ++i )
{
- if ( !sameTopology && ids2Hyps[i].first != 1 )
- continue; // assign only global hypos
int sID = ids2Hyps[i].first;
std::map< int, int >::iterator o2n = old2newIDs.find( sID );
if ( o2n != old2newIDs.end() )
sID = o2n->second;
+ else if ( sID != 1 )
+ continue;
const TopoDS_Shape& s = meshDS->IndexToShape( sID );
const THypList& hyps = ids2Hyps[i].second;
THypList::const_iterator h = hyps.begin();
_impl->AddHypothesis( s, (*h)->GetID() );
}
- if ( !sameTopology )
- {
- // remove invalid study sub-objects
- CheckGeomGroupModif();
- }
- else
{
// restore groups on geometry
for ( size_t i = 0; i < groupsData.size(); ++i )
i_sm->second = _impl->GetSubMesh( meshDS->IndexToShape( i_sm->first ));
}
+ if ( !sameTopology )
+ {
+ // remove invalid study sub-objects
+ CheckGeomGroupModif();
+ }
+
_gen_i->UpdateIcons( me );
if ( !isBreakLink && isShaper )