#include "SMESH_Comment.hxx"
#include "SMESH_ComputeError.hxx"
#include "SMESH_Mesh.hxx"
+#include "SMESH_MeshAlgos.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
//
TIDSortedElemSet emptySet, avoidSet;
avoidSet.insert( firstQuad );
- firstQuad = SMESH_MeshEditor::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
+ firstQuad = SMESH_MeshAlgos::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
while ( firstQuad && !faceSubMesh->Contains( firstQuad )) {
avoidSet.insert( firstQuad );
- firstQuad = SMESH_MeshEditor::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
+ firstQuad = SMESH_MeshAlgos::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
}
if ( !firstQuad || !faceSubMesh->Contains( firstQuad ))
return error(ERR_LI("Error in _QuadFaceGrid::LoadGrid()"));
{
// next face
avoidSet.clear(); avoidSet.insert( quad );
- quad = SMESH_MeshEditor::FindFaceInSet( n1down, n1up, emptySet, avoidSet );
+ quad = SMESH_MeshAlgos::FindFaceInSet( n1down, n1up, emptySet, avoidSet );
if ( !quad || quad->NbNodes() % 4 > 0)
return error(ERR_LI("Error in _QuadFaceGrid::LoadGrid()"));
#include "SMDS_VolumeOfNodes.hxx"
#include "SMDS_VolumeTool.hxx"
#include "SMESH_Block.hxx"
+#include "SMESH_MeshAlgos.hxx"
#include "SMESH_MesherHelper.hxx"
#include <gp_Ax2.hxx>
-//#include "utilities.h"
#include <limits>
// Define error message and _MYDEBUG_ if needed
const SMDS_MeshNode* n1down = side.getNode( 0, y-1 );
const SMDS_MeshNode* n2down = side.getNode( 1, y-1 );
avoidSet.clear(); avoidSet.insert( firstQuad );
- firstQuad = SMESH_MeshEditor::FindFaceInSet( n1down, n2down, emptySet, avoidSet,
+ firstQuad = SMESH_MeshAlgos::FindFaceInSet( n1down, n2down, emptySet, avoidSet,
&i1down, &i2down);
if ( !isQuadrangle( firstQuad ))
return BAD_MESH_ERR;
x = 1;
while ( ++x < nbX )
{
- const SMDS_MeshElement* quad = SMESH_MeshEditor::FindFaceInSet( n2up, n2down, emptySet,
+ const SMDS_MeshElement* quad = SMESH_MeshAlgos::FindFaceInSet( n2up, n2down, emptySet,
avoidSet, &i2up, &i2down);
if ( !isQuadrangle( quad ))
return BAD_MESH_ERR;
while ( !isCornerNode( n2 ) )
{
avoidSet.clear(); avoidSet.insert( quad );
- quad = SMESH_MeshEditor::FindFaceInSet( n1, n2, emptySet, avoidSet, &i1, &i2 );
+ quad = SMESH_MeshAlgos::FindFaceInSet( n1, n2, emptySet, avoidSet, &i1, &i2 );
if ( !isQuadrangle( quad ))
return BAD_MESH_ERR;
#include "SMDS_VolumeOfNodes.hxx"
#include "SMDS_VolumeTool.hxx"
#include "SMESHDS_SubMesh.hxx"
+#include "SMESH_Comment.hxx"
#include "SMESH_Mesh.hxx"
+#include "SMESH_MeshAlgos.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_subMeshEventListener.hxx"
-#include "SMESH_Comment.hxx"
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
const SMDS_MeshElement* face = 0;
do {
// look for a face by 2 nodes
- face = SMESH_MeshEditor::FindFaceInSet( n1, n2, allFaces, foundFaces );
+ face = SMESH_MeshAlgos::FindFaceInSet( n1, n2, allFaces, foundFaces );
if ( face ) {
int nbFaceNodes = face->NbNodes();
if ( (!myCreateQuadratic && nbFaceNodes>4) ||
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_subMeshEventListener.hxx"
+#include "SMESH_MeshAlgos.hxx"
#include "utilities.h"
TIDSortedElemSet inSet, notInSet;
const SMDS_MeshElement* f1 =
- SMESH_MeshEditor::FindFaceInSet( vNode, eNode, inSet, notInSet );
+ SMESH_MeshAlgos::FindFaceInSet( vNode, eNode, inSet, notInSet );
if ( !f1 ) RETURN_BAD_RESULT("The first face on seam not found");
notInSet.insert( f1 );
const SMDS_MeshElement* f2 =
- SMESH_MeshEditor::FindFaceInSet( vNode, eNode, inSet, notInSet );
+ SMESH_MeshAlgos::FindFaceInSet( vNode, eNode, inSet, notInSet );
if ( !f2 ) RETURN_BAD_RESULT("The second face on seam not found");
// select a face with less UV of vNode
for ( int i = 0; i < nbNodes; ++i ) {
const SMDS_MeshNode* n1 = faceToKeep->GetNode( i );
const SMDS_MeshNode* n2 = faceToKeep->GetNode(( i+1 ) % nbNodes );
- f1 = SMESH_MeshEditor::FindFaceInSet( n1, n2, inSet, notInSet );
+ f1 = SMESH_MeshAlgos::FindFaceInSet( n1, n2, inSet, notInSet );
if ( f1 )
elems.insert( f1 );
}
#include "SMDS_SetIterator.hxx"
+#include "SMESHDS_GroupBase.hxx"
#include "SMESH_Algo.hxx"
-#include "SMESH_MesherHelper.hxx"
#include "SMESH_Group.hxx"
-#include "SMESHDS_GroupBase.hxx"
+#include "SMESH_MeshAlgos.hxx"
+#include "SMESH_MesherHelper.hxx"
#include <IntAna_IntConicQuad.hxx>
#include <IntAna_Quadric.hxx>
TIDSortedElemSet emptySet, avoidSet;
int i1, i2;
while ( const SMDS_MeshElement* f =
- SMESH_MeshEditor::FindFaceInSet( baseNodes[0], baseNodes[1],
- emptySet, avoidSet, &i1, &i2 ))
+ SMESH_MeshAlgos::FindFaceInSet( baseNodes[0], baseNodes[1],
+ emptySet, avoidSet, &i1, &i2 ))
{
avoidSet.insert( f );
const SMDS_MeshElement* NotCheckedFace)
{
if ( !myElemSearcher )
- myElemSearcher = SMESH_MeshEditor(&aMesh).GetElementSearcher();
+ myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *aMesh.GetMeshDS() );
SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
//SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
if ( myElemSearcher ) delete myElemSearcher;
if ( aProxyMesh )
- myElemSearcher = SMESH_MeshEditor(&aMesh).GetElementSearcher( aProxyMesh->GetFaces(aShape));
+ myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS, aProxyMesh->GetFaces(aShape));
else
- myElemSearcher = SMESH_MeshEditor(&aMesh).GetElementSearcher();
+ myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
const SMESHDS_SubMesh * aSubMeshDSFace;
Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5);
delete myElemSearcher;
myElemSearcher =
- SMESH_MeshEditor(&aMesh).GetElementSearcher( aProxyMesh->GetFaces(aShape));
+ SMESH_MeshAlgos::GetElementSearcher( *meshDS, aProxyMesh->GetFaces(aShape));
}
}
}
helper.IsQuadraticSubMesh(aMesh.GetShapeToMesh());
helper.SetElementsOnShape( true );
- if ( !myElemSearcher )
- myElemSearcher = SMESH_MeshEditor(&aMesh).GetElementSearcher();
- SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
-
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
SMESH_ProxyMesh::SubMesh* prxSubMesh = getProxySubMesh();
+ if ( !myElemSearcher )
+ myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
+ SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
+
SMDS_FaceIteratorPtr fIt = meshDS->facesIterator(/*idInceasingOrder=*/true);
while( fIt->more())
{
// if the face belong to the group of skinFaces, do not build a pyramid outside
if (groupDS && groupDS->Contains(face))
+ {
intersected[0] = false;
+ }
+ else if ( intersected[0] && intersected[1] ) // check if one of pyramids is in a hole
+ {
+ gp_Pnt P ( PC.XYZ() + tmpDir.XYZ() * 0.5 * PC.Distance( intPnt[0] ));
+ if ( searcher->GetPointState( P ) == TopAbs_OUT )
+ intersected[0] = false;
+ else
+ {
+ P = ( PC.XYZ() - tmpDir.XYZ() * 0.5 * PC.Distance( intPnt[1] ));
+ if ( searcher->GetPointState( P ) == TopAbs_OUT )
+ intersected[1] = false;
+ }
+ }
// Create one or two pyramids
int i, j, k, myShapeID = myPyramids[0]->GetNode(4)->getshapeId();
if ( myElemSearcher ) delete myElemSearcher;
- myElemSearcher = SMESH_MeshEditor(&aMesh).GetElementSearcher();
+ myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
set<const SMDS_MeshNode*> nodesToMove;
while ( vIt->more() )
{
const SMDS_MeshElement* PrmJ = vIt->next();
- if ( SMESH_Algo::GetCommonNodes( PrmI, PrmJ ).size() > 1 )
+ if ( SMESH_MeshAlgos::GetCommonNodes( PrmI, PrmJ ).size() > 1 )
checkedPyrams.insert( PrmJ );
}
}
#include "SMESH_Gen.hxx"
#include "SMESH_Group.hxx"
#include "SMESH_Mesh.hxx"
+#include "SMESH_MeshAlgos.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_ProxyMesh.hxx"
#include "SMESH_subMesh.hxx"
// Limit inflation step size by geometry size found by itersecting
// normals of _LayerEdge's with mesh faces
double geomSize = Precision::Infinite(), intersecDist;
- SMESH_MeshEditor editor( _mesh );
auto_ptr<SMESH_ElementSearcher> searcher
- ( editor.GetElementSearcher( data._proxyMesh->GetFaces( data._solid )) );
+ ( SMESH_MeshAlgos::GetElementSearcher( *getMeshDS(),
+ data._proxyMesh->GetFaces( data._solid )) );
for ( unsigned i = 0; i < data._edges.size(); ++i )
{
if ( data._edges[i]->IsOnEdge() ) continue;
// Check if the last segments of _LayerEdge intersects 2D elements;
// checked elements are either temporary faces or faces on surfaces w/o the layers
- SMESH_MeshEditor editor( _mesh );
auto_ptr<SMESH_ElementSearcher> searcher
- ( editor.GetElementSearcher( data._proxyMesh->GetFaces( data._solid )) );
+ ( SMESH_MeshAlgos::GetElementSearcher( *getMeshDS(),
+ data._proxyMesh->GetFaces( data._solid )) );
distToIntersection = Precision::Infinite();
double dist;
// 1) to find and fix intersection
// 2) to check that no new intersection appears as result of 1)
- SMESH_MeshEditor editor( _mesh );
SMDS_ElemIteratorPtr fIt( new SMDS_ElementVectorIterator( tmpFaces.begin(),
tmpFaces.end()));
- auto_ptr<SMESH_ElementSearcher> searcher ( editor.GetElementSearcher( fIt ));
+ auto_ptr<SMESH_ElementSearcher> searcher
+ ( SMESH_MeshAlgos::GetElementSearcher( *getMeshDS(), fIt ));
// 1) Find intersections
double dist;
const SMDS_MeshNode* n1 = badTrias[iTia]->GetNode( iSide );
const SMDS_MeshNode* n2 = badTrias[iTia]->GetNode(( iSide+1 ) % 3 );
trias [iSide].first = badTrias[iTia];
- trias [iSide].second = SMESH_MeshEditor::FindFaceInSet( n1, n2, emptySet, involvedFaces,
- & i1, & i2 );
+ trias [iSide].second = SMESH_MeshAlgos::FindFaceInSet( n1, n2, emptySet, involvedFaces,
+ & i1, & i2 );
if ( ! trias[iSide].second || trias[iSide].second->NbCornerNodes() != 3 )
continue;