IPAL54104: Wrong prismatic mesh

Fix sub-shape association of FACEs with a seam in a propagation case

+ Remember a state of "Show IDs" check-box in Mesh Info / Element info
This commit is contained in:
eap 2017-04-18 14:07:52 +03:00
parent 096485adbe
commit 9ecacf41d1
4 changed files with 31 additions and 17 deletions

View File

@ -84,6 +84,8 @@ const int GROUPS_ID = 100;
const int SUBMESHES_ID = 200; const int SUBMESHES_ID = 200;
const int SPACING_INFO = 2; const int SPACING_INFO = 2;
const char* id_preview_resource = "id_preview_resource";
enum InfoRole { enum InfoRole {
TypeRole = Qt::UserRole + 10, TypeRole = Qt::UserRole + 10,
IdRole, IdRole,
@ -2942,6 +2944,8 @@ SMESHGUI_MeshInfoDlg::SMESHGUI_MeshInfoDlg( QWidget* parent, int page )
connect( myElemInfo, SIGNAL( itemInfo( int )), this, SLOT( showItemInfo( int ))); connect( myElemInfo, SIGNAL( itemInfo( int )), this, SLOT( showItemInfo( int )));
connect( myElemInfo, SIGNAL( itemInfo( QString )), this, SLOT( showItemInfo( QString ))); connect( myElemInfo, SIGNAL( itemInfo( QString )), this, SLOT( showItemInfo( QString )));
myIDPreviewCheck->setChecked( SMESHGUI::resourceMgr()->booleanValue( "SMESH", id_preview_resource, false ));
updateSelection(); updateSelection();
} }
@ -3189,6 +3193,7 @@ void SMESHGUI_MeshInfoDlg::idChanged()
void SMESHGUI_MeshInfoDlg::idPreviewChange( bool isOn ) void SMESHGUI_MeshInfoDlg::idPreviewChange( bool isOn )
{ {
myIDPreview->SetPointsLabeled( isOn && !myID->text().simplified().isEmpty() ); myIDPreview->SetPointsLabeled( isOn && !myID->text().simplified().isEmpty() );
SMESHGUI::resourceMgr()->setValue("SMESH", id_preview_resource, isOn );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
aViewWindow->Repaint(); aViewWindow->Repaint();
} }

View File

@ -36,8 +36,11 @@ import os
# Values # Values
# ------ # ------
tmpDir = os.getenv('SALOME_TMP_DIR', '/tmp')
print "Output directory:", tmpDir
# Path for ".med" files # Path for ".med" files
path = "/tmp/ex29_%s_" % os.getenv('USER','unknown') path = os.path.join( tmpDir, "ex29_%s_" % os.getenv('USER','unknown'))
# Name of the shape and the mesh # Name of the shape and the mesh
name = "Carre" name = "Carre"

View File

@ -1100,6 +1100,11 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the
// take care of proper association of propagated edges // take care of proper association of propagated edges
bool same1 = edge1.IsSame( edges1.front() ); bool same1 = edge1.IsSame( edges1.front() );
bool same2 = edge2.IsSame( edges2.front() ); bool same2 = edge2.IsSame( edges2.front() );
if ( !same1 && !same2 )
{
same1 = ( edges1.back().Orientation() == edge1.Orientation() );
same2 = ( edges2.back().Orientation() == edge2.Orientation() );
}
if ( same1 != same2 ) if ( same1 != same2 )
{ {
reverseEdges(edges2, nbE); reverseEdges(edges2, nbE);

View File

@ -1380,11 +1380,12 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
TopoDS_Edge srcE1 = srcEdges.front(), tgtE1 = tgtEdges.front(); TopoDS_Edge srcE1 = srcEdges.front(), tgtE1 = tgtEdges.front();
TopoDS_Shape srcE1bis = shape2ShapeMap( tgtE1 ); TopoDS_Shape srcE1bis = shape2ShapeMap( tgtE1 );
reverse = ( ! srcE1.IsSame( srcE1bis )); reverse = ( ! srcE1.IsSame( srcE1bis ));
if ( reverse && if ( ( reverse || srcE1.Orientation() != srcE1bis.Orientation() ) &&
//_sourceHypo->HasVertexAssociation() &&
nbEdgesInWires.front() > 2 && nbEdgesInWires.front() > 2 &&
helper.IsRealSeam( tgtEdges.front() )) helper.IsRealSeam( tgtEdges.front() ))
{ {
if ( srcE1.Orientation() != srcE1bis.Orientation() )
reverse = true;
// projection to a face with seam EDGE; pb is that GetOrderedEdges() // projection to a face with seam EDGE; pb is that GetOrderedEdges()
// always puts a seam EDGE first (if possible) and as a result // always puts a seam EDGE first (if possible) and as a result
// we can't use only theReverse flag to correctly associate source // we can't use only theReverse flag to correctly associate source