1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef __TWO_NODES_STRUCT_HEADER__
15 #define __TWO_NODES_STRUCT_HEADER__
17 #ifndef _Standard_HeaderFile
18 #include <Standard.hxx>
20 #ifndef _Standard_Macro_HeaderFile
21 #include <Standard_Macro.hxx>
24 //! Structure containing two IDs (of nodes) for using as a key in a map
25 //! (as representation of a mesh link)
27 struct MeshVS_TwoNodes
29 Standard_Integer First, Second;
31 MeshVS_TwoNodes (Standard_Integer aFirst=0, Standard_Integer aSecond=0)
32 : First(aFirst), Second(aSecond) {}
35 //================================================================
36 // Function : HashCode
38 //================================================================
40 inline Standard_Integer HashCode( const MeshVS_TwoNodes& obj,
41 const Standard_Integer Upper )
43 // symmetrical with respect to obj.First and obj.Second
44 const Standard_Integer aKey = obj.First + obj.Second;
45 return HashCode (aKey, Upper);
48 //================================================================
49 // Function : operator ==
51 //================================================================
53 inline Standard_Boolean operator==( const MeshVS_TwoNodes& obj1,
54 const MeshVS_TwoNodes& obj2 )
56 return ( ( obj1.First == obj2.First ) && ( obj1.Second == obj2.Second ) ) ||
57 ( ( obj1.First == obj2.Second ) && ( obj1.Second == obj2.First ) );