Salome HOME
IPAL54104: Wrong prismatic mesh
authoreap <eap@opencascade.com>
Tue, 18 Apr 2017 11:07:52 +0000 (14:07 +0300)
committereap <eap@opencascade.com>
Tue, 18 Apr 2017 11:07:52 +0000 (14:07 +0300)
  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

src/SMESHGUI/SMESHGUI_MeshInfo.cxx
src/SMESH_SWIG/ex29_refine.py
src/StdMeshers/StdMeshers_ProjectionUtils.cxx
src/StdMeshers/StdMeshers_Projection_2D.cxx

index c2932c2032730c788df81e2b55bf9fcdc5a9576f..299ba97c0471bfe536fc50f5de4df9bd6ce99d20 100644 (file)
 
 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();
 }
index 938d0eac100553a1fd32ff368f33b7ba5c5329d3..72e0f631a0faeee7e48106daea43d0edc3cb715c 100644 (file)
@@ -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"
index bca7292ffaed8db11038a0842c70e8762e8d209b..cda4346fa753a7b2fff9e103289998ecf62c6a36 100644 (file)
@@ -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);
index dc418c4f3e9e9d78c85f12cc74655fb72792de82..64ce054c5d9d6a2385c97e980f0d8e6de654156e 100644 (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_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