From 91d01b7efe6062e93c5ad121a4d4bad58e00d2b1 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 19 May 2009 15:13:59 +0000 Subject: [PATCH] + const SMDS_MeshNode* GetNodeWrap(const int ind) const { return GetNode( WrappedIndex( ind )); } +// ============================================================ +/*! + * \brief Comparator of elements by ID for usage in std containers + */ +// ============================================================ + +struct TIDCompare { + bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const + { return e1->GetID() < e2->GetID(); } +}; --- src/SMDS/SMDS_MeshElement.hxx | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/SMDS/SMDS_MeshElement.hxx b/src/SMDS/SMDS_MeshElement.hxx index 2716456d3..13498092a 100644 --- a/src/SMDS/SMDS_MeshElement.hxx +++ b/src/SMDS/SMDS_MeshElement.hxx @@ -40,9 +40,12 @@ class SMDS_MeshNode; class SMDS_MeshEdge; class SMDS_MeshFace; -/////////////////////////////////////////////////////////////////////////////// -/// Base class for elements -/////////////////////////////////////////////////////////////////////////////// +// ============================================================ +/*! + * \brief Base class for elements + */ +// ============================================================ + class SMDS_EXPORT SMDS_MeshElement:public SMDS_MeshObject { public: @@ -70,6 +73,13 @@ public: // =========================== // Access to nodes by index // =========================== + /*! + * \brief Return node by its index + * \param ind - node index + * \retval const SMDS_MeshNode* - the node + */ + virtual const SMDS_MeshNode* GetNode(const int ind) const; + /*! * \brief Return node by its index * \param ind - node index @@ -77,7 +87,7 @@ public: * * Index is wrapped if it is out of a valid range */ - virtual const SMDS_MeshNode* GetNode(const int ind) const; + const SMDS_MeshNode* GetNodeWrap(const int ind) const { return GetNode( WrappedIndex( ind )); } /*! * \brief Return true if index of node is valid (0 <= ind < NbNodes()) @@ -112,4 +122,15 @@ private: int myID; }; +// ============================================================ +/*! + * \brief Comparator of elements by ID for usage in std containers + */ +// ============================================================ + +struct TIDCompare { + bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const + { return e1->GetID() < e2->GetID(); } +}; + #endif