diff --git a/doc/salome/gui/SMESH/images/free_borders1.png b/doc/salome/gui/SMESH/images/free_borders1.png
old mode 100755
new mode 100644
index 6e73c9329..871beba86
Binary files a/doc/salome/gui/SMESH/images/free_borders1.png and b/doc/salome/gui/SMESH/images/free_borders1.png differ
diff --git a/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc b/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc
index 336ca5ddd..a5b54c82c 100644
--- a/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc
+++ b/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc
@@ -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 number of segments,
+calculated by dividing the edge length 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.
+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 edge length 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
diff --git a/doc/salome/gui/SMESH/input/about_quality_controls.doc b/doc/salome/gui/SMESH/input/about_quality_controls.doc
index 1e170e440..9dbb5c992 100644
--- a/doc/salome/gui/SMESH/input/about_quality_controls.doc
+++ b/doc/salome/gui/SMESH/input/about_quality_controls.doc
@@ -24,7 +24,6 @@ Node quality controls:
Edge quality controls:
-- \subpage free_edges_page "Free edges"
- \subpage free_borders_page "Free borders"
- \subpage length_page "Length"
- \subpage borders_at_multi_connection_page "Borders at multi-connection"
@@ -33,6 +32,7 @@ Edge quality controls:
Face quality controls:
+- \subpage free_edges_page "Free edges"
- \subpage free_faces_page "Free faces"
- \subpage bare_border_faces_page "Bare border faces"
- \subpage over_constrained_faces_page "Over-constrained faces"
diff --git a/doc/salome/gui/SMESH/input/free_borders.doc b/doc/salome/gui/SMESH/input/free_borders.doc
index 86e5e2a37..3a8497c30 100644
--- a/doc/salome/gui/SMESH/input/free_borders.doc
+++ b/doc/salome/gui/SMESH/input/free_borders.doc
@@ -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 Display Entity menu as all elements but
+segments are hidden upon this control activation).
See Also a sample TUI Script of a
\ref tui_free_borders "Free Borders quality control" operation.
-*/
\ No newline at end of file
+*/
diff --git a/doc/salome/gui/SMESH/input/free_edges.doc b/doc/salome/gui/SMESH/input/free_edges.doc
index 1a5720ee2..2e9d4a6ec 100644
--- a/doc/salome/gui/SMESH/input/free_edges.doc
+++ b/doc/salome/gui/SMESH/input/free_edges.doc
@@ -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
In this picture some elements of mesh have been deleted and
diff --git a/doc/salome/gui/SMESH/input/selection_filter_library.doc b/doc/salome/gui/SMESH/input/selection_filter_library.doc
index ed93878cb..6acd7e751 100644
--- a/doc/salome/gui/SMESH/input/selection_filter_library.doc
+++ b/doc/salome/gui/SMESH/input/selection_filter_library.doc
@@ -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 Tools / Selection filter library.
+\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 Tools / Selection filter library.
+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 Set Filter 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 Entity types:
-
Belong to Geom 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 Edges:
-
Free Borders 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".
-
Double edges selects 1D mesh elements basing on the same set of nodes.
@@ -177,8 +179,8 @@ The following criteria allow selecting mesh Faces:
\ref area_page "Area quality control"), which is more, less or equal (within a given
Tolerance) to the predefined Threshold Value.
-
-Free edges selects 2D mesh elements consisting of edges belonging to
-one element of mesh only. See also a
+Free edges 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".
-
Free faces selects 2D mesh elements, which belong to less than two volumes.
diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx
index c70528f27..65ff05b9b 100644
--- a/src/Controls/SMESH_Controls.cxx
+++ b/src/Controls/SMESH_Controls.cxx
@@ -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
- (aFace)->interlacedNodesElemIterator();
- }
- else {
- anIter = aFace->nodesIterator();
- }
+ SMDS_NodeIteratorPtr anIter = aFace->interlacedNodesIterator();
if ( !anIter )
return false;
int i = 0, nbNodes = aFace->NbNodes();
std::vector 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++ )
diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx
index 6271fe857..4b0c895ed 100644
--- a/src/SMESHGUI/SMESHGUI.cxx
+++ b/src/SMESHGUI/SMESHGUI.cxx
@@ -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 );
diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.cxx b/src/StdMeshers/StdMeshers_Adaptive1D.cxx
index 45e22ebb3..946c200df 100644
--- a/src/StdMeshers/StdMeshers_Adaptive1D.cxx
+++ b/src/StdMeshers/StdMeshers_Adaptive1D.cxx
@@ -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;
diff --git a/src/StdMeshers/StdMeshers_Penta_3D.cxx b/src/StdMeshers/StdMeshers_Penta_3D.cxx
index 20f1ff59d..6d99a44de 100644
--- a/src/StdMeshers/StdMeshers_Penta_3D.cxx
+++ b/src/StdMeshers/StdMeshers_Penta_3D.cxx
@@ -657,7 +657,7 @@ void StdMeshers_Penta_3D::MakeVolumeMesh()
}
//
// 2. Make pentahedrons
- int aID0, k , aJ[3];
+ int aID0, k , aJ[4];
vector aN;
//
SMDS_ElemIteratorPtr itf, aItNodes;
diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
index 4cd7ccf9a..1e35cb60b 100644
--- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
+++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
@@ -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;
diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
index 204682ea9..03395bd10 100644
--- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
+++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
@@ -930,8 +930,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh,
//cout<<"Angles.Length() = "< 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) );