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.
16 #include <IntTools_Root.ixx>
18 //=======================================================================
19 //function :IntTools_Root::IntTools_Root
21 //=======================================================================
22 IntTools_Root::IntTools_Root():
23 myRoot(0.),myType(-1),myLayerHeight(0.),
24 myStateBefore(TopAbs_UNKNOWN),
25 myStateAfter(TopAbs_UNKNOWN),
32 //=======================================================================
33 //function :IntTools_Root::IntTools_Root
35 //=======================================================================
36 IntTools_Root::IntTools_Root(const Standard_Real aRoot,
37 const Standard_Integer aType):
39 myStateBefore(TopAbs_UNKNOWN),
40 myStateAfter(TopAbs_UNKNOWN),
50 //=======================================================================
53 //=======================================================================
54 void IntTools_Root::SetRoot(const Standard_Real aRoot)
58 //=======================================================================
61 //=======================================================================
62 void IntTools_Root::SetType(const Standard_Integer aType)
66 //=======================================================================
67 //function :SetStateBefore
69 //=======================================================================
70 void IntTools_Root::SetStateBefore(const TopAbs_State aState)
74 //=======================================================================
75 //function :SetStateAfter
77 //=======================================================================
78 void IntTools_Root::SetStateAfter(const TopAbs_State aState)
82 //=======================================================================
83 //function :SetLayerHeight
85 //=======================================================================
86 void IntTools_Root::SetLayerHeight(const Standard_Real aHeight)
88 myLayerHeight=aHeight;
90 //=======================================================================
91 //function :SetInterval
93 //=======================================================================
94 void IntTools_Root::SetInterval(const Standard_Real t1,
95 const Standard_Real t2,
96 const Standard_Real f1,
97 const Standard_Real f2)
104 //=======================================================================
107 //=======================================================================
108 void IntTools_Root::Interval(Standard_Real& t1,
111 Standard_Real& f2) const
119 //=======================================================================
122 //=======================================================================
123 Standard_Real IntTools_Root::Root() const
128 //=======================================================================
131 //=======================================================================
132 Standard_Integer IntTools_Root::Type() const
136 //=======================================================================
137 //function :StateBefore
139 //=======================================================================
140 TopAbs_State IntTools_Root::StateBefore() const
142 return myStateBefore;
144 //=======================================================================
145 //function :StateAfter
147 //=======================================================================
148 TopAbs_State IntTools_Root::StateAfter() const
152 //=======================================================================
153 //function :LayerHeight
155 //=======================================================================
156 Standard_Real IntTools_Root::LayerHeight() const
158 return myLayerHeight;
161 //=======================================================================
164 //=======================================================================
165 Standard_Boolean IntTools_Root::IsValid() const
167 if (myStateBefore==TopAbs_OUT && myStateAfter==TopAbs_IN )
168 return Standard_True;
169 if (myStateBefore==TopAbs_OUT && myStateAfter==TopAbs_ON )
170 return Standard_True;
171 if (myStateBefore==TopAbs_ON && myStateAfter==TopAbs_OUT)
172 return Standard_True;
173 if (myStateBefore==TopAbs_IN && myStateAfter==TopAbs_OUT)
174 return Standard_True;
176 return Standard_False;