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
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>
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>
\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
+*/
\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
\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
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
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
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.
\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.
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();
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++ )
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 );
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");
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 );
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 );
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(); )
{
//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 =
pIt1->mySegSize = allowedSize;
}
++pIt1;
- if ( & (*pIt1) == & eData.Last() )
+ if ( pIt1 == pItLast )
avoidPnt = & eData.Last().myP;
else
avoidPnt = NULL;
}
//
// 2. Make pentahedrons
- int aID0, k , aJ[3];
+ int aID0, k , aJ[4];
vector<const SMDS_MeshNode*> aN;
//
SMDS_ElemIteratorPtr itf, aItNodes;
// << " 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;
//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) );