1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File: NMTDS_Pair.cxx
24 // Author: Peter KURNEV
26 #include <NMTDS_Pair.ixx>
30 #include <TColStd_ListIteratorOfListOfInteger.hxx>
31 #include <TColStd_ListOfInteger.hxx>
34 #pragma warning( disable : 4101)
38 Standard_Integer NormalizedId(const Standard_Integer aId,
39 const Standard_Integer aDiv);
41 //=======================================================================
44 //=======================================================================
45 NMTDS_Pair::NMTDS_Pair()
49 //=======================================================================
52 //=======================================================================
53 NMTDS_Pair::NMTDS_Pair(const NMTDS_Pair& aOther)
58 //=======================================================================
59 //function :operator =
61 //=======================================================================
62 NMTDS_Pair& NMTDS_Pair::operator =(const NMTDS_Pair& aOther)
68 //=======================================================================
71 //=======================================================================
72 NMTDS_Pair::~NMTDS_Pair()
75 //=======================================================================
78 //=======================================================================
79 void NMTDS_Pair::Clear()
84 //=======================================================================
87 //=======================================================================
88 void NMTDS_Pair::SetIds(const Standard_Integer aId1,
89 const Standard_Integer aId2)
99 //=======================================================================
102 //=======================================================================
103 void NMTDS_Pair::Ids(Standard_Integer& aId1,
104 Standard_Integer& aId2) const
109 //=======================================================================
112 //=======================================================================
113 Standard_Boolean NMTDS_Pair::IsEqual(const NMTDS_Pair& aOther) const
116 Standard_Boolean bRet;
118 bRet=(myId1==aOther.myId1 && myId2==aOther.myId2);//ZZ
121 //=======================================================================
122 //function : HashCode
124 //=======================================================================
125 Standard_Integer NMTDS_Pair::HashCode(const Standard_Integer aUpper) const
127 Standard_Integer aSum;
130 aSum+=NormalizedId(myId1, 2);
131 aSum+=NormalizedId(myId2, 2);
132 return ::HashCode(aSum, aUpper);
134 //=======================================================================
135 // function: NormalizedId
137 //=======================================================================
138 Standard_Integer NormalizedId(const Standard_Integer aId,
139 const Standard_Integer aDiv)
141 Standard_Integer aMax, aTresh, aIdRet;
144 aMax=::IntegerLast();