mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-29 10:50:34 +05:00
non-regression test SMESH_TEST/Grids/smesh/mesh_rotation/A8
Fix generateGroups() to correctly generate "top" groups for initial groups of nodes
This commit is contained in:
parent
0f842b1c6a
commit
9aeac93db0
@ -6065,7 +6065,26 @@ SMESH_MeshEditor::generateGroups(const SMESH_SequenceOfElemPtr& nodeGens,
|
|||||||
if ( resElem != sourceElem )
|
if ( resElem != sourceElem )
|
||||||
resultElems.push_back( resElem );
|
resultElems.push_back( resElem );
|
||||||
|
|
||||||
// add resultElems to groups made by ones the sourceElem belongs to
|
// there must be a top element
|
||||||
|
const SMDS_MeshElement* topElem = 0;
|
||||||
|
if ( isNodes )
|
||||||
|
{
|
||||||
|
topElem = resultElems.back();
|
||||||
|
resultElems.pop_back();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
list< const SMDS_MeshElement* >::reverse_iterator resElemIt = resultElems.rbegin();
|
||||||
|
for ( ; resElemIt != resultElems.rend() ; ++resElemIt )
|
||||||
|
if ( (*resElemIt)->GetType() == sourceElem->GetType() )
|
||||||
|
{
|
||||||
|
topElem = *resElemIt;
|
||||||
|
resultElems.erase( --(resElemIt.base()) ); // erase *resElemIt
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add resultElems to groups originted from ones the sourceElem belongs to
|
||||||
list< TOldNewGroup >::iterator gOldNew, gLast = groupsOldNew.end();
|
list< TOldNewGroup >::iterator gOldNew, gLast = groupsOldNew.end();
|
||||||
for ( gOldNew = groupsOldNew.begin(); gOldNew != gLast; ++gOldNew )
|
for ( gOldNew = groupsOldNew.begin(); gOldNew != gLast; ++gOldNew )
|
||||||
{
|
{
|
||||||
@ -6074,19 +6093,15 @@ SMESH_MeshEditor::generateGroups(const SMESH_SequenceOfElemPtr& nodeGens,
|
|||||||
{
|
{
|
||||||
// fill in a new group
|
// fill in a new group
|
||||||
SMDS_MeshGroup & newGroup = gOldNew->get<1>()->SMDSGroup();
|
SMDS_MeshGroup & newGroup = gOldNew->get<1>()->SMDSGroup();
|
||||||
list< const SMDS_MeshElement* > rejectedElems; // elements of other type
|
|
||||||
list< const SMDS_MeshElement* >::iterator resLast = resultElems.end(), resElemIt;
|
list< const SMDS_MeshElement* >::iterator resLast = resultElems.end(), resElemIt;
|
||||||
for ( resElemIt = resultElems.begin(); resElemIt != resLast; ++resElemIt )
|
for ( resElemIt = resultElems.begin(); resElemIt != resLast; ++resElemIt )
|
||||||
if ( !newGroup.Add( *resElemIt ))
|
newGroup.Add( *resElemIt );
|
||||||
rejectedElems.push_back( *resElemIt );
|
|
||||||
|
|
||||||
// fill "top" group
|
// fill a "top" group
|
||||||
if ( !rejectedElems.empty() )
|
if ( topElem )
|
||||||
{
|
{
|
||||||
SMDS_MeshGroup & newTopGroup = gOldNew->get<2>()->SMDSGroup();
|
SMDS_MeshGroup & newTopGroup = gOldNew->get<2>()->SMDSGroup();
|
||||||
resLast = rejectedElems.end();
|
newTopGroup.Add( topElem );
|
||||||
for ( resElemIt = rejectedElems.begin(); resElemIt != resLast; ++resElemIt )
|
|
||||||
!newTopGroup.Add( *resElemIt );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6116,7 +6131,9 @@ SMESH_MeshEditor::generateGroups(const SMESH_SequenceOfElemPtr& nodeGens,
|
|||||||
|
|
||||||
// make a name
|
// make a name
|
||||||
const bool isTop = ( nbNewGroups == 2 &&
|
const bool isTop = ( nbNewGroups == 2 &&
|
||||||
newGroupDS->GetType() == oldGroupDS->GetType() );
|
newGroupDS->GetType() == oldGroupDS->GetType() &&
|
||||||
|
is2nd );
|
||||||
|
|
||||||
string name = oldGroupDS->GetStoreName();
|
string name = oldGroupDS->GetStoreName();
|
||||||
if ( !targetMesh ) {
|
if ( !targetMesh ) {
|
||||||
string suffix = ( isTop ? "top": postfix.c_str() );
|
string suffix = ( isTop ? "top": postfix.c_str() );
|
||||||
|
Loading…
Reference in New Issue
Block a user