vector< const SMDS_MeshElement* >& foundElements);
virtual TopAbs_State GetPointState(const gp_Pnt& point);
+ void GetElementsNearLine( const gp_Ax1& line,
+ SMDSAbs_ElementType type,
+ vector< const SMDS_MeshElement* >& foundElems);
double getTolerance();
bool getIntersParamOnLine(const gp_Lin& line, const SMDS_MeshElement* face,
const double tolerance, double & param);
{
return _outerFaces.empty() || _outerFaces.count(face);
}
- struct TInters //!< data of intersection of the line and the mesh face used in GetPointState()
+ struct TInters //!< data of intersection of the line and the mesh face (used in GetPointState())
{
const SMDS_MeshElement* _face;
gp_Vec _faceNorm;
return TopAbs_UNKNOWN;
}
+//=======================================================================
+/*!
+ * \brief Return elements possibly intersecting the line
+ */
+//=======================================================================
+
+void SMESH_ElementSearcherImpl::GetElementsNearLine( const gp_Ax1& line,
+ SMDSAbs_ElementType type,
+ vector< const SMDS_MeshElement* >& foundElems)
+{
+ if ( !_ebbTree || _elementType != type )
+ {
+ if ( _ebbTree ) delete _ebbTree;
+ _ebbTree = new ElementBndBoxTree( *_mesh, _elementType = type );
+ }
+ TIDSortedElemSet suspectFaces; // elements possibly intersecting the line
+ _ebbTree->getElementsNearLine( line, suspectFaces );
+ foundElems.assign( suspectFaces.begin(), suspectFaces.end());
+}
+
//=======================================================================
/*!
* \brief Return SMESH_ElementSearcher
std::vector< const SMDS_MeshElement* >& foundElems)=0;
virtual TopAbs_State GetPointState(const gp_Pnt& point) = 0;
+
+ /*!
+ * \brief Return elements possibly intersecting the line
+ */
+ virtual void GetElementsNearLine( const gp_Ax1& line,
+ SMDSAbs_ElementType type,
+ std::vector< const SMDS_MeshElement* >& foundElems)=0;
};
//=======================================================================
// Search among theNodes or in the whole mesh if theNodes is empty.
/*!
- * \brief Return SMESH_NodeSearcher
+ * \brief Return SMESH_NodeSearcher. The caller is responsible for deleteing it
*/
SMESH_NodeSearcher* GetNodeSearcher();
/*!
- * \brief Return SMESH_ElementSearcher
+ * \brief Return SMESH_ElementSearcher. The caller is responsible for deleteing it
*/
SMESH_ElementSearcher* GetElementSearcher();
/*!