b311480e |
1 | -- Created on: 2000-05-22 |
2 | -- Created by: Peter KURNEV |
973c2be1 |
3 | -- Copyright (c) 2000-2014 OPEN CASCADE SAS |
b311480e |
4 | -- |
973c2be1 |
5 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
6 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | -- |
973c2be1 |
13 | -- Alternatively, this file may be used under the terms of Open CASCADE |
14 | -- commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | class Root from IntTools |
17 | |
18 | ---Purpose: The class is to describe the root of |
19 | -- function of one variable for Edge/Edge |
20 | -- and Edge/Surface algorithms. |
21 | |
22 | uses |
23 | State from TopAbs |
24 | |
25 | ---raises |
26 | is |
27 | Create |
28 | returns Root from IntTools ; |
29 | ---Purpose: |
30 | --- Empty constructor |
31 | --- |
32 | |
33 | Create(aRoot: Real from Standard; |
34 | aType: Integer from Standard) |
35 | returns Root from IntTools ; |
36 | ---Purpose: |
37 | --- Initializes my by range of parameters |
38 | --- and type of root |
39 | --- |
40 | |
41 | SetRoot (me:out; aRoot: Real from Standard); |
42 | ---Purpose: |
43 | --- Sets the Root's value |
44 | --- |
45 | |
46 | SetType (me:out; aType: Integer from Standard); |
47 | ---Purpose: |
48 | --- Sets the Root's Type |
49 | --- |
50 | |
51 | SetStateBefore (me:out; aState: State from TopAbs); |
52 | ---Purpose: |
53 | --- Set the value of the state before the root |
54 | --- (at t=Root-dt) |
55 | --- |
56 | |
57 | SetStateAfter (me:out; aState: State from TopAbs); |
58 | ---Purpose: |
59 | --- Set the value of the state after the root |
60 | --- (at t=Root-dt) |
61 | --- |
62 | |
63 | SetLayerHeight (me:out; aHeight:Real from Standard); |
64 | ---Purpose: |
65 | --- Not used in Edge/Edge algorithm |
66 | --- |
67 | |
68 | SetInterval (me:out; t1, t2, f1, f2:Real from Standard); |
69 | ---Purpose: |
70 | --- Sets the interval from which the Root was |
71 | --- found [t1,t2] and the corresponding values |
72 | --- of the function on the bounds f(t1), f(t2). |
73 | --- |
74 | |
75 | Root (me) |
76 | returns Real from Standard; |
77 | ---Purpose: |
78 | --- Returns the Root value |
79 | --- |
80 | |
81 | Type (me) |
82 | returns Integer from Standard; |
83 | ---Purpose: |
84 | --- Returns the type of the root |
85 | --- =0 - Simple (was found by bisection method); |
86 | --- =2 - Smart when f1=0, f2!=0 or vice versa |
87 | --- (was found by Fibbonacci method); |
88 | --- =1 - Pure (pure zero for all t [t1,t2] ); |
89 | |
90 | StateBefore(me) |
91 | returns State from TopAbs; |
92 | ---Purpose: |
93 | --- Returns the state before the root |
94 | --- |
95 | |
96 | StateAfter(me) |
97 | returns State from TopAbs; |
98 | ---Purpose: |
99 | --- Returns the state after the root |
100 | --- |
101 | |
102 | LayerHeight (me) |
103 | returns Real from Standard; |
104 | ---Purpose: |
105 | --- Not used in Edge/Edge algorithm |
106 | --- |
107 | |
108 | IsValid (me) |
109 | returns Boolean from Standard; |
110 | ---Purpose: |
111 | --- Returns the validity flag for the root, |
112 | --- True if |
113 | --- myStateBefore==TopAbs_OUT && myStateAfter==TopAbs_IN or |
114 | --- myStateBefore==TopAbs_OUT && myStateAfter==TopAbs_ON or |
115 | --- myStateBefore==TopAbs_ON && myStateAfter==TopAbs_OUT or |
116 | --- myStateBefore==TopAbs_IN && myStateAfter==TopAbs_OUT . |
117 | --- For other cases it returns False. |
118 | --- |
119 | |
120 | Interval (me; t1:out Real from Standard; |
121 | t2:out Real from Standard; |
122 | f1:out Real from Standard; |
123 | f2:out Real from Standard); |
124 | ---Purpose: |
125 | --- Returns the values of interval from which the Root was |
126 | --- found [t1,t2] and the corresponding values |
127 | --- of the function on the bounds f(t1), f(t2). |
128 | --- |
129 | |
130 | fields |
131 | myRoot: Real from Standard; |
132 | |
133 | myType: Integer from Standard; |
134 | |
135 | myLayerHeight: Real from Standard; |
136 | myStateBefore: State from TopAbs; |
137 | myStateAfter : State from TopAbs; |
138 | |
139 | myt1: Real from Standard; |
140 | myt2: Real from Standard; |
141 | myf1: Real from Standard; |
142 | myf2: Real from Standard; |
143 | end Root; |