0024143: bopcheck command throws an exception
[occt.git] / src / IntTools / IntTools_Root.cxx
1 // Created on: 2000-05-22
2 // Created by: Peter KURNEV
3 // Copyright (c) 2000-2012 OPEN CASCADE SAS
4 //
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.
9 //
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.
12 //
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.
19
20
21
22 #include <IntTools_Root.ixx>
23
24 //=======================================================================
25 //function :IntTools_Root::IntTools_Root
26 //purpose  : 
27 //=======================================================================
28 IntTools_Root::IntTools_Root():
29   myRoot(0.),myType(-1),myLayerHeight(0.),
30   myStateBefore(TopAbs_UNKNOWN), 
31   myStateAfter(TopAbs_UNKNOWN),
32   myt1(0.), 
33   myt2(0.), 
34   myf1(0.), 
35   myf2(0.) 
36 {}
37  
38 //=======================================================================
39 //function :IntTools_Root::IntTools_Root
40 //purpose  : 
41 //=======================================================================
42   IntTools_Root::IntTools_Root(const Standard_Real aRoot,
43                                const Standard_Integer aType):
44   myLayerHeight(0.),
45   myStateBefore(TopAbs_UNKNOWN), 
46   myStateAfter(TopAbs_UNKNOWN),
47   myt1(0.), 
48   myt2(0.), 
49   myf1(0.), 
50   myf2(0.)  
51 {
52   myRoot=aRoot;
53   myType=aType;
54
55
56 //=======================================================================
57 //function :SetRoot
58 //purpose  : 
59 //=======================================================================
60   void IntTools_Root::SetRoot(const Standard_Real aRoot)
61 {
62   myRoot=aRoot;
63
64 //=======================================================================
65 //function :SetType
66 //purpose  : 
67 //=======================================================================
68   void IntTools_Root::SetType(const Standard_Integer aType)
69 {
70   myType=aType;
71
72 //=======================================================================
73 //function :SetStateBefore
74 //purpose  : 
75 //=======================================================================
76   void IntTools_Root::SetStateBefore(const TopAbs_State aState)
77 {
78   myStateBefore=aState;
79
80 //=======================================================================
81 //function :SetStateAfter
82 //purpose  : 
83 //=======================================================================
84   void IntTools_Root::SetStateAfter(const TopAbs_State aState)
85 {
86   myStateAfter=aState;
87 }
88 //=======================================================================
89 //function :SetLayerHeight
90 //purpose  : 
91 //=======================================================================
92   void IntTools_Root::SetLayerHeight(const Standard_Real aHeight)
93 {
94   myLayerHeight=aHeight;
95
96 //=======================================================================
97 //function :SetInterval
98 //purpose  : 
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)
104 {
105   myt1=t1;
106   myt2=t2;
107   myf1=f1;
108   myf2=f2;
109
110 //=======================================================================
111 //function :Interval
112 //purpose  : 
113 //=======================================================================
114   void IntTools_Root::Interval(Standard_Real& t1,
115                                Standard_Real& t2,
116                                Standard_Real& f1,
117                                Standard_Real& f2) const
118 {
119   t1=myt1;
120   t2=myt2;
121   f1=myf1;
122   f2=myf2;
123 }
124  
125 //=======================================================================
126 //function :Root
127 //purpose  : 
128 //=======================================================================
129   Standard_Real IntTools_Root::Root() const
130 {
131   return myRoot;
132 }
133
134 //=======================================================================
135 //function :Type
136 //purpose  : 
137 //=======================================================================
138   Standard_Integer IntTools_Root::Type() const
139 {
140   return myType;
141 }
142 //=======================================================================
143 //function :StateBefore
144 //purpose  : 
145 //=======================================================================
146   TopAbs_State IntTools_Root::StateBefore() const
147 {
148   return myStateBefore;
149
150 //=======================================================================
151 //function :StateAfter
152 //purpose  : 
153 //=======================================================================
154   TopAbs_State IntTools_Root::StateAfter() const
155 {
156   return myStateAfter;
157
158 //=======================================================================
159 //function :LayerHeight
160 //purpose  : 
161 //=======================================================================
162   Standard_Real IntTools_Root::LayerHeight() const
163 {
164   return myLayerHeight;
165 }
166
167 //=======================================================================
168 //function :IsValid
169 //purpose  : 
170 //=======================================================================
171   Standard_Boolean IntTools_Root::IsValid() const
172 {
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;
181
182   return Standard_False;
183