From: eap Date: Tue, 18 Apr 2017 11:07:52 +0000 (+0300) Subject: IPAL54104: Wrong prismatic mesh X-Git-Tag: Before_multi_study_removal_06072017~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9ecacf41d1f3bb33c5cee644b5359e164b2302cf;p=modules%2Fsmesh.git 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 --- diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index c2932c203..299ba97c0 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -77,22 +77,24 @@ namespace { -const int SPACING = 6; -const int MARGIN = 9; -const int MAXITEMS = 10; -const int GROUPS_ID = 100; -const int SUBMESHES_ID = 200; -const int SPACING_INFO = 2; - -enum InfoRole { - TypeRole = Qt::UserRole + 10, - IdRole, -}; - -enum InfoType { - NodeConnectivity = 100, - ElemConnectivity, -}; + const int SPACING = 6; + const int MARGIN = 9; + const int MAXITEMS = 10; + const int GROUPS_ID = 100; + const int SUBMESHES_ID = 200; + const int SPACING_INFO = 2; + + const char* id_preview_resource = "id_preview_resource"; + + enum InfoRole { + TypeRole = Qt::UserRole + 10, + IdRole, + }; + + enum InfoType { + NodeConnectivity = 100, + ElemConnectivity, + }; } // namesapce /*! @@ -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( QString )), this, SLOT( showItemInfo( QString ))); + myIDPreviewCheck->setChecked( SMESHGUI::resourceMgr()->booleanValue( "SMESH", id_preview_resource, false )); + updateSelection(); } @@ -3189,6 +3193,7 @@ void SMESHGUI_MeshInfoDlg::idChanged() void SMESHGUI_MeshInfoDlg::idPreviewChange( bool isOn ) { myIDPreview->SetPointsLabeled( isOn && !myID->text().simplified().isEmpty() ); + SMESHGUI::resourceMgr()->setValue("SMESH", id_preview_resource, isOn ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() ) aViewWindow->Repaint(); } diff --git a/src/SMESH_SWIG/ex29_refine.py b/src/SMESH_SWIG/ex29_refine.py index 938d0eac1..72e0f631a 100644 --- a/src/SMESH_SWIG/ex29_refine.py +++ b/src/SMESH_SWIG/ex29_refine.py @@ -36,8 +36,11 @@ import os # Values # ------ +tmpDir = os.getenv('SALOME_TMP_DIR', '/tmp') +print "Output directory:", tmpDir + # 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 = "Carre" diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index bca7292ff..cda4346fa 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -1100,6 +1100,11 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the // take care of proper association of propagated edges bool same1 = edge1.IsSame( edges1.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 ) { reverseEdges(edges2, nbE); diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index dc418c4f3..64ce054c5 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -1380,11 +1380,12 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& TopoDS_Edge srcE1 = srcEdges.front(), tgtE1 = tgtEdges.front(); TopoDS_Shape srcE1bis = shape2ShapeMap( tgtE1 ); reverse = ( ! srcE1.IsSame( srcE1bis )); - if ( reverse && - //_sourceHypo->HasVertexAssociation() && + if ( ( reverse || srcE1.Orientation() != srcE1bis.Orientation() ) && nbEdgesInWires.front() > 2 && helper.IsRealSeam( tgtEdges.front() )) { + if ( srcE1.Orientation() != srcE1bis.Orientation() ) + reverse = true; // projection to a face with seam EDGE; pb is that GetOrderedEdges() // always puts a seam EDGE first (if possible) and as a result // we can't use only theReverse flag to correctly associate source