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