X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_MeshAlgos.hxx;h=ea5a1ee094bc37594f34aab0367d7e33edd2809d;hp=03e695a1dee06a90d35c07f9975755e9fcc0c3d7;hb=499f29d24922cec66e41b41a0039a954993bc6df;hpb=6d32f944a0a115b6419184c50b57bf7c4eef5786 diff --git a/src/SMESHUtils/SMESH_MeshAlgos.hxx b/src/SMESHUtils/SMESH_MeshAlgos.hxx index 03e695a1d..ea5a1ee09 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.hxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -187,12 +187,24 @@ namespace SMESH_MeshAlgos SMESHUtils_EXPORT bool FaceNormal(const SMDS_MeshElement* F, gp_XYZ& normal, bool normalized=true); + /*! + * \brief Return number of nodes common to two elements + */ + SMESHUtils_EXPORT + int NbCommonNodes(const SMDS_MeshElement* e1, + const SMDS_MeshElement* e2); /*! * \brief Return nodes common to two elements */ SMESHUtils_EXPORT std::vector< const SMDS_MeshNode*> GetCommonNodes(const SMDS_MeshElement* e1, const SMDS_MeshElement* e2); + /*! + * \brief Return true if a node is on a boundary of 2D mesh. + * Optionally returns two neighboring boundary nodes (or more in non-manifold mesh) + */ + SMESHUtils_EXPORT bool IsOn2DBoundary( const SMDS_MeshNode* node, + std::vector< const SMDS_MeshNode*> * neibors = nullptr ); /*! * \brief Return true if node1 encounters first in the face and node2, after. * The nodes are supposed to be neighbor nodes in the face. @@ -219,6 +231,7 @@ namespace SMESH_MeshAlgos /*! * \brief Mark elements given by SMDS_Iterator + * \sa SMDS_Mesh::SetAllNodesNotMarked() and SMDS_Mesh::SetAllCellsNotMarked() */ template< class ElemIter > void MarkElems( ElemIter it, const bool isMarked ) @@ -443,28 +456,12 @@ namespace SMESH_MeshAlgos 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; - size_t _index; - gp_XY _xy; - PolyVertex* _prev; - PolyVertex* _next; - - void SetNodeAndNext( const SMDS_MeshNode* n, PolyVertex& v, size_t index ); - void GetTriaNodes( const SMDS_MeshNode** nodes, size_t* nodeIndices) const; - double TriaArea() const; - bool IsInsideTria( const PolyVertex* v ); - PolyVertex* Delete(); - }; + struct PolyVertex; struct Optimizer; + struct Data; - std::vector< PolyVertex > _pv; - std::vector< size_t > _nodeIndex; - Optimizer* _optimizer; + Data* _data; + Optimizer* _optimizer; }; // structure used in MakePolyLine() to define a cutting plane @@ -516,14 +513,15 @@ namespace SMESH_MeshAlgos /*! * Create a slot of given width around given 1D elements lying on a triangle mesh. - * The slot is consrtucted by cutting faces by cylindrical surfaces made around each segment. + * The slot is constructed by cutting faces by cylindrical surfaces made around each segment. * \return Edges located at the slot boundary */ // Implemented in ./SMESH_Slot.cxx SMESHUtils_EXPORT - std::vector< Edge > MakeSlot( SMDS_ElemIteratorPtr segmentIt, - double width, - SMDS_Mesh* mesh); + std::vector< Edge > MakeSlot( SMDS_ElemIteratorPtr segmentIt, + double width, + SMDS_Mesh* mesh, + std::vector< SMDS_MeshGroup* > & groupsToUpdate); } // namespace SMESH_MeshAlgos