0026489: The class ShapeUpgrade_UnifySameDomain provides the results that are wrong...
[occt.git] / src / ShapeUpgrade / ShapeUpgrade_Tool.lxx
1 // Created on: 1999-08-31
2 // Created by: Pavel DURANDIN
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 //=======================================================================
18 //function : SetContext
19 //purpose  : 
20 //=======================================================================
21
22 inline void ShapeUpgrade_Tool::SetContext (const Handle(ShapeBuild_ReShape)& context) 
23 {
24   myContext = context;
25 }
26
27
28 //=======================================================================
29 //function : Context
30 //purpose  : 
31 //=======================================================================
32
33 inline Handle(ShapeBuild_ReShape) ShapeUpgrade_Tool::Context() const
34 {
35   return myContext;
36 }
37
38
39 //=======================================================================
40 //function : SetPrecision
41 //purpose  : 
42 //=======================================================================
43
44 inline void ShapeUpgrade_Tool::SetPrecision (const Standard_Real preci) 
45 {
46   myPrecision = preci;
47   if(myMaxTol < myPrecision) myMaxTol = myPrecision;
48   if(myMinTol > myPrecision) myMinTol = myPrecision;
49 }
50
51
52 //=======================================================================
53 //function : Precision
54 //purpose  : 
55 //=======================================================================
56
57 inline Standard_Real ShapeUpgrade_Tool::Precision() const
58 {
59   return myPrecision;
60 }
61
62
63 //=======================================================================
64 //function : SetMinTolerance
65 //purpose  : 
66 //=======================================================================
67
68 inline void ShapeUpgrade_Tool::SetMinTolerance (const Standard_Real mintol) 
69 {
70   myMinTol = mintol;
71 }
72
73
74 //=======================================================================
75 //function : MinTolerance
76 //purpose  : 
77 //=======================================================================
78
79 inline Standard_Real ShapeUpgrade_Tool::MinTolerance() const
80 {
81   return myMinTol;
82 }
83
84
85 //=======================================================================
86 //function : SetMaxTolerance
87 //purpose  : 
88 //=======================================================================
89
90 inline void ShapeUpgrade_Tool::SetMaxTolerance (const Standard_Real maxtol) 
91 {
92   myMaxTol = maxtol;
93 }
94
95
96 //=======================================================================
97 //function : MaxTolerance
98 //purpose  : 
99 //=======================================================================
100
101 inline Standard_Real ShapeUpgrade_Tool::MaxTolerance() const
102 {
103   return myMaxTol;
104 }
105
106 //=======================================================================
107 //function : LimitTolerance
108 //purpose  : 
109 //=======================================================================
110
111 inline Standard_Real ShapeUpgrade_Tool::LimitTolerance(const Standard_Real toler) const
112 {
113   //only maximal restriction implemented.
114   return Min(myMaxTol,toler);
115 }