1 // Created on: 2000-05-22
2 // Created by: Peter KURNEV
3 // Copyright (c) 2000-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
22 #include <IntTools_Root.ixx>
24 //=======================================================================
25 //function :IntTools_Root::IntTools_Root
27 //=======================================================================
28 IntTools_Root::IntTools_Root():
29 myRoot(0.),myType(-1),myLayerHeight(0.),
30 myStateBefore(TopAbs_UNKNOWN),
31 myStateAfter(TopAbs_UNKNOWN),
38 //=======================================================================
39 //function :IntTools_Root::IntTools_Root
41 //=======================================================================
42 IntTools_Root::IntTools_Root(const Standard_Real aRoot,
43 const Standard_Integer aType):
45 myStateBefore(TopAbs_UNKNOWN),
46 myStateAfter(TopAbs_UNKNOWN),
56 //=======================================================================
59 //=======================================================================
60 void IntTools_Root::SetRoot(const Standard_Real aRoot)
64 //=======================================================================
67 //=======================================================================
68 void IntTools_Root::SetType(const Standard_Integer aType)
72 //=======================================================================
73 //function :SetStateBefore
75 //=======================================================================
76 void IntTools_Root::SetStateBefore(const TopAbs_State aState)
80 //=======================================================================
81 //function :SetStateAfter
83 //=======================================================================
84 void IntTools_Root::SetStateAfter(const TopAbs_State aState)
88 //=======================================================================
89 //function :SetLayerHeight
91 //=======================================================================
92 void IntTools_Root::SetLayerHeight(const Standard_Real aHeight)
94 myLayerHeight=aHeight;
96 //=======================================================================
97 //function :SetInterval
99 //=======================================================================
100 void IntTools_Root::SetInterval(const Standard_Real t1,
101 const Standard_Real t2,
102 const Standard_Real f1,
103 const Standard_Real f2)
110 //=======================================================================
113 //=======================================================================
114 void IntTools_Root::Interval(Standard_Real& t1,
117 Standard_Real& f2) const
125 //=======================================================================
128 //=======================================================================
129 Standard_Real IntTools_Root::Root() const
134 //=======================================================================
137 //=======================================================================
138 Standard_Integer IntTools_Root::Type() const
142 //=======================================================================
143 //function :StateBefore
145 //=======================================================================
146 TopAbs_State IntTools_Root::StateBefore() const
148 return myStateBefore;
150 //=======================================================================
151 //function :StateAfter
153 //=======================================================================
154 TopAbs_State IntTools_Root::StateAfter() const
158 //=======================================================================
159 //function :LayerHeight
161 //=======================================================================
162 Standard_Real IntTools_Root::LayerHeight() const
164 return myLayerHeight;
167 //=======================================================================
170 //=======================================================================
171 Standard_Boolean IntTools_Root::IsValid() const
173 if (myStateBefore==TopAbs_OUT && myStateAfter==TopAbs_IN )
174 return Standard_True;
175 if (myStateBefore==TopAbs_OUT && myStateAfter==TopAbs_ON )
176 return Standard_True;
177 if (myStateBefore==TopAbs_ON && myStateAfter==TopAbs_OUT)
178 return Standard_True;
179 if (myStateBefore==TopAbs_IN && myStateAfter==TopAbs_OUT)
180 return Standard_True;
182 return Standard_False;