1 // Created on: 2000-10-24
2 // Created by: Peter KURNEV
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <IntTools_CompareRange.ixx>
17 //=======================================================================
18 //function :IntTools_CompareRange::IntTools_CompareRange
20 //=======================================================================
21 IntTools_CompareRange::IntTools_CompareRange() :myTol(1.e-12) {}
23 //=======================================================================
24 //function :IntTools_CompareRange::IntTools_CompareRange
26 //=======================================================================
27 IntTools_CompareRange::IntTools_CompareRange(const Standard_Real aTol)
32 //=======================================================================
35 //=======================================================================
36 Standard_Boolean IntTools_CompareRange::IsLower(const IntTools_Range& aLeft,
37 const IntTools_Range& aRight)const
39 return aLeft.First()<aRight.First();
42 //=======================================================================
45 //=======================================================================
46 Standard_Boolean IntTools_CompareRange::IsGreater(const IntTools_Range& aLeft,
47 const IntTools_Range& aRight)const
49 return !IsLower(aLeft,aRight);
52 //=======================================================================
55 //=======================================================================
56 Standard_Boolean IntTools_CompareRange::IsEqual(const IntTools_Range& aLeft,
57 const IntTools_Range& aRight)const
62 return fabs(a-b) < myTol;