0023884: Boolean Fuse between two faces fails
[occt.git] / src / IntTools / IntTools_Root.cxx
1 // Created on: 2000-05-22
2 // Created by: Peter KURNEV
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and / or modify it
8 // under the terms of the GNU Lesser General Public 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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #include <IntTools_Root.ixx>
17
18 //=======================================================================
19 //function :IntTools_Root::IntTools_Root
20 //purpose  : 
21 //=======================================================================
22 IntTools_Root::IntTools_Root():
23   myRoot(0.),myType(-1),myLayerHeight(0.),
24   myStateBefore(TopAbs_UNKNOWN), 
25   myStateAfter(TopAbs_UNKNOWN),
26   myt1(0.), 
27   myt2(0.), 
28   myf1(0.), 
29   myf2(0.) 
30 {}
31  
32 //=======================================================================
33 //function :IntTools_Root::IntTools_Root
34 //purpose  : 
35 //=======================================================================
36   IntTools_Root::IntTools_Root(const Standard_Real aRoot,
37                                const Standard_Integer aType):
38   myLayerHeight(0.),
39   myStateBefore(TopAbs_UNKNOWN), 
40   myStateAfter(TopAbs_UNKNOWN),
41   myt1(0.), 
42   myt2(0.), 
43   myf1(0.), 
44   myf2(0.)  
45 {
46   myRoot=aRoot;
47   myType=aType;
48
49
50 //=======================================================================
51 //function :SetRoot
52 //purpose  : 
53 //=======================================================================
54   void IntTools_Root::SetRoot(const Standard_Real aRoot)
55 {
56   myRoot=aRoot;
57
58 //=======================================================================
59 //function :SetType
60 //purpose  : 
61 //=======================================================================
62   void IntTools_Root::SetType(const Standard_Integer aType)
63 {
64   myType=aType;
65
66 //=======================================================================
67 //function :SetStateBefore
68 //purpose  : 
69 //=======================================================================
70   void IntTools_Root::SetStateBefore(const TopAbs_State aState)
71 {
72   myStateBefore=aState;
73
74 //=======================================================================
75 //function :SetStateAfter
76 //purpose  : 
77 //=======================================================================
78   void IntTools_Root::SetStateAfter(const TopAbs_State aState)
79 {
80   myStateAfter=aState;
81 }
82 //=======================================================================
83 //function :SetLayerHeight
84 //purpose  : 
85 //=======================================================================
86   void IntTools_Root::SetLayerHeight(const Standard_Real aHeight)
87 {
88   myLayerHeight=aHeight;
89
90 //=======================================================================
91 //function :SetInterval
92 //purpose  : 
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)
98 {
99   myt1=t1;
100   myt2=t2;
101   myf1=f1;
102   myf2=f2;
103
104 //=======================================================================
105 //function :Interval
106 //purpose  : 
107 //=======================================================================
108   void IntTools_Root::Interval(Standard_Real& t1,
109                                Standard_Real& t2,
110                                Standard_Real& f1,
111                                Standard_Real& f2) const
112 {
113   t1=myt1;
114   t2=myt2;
115   f1=myf1;
116   f2=myf2;
117 }
118  
119 //=======================================================================
120 //function :Root
121 //purpose  : 
122 //=======================================================================
123   Standard_Real IntTools_Root::Root() const
124 {
125   return myRoot;
126 }
127
128 //=======================================================================
129 //function :Type
130 //purpose  : 
131 //=======================================================================
132   Standard_Integer IntTools_Root::Type() const
133 {
134   return myType;
135 }
136 //=======================================================================
137 //function :StateBefore
138 //purpose  : 
139 //=======================================================================
140   TopAbs_State IntTools_Root::StateBefore() const
141 {
142   return myStateBefore;
143
144 //=======================================================================
145 //function :StateAfter
146 //purpose  : 
147 //=======================================================================
148   TopAbs_State IntTools_Root::StateAfter() const
149 {
150   return myStateAfter;
151
152 //=======================================================================
153 //function :LayerHeight
154 //purpose  : 
155 //=======================================================================
156   Standard_Real IntTools_Root::LayerHeight() const
157 {
158   return myLayerHeight;
159 }
160
161 //=======================================================================
162 //function :IsValid
163 //purpose  : 
164 //=======================================================================
165   Standard_Boolean IntTools_Root::IsValid() const
166 {
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;
175
176   return Standard_False;
177