0026595: Lost some comments in OCCT-code after cdl elimination
[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 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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16
17 #include <IntTools_Root.hxx>
18
19 //=======================================================================
20 //function :IntTools_Root::IntTools_Root
21 //purpose  : 
22 //=======================================================================
23 IntTools_Root::IntTools_Root():
24   myRoot(0.),myType(-1),myLayerHeight(0.),
25   myStateBefore(TopAbs_UNKNOWN), 
26   myStateAfter(TopAbs_UNKNOWN),
27   myt1(0.), 
28   myt2(0.), 
29   myf1(0.), 
30   myf2(0.) 
31 {}
32  
33 //=======================================================================
34 //function :IntTools_Root::IntTools_Root
35 //purpose  : 
36 //=======================================================================
37   IntTools_Root::IntTools_Root(const Standard_Real aRoot,
38                                const Standard_Integer aType):
39   myLayerHeight(0.),
40   myStateBefore(TopAbs_UNKNOWN), 
41   myStateAfter(TopAbs_UNKNOWN),
42   myt1(0.), 
43   myt2(0.), 
44   myf1(0.), 
45   myf2(0.)  
46 {
47   myRoot=aRoot;
48   myType=aType;
49
50
51 //=======================================================================
52 //function :SetRoot
53 //purpose  : 
54 //=======================================================================
55   void IntTools_Root::SetRoot(const Standard_Real aRoot)
56 {
57   myRoot=aRoot;
58
59 //=======================================================================
60 //function :SetType
61 //purpose  : 
62 //=======================================================================
63   void IntTools_Root::SetType(const Standard_Integer aType)
64 {
65   myType=aType;
66
67 //=======================================================================
68 //function :SetStateBefore
69 //purpose  : 
70 //=======================================================================
71   void IntTools_Root::SetStateBefore(const TopAbs_State aState)
72 {
73   myStateBefore=aState;
74
75 //=======================================================================
76 //function :SetStateAfter
77 //purpose  : 
78 //=======================================================================
79   void IntTools_Root::SetStateAfter(const TopAbs_State aState)
80 {
81   myStateAfter=aState;
82 }
83 //=======================================================================
84 //function :SetLayerHeight
85 //purpose  : 
86 //=======================================================================
87   void IntTools_Root::SetLayerHeight(const Standard_Real aHeight)
88 {
89   myLayerHeight=aHeight;
90
91 //=======================================================================
92 //function :SetInterval
93 //purpose  : 
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)
99 {
100   myt1=t1;
101   myt2=t2;
102   myf1=f1;
103   myf2=f2;
104
105 //=======================================================================
106 //function :Interval
107 //purpose  : 
108 //=======================================================================
109   void IntTools_Root::Interval(Standard_Real& t1,
110                                Standard_Real& t2,
111                                Standard_Real& f1,
112                                Standard_Real& f2) const
113 {
114   t1=myt1;
115   t2=myt2;
116   f1=myf1;
117   f2=myf2;
118 }
119  
120 //=======================================================================
121 //function :Root
122 //purpose  : 
123 //=======================================================================
124   Standard_Real IntTools_Root::Root() const
125 {
126   return myRoot;
127 }
128
129 //=======================================================================
130 //function :Type
131 //purpose  : 
132 //=======================================================================
133   Standard_Integer IntTools_Root::Type() const
134 {
135   return myType;
136 }
137 //=======================================================================
138 //function :StateBefore
139 //purpose  : 
140 //=======================================================================
141   TopAbs_State IntTools_Root::StateBefore() const
142 {
143   return myStateBefore;
144
145 //=======================================================================
146 //function :StateAfter
147 //purpose  : 
148 //=======================================================================
149   TopAbs_State IntTools_Root::StateAfter() const
150 {
151   return myStateAfter;
152
153 //=======================================================================
154 //function :LayerHeight
155 //purpose  : 
156 //=======================================================================
157   Standard_Real IntTools_Root::LayerHeight() const
158 {
159   return myLayerHeight;
160 }
161
162 //=======================================================================
163 //function :IsValid
164 //purpose  : 
165 //=======================================================================
166   Standard_Boolean IntTools_Root::IsValid() const
167 {
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;
176
177   return Standard_False;
178