mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-15 21:21:21 +05:00
0020832: EDF 1359 SMESH : Automatic meshing of boundary layers
make SMESH_ElementSearcher work on a sub-set of elements
This commit is contained in:
parent
c0b03d98ac
commit
121d45ed88
@ -6296,7 +6296,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ElementBndBoxTree(const SMDS_Mesh& mesh, SMDSAbs_ElementType elemType, double tolerance = NodeRadius );
|
ElementBndBoxTree(const SMDS_Mesh& mesh, SMDSAbs_ElementType elemType, SMDS_ElemIteratorPtr theElemIt = SMDS_ElemIteratorPtr(), double tolerance = NodeRadius );
|
||||||
void getElementsNearPoint( const gp_Pnt& point, TIDSortedElemSet& foundElems);
|
void getElementsNearPoint( const gp_Pnt& point, TIDSortedElemSet& foundElems);
|
||||||
void getElementsNearLine ( const gp_Ax1& line, TIDSortedElemSet& foundElems);
|
void getElementsNearLine ( const gp_Ax1& line, TIDSortedElemSet& foundElems);
|
||||||
~ElementBndBoxTree();
|
~ElementBndBoxTree();
|
||||||
@ -6323,13 +6323,13 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
ElementBndBoxTree::ElementBndBoxTree(const SMDS_Mesh& mesh, SMDSAbs_ElementType elemType, double tolerance)
|
ElementBndBoxTree::ElementBndBoxTree(const SMDS_Mesh& mesh, SMDSAbs_ElementType elemType, SMDS_ElemIteratorPtr theElemIt, double tolerance)
|
||||||
:SMESH_Octree( new SMESH_Octree::Limit( MaxLevel, /*minSize=*/0. ))
|
:SMESH_Octree( new SMESH_Octree::Limit( MaxLevel, /*minSize=*/0. ))
|
||||||
{
|
{
|
||||||
int nbElems = mesh.GetMeshInfo().NbElements( elemType );
|
int nbElems = mesh.GetMeshInfo().NbElements( elemType );
|
||||||
_elements.reserve( nbElems );
|
_elements.reserve( nbElems );
|
||||||
|
|
||||||
SMDS_ElemIteratorPtr elemIt = mesh.elementsIterator( elemType );
|
SMDS_ElemIteratorPtr elemIt = theElemIt ? theElemIt : mesh.elementsIterator( elemType );
|
||||||
while ( elemIt->more() )
|
while ( elemIt->more() )
|
||||||
_elements.push_back( new ElementBox( elemIt->next(),tolerance ));
|
_elements.push_back( new ElementBox( elemIt->next(),tolerance ));
|
||||||
|
|
||||||
@ -6477,6 +6477,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
|
|||||||
struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher
|
struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher
|
||||||
{
|
{
|
||||||
SMESHDS_Mesh* _mesh;
|
SMESHDS_Mesh* _mesh;
|
||||||
|
SMDS_ElemIteratorPtr _meshPartIt;
|
||||||
ElementBndBoxTree* _ebbTree;
|
ElementBndBoxTree* _ebbTree;
|
||||||
SMESH_NodeSearcherImpl* _nodeSearcher;
|
SMESH_NodeSearcherImpl* _nodeSearcher;
|
||||||
SMDSAbs_ElementType _elementType;
|
SMDSAbs_ElementType _elementType;
|
||||||
@ -6484,8 +6485,8 @@ struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher
|
|||||||
bool _outerFacesFound;
|
bool _outerFacesFound;
|
||||||
set<const SMDS_MeshElement*> _outerFaces; // empty means "no internal faces at all"
|
set<const SMDS_MeshElement*> _outerFaces; // empty means "no internal faces at all"
|
||||||
|
|
||||||
SMESH_ElementSearcherImpl( SMESHDS_Mesh& mesh )
|
SMESH_ElementSearcherImpl( SMESHDS_Mesh& mesh, SMDS_ElemIteratorPtr elemIt=SMDS_ElemIteratorPtr())
|
||||||
: _mesh(&mesh),_ebbTree(0),_nodeSearcher(0), _tolerance(-1), _outerFacesFound(false) {}
|
: _mesh(&mesh),_meshPartIt(elemIt),_ebbTree(0),_nodeSearcher(0),_tolerance(-1),_outerFacesFound(false) {}
|
||||||
~SMESH_ElementSearcherImpl()
|
~SMESH_ElementSearcherImpl()
|
||||||
{
|
{
|
||||||
if ( _ebbTree ) delete _ebbTree; _ebbTree = 0;
|
if ( _ebbTree ) delete _ebbTree; _ebbTree = 0;
|
||||||
@ -6773,7 +6774,7 @@ FindElementsByPoint(const gp_Pnt& point,
|
|||||||
if ( !_ebbTree || _elementType != type )
|
if ( !_ebbTree || _elementType != type )
|
||||||
{
|
{
|
||||||
if ( _ebbTree ) delete _ebbTree;
|
if ( _ebbTree ) delete _ebbTree;
|
||||||
_ebbTree = new ElementBndBoxTree( *_mesh, _elementType = type, tolerance );
|
_ebbTree = new ElementBndBoxTree( *_mesh, _elementType = type, _meshPartIt, tolerance );
|
||||||
}
|
}
|
||||||
TIDSortedElemSet suspectElems;
|
TIDSortedElemSet suspectElems;
|
||||||
_ebbTree->getElementsNearPoint( point, suspectElems );
|
_ebbTree->getElementsNearPoint( point, suspectElems );
|
||||||
@ -6797,7 +6798,7 @@ TopAbs_State SMESH_ElementSearcherImpl::GetPointState(const gp_Pnt& point)
|
|||||||
if ( !_ebbTree || _elementType != SMDSAbs_Face )
|
if ( !_ebbTree || _elementType != SMDSAbs_Face )
|
||||||
{
|
{
|
||||||
if ( _ebbTree ) delete _ebbTree;
|
if ( _ebbTree ) delete _ebbTree;
|
||||||
_ebbTree = new ElementBndBoxTree( *_mesh, _elementType = SMDSAbs_Face );
|
_ebbTree = new ElementBndBoxTree( *_mesh, _elementType = SMDSAbs_Face, _meshPartIt );
|
||||||
}
|
}
|
||||||
// Algo: analyse transition of a line starting at the point through mesh boundary;
|
// Algo: analyse transition of a line starting at the point through mesh boundary;
|
||||||
// try three lines parallel to axis of the coordinate system and perform rough
|
// try three lines parallel to axis of the coordinate system and perform rough
|
||||||
@ -7021,7 +7022,7 @@ void SMESH_ElementSearcherImpl::GetElementsNearLine( const gp_Ax1&
|
|||||||
if ( !_ebbTree || _elementType != type )
|
if ( !_ebbTree || _elementType != type )
|
||||||
{
|
{
|
||||||
if ( _ebbTree ) delete _ebbTree;
|
if ( _ebbTree ) delete _ebbTree;
|
||||||
_ebbTree = new ElementBndBoxTree( *_mesh, _elementType = type );
|
_ebbTree = new ElementBndBoxTree( *_mesh, _elementType = type, _meshPartIt );
|
||||||
}
|
}
|
||||||
TIDSortedElemSet suspectFaces; // elements possibly intersecting the line
|
TIDSortedElemSet suspectFaces; // elements possibly intersecting the line
|
||||||
_ebbTree->getElementsNearLine( line, suspectFaces );
|
_ebbTree->getElementsNearLine( line, suspectFaces );
|
||||||
@ -7039,6 +7040,17 @@ SMESH_ElementSearcher* SMESH_MeshEditor::GetElementSearcher()
|
|||||||
return new SMESH_ElementSearcherImpl( *GetMeshDS() );
|
return new SMESH_ElementSearcherImpl( *GetMeshDS() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Return SMESH_ElementSearcher
|
||||||
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
SMESH_ElementSearcher* SMESH_MeshEditor::GetElementSearcher(SMDS_ElemIteratorPtr elemIt)
|
||||||
|
{
|
||||||
|
return new SMESH_ElementSearcherImpl( *GetMeshDS(), elemIt );
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Return true if the point is IN or ON of the element
|
* \brief Return true if the point is IN or ON of the element
|
||||||
|
@ -407,6 +407,7 @@ public:
|
|||||||
* \brief Return SMESH_ElementSearcher. The caller is responsible for deleteing it
|
* \brief Return SMESH_ElementSearcher. The caller is responsible for deleteing it
|
||||||
*/
|
*/
|
||||||
SMESH_ElementSearcher* GetElementSearcher();
|
SMESH_ElementSearcher* GetElementSearcher();
|
||||||
|
SMESH_ElementSearcher* GetElementSearcher( SMDS_ElemIteratorPtr elemIt );
|
||||||
/*!
|
/*!
|
||||||
* \brief Return true if the point is IN or ON of the element
|
* \brief Return true if the point is IN or ON of the element
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user