SMDS_Mesh* _mesh;
SMDS_ElemIteratorPtr _meshPartIt;
ElementBndBoxTree* _ebbTree;
+ int _ebbTreeHeight;
SMESH_NodeSearcherImpl* _nodeSearcher;
SMDSAbs_ElementType _elementType;
double _tolerance;
SMESH_ElementSearcherImpl( SMDS_Mesh& mesh,
double tol=-1,
SMDS_ElemIteratorPtr elemIt=SMDS_ElemIteratorPtr())
- : _mesh(&mesh),_meshPartIt(elemIt),_ebbTree(0),_nodeSearcher(0),_tolerance(tol),_outerFacesFound(false) {}
+ : _mesh(&mesh),_meshPartIt(elemIt),_ebbTree(0),_ebbTreeHeight(-1),_nodeSearcher(0),_tolerance(tol),_outerFacesFound(false) {}
virtual ~SMESH_ElementSearcherImpl()
{
if ( _ebbTree ) delete _ebbTree; _ebbTree = 0;
{
return _outerFaces.empty() || _outerFaces.count(face);
}
+ int getTreeHeight()
+ {
+ if ( _ebbTreeHeight < 0 )
+ _ebbTreeHeight = _ebbTree->getHeight();
+ return _ebbTreeHeight;
+ }
struct TInters //!< data of intersection of the line and the mesh face (used in GetPointState())
{
if ( _ebbTree->getBox()->IsOut( point.XYZ() ))
radius = point.Distance( boxCenter ) - 0.5 * _ebbTree->maxSize();
if ( radius < 0 )
- radius = _ebbTree->maxSize() / pow( 2., _ebbTree->getHeight()) / 2;
+ radius = _ebbTree->maxSize() / pow( 2., getTreeHeight()) / 2;
while ( suspectElems.empty() )
{
_ebbTree->getElementsInSphere( point.XYZ(), radius, suspectElems );