1// Copyright (c) 1999-2014 OPEN CASCADE SAS
2//
3// This file is part of Open CASCADE Technology software library.
4//
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.
10//
11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
13
14#include <Precision.hxx>
15
16//=======================================================================
17//function : Context
18//purpose  :
19//=======================================================================
20
21inline Handle(ShapeBuild_ReShape) ShapeFix_Root::Context() const
22{
23  return myContext;
24}
25
26//=======================================================================
27//function : MsgRegistrator
28//purpose  :
29//=======================================================================
30
31inline Handle(ShapeExtend_BasicMsgRegistrator) ShapeFix_Root::MsgRegistrator() const
32{
33  return myMsgReg;
34}
35
36//=======================================================================
37//function : Precision
38//purpose  :
39//=======================================================================
40
41inline Standard_Real ShapeFix_Root::Precision() const
42{
43  return myPrecision;
44}
45
46//=======================================================================
47//function : MinTolerance
48//purpose  :
49//=======================================================================
50
51inline Standard_Real ShapeFix_Root::MinTolerance() const
52{
53  return myMinTol;
54}
55
56//=======================================================================
57//function : MaxTolerance
58//purpose  :
59//=======================================================================
60
61inline Standard_Real ShapeFix_Root::MaxTolerance() const
62{
63  return myMaxTol;
64}
65
66//=======================================================================
67//function : LimitTolerance
68//purpose  :
69//=======================================================================
70
71inline Standard_Real ShapeFix_Root::LimitTolerance(const Standard_Real toler) const
72{
73  //only maximal restriction implemented.
74  return Min(myMaxTol,toler);
75}
76
77//=======================================================================
78//function : SendMsg
79//purpose  :
80//=======================================================================
81
82inline  void ShapeFix_Root::SendMsg(const Message_Msg& message,const Message_Gravity gravity) const
83{
84  SendMsg (myShape, message, gravity);
85}
86
87
88//=======================================================================
89//function : SendWarning
90//purpose  :
91//=======================================================================
92
93inline  void ShapeFix_Root::SendWarning(const TopoDS_Shape& shape,const Message_Msg& message) const
94{
95  SendMsg (shape, message, Message_Warning);
96}
97
98
99//=======================================================================
100//function : SendWarning
101//purpose  :
102//=======================================================================
103
104inline  void ShapeFix_Root::SendWarning(const Message_Msg& message) const
105{
106  SendWarning (myShape, message);
107}
108
109
110//=======================================================================
111//function : SendFail
112//purpose  :
113//=======================================================================
114
115inline  void ShapeFix_Root::SendFail(const TopoDS_Shape& shape,const Message_Msg& message) const
116{
117  SendMsg (shape, message, Message_Fail);
118}
119
120
121//=======================================================================
122//function : SendFail
123//purpose  :
124//=======================================================================
125
126inline  void ShapeFix_Root::SendFail(const Message_Msg& message) const
127{
128  SendFail (myShape, message);
129}
130
131
132//=======================================================================
133//function : NeedFix
134//purpose  : Function used to define if the fixing method needs to be called
135//           according to its specific flag if it is set, or
136//           to some additional criteria (if Flag is default)
137//=======================================================================
138
139inline Standard_Boolean ShapeFix_Root::NeedFix (const Standard_Integer Flag,
140						const Standard_Boolean need)
141{
142  return Flag <0 ? need : ( Flag >0 );
143}
144