Salome HOME
Fix
[modules/smesh.git] / src / SMDS / SMDS_MeshElement.hxx
index 78238dcea1eb24053e6e1ffe52a31853f643012c..7b1d33dbe419068a739219f862ba2fca17fb3a5c 100644 (file)
@@ -141,7 +141,7 @@ public:
     * \param node - the node to check
     * \retval int - node index within the element, -1 if not found
    */
-  int GetNodeIndex( const SMDS_MeshNode* node ) const;
+  virtual int GetNodeIndex( const SMDS_MeshNode* node ) const;
 
   inline ShortType getMeshId()  const { return myMeshId; }
   inline LongType  getshapeId() const { return myShapeId; }
@@ -208,9 +208,16 @@ protected:
  */
 // ============================================================
 
-struct TIDCompare {
+struct TIDTypeCompare {
   bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const
   { return e1->GetType() == e2->GetType() ? e1->GetID() < e2->GetID() : e1->GetType() < e2->GetType(); }
 };
 
+// WARNING: this comparator makes impossible to store both nodes and elements in the same set
+// because there are nodes and elements with the same ID. Use TIDTypeCompare for such containers.
+struct TIDCompare {
+  bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const
+  { return e1->GetID() < e2->GetID(); }
+};
+
 #endif