Salome HOME
IPAL52860: Free Edges control mis-location and mis-visibility
authoreap <eap@opencascade.com>
Fri, 4 Sep 2015 13:55:55 +0000 (16:55 +0300)
committereap <eap@opencascade.com>
Fri, 4 Sep 2015 13:55:55 +0000 (16:55 +0300)
IPAL19098: Confusing "Precision" of "Average Length" implemented for NPAL17873

12 files changed:
doc/salome/gui/SMESH/images/free_borders1.png [changed mode: 0755->0644]
doc/salome/gui/SMESH/input/1d_meshing_hypo.doc
doc/salome/gui/SMESH/input/about_quality_controls.doc
doc/salome/gui/SMESH/input/free_borders.doc
doc/salome/gui/SMESH/input/free_edges.doc
doc/salome/gui/SMESH/input/selection_filter_library.doc
src/Controls/SMESH_Controls.cxx
src/SMESHGUI/SMESHGUI.cxx
src/StdMeshers/StdMeshers_Adaptive1D.cxx
src/StdMeshers/StdMeshers_Penta_3D.cxx
src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx

old mode 100755 (executable)
new mode 100644 (file)
index 6e73c93..871beba
Binary files a/doc/salome/gui/SMESH/images/free_borders1.png and b/doc/salome/gui/SMESH/images/free_borders1.png differ
index 336ca5ddd8baad2cca71762f6ae7e765f432e016..a5b54c82c0422fd3d8cbd7e11db971d3edba118b 100644 (file)
@@ -144,12 +144,17 @@ composing your geometrical object. Definition of this hypothesis
 consists of setting the \b length of segments, which will approximate these
 edges, and the \b precision of rounding.
 
-The \b precision parameter is used to round a number of segments,
-calculated by dividing the edge length by the specified \b length of
-segment, to the higher integer if the remainder exceeds the precision
-and to the lower integer otherwise. Use value 0.5 to provide rounding
-to the nearest integer, 1.0 for the lower integer, 0.0 for the higher
-integer. Default value is 1e-07.
+The \b precision parameter is used to round a <em>number of segments</em>,
+calculated by dividing the <em>edge length</em> by the specified \b length of
+segment, to the higher integer if the \a remainder exceeds the \b precision
+and to the lower integer otherwise. <br>
+Use value 0.5 to provide rounding to the nearest integer, 1.0 for the lower integer, 0.0 for the higher integer. Default value is 1e-07.
+
+For example: if <em>edge length</em> is 10.0 and the segment \b length
+is 3.0 then their division gives 10./3. = 3.33(3) and the \a remainder is 0.33(3).
+If \b precision is less than 0.33(3) then the edge is divided into 3 segments.
+If \b precision is more than 0.33(3) then the edge is divided into 4 segments.
+
 
 \image html image41.gif
 
index 1e170e440bd0e15ecf80d7bfdeae228b887845e9..9dbb5c9923cff006424fe84e3a5c4867d98aa570 100644 (file)
@@ -24,7 +24,6 @@ Node quality controls:
 
 Edge quality controls:
 <ul>
-<li>\subpage free_edges_page "Free edges"</li>
 <li>\subpage free_borders_page "Free borders"</li>
 <li>\subpage length_page "Length"</li>
 <li>\subpage borders_at_multi_connection_page "Borders at multi-connection"</li>
@@ -33,6 +32,7 @@ Edge quality controls:
 
 Face quality controls:
 <ul>
+<li>\subpage free_edges_page "Free edges"</li>
 <li>\subpage free_faces_page "Free faces"</li>
 <li>\subpage bare_border_faces_page "Bare border faces"</li>
 <li>\subpage over_constrained_faces_page "Over-constrained faces"</li>
index 86e5e2a372d170d2b3b8bca208c9211d9f958970..3a8497c3047274f167b85acfabbff0cd567c4044 100644 (file)
@@ -2,14 +2,16 @@
 
 \page free_borders_page Free borders
 
-\n This mesh quality control highlights borders of faces consisting of
-1D elements (segments) belonging to one face only.
+\n This mesh quality control highlights 1D elements (segments)
+belonging to one element (face or volume) only.
 
 \image html free_borders1.png
 
-In this picture the free borders are displayed in white.
+In this picture the free borders are displayed in red. (Faces are
+explicitly shown via <em>Display Entity</em> menu as all elements but
+segments are hidden upon this control activation).
 
 <br><b>See Also</b> a sample TUI Script of a 
 \ref tui_free_borders "Free Borders quality control" operation.  
 
-*/
\ No newline at end of file
+*/
index 1a5720ee2fd121ceef9ed79ff99cca91d7ab52e9..2e9d4a6ecfce814aff2c25ace9e0a5c2e76df89d 100644 (file)
@@ -3,7 +3,7 @@
 \page free_edges_page Free edges
 
 \n This mesh quality control highlights borders of faces
-consisting of node links belonging to one face only.
+(links between nodes, not mesh segments) belonging to one face only.
 
 \image html free_edges.png
 <center>In this picture some elements of mesh have been deleted and
index ed93878cbdb5e648653476f184b666f617d38ea7..6acd7e751aa1fdd0404c6fa2c50785d0e2d6a856 100644 (file)
@@ -2,9 +2,11 @@
 
 \page selection_filter_library_page Selection filter library
 
-\n Selection filter library is a powerful tool enabling to create
-filters to be used on meshes. You can access to it from the Main Menu
-via <b>Tools / Selection filter library</b>.
+\n Selection filter library allows creating and storing in files
+filters that can be later reused for operations on meshes. You can
+access to it from the Main Menu via <b>Tools / Selection filter library</b>.
+It is also possible to save any filter by invoking the filter library
+from \a Filter dialog launched from any mesh operation.
 
 \image html selectionfilterlibrary.png
 
@@ -20,7 +22,9 @@ filter. By default it is prefixed with the corresponding entity type.
 
 When we use filters during a group creation or another operation (by 
 clicking <b>Set Filter</b> button in the corresponding dialog), the
-menu for setting filters looks as shown below.
+dialog for setting filters looks as shown below.
+
+\image html a-filteronfaces.png
 
 The \b Add button creates a new criterion at the end of the list of
 criteria. The \b Insert button creates a new criterion before the
@@ -56,8 +60,6 @@ in the Library.
 is no selected mesh in the Object Browser and the filter can not be
 created. You have to select the mesh and the button will be enabled.
 
-\image html a-filteronfaces.png
-
 Some criteria are applicable to all <b>Entity types</b>:
 <ul><li>
 <b>Belong to Geom</b> selects entities whose all nodes lie on the
@@ -133,7 +135,7 @@ See also \ref tui_double_nodes_control "Double Nodes quality control".
 The following criteria allow selecting mesh <b>Edges</b>:
 <ul><li>
 <b>Free Borders</b> selects free 1D mesh elements, i.e. edges belonging to 
-one face only. See also a
+one element (face or volume) only. See also a
 \ref free_borders_page "Free Borders quality control".
 </li><li>
 <b>Double edges</b> selects 1D mesh elements basing on the same set of nodes.
@@ -177,8 +179,8 @@ The following criteria allow selecting mesh <b>Faces</b>:
 \ref area_page "Area quality control"), which is more, less or equal (within a given
 <b>Tolerance</b>) to the predefined <b>Threshold Value</b>.
 </li><li>
-<b>Free edges</b> selects 2D mesh elements consisting of edges belonging to 
-one element of mesh only. See also a
+<b>Free edges</b> selects 2D mesh elements having at least one of its
+edges not shared with other faces. See also a
 \ref free_edges_page "Free Edges quality control".
 </li><li>
 <b>Free faces</b> selects 2D mesh elements, which belong to less than two volumes.
index c70528f279b3217a6b56f15a13edecac5c20f051..65ff05b9b3be6fd38e2e3f66580d831a37023cfd 100644 (file)
@@ -135,8 +135,8 @@ namespace {
     int aResult0 = 0, aResult1 = 0;
      // last node, it is a medium one in a quadratic edge
     const SMDS_MeshNode* aLastNode = anEdge->GetNode( anEdge->NbNodes() - 1 );
-    const SMDS_MeshNode* aNode0 = anEdge->GetNode( 0 );
-    const SMDS_MeshNode* aNode1 = anEdge->GetNode( 1 );
+    const SMDS_MeshNode*    aNode0 = anEdge->GetNode( 0 );
+    const SMDS_MeshNode*    aNode1 = anEdge->GetNode( 1 );
     if ( aNode1 == aLastNode ) aNode1 = 0;
 
     SMDS_ElemIteratorPtr anElemIter = aLastNode->GetInverseElementIterator();
@@ -2429,26 +2429,15 @@ bool FreeEdges::IsSatisfy( long theId )
   if ( aFace == 0 || aFace->GetType() != SMDSAbs_Face || aFace->NbNodes() < 3 )
     return false;
 
-  SMDS_ElemIteratorPtr anIter;
-  if ( aFace->IsQuadratic() ) {
-    anIter = dynamic_cast<const SMDS_VtkFace*>
-      (aFace)->interlacedNodesElemIterator();
-  }
-  else {
-    anIter = aFace->nodesIterator();
-  }
+  SMDS_NodeIteratorPtr anIter = aFace->interlacedNodesIterator();
   if ( !anIter )
     return false;
 
   int i = 0, nbNodes = aFace->NbNodes();
   std::vector <const SMDS_MeshNode*> aNodes( nbNodes+1 );
   while( anIter->more() )
-  {
-    const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
-    if ( aNode == 0 )
+    if ( ! ( aNodes[ i++ ] = anIter->next() ))
       return false;
-    aNodes[ i++ ] = aNode;
-  }
   aNodes[ nbNodes ] = aNodes[ 0 ];
 
   for ( i = 0; i < nbNodes; i++ )
index 6271fe8570a99a698d10945294a6dcfabc680713..4b0c895ed4aab0c1e1cb28bdd32064d036cc1f5c 100644 (file)
@@ -1677,7 +1677,7 @@ namespace
         if(!anIO.IsNull()){
           _PTR(SObject) SO = aStudy->FindObjectID( It.Value()->getEntry() );
           if ( SO ) {
-            CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
+            CORBA::Object_var           aObject = SMESH::SObjectToObject( SO );
             SMESH::SMESH_Mesh_var      aMesh    = SMESH::SMESH_Mesh::_narrow( aObject );
             SMESH::SMESH_subMesh_var   aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject );
             SMESH::SMESH_GroupBase_var aGroup   = SMESH::SMESH_GroupBase::_narrow( aObject );
@@ -4366,7 +4366,8 @@ void SMESHGUI::initialize( CAM_Application* app )
     hasElems0d("({'Elem0d'} in elemTypes)"),
     hasEdges("({'Edge'} in elemTypes)"),
     hasFaces("({'Face'} in elemTypes)"),
-    hasVolumes("({'Volume'} in elemTypes)");
+    hasVolumes("({'Volume'} in elemTypes)"),
+    hasFacesOrVolumes("(({'Face'} in elemTypes) || ({'Volume'} in elemTypes)) ");
 
   createPopupItem( SMESHOp::OpFileInformation,      OB, mesh, "&& selcount=1 && isImported" );
   createPopupItem( SMESHOp::OpCreateSubMesh,        OB, mesh, "&& isComputable");
@@ -4577,12 +4578,8 @@ void SMESHGUI::initialize( CAM_Application* app )
 
   aSubId = popupMgr()->insert( tr( "MEN_EDGE_CTRL" ), anId, -1 ); // EDGE CONTROLS
 
-  popupMgr()->insert( action( SMESHOp::OpFreeEdge ), aSubId, -1 );
-  popupMgr()->setRule( action( SMESHOp::OpFreeEdge ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
-  popupMgr()->setRule( action( SMESHOp::OpFreeEdge ), "controlMode = 'eFreeEdges'", QtxPopupMgr::ToggleRule );
-
   popupMgr()->insert( action( SMESHOp::OpFreeBorder ), aSubId, -1 );
-  popupMgr()->setRule( action( SMESHOp::OpFreeBorder ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
+  popupMgr()->setRule( action( SMESHOp::OpFreeBorder ), aMeshInVTK + "&&" + hasEdges + "&&" + hasFacesOrVolumes, QtxPopupMgr::VisibleRule );
   popupMgr()->setRule( action( SMESHOp::OpFreeBorder ), "controlMode = 'eFreeBorders'", QtxPopupMgr::ToggleRule );
 
   popupMgr()->insert( action( SMESHOp::OpLength ), aSubId, -1 );
@@ -4598,6 +4595,10 @@ void SMESHGUI::initialize( CAM_Application* app )
 
   aSubId = popupMgr()->insert( tr( "MEN_FACE_CTRL" ), anId, -1 ); // FACE CONTROLS
 
+  popupMgr()->insert( action( SMESHOp::OpFreeEdge ), aSubId, -1 );
+  popupMgr()->setRule( action( SMESHOp::OpFreeEdge ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+  popupMgr()->setRule( action( SMESHOp::OpFreeEdge ), "controlMode = 'eFreeEdges'", QtxPopupMgr::ToggleRule );
+
   popupMgr()->insert ( action( SMESHOp::OpFreeFace ), aSubId, -1 );
   popupMgr()->setRule( action( SMESHOp::OpFreeFace ), aMeshInVtkHasFaces /*aMeshInVtkHasVolumes*/,
                                        QtxPopupMgr::VisibleRule );
index 45e22ebb3fc23e654e35e05b63b96608f974025a..946c200df7c2343ba9436b324580d40fb3dba664 100644 (file)
@@ -1260,7 +1260,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
         double maxSegSize = 0;
 
         // get points to check distance to the face
-        EdgeData::TPntIter pIt2 = eData.myPoints.begin(), pIt1 = pIt2++;
+        EdgeData::TPntIter pIt2 = eData.myPoints.begin(), pIt1 = pIt2++, pItLast;
         maxSegSize = pIt1->mySegSize = Min( pIt1->mySegSize, sizeTree.GetSize( pIt1->myP ));
         for ( ; pIt2 != eData.myPoints.end(); )
         {
@@ -1290,6 +1290,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
         //cout << "E " << theMesh.GetMeshDS()->ShapeToIndex( eData.Edge() ) << endl;
         sizeDecreased = false;
         const gp_Pnt* avoidPnt = & eData.First().myP;
+        pItLast = --eData.myPoints.end();
         for ( pIt1 = eData.myPoints.begin(); pIt1 != eData.myPoints.end();  )
         {
           double distToFace =
@@ -1316,7 +1317,7 @@ bool AdaptiveAlgo::Compute(SMESH_Mesh &         theMesh,
             pIt1->mySegSize = allowedSize;
           }
           ++pIt1;
-          if ( & (*pIt1) == & eData.Last() )
+          if ( pIt1 == pItLast )
             avoidPnt = & eData.Last().myP;
           else
             avoidPnt = NULL;
index 20f1ff59d51a6c77758e4bbb66e03a30fc098a0c..6d99a44de3a3ef1a2e3f19bf12a2f1d08d480af7 100644 (file)
@@ -657,7 +657,7 @@ void StdMeshers_Penta_3D::MakeVolumeMesh()
   }
   //
   // 2. Make pentahedrons
-  int aID0, k , aJ[3];
+  int aID0, k , aJ[4];
   vector<const SMDS_MeshNode*> aN;
   //
   SMDS_ElemIteratorPtr itf, aItNodes;
index 4cd7ccf9a690767b6d8a1125a11afb7cefcb6971..1e35cb60b40d4393f8844ca4b2e66d7ee18d68bd 100644 (file)
@@ -5072,8 +5072,10 @@ int StdMeshers_Quadrangle_2D::splitQuad(FaceQuadStruct::Ptr quad, int I, int J)
     //      << " L " << &quad->side[ QUAD_LEFT_SIDE ] << " "<< quad->side[ QUAD_LEFT_SIDE].NbPoints()
     //      << " R " << &quad->side[ QUAD_RIGHT_SIDE ]  << " "<< quad->side[ QUAD_RIGHT_SIDE].NbPoints()<< endl;
 
-    newQuad->side[ QUAD_RIGHT_SIDE ].to = iRgt+1;
-    newQuad->side[ QUAD_LEFT_SIDE  ].to = iLft+1;
+    bool rRev = newQuad->side[ QUAD_RIGHT_SIDE ].IsReversed();
+    bool lRev = newQuad->side[ QUAD_LEFT_SIDE  ].IsReversed();
+    newQuad->side[ QUAD_RIGHT_SIDE ].to = iRgt + ( rRev ? -1 : +1 );
+    newQuad->side[ QUAD_LEFT_SIDE  ].to = iLft + ( lRev ? -1 : +1 );
     newQuad->name = ( TComm("Below J=") << J );
 
     quad->side[ QUAD_RIGHT_SIDE ].from = iRgt;
index 204682ea9180c9a3a2c966fe5fcdc82f945cb131..03395bd108806aa396c50e9fd5909e31afeefa6b 100644 (file)
@@ -930,8 +930,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh&         aMesh,
   //cout<<"Angles.Length() = "<<Angles.Length()<<"   Points.Length() = "<<Points.Length()<<endl;
   //cout<<"Nodes1.size() = "<<Nodes1.size()<<"   Pnts2d1.Length() = "<<Pnts2d1.Length()<<endl;
   for(; i<Angles.Length(); i++) {
-    vector< const SMDS_MeshNode* > tmpNodes;
-    tmpNodes.reserve(Nodes1.size());
+    vector< const SMDS_MeshNode* > tmpNodes(Nodes1.size());
     gp_Trsf aTrsf;
     gp_Ax1 theAxis(P0,gp_Dir(Axis));
     aTrsf.SetRotation( theAxis, Angles.Value(i) );