]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To implement operator < in order to provide lexicographical comparision of std::set...
authorapo <apo@opencascade.com>
Fri, 22 Jul 2005 16:12:28 +0000 (16:12 +0000)
committerapo <apo@opencascade.com>
Fri, 22 Jul 2005 16:12:28 +0000 (16:12 +0000)
src/CONVERTOR/VISU_Convertor.hxx
src/CONVERTOR/VISU_Convertor_impl.cxx

index ee0b46e84ef2fd0660b0efcf3a161feb38b4f468..39c5b5e916f8525f826890913a27bae57cdce6b1 100644 (file)
@@ -132,13 +132,10 @@ namespace VISU{
 
 
   //---------------------------------------------------------------
-  struct TSubProfileLess
-  {
-    bool
-    operator()(const PSubProfile& theLeft, const PSubProfile& theRight) const;
-  };
+  bool
+  operator<(const PSubProfile& theLeft, const PSubProfile& theRight);
 
-  typedef std::set<PSubProfile,TSubProfileLess> TProfileKey;
+  typedef std::set<PSubProfile> TProfileKey;
   typedef std::map<TProfileKey,PProfile> TProfileMap;
 
 
@@ -161,13 +158,10 @@ namespace VISU{
 
 
   //---------------------------------------------------------------
-  struct TGaussSubMeshLess
-  {
-    bool
-    operator()(const PGaussSubMesh& theLeft, const PGaussSubMesh& theRight) const;
-  };
+  bool
+  operator<(const PGaussSubMesh& theLeft, const PGaussSubMesh& theRight);
 
-  typedef std::set<PGaussSubMesh,TGaussSubMeshLess> TGaussKey;
+  typedef std::set<PGaussSubMesh> TGaussKey;
   typedef std::map<TGaussKey,PGaussMesh> TGaussMeshMap;
 
 
index 9670e120007c2a3169f3f69507b7ae5222fe2939..341c70f3aa7fee91054457e579fd71bd96ffb2c9 100644 (file)
@@ -128,12 +128,13 @@ namespace VISU
 
   //---------------------------------------------------------------
   bool
-  TSubProfileLess
-  ::operator()(const PSubProfile& theLeft, const PSubProfile& theRight) const
+  operator<(const PSubProfile& theLeft, const PSubProfile& theRight)
   {
     PSubProfileImpl aLeft(theLeft), aRight(theRight);
+
     if(aLeft->myGeom != aRight->myGeom)
       return aLeft->myGeom < aRight->myGeom;
+
     return aLeft->myName < aRight->myName;
   }
 
@@ -156,8 +157,7 @@ namespace VISU
 
   //---------------------------------------------------------------
   bool
-  TGaussSubMeshLess::
-  operator()(const PGaussSubMesh& theLeft, const PGaussSubMesh& theRight) const
+  operator<(const PGaussSubMesh& theLeft, const PGaussSubMesh& theRight)
   {
     PGaussImpl aLeft(theLeft->myGauss), aRight(theRight->myGauss);
 
@@ -167,7 +167,7 @@ namespace VISU
     if(aLeft->myName != aRight->myName)
       return aLeft->myName < aRight->myName;
 
-    return TSubProfileLess()(theLeft->mySubProfile,theRight->mySubProfile);
+    return theLeft->mySubProfile < theRight->mySubProfile;
   }