1) 0022100: EDF 2413 SMESH: Take into account TRIA7

2) 0022098: EDF 2036 SMESH: Create groups from none conected parts of a mesh

Move SMESH_ElementSearcher to from SMESH/SMESH_MeshEditor.hxx SMESHUtils/SMESH_MeshAlgos.hxx
in order to make SMESH_ElementSearcher accessible from Controls/SMESH_Controls.cxx

-struct SMESH_NodeSearcher
-{
-struct SMESH_ElementSearcher
-{
-  SMESH_NodeSearcher* GetNodeSearcher();
-  SMESH_ElementSearcher* GetElementSearcher();
-  SMESH_ElementSearcher* GetElementSearcher( SMDS_ElemIteratorPtr elemIt );
-  static bool IsOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol );
-  static double GetDistance( const SMDS_MeshFace* face, const gp_Pnt& point );
-  static const SMDS_MeshElement* FindFaceInSet(const SMDS_MeshNode*    n1,
This commit is contained in:
eap 2013-05-16 16:27:06 +00:00
parent 68683b462f
commit 664ae5e033
2 changed files with 466 additions and 1933 deletions

File diff suppressed because it is too large Load Diff

View File

@ -51,53 +51,7 @@ class gp_Ax1;
class gp_Vec; class gp_Vec;
class gp_Pnt; class gp_Pnt;
class SMESH_MesherHelper; class SMESH_MesherHelper;
class SMESH_NodeSearcher;
//=======================================================================
/*!
* \brief Searcher for the node closest to point
*/
//=======================================================================
struct SMESH_NodeSearcher
{
virtual const SMDS_MeshNode* FindClosestTo( const gp_Pnt& pnt ) = 0;
virtual void MoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt ) = 0;
};
//=======================================================================
/*!
* \brief Searcher for elements
*/
//=======================================================================
struct SMESH_ElementSearcher
{
/*!
* \brief 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 and 0D elements
*/
virtual int FindElementsByPoint(const gp_Pnt& point,
SMDSAbs_ElementType type,
std::vector< const SMDS_MeshElement* >& foundElems)=0;
/*!
* \brief Return an element most close to the given point
*/
virtual const SMDS_MeshElement* FindClosestTo( const gp_Pnt& point,
SMDSAbs_ElementType type) = 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;
/*!
* \brief Find out if the given point is out of closed 2D mesh.
*/
virtual TopAbs_State GetPointState(const gp_Pnt& point) = 0;
};
// ============================================================ // ============================================================
/*! /*!
@ -356,17 +310,6 @@ public:
SMESH_Mesh* theTargetMesh=0); SMESH_Mesh* theTargetMesh=0);
// Move or copy theElements applying theTrsf to their nodes // Move or copy theElements applying theTrsf to their nodes
/*!
* \brief Return SMESH_NodeSearcher. The caller is responsible for deleteing it
*/
SMESH_NodeSearcher* GetNodeSearcher();
/*!
* \brief Return SMESH_ElementSearcher. The caller is responsible for deleting it
*/
SMESH_ElementSearcher* GetElementSearcher();
SMESH_ElementSearcher* GetElementSearcher( SMDS_ElemIteratorPtr elemIt );
typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes; typedef std::list< std::list< const SMDS_MeshNode* > > TListOfListOfNodes;
void FindCoincidentNodes (TIDSortedNodeSet & theNodes, void FindCoincidentNodes (TIDSortedNodeSet & theNodes,
@ -393,16 +336,9 @@ public:
// Remove all but one of elements built on the same nodes. // Remove all but one of elements built on the same nodes.
// Return nb of successfully merged groups. // Return nb of successfully merged groups.
/*! int SimplifyFace (const std::vector<const SMDS_MeshNode *>& faceNodes,
* \brief Return true if the point is IN or ON of the element std::vector<const SMDS_MeshNode *>& poly_nodes,
*/ std::vector<int>& quantities) const;
static bool IsOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol );
static double GetDistance( const SMDS_MeshFace* face, const gp_Pnt& point );
int SimplifyFace (const std::vector<const SMDS_MeshNode *> faceNodes,
std::vector<const SMDS_MeshNode *>& poly_nodes,
std::vector<int>& quantities) const;
// Split face, defined by <faceNodes>, into several faces by repeating nodes. // Split face, defined by <faceNodes>, into several faces by repeating nodes.
// Is used by MergeNodes() // Is used by MergeNodes()
@ -533,17 +469,6 @@ public:
TIDSortedElemSet & linkedNodes, TIDSortedElemSet & linkedNodes,
SMDSAbs_ElementType type = SMDSAbs_All ); SMDSAbs_ElementType type = SMDSAbs_All );
static const SMDS_MeshElement* FindFaceInSet(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const TIDSortedElemSet& elemSet,
const TIDSortedElemSet& avoidSet,
int* i1=0,
int* i2=0);
// Return a face having linked nodes n1 and n2 and which is
// - not in avoidSet,
// - in elemSet provided that !elemSet.empty()
// i1 and i2 optionally returns indices of n1 and n2
/*! /*!
* \brief Find corresponding nodes in two sets of faces * \brief Find corresponding nodes in two sets of faces
* \param theSide1 - first face set * \param theSide1 - first face set