1 // Created on: 2000-05-22
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.
17 #include <IntTools_Root.hxx>
19 //=======================================================================
20 //function :IntTools_Root::IntTools_Root
22 //=======================================================================
23 IntTools_Root::IntTools_Root():
24 myRoot(0.),myType(-1),myLayerHeight(0.),
25 myStateBefore(TopAbs_UNKNOWN),
26 myStateAfter(TopAbs_UNKNOWN),
33 //=======================================================================
34 //function :IntTools_Root::IntTools_Root
36 //=======================================================================
37 IntTools_Root::IntTools_Root(const Standard_Real aRoot,
38 const Standard_Integer aType):
40 myStateBefore(TopAbs_UNKNOWN),
41 myStateAfter(TopAbs_UNKNOWN),
51 //=======================================================================
54 //=======================================================================
55 void IntTools_Root::SetRoot(const Standard_Real aRoot)
59 //=======================================================================
62 //=======================================================================
63 void IntTools_Root::SetType(const Standard_Integer aType)
67 //=======================================================================
68 //function :SetStateBefore
70 //=======================================================================
71 void IntTools_Root::SetStateBefore(const TopAbs_State aState)
75 //=======================================================================
76 //function :SetStateAfter
78 //=======================================================================
79 void IntTools_Root::SetStateAfter(const TopAbs_State aState)
83 //=======================================================================
84 //function :SetLayerHeight
86 //=======================================================================
87 void IntTools_Root::SetLayerHeight(const Standard_Real aHeight)
89 myLayerHeight=aHeight;
91 //=======================================================================
92 //function :SetInterval
94 //=======================================================================
95 void IntTools_Root::SetInterval(const Standard_Real t1,
96 const Standard_Real t2,
97 const Standard_Real f1,
98 const Standard_Real f2)
105 //=======================================================================
108 //=======================================================================
109 void IntTools_Root::Interval(Standard_Real& t1,
112 Standard_Real& f2) const
120 //=======================================================================
123 //=======================================================================
124 Standard_Real IntTools_Root::Root() const
129 //=======================================================================
132 //=======================================================================
133 Standard_Integer IntTools_Root::Type() const
137 //=======================================================================
138 //function :StateBefore
140 //=======================================================================
141 TopAbs_State IntTools_Root::StateBefore() const
143 return myStateBefore;
145 //=======================================================================
146 //function :StateAfter
148 //=======================================================================
149 TopAbs_State IntTools_Root::StateAfter() const
153 //=======================================================================
154 //function :LayerHeight
156 //=======================================================================
157 Standard_Real IntTools_Root::LayerHeight() const
159 return myLayerHeight;
162 //=======================================================================
165 //=======================================================================
166 Standard_Boolean IntTools_Root::IsValid() const
168 if (myStateBefore==TopAbs_OUT && myStateAfter==TopAbs_IN )
169 return Standard_True;
170 if (myStateBefore==TopAbs_OUT && myStateAfter==TopAbs_ON )
171 return Standard_True;
172 if (myStateBefore==TopAbs_ON && myStateAfter==TopAbs_OUT)
173 return Standard_True;
174 if (myStateBefore==TopAbs_IN && myStateAfter==TopAbs_OUT)
175 return Standard_True;
177 return Standard_False;