1 // Created by: Eugeny MALTCHIKOV
2 // Copyright (c) 2017 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef _BOPDS_Pair_HeaderFile
16 #define _BOPDS_Pair_HeaderFile
18 #include <Standard.hxx>
19 #include <Standard_DefineAlloc.hxx>
20 #include <Standard_Handle.hxx>
22 //! The class is to provide the pair of indices of interfering shapes.
29 BOPDS_Pair() : myIndex1(-1), myIndex2(-1) {}
31 BOPDS_Pair(const Standard_Integer theIndex1,
32 const Standard_Integer theIndex2) : myIndex1(theIndex1), myIndex2(theIndex2) {}
37 void SetIndices(const Standard_Integer theIndex1,
38 const Standard_Integer theIndex2)
45 void Indices(Standard_Integer& theIndex1,
46 Standard_Integer& theIndex2) const
53 Standard_Boolean operator < (const BOPDS_Pair& theOther) const
55 return ((myIndex1 != theOther.myIndex1) ?
56 (myIndex1 < theOther.myIndex1) : (myIndex2 < theOther.myIndex2));
59 //! Returns true if the Pair is equal to <the theOther>
60 Standard_Boolean IsEqual (const BOPDS_Pair& theOther) const
62 return (myIndex1 == theOther.myIndex1 && myIndex2 == theOther.myIndex2) ||
63 (myIndex1 == theOther.myIndex2 && myIndex2 == theOther.myIndex1);
67 Standard_Integer HashCode (const Standard_Integer theUpper) const
69 return ::HashCode(myIndex1 + myIndex2, theUpper);
73 Standard_Integer myIndex1;
74 Standard_Integer myIndex2;