0025715: Intersection between cylinders produces excess vertices
[occt.git] / src / IntTools / IntTools_Compare.cxx
1 // Created on: 2000-05-22
2 // Created by: Peter KURNEV
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #include <IntTools_Compare.ixx>
17 //=======================================================================
18 //function :IntTools_Compare::IntTools_Compare
19 //purpose  : 
20 //=======================================================================
21 IntTools_Compare::IntTools_Compare() :myTol(1.e-12) {}
22
23 //=======================================================================
24 //function :IntTools_Compare::IntTools_Compare
25 //purpose  : 
26 //=======================================================================
27   IntTools_Compare::IntTools_Compare(const Standard_Real aTol)
28 {
29   myTol=aTol;
30 }
31
32 //=======================================================================
33 //function :IsLower
34 //purpose  : 
35 //=======================================================================
36   Standard_Boolean IntTools_Compare::IsLower(const IntTools_Root& aLeft,
37                                              const IntTools_Root& aRight)const
38 {
39   return aLeft.Root()<aRight.Root();
40 }
41
42 //=======================================================================
43 //function :IsGreater
44 //purpose  : 
45 //=======================================================================
46   Standard_Boolean IntTools_Compare::IsGreater(const IntTools_Root& aLeft,
47                                                const IntTools_Root& aRight)const
48 {
49   return !IsLower(aLeft,aRight);
50 }
51
52 //=======================================================================
53 //function :IsEqual
54 //purpose  : 
55 //=======================================================================
56   Standard_Boolean IntTools_Compare::IsEqual(const IntTools_Root& aLeft,
57                                              const IntTools_Root& aRight)const
58 {
59   Standard_Real a, b;
60   a=aLeft.Root();
61   b=aRight.Root();
62   return fabs(a-b) < myTol;
63 }
64
65
66
67
68
69