Version: 8.3.0
SMESH_ElementSearcherImpl Struct Reference
Inheritance diagram for SMESH_ElementSearcherImpl:

Data Structures

struct  TFaceLink
 < link and faces sharing it (used in findOuterBoundary()) More...
 
struct  TInters
 < data of intersection of the line and the mesh face (used in GetPointState()) More...
 

Public Member Functions

 SMESH_ElementSearcherImpl (SMDS_Mesh &mesh, double tol=-1, SMDS_ElemIteratorPtr elemIt=SMDS_ElemIteratorPtr())
 
virtual ~SMESH_ElementSearcherImpl ()
 
virtual int FindElementsByPoint (const gp_Pnt &point, SMDSAbs_ElementType type, vector< const SMDS_MeshElement * > &foundElements)
 Find elements of given type where the given point is IN or ON. More...
 
virtual TopAbs_State GetPointState (const gp_Pnt &point)
 Classify the given point in the closed 2D mesh. More...
 
virtual const SMDS_MeshElementFindClosestTo (const gp_Pnt &point, SMDSAbs_ElementType type)
 Find an element of given type most close to the given point. More...
 
void GetElementsNearLine (const gp_Ax1 &line, SMDSAbs_ElementType type, vector< const SMDS_MeshElement * > &foundElems)
 Return elements possibly intersecting the line. More...
 
void GetElementsInSphere (const gp_XYZ &center, const double radius, SMDSAbs_ElementType type, vector< const SMDS_MeshElement * > &foundElems)
 Return elements whose bounding box intersects a sphere. More...
 
double getTolerance ()
 define tolerance for search More...
 
bool getIntersParamOnLine (const gp_Lin &line, const SMDS_MeshElement *face, const double tolerance, double &param)
 Find intersection of the line and an edge of face and return parameter on line. More...
 
void findOuterBoundary (const SMDS_MeshElement *anyOuterFace)
 Find all faces belonging to the outer boundary of mesh. More...
 
bool isOuterBoundary (const SMDS_MeshElement *face) const
 
int getTreeHeight ()
 

Data Fields

SMDS_Mesh_mesh
 
SMDS_ElemIteratorPtr _meshPartIt
 
ElementBndBoxTree * _ebbTree [SMDSAbs_NbElementTypes]
 
int _ebbTreeHeight [SMDSAbs_NbElementTypes]
 
SMESH_NodeSearcherImpl_nodeSearcher
 
SMDSAbs_ElementType _elementType
 
double _tolerance
 
bool _outerFacesFound
 
set< const SMDS_MeshElement * > _outerFaces
 

Constructor & Destructor Documentation

SMESH_ElementSearcherImpl::SMESH_ElementSearcherImpl ( SMDS_Mesh mesh,
double  tol = -1,
SMDS_ElemIteratorPtr  elemIt = SMDS_ElemIteratorPtr() 
)
virtual SMESH_ElementSearcherImpl::~SMESH_ElementSearcherImpl ( )
virtual

Member Function Documentation

const SMDS_MeshElement * SMESH_ElementSearcherImpl::FindClosestTo ( const gp_Pnt &  point,
SMDSAbs_ElementType  type 
)
virtual

Find an element of given type most close to the given point.

WARNING: Only face search is implemeneted so far

Implements SMESH_ElementSearcher.

References _ebbTree, _elementType, _mesh, _meshPartIt, MESHCUT::d, SMESH_MeshAlgos::GetDistance(), getTreeHeight(), SMDS_MeshElement::NbNodes(), SMDS_MeshElement::nodesIterator(), SMDSAbs_Face, and SMDSAbs_Volume.

int SMESH_ElementSearcherImpl::FindElementsByPoint ( const gp_Pnt &  point,
SMDSAbs_ElementType  type,
vector< const SMDS_MeshElement * > &  foundElements 
)
virtual

Find elements of given type where the given point is IN or ON.

   Returns nb of found elements and elements them-selves.

'ALL' type means elements of any type excluding nodes, balls and 0D elements

Implements SMESH_ElementSearcher.

References _ebbTree, _elementType, _mesh, _meshPartIt, _nodeSearcher, SMESH_NodeSearcherImpl::FindNearPoint(), getTolerance(), SMESH_MeshAlgos::IsOut(), SMDSAbs_0DElement, SMDSAbs_Ball, and SMDSAbs_Node.

void SMESH_ElementSearcherImpl::findOuterBoundary ( const SMDS_MeshElement anyOuterFace)
void SMESH_ElementSearcherImpl::GetElementsInSphere ( const gp_XYZ &  center,
const double  radius,
SMDSAbs_ElementType  type,
vector< const SMDS_MeshElement * > &  foundElems 
)
virtual

Return elements whose bounding box intersects a sphere.

Implements SMESH_ElementSearcher.

References _ebbTree, _elementType, _mesh, and _meshPartIt.

void SMESH_ElementSearcherImpl::GetElementsNearLine ( const gp_Ax1 &  line,
SMDSAbs_ElementType  type,
vector< const SMDS_MeshElement * > &  foundElems 
)
virtual

Return elements possibly intersecting the line.

Implements SMESH_ElementSearcher.

References _ebbTree, _elementType, _mesh, and _meshPartIt.

bool SMESH_ElementSearcherImpl::getIntersParamOnLine ( const gp_Lin &  line,
const SMDS_MeshElement face,
const double  tolerance,
double &  param 
)

Find intersection of the line and an edge of face and return parameter on line.

References SMDS_MeshElement::GetNode(), Handle(), SMDS_MeshElement::IsQuadratic(), and SMDS_MeshElement::NbNodes().

Referenced by GetPointState().

TopAbs_State SMESH_ElementSearcherImpl::GetPointState ( const gp_Pnt &  point)
virtual
int SMESH_ElementSearcherImpl::getTreeHeight ( )

References _ebbTree, _ebbTreeHeight, and _elementType.

Referenced by FindClosestTo().

bool SMESH_ElementSearcherImpl::isOuterBoundary ( const SMDS_MeshElement face) const

References _outerFaces.

Referenced by GetPointState().

Field Documentation

int SMESH_ElementSearcherImpl::_ebbTreeHeight[SMDSAbs_NbElementTypes]
SMESH_NodeSearcherImpl* SMESH_ElementSearcherImpl::_nodeSearcher
set<const SMDS_MeshElement*> SMESH_ElementSearcherImpl::_outerFaces
bool SMESH_ElementSearcherImpl::_outerFacesFound

Referenced by findOuterBoundary(), and GetPointState().

double SMESH_ElementSearcherImpl::_tolerance

Referenced by getTolerance().