From: eap Date: Fri, 23 Aug 2013 13:11:32 +0000 (+0000) Subject: SALOME Forum bug: http://www.salome-platform.org/forum/forum_10/967838025 X-Git-Tag: V7_3_0a1~191 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c4b93d024f14dfc722accc0a83e4488e05dd4190;p=modules%2Fsmesh.git SALOME Forum bug: http://www.salome-platform.org/forum/forum_10/967838025 Fix the problem of element-submesh relation restoring at study loading in case if some faces have ids lower than segments. Now TIDCompare does not compare types, a new comparator created for this: +struct TIDTypeCompare { --- diff --git a/src/SMDS/SMDS_MeshElement.hxx b/src/SMDS/SMDS_MeshElement.hxx index 045178942..7b1d33dbe 100644 --- a/src/SMDS/SMDS_MeshElement.hxx +++ b/src/SMDS/SMDS_MeshElement.hxx @@ -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