Version: 9.12.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, std::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...
 
virtual void GetElementsNearLine (const gp_Ax1 &line, SMDSAbs_ElementType type, std::vector< const SMDS_MeshElement * > &foundElems)
 Return elements possibly intersecting the line. More...
 
virtual void GetElementsInSphere (const gp_XYZ &center, const double radius, SMDSAbs_ElementType type, std::vector< const SMDS_MeshElement * > &foundElems)
 Return elements whose bounding box intersects a sphere. More...
 
virtual void GetElementsInBox (const Bnd_B3d &box, SMDSAbs_ElementType type, std::vector< const SMDS_MeshElement * > &foundElems)
 Return elements whose bounding box intersects a given bounding box. More...
 
virtual gp_XYZ Project (const gp_Pnt &point, SMDSAbs_ElementType type, const SMDS_MeshElement **closestElem)
 Return a projection of a given point to a 2D mesh. 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
 
std::set< const SMDS_MeshElement * > _outerFaces
 

Constructor & Destructor Documentation

◆ SMESH_ElementSearcherImpl()

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

◆ ~SMESH_ElementSearcherImpl()

virtual SMESH_ElementSearcherImpl::~SMESH_ElementSearcherImpl ( )
virtual

Member Function Documentation

◆ FindClosestTo()

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 edge, face and volume search is implemented so far

Implements SMESH_ElementSearcher.

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

◆ FindElementsByPoint()

int SMESH_ElementSearcherImpl::FindElementsByPoint ( const gp_Pnt &  point,
SMDSAbs_ElementType  type,
std::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.

◆ findOuterBoundary()

void SMESH_ElementSearcherImpl::findOuterBoundary ( const SMDS_MeshElement anyOuterFace)

◆ GetElementsInBox()

void SMESH_ElementSearcherImpl::GetElementsInBox ( const Bnd_B3d &  box,
SMDSAbs_ElementType  type,
std::vector< const SMDS_MeshElement * > &  foundElems 
)
virtual

Return elements whose bounding box intersects a given bounding box.

Implements SMESH_ElementSearcher.

References _ebbTree, _elementType, _mesh, _meshPartIt, and getTolerance().

◆ GetElementsInSphere()

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

Return elements whose bounding box intersects a sphere.

Implements SMESH_ElementSearcher.

References _ebbTree, _elementType, _mesh, and _meshPartIt.

◆ GetElementsNearLine()

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

Return elements possibly intersecting the line.

Implements SMESH_ElementSearcher.

References _ebbTree, _elementType, _mesh, and _meshPartIt.

◆ getIntersParamOnLine()

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().

◆ GetPointState()

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

◆ getTolerance()

◆ getTreeHeight()

int SMESH_ElementSearcherImpl::getTreeHeight ( )

References _ebbTree, _ebbTreeHeight, and _elementType.

Referenced by FindClosestTo().

◆ isOuterBoundary()

bool SMESH_ElementSearcherImpl::isOuterBoundary ( const SMDS_MeshElement face) const

References _outerFaces.

Referenced by GetPointState().

◆ Project()

gp_XYZ SMESH_ElementSearcherImpl::Project ( const gp_Pnt &  point,
SMDSAbs_ElementType  type,
const SMDS_MeshElement **  closestFace 
)
virtual

Return a projection of a given point to a 2D mesh.

Optionally return the closest face

Implements SMESH_ElementSearcher.

References _ebbTree, _elementType, _mesh, _meshPartIt, MESHCUT::d, SMESH_MeshAlgos::GetDistance(), SMDS_Mesh::GetMeshInfo(), and SMDS_MeshInfo::NbElements().

Field Documentation

◆ _ebbTree

◆ _ebbTreeHeight

int SMESH_ElementSearcherImpl::_ebbTreeHeight[SMDSAbs_NbElementTypes]

◆ _elementType

◆ _mesh

◆ _meshPartIt

◆ _nodeSearcher

SMESH_NodeSearcherImpl* SMESH_ElementSearcherImpl::_nodeSearcher

◆ _outerFaces

std::set<const SMDS_MeshElement*> SMESH_ElementSearcherImpl::_outerFaces

◆ _outerFacesFound

bool SMESH_ElementSearcherImpl::_outerFacesFound

Referenced by findOuterBoundary(), and GetPointState().

◆ _tolerance

double SMESH_ElementSearcherImpl::_tolerance

Referenced by getTolerance().