From: eap Date: Wed, 20 May 2009 15:32:49 +0000 (+0000) Subject: + const SMDS_MeshNode* GetNodeWrap(const int ind) const { return GetNode( WrappedInd... X-Git-Tag: V4_1_0_maintainance_FINAL~92 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0f82f7f1b31f79ccf3b77b3ad446296e2b1ad5b3;p=modules%2Fsmesh.git + 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(); } +}; ============================================================================= --- 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