mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 09:20:34 +05:00
Regression of doc/salome/examples/transforming_meshes_ex11.py
This commit is contained in:
parent
c656333fb4
commit
9655cb578d
@ -7979,33 +7979,29 @@ void SMESH_MeshEditor::FindEqualElements(TIDSortedElemSet & theElements,
|
|||||||
typedef map< SortableElement, int > TMapOfNodeSet;
|
typedef map< SortableElement, int > TMapOfNodeSet;
|
||||||
typedef list<int> TGroupOfElems;
|
typedef list<int> TGroupOfElems;
|
||||||
|
|
||||||
if ( theElements.empty() )
|
SMDS_ElemIteratorPtr elemIt;
|
||||||
{ // get all elements in the mesh
|
if ( theElements.empty() ) elemIt = GetMeshDS()->elementsIterator();
|
||||||
SMDS_ElemIteratorPtr eIt = GetMeshDS()->elementsIterator();
|
else elemIt = elemSetIterator( theElements );
|
||||||
while ( eIt->more() )
|
|
||||||
theElements.insert( theElements.end(), eIt->next() );
|
|
||||||
}
|
|
||||||
|
|
||||||
vector< TGroupOfElems > arrayOfGroups;
|
vector< TGroupOfElems > arrayOfGroups;
|
||||||
TGroupOfElems groupOfElems;
|
TGroupOfElems groupOfElems;
|
||||||
TMapOfNodeSet mapOfNodeSet;
|
TMapOfNodeSet mapOfNodeSet;
|
||||||
|
|
||||||
TIDSortedElemSet::iterator elemIt = theElements.begin();
|
for ( int iGroup = 0; elemIt->more(); )
|
||||||
for ( int i = 0; elemIt != theElements.end(); ++elemIt )
|
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement* curElem = *elemIt;
|
const SMDS_MeshElement* curElem = elemIt->next();
|
||||||
SortableElement SE(curElem);
|
SortableElement SE(curElem);
|
||||||
// check uniqueness
|
// check uniqueness
|
||||||
pair< TMapOfNodeSet::iterator, bool> pp = mapOfNodeSet.insert(make_pair(SE, i));
|
pair< TMapOfNodeSet::iterator, bool> pp = mapOfNodeSet.insert(make_pair(SE, iGroup));
|
||||||
if ( !pp.second ) { // one more coincident elem
|
if ( !pp.second ) { // one more coincident elem
|
||||||
TMapOfNodeSet::iterator& itSE = pp.first;
|
TMapOfNodeSet::iterator& itSE = pp.first;
|
||||||
int ind = (*itSE).second;
|
int iG = itSE->second;
|
||||||
arrayOfGroups[ind].push_back( curElem->GetID() );
|
arrayOfGroups[ iG ].push_back( curElem->GetID() );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
arrayOfGroups.push_back( groupOfElems );
|
arrayOfGroups.push_back( groupOfElems );
|
||||||
arrayOfGroups.back().push_back( curElem->GetID() );
|
arrayOfGroups.back().push_back( curElem->GetID() );
|
||||||
i++;
|
iGroup++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11189,6 +11185,9 @@ void SMESH_MeshEditor::DoubleElements( const TIDSortedElemSet& theElements )
|
|||||||
elemIt = elemSetIterator( theElements );
|
elemIt = elemSetIterator( theElements );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// un-mark all elements to avoid duplicating just created elements
|
||||||
|
SMESH_MeshAlgos::MarkElems( mesh->elementsIterator( type ), false );
|
||||||
|
|
||||||
// duplicate elements
|
// duplicate elements
|
||||||
|
|
||||||
ElemFeatures elemType;
|
ElemFeatures elemType;
|
||||||
@ -11197,13 +11196,14 @@ void SMESH_MeshEditor::DoubleElements( const TIDSortedElemSet& theElements )
|
|||||||
while ( elemIt->more() )
|
while ( elemIt->more() )
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement* elem = elemIt->next();
|
const SMDS_MeshElement* elem = elemIt->next();
|
||||||
if ( elem->GetType() != type )
|
if ( elem->GetType() != type || elem->isMarked() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
elemType.Init( elem, /*basicOnly=*/false );
|
elemType.Init( elem, /*basicOnly=*/false );
|
||||||
nodes.assign( elem->begin_nodes(), elem->end_nodes() );
|
nodes.assign( elem->begin_nodes(), elem->end_nodes() );
|
||||||
|
|
||||||
AddElement( nodes, elemType );
|
if ( const SMDS_MeshElement* newElem = AddElement( nodes, elemType ))
|
||||||
|
newElem->setIsMarked( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user