mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-06-06 12:37:48 +05:00
0020833: EDF 1361 SMESH : Graphical Selection of the boundary faces in one clic
Change behavior of CoplanarFaces: normals of neighboring faces are compared and not that of the selected face and candidate faces
This commit is contained in:
parent
3f3fd308b1
commit
8203a3d57e
@ -2737,30 +2737,37 @@ void CoplanarFaces::SetMesh( const SMDS_Mesh* theMesh )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const double radianTol = myToler * M_PI / 180.;
|
const double radianTol = myToler * M_PI / 180.;
|
||||||
typedef SMDS_StdIterator< const SMDS_MeshElement*, SMDS_ElemIteratorPtr > TFaceIt;
|
std::set< SMESH_TLink > checkedLinks;
|
||||||
std::set<const SMDS_MeshElement*> checkedFaces, checkedNodes;
|
|
||||||
std::list<const SMDS_MeshElement*> faceQueue( 1, face );
|
std::list< pair< const SMDS_MeshElement*, gp_Vec > > faceQueue;
|
||||||
|
faceQueue.push_back( make_pair( face, myNorm ));
|
||||||
while ( !faceQueue.empty() )
|
while ( !faceQueue.empty() )
|
||||||
{
|
{
|
||||||
face = faceQueue.front();
|
face = faceQueue.front().first;
|
||||||
if ( checkedFaces.insert( face ).second )
|
myNorm = faceQueue.front().second;
|
||||||
|
faceQueue.pop_front();
|
||||||
|
|
||||||
|
for ( int i = 0, nbN = face->NbCornerNodes(); i < nbN; ++i )
|
||||||
{
|
{
|
||||||
gp_Vec norm = getNormale( static_cast<const SMDS_MeshFace*>(face), &normOK );
|
const SMDS_MeshNode* n1 = face->GetNode( i );
|
||||||
|
const SMDS_MeshNode* n2 = face->GetNode(( i+1 )%nbN);
|
||||||
|
if ( !checkedLinks.insert( SMESH_TLink( n1, n2 )).second )
|
||||||
|
continue;
|
||||||
|
SMDS_ElemIteratorPtr fIt = n1->GetInverseElementIterator(SMDSAbs_Face);
|
||||||
|
while ( fIt->more() )
|
||||||
|
{
|
||||||
|
const SMDS_MeshElement* f = fIt->next();
|
||||||
|
if ( f->GetNodeIndex( n2 ) > -1 )
|
||||||
|
{
|
||||||
|
gp_Vec norm = getNormale( static_cast<const SMDS_MeshFace*>(f), &normOK );
|
||||||
if (!normOK || myNorm.Angle( norm ) <= radianTol)
|
if (!normOK || myNorm.Angle( norm ) <= radianTol)
|
||||||
{
|
{
|
||||||
myCoplanarIDs.insert( face->GetID() );
|
myCoplanarIDs.insert( f->GetID() );
|
||||||
std::set<const SMDS_MeshElement*> neighborFaces;
|
faceQueue.push_back( make_pair( f, norm ));
|
||||||
for ( int i = 0; i < face->NbCornerNodes(); ++i )
|
}
|
||||||
{
|
}
|
||||||
const SMDS_MeshNode* n = face->GetNode( i );
|
|
||||||
if ( checkedNodes.insert( n ).second )
|
|
||||||
neighborFaces.insert( TFaceIt( n->GetInverseElementIterator(SMDSAbs_Face)),
|
|
||||||
TFaceIt());
|
|
||||||
}
|
|
||||||
faceQueue.insert( faceQueue.end(), neighborFaces.begin(), neighborFaces.end() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
faceQueue.pop_front();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user