Salome HOME
+ const SMDS_MeshNode* GetNodeWrap(const int ind) const { return GetNode( WrappedInd...
authoreap <eap@opencascade.com>
Wed, 20 May 2009 15:32:49 +0000 (15:32 +0000)
committereap <eap@opencascade.com>
Wed, 20 May 2009 15:32:49 +0000 (15:32 +0000)
+// ============================================================
+/*!
+ * \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

index 2716456d34cfcf70f4a6057412c176be096f5c4e..13498092ab86d655eec439f99267e4bed56f167d 100644 (file)
@@ -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