0023884: Boolean Fuse between two faces fails
[occt.git] / src / IntTools / IntTools_CompareRange.cxx
CommitLineData
b311480e 1// Created on: 2000-10-24
2// Created by: Peter KURNEV
973c2be1 3// Copyright (c) 2000-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
973c2be1 7// This library is free software; you can redistribute it and / or modify it
8// under the terms of the GNU Lesser General Public 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
16#include <IntTools_CompareRange.ixx>
17//=======================================================================
18//function :IntTools_CompareRange::IntTools_CompareRange
19//purpose :
20//=======================================================================
b311480e 21IntTools_CompareRange::IntTools_CompareRange() :myTol(1.e-12) {}
7fd59977 22
23//=======================================================================
24//function :IntTools_CompareRange::IntTools_CompareRange
25//purpose :
26//=======================================================================
27 IntTools_CompareRange::IntTools_CompareRange(const Standard_Real aTol)
28{
29 myTol=aTol;
30}
31
32//=======================================================================
33//function :IsLower
34//purpose :
35//=======================================================================
36 Standard_Boolean IntTools_CompareRange::IsLower(const IntTools_Range& aLeft,
37 const IntTools_Range& aRight)const
38{
39 return aLeft.First()<aRight.First();
40}
41
42//=======================================================================
43//function :IsGreater
44//purpose :
45//=======================================================================
46 Standard_Boolean IntTools_CompareRange::IsGreater(const IntTools_Range& aLeft,
47 const IntTools_Range& aRight)const
48{
49 return !IsLower(aLeft,aRight);
50}
51
52//=======================================================================
53//function :IsEqual
54//purpose :
55//=======================================================================
56 Standard_Boolean IntTools_CompareRange::IsEqual(const IntTools_Range& aLeft,
57 const IntTools_Range& aRight)const
58{
59 Standard_Real a, b;
60 a=aLeft.First();
61 b=aRight.First();
62 return fabs(a-b) < myTol;
63}
64
65
66