From: eap Date: Fri, 29 Jun 2012 13:40:11 +0000 (+0000) Subject: struct SMESH_ElementSearcher X-Git-Tag: V6_6_0a1~293 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6051d0caf8d1fb99128632d21dfc44c56970ebd0;p=modules%2Fsmesh.git struct SMESH_ElementSearcher { + virtual const SMDS_MeshElement* FindClosestTo( const gp_Pnt& point, + SMDSAbs_ElementType type) = 0; } + int Reorient2D (TIDSortedElemSet & theFaces, + const gp_Dir& theDirection, + const SMDS_MeshElement * theFace); + static double GetDistance( const SMDS_MeshFace* face, const gp_Pnt& point ); --- diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index 1ad951b38..1e8c1db09 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -66,28 +66,37 @@ struct SMESH_NodeSearcher //======================================================================= /*! - * \brief Find elements of given type where the given point is IN or ON. - * Returns nb of found elements and elements them-selves. - * Another task is to find out if the given point is out of closed 2D mesh. - * - * 'ALL' type means elements of any type excluding nodes and 0D elements + * \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; - - virtual TopAbs_State GetPointState(const gp_Pnt& point) = 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; + }; // ============================================================ @@ -142,6 +151,11 @@ public: bool Reorient (const SMDS_MeshElement * theElement); // Reverse theElement orientation + int Reorient2D (TIDSortedElemSet & theFaces, + const gp_Dir& theDirection, + const SMDS_MeshElement * theFace); + // Reverse theFaces whose orientation to be same as that of theFace + // oriented according to theDirection. Return nb of reoriented faces /*! * \brief Fuse neighbour triangles into quadrangles. @@ -349,8 +363,9 @@ public: /*! * \brief Return true if the point is IN or ON of the element */ - static bool isOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol ); + 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 faceNodes, std::vector& poly_nodes,