+ // Implemented in ./SMESH_FreeBorders.cxx
+
+ /*!
+ * Returns all or only closed TFreeBorder's.
+ * Optionally check if the mesh is manifold and if faces are correctly oriented.
+ */
+ SMESHUtils_EXPORT
+ void FindFreeBorders(SMDS_Mesh& mesh,
+ TFreeBorderVec & foundFreeBordes,
+ const bool closedOnly,
+ bool* isManifold = 0,
+ bool* isGoodOri = 0);
+ // Implemented in ./SMESH_FreeBorders.cxx
+
+ /*!
+ * Fill a hole defined by a TFreeBorder with 2D elements.
+ */
+ SMESHUtils_EXPORT
+ void FillHole(const TFreeBorder & freeBorder,
+ SMDS_Mesh& mesh,
+ std::vector<const SMDS_MeshElement*>& newFaces);
+ // Implemented in ./SMESH_FillHole.cxx
+
+
+ /*!
+ * \brief Find nodes whose merge makes the element invalid
+ */
+ SMESHUtils_EXPORT
+ void DeMerge(const SMDS_MeshElement* elem,
+ std::vector< const SMDS_MeshNode* >& newNodes,
+ std::vector< const SMDS_MeshNode* >& noMergeNodes);
+ // Implemented in SMESH_DeMerge.cxx
+
+
+ typedef std::vector< std::pair< const SMDS_MeshElement*, const SMDS_MeshElement* > > TEPairVec;
+ typedef std::vector< std::pair< const SMDS_MeshNode*, const SMDS_MeshNode* > > TNPairVec;
+ /*!
+ * \brief Create an offset mesh of given faces
+ * \param [in] faceIt - the input faces
+ * \param [in] theFixIntersections - to fix self intersections of the offset mesh or not
+ * \param [out] new2OldFaces - history of faces
+ * \param [out] new2OldNodes - history of nodes
+ * \return SMDS_Mesh* - the new offset mesh, a caller should delete
+ */
+ SMESHUtils_EXPORT
+ SMDS_Mesh* MakeOffset( SMDS_ElemIteratorPtr faceIt,
+ SMDS_Mesh& mesh,
+ const double offset,
+ const bool theFixIntersections,
+ TEPairVec& new2OldFaces,
+ TNPairVec& new2OldNodes );
+ // Implemented in ./SMESH_Offset.cxx
+
+
+ /*!
+ * \brief Divide a mesh face into triangles
+ */
+ // Implemented in ./SMESH_Triangulate.cxx
+
+ class SMESHUtils_EXPORT Triangulate
+ {
+ public:
+
+ static int GetNbTriangles( const SMDS_MeshElement* face );
+
+ int GetTriangles( const SMDS_MeshElement* face,
+ std::vector< const SMDS_MeshNode*>& nodes);
+ private:
+
+ bool triangulate( std::vector< const SMDS_MeshNode*>& nodes, const size_t nbNodes );
+
+ /*!
+ * \brief Vertex of a polygon. Together with 2 neighbor Vertices represents a triangle
+ */
+ struct PolyVertex
+ {
+ SMESH_NodeXYZ _nxyz;
+ gp_XY _xy;
+ PolyVertex* _prev;
+ PolyVertex* _next;
+
+ void SetNodeAndNext( const SMDS_MeshNode* n, PolyVertex& v );
+ void GetTriaNodes( const SMDS_MeshNode** nodes) const;
+ double TriaArea() const;
+ bool IsInsideTria( const PolyVertex* v );
+ PolyVertex* Delete();
+ };
+ std::vector< PolyVertex > _pv;
+ };
+