1 // Copyright (C) 2007-2011 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
22 // File: NMTDS_Pair.cxx
23 // Author: Peter KURNEV
25 #include <NMTDS_Pair.ixx>
29 #include <TColStd_ListIteratorOfListOfInteger.hxx>
30 #include <TColStd_ListOfInteger.hxx>
33 #pragma warning( disable : 4101)
37 Standard_Integer NormalizedId(const Standard_Integer aId,
38 const Standard_Integer aDiv);
40 //=======================================================================
43 //=======================================================================
44 NMTDS_Pair::NMTDS_Pair()
48 //=======================================================================
51 //=======================================================================
52 NMTDS_Pair::NMTDS_Pair(const NMTDS_Pair& aOther)
57 //=======================================================================
58 //function :operator =
60 //=======================================================================
61 NMTDS_Pair& NMTDS_Pair::operator =(const NMTDS_Pair& aOther)
67 //=======================================================================
70 //=======================================================================
71 NMTDS_Pair::~NMTDS_Pair()
74 //=======================================================================
77 //=======================================================================
78 void NMTDS_Pair::Clear()
83 //=======================================================================
86 //=======================================================================
87 void NMTDS_Pair::SetIds(const Standard_Integer aId1,
88 const Standard_Integer aId2)
98 //=======================================================================
101 //=======================================================================
102 void NMTDS_Pair::Ids(Standard_Integer& aId1,
103 Standard_Integer& aId2) const
108 //=======================================================================
111 //=======================================================================
112 Standard_Boolean NMTDS_Pair::IsEqual(const NMTDS_Pair& aOther) const
115 Standard_Boolean bRet;
117 bRet=(myId1==aOther.myId1 && myId2==aOther.myId2);//ZZ
120 //=======================================================================
121 //function : HashCode
123 //=======================================================================
124 Standard_Integer NMTDS_Pair::HashCode(const Standard_Integer aUpper) const
126 Standard_Integer aSum;
129 aSum+=NormalizedId(myId1, 2);
130 aSum+=NormalizedId(myId2, 2);
131 return ::HashCode(aSum, aUpper);
133 //=======================================================================
134 // function: NormalizedId
136 //=======================================================================
137 Standard_Integer NormalizedId(const Standard_Integer aId,
138 const Standard_Integer aDiv)
140 Standard_Integer aMax, aTresh, aIdRet;
143 aMax=::IntegerLast();