From 966f6ecf0641e79e6a552738d94850232e58f885 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 19 May 2009 15:33:12 +0000 Subject: [PATCH] 0020279: [CEA 334] control the "random" use when using mesh algorithms In SetEventListener(), avoid meshing of internal vertices of complex edge --- .../StdMeshers_CompositeSegment_1D.cxx | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx index f5cf86cd9..eee3ef012 100644 --- a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx @@ -251,6 +251,35 @@ StdMeshers_CompositeSegment_1D::~StdMeshers_CompositeSegment_1D() void StdMeshers_CompositeSegment_1D::SetEventListener(SMESH_subMesh* subMesh) { + // issue 0020279. Set "_alwaysComputed" flag to the submeshes of internal + // vertices of composite edge in order to avoid creation of vertices on + // them for the sake of stability. + + // check if "_alwaysComputed" is not yet set + bool isAlwaysComputed = false; + SMESH_subMeshIteratorPtr smIt = subMesh->getDependsOnIterator(false,false); + while ( !isAlwaysComputed && smIt->more() ) + isAlwaysComputed = smIt->next()->IsAlwaysComputed(); + + if ( !isAlwaysComputed ) + { + // check if an edge is a part of a complex side + TopoDS_Face face; + TopoDS_Edge edge = TopoDS::Edge( subMesh->GetSubShape() ); + auto_ptr< StdMeshers_FaceSide > side + ( StdMeshers_CompositeSegment_1D::GetFaceSide(*subMesh->GetFather(),edge, face, false )); + if ( side->NbEdges() > 1 ) { // complex + + // set _alwaysComputed to vertices + for ( int iE = 1; iE < side->NbEdges(); ++iE ) + { + TopoDS_Vertex V = side->FirstVertex( iE ); + SMESH_subMesh* sm = side->GetMesh()->GetSubMesh( V ); + sm->SetIsAlwaysComputed( true ); + } + } + } + // set listener that will remove _alwaysComputed from submeshes at algorithm change subMesh->SetEventListener( _EventListener, 0, subMesh); StdMeshers_Regular_1D::SetEventListener( subMesh ); } -- 2.39.2