From d87588fd02ba2ec257ef8893b058826d3b6e6cf5 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 20 May 2009 15:36:57 +0000 Subject: [PATCH] move struct TIDCompare to SMDS_MeshElement.hxx --- src/SMESH/SMESH_MeshEditor.hxx | 46 +++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index 6e9819e27..06896059b 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -30,42 +30,49 @@ #include "SMESH_SMESH.hxx" -#include "SMESH_Mesh.hxx" +#include "SMDS_MeshElement.hxx" #include "SMESH_Controls.hxx" -#include "SMESH_SequenceOfNode.hxx" +#include "SMESH_Mesh.hxx" #include "SMESH_SequenceOfElemPtr.hxx" -#include "TColStd_HSequenceOfReal.hxx" -#include "SMESH_MesherHelper.hxx" -#include "SMDS_MeshElement.hxx" +#include "SMESH_SequenceOfNode.hxx" +#include #include #include #include -typedef std::map > TElemOfElemListMap; -typedef std::map TNodeNodeMap; - class SMDS_MeshFace; class SMDS_MeshNode; class gp_Ax1; class gp_Vec; class gp_Pnt; +class SMESH_MesherHelper; -// ============================================================ + +typedef std::map > TElemOfElemListMap; +typedef std::map TNodeNodeMap; + + //!< Set of elements sorted by ID, to be used to assure predictability of edition +typedef std::set< const SMDS_MeshElement*, TIDCompare > TIDSortedElemSet; + +typedef pair< const SMDS_MeshNode*, const SMDS_MeshNode* > NLink; + + +//======================================================================= /*! - * \brief Set of elements sorted by ID, to be used to assure - * predictability of edition + * \brief A sorted pair of nodes */ -// ============================================================ +//======================================================================= -template < class TMeshElem = SMDS_MeshElement> -struct TIDCompare { - bool operator () (const TMeshElem* e1, const TMeshElem* e2) const - { return e1->GetID() < e2->GetID(); } +struct SMESH_TLink: public NLink +{ + SMESH_TLink(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2 ):NLink( n1, n2 ) + { if ( n1->GetID() < n2->GetID() ) std::swap( first, second ); } + SMESH_TLink(const NLink& link ):NLink( link ) + { if ( first->GetID() < second->GetID() ) std::swap( first, second ); } }; -typedef std::set< const SMDS_MeshElement*, TIDCompare< SMDS_MeshElement> > TIDSortedElemSet; // ============================================================ /*! @@ -509,6 +516,9 @@ public: const SMESH_SequenceOfElemPtr& GetLastCreatedNodes() const { return myLastCreatedNodes; } const SMESH_SequenceOfElemPtr& GetLastCreatedElems() const { return myLastCreatedElems; } + + bool DoubleNodes( const std::list< int >& theListOfNodes, + const std::list< int >& theListOfModifiedElems ); private: -- 2.39.2