0023024: Update headers of OCCT files
[occt.git] / src / BOPTools / BOPTools_CoupleOfInteger.cxx
CommitLineData
b311480e 1// Created on: 2002-04-01
2// Created by: Peter KURNEV
3// Copyright (c) 2002-2012 OPEN CASCADE SAS
4//
5// The content of this file is subject to the Open CASCADE Technology Public
6// License Version 6.5 (the "License"). You may not use the content of this file
7// except in compliance with the License. Please obtain a copy of the License
8// at http://www.opencascade.org and read it completely before using this file.
9//
10// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12//
13// The Original Code and all software distributed under the License is
14// distributed on an "AS IS" basis, without warranty of any kind, and the
15// Initial Developer hereby disclaims all such warranties, including without
16// limitation, any warranties of merchantability, fitness for a particular
17// purpose or non-infringement. Please see the License for the specific terms
18// and conditions governing the rights and limitations under the License.
19
7fd59977 20
21#include <BOPTools_CoupleOfInteger.ixx>
22
23//=======================================================================
24// function: BOPTools_CoupleOfInteger::BOPTools_CoupleOfInteger
25// purpose:
26//=======================================================================
b311480e 27BOPTools_CoupleOfInteger::BOPTools_CoupleOfInteger()
7fd59977 28:
29 myFirst(99),
30 mySecond(99)
31{}
32
33//=======================================================================
34// function: BOPTools_CoupleOfInteger::BOPTools_CoupleOfInteger
35// purpose:
36//=======================================================================
37 BOPTools_CoupleOfInteger::BOPTools_CoupleOfInteger(const Standard_Integer aFirst,
38 const Standard_Integer aSecond)
39:
40 myFirst(aFirst),
41 mySecond(aSecond)
42{}
43
44//=======================================================================
45// function: SetCouple
46// purpose:
47//=======================================================================
48 void BOPTools_CoupleOfInteger::SetCouple(const Standard_Integer aFirst,
49 const Standard_Integer aSecond)
50{
51 myFirst=aFirst;
52 mySecond=aSecond;
53}
54
55//=======================================================================
56// function: SetFirst
57// purpose:
58//=======================================================================
59 void BOPTools_CoupleOfInteger::SetFirst(const Standard_Integer aFirst)
60{
61 myFirst=aFirst;
62}
63
64
65//=======================================================================
66// function: SetSecond
67// purpose:
68//=======================================================================
69 void BOPTools_CoupleOfInteger::SetSecond(const Standard_Integer aSecond)
70{
71 mySecond=aSecond;
72}
73
74//=======================================================================
75// function: Couple
76// purpose:
77//=======================================================================
78 void BOPTools_CoupleOfInteger::Couple(Standard_Integer& aFirst,
79 Standard_Integer& aSecond)const
80{
81 aFirst=myFirst;
82 aSecond=mySecond;
83}
84//=======================================================================
85// function: First
86// purpose:
87//=======================================================================
88 Standard_Integer BOPTools_CoupleOfInteger::First()const
89{
90 return myFirst;
91}
92//=======================================================================
93// function: Second
94// purpose:
95//=======================================================================
96 Standard_Integer BOPTools_CoupleOfInteger::Second()const
97{
98 return mySecond;
99}
100//=======================================================================
101// function: IsEqual
102// purpose:
103//=======================================================================
104 Standard_Boolean BOPTools_CoupleOfInteger::IsEqual(const BOPTools_CoupleOfInteger& aOther)const
105{
106 Standard_Boolean b1, b2;
107 //
108 b1=(Standard_Boolean)((myFirst==aOther.myFirst ) && (mySecond==aOther.mySecond));
109 b2=(Standard_Boolean)((myFirst==aOther.mySecond) && (mySecond==aOther.myFirst ));
110 return (Standard_Boolean)(b1||b2);
111}
112//=======================================================================
113// function: HashCode
114// purpose:
115//=======================================================================
116 Standard_Integer BOPTools_CoupleOfInteger::HashCode(const Standard_Integer aUpper)const
117{
118 return (myFirst+mySecond)%aUpper;
119}