Commit | Line | Data |
---|---|---|
b311480e | 1 | -- Created on: 2001-02-26 |
2 | -- Created by: Peter KURNEV | |
3 | -- Copyright (c) 2001-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 EdgeFace from IntTools | |
23 | ||
24 | ---Purpose: The class provides Edge/Face algorithm to determine | |
25 | --- common parts between edge and face in 3-d space. | |
26 | -- Common parts can be : Vertices or Edges. | |
27 | --- | |
28 | ||
29 | uses | |
30 | Pnt from gp, | |
31 | Edge from TopoDS, | |
32 | Face from TopoDS, | |
33 | Curve from BRepAdaptor, | |
34 | Surface from BRepAdaptor, | |
35 | SequenceOfRanges from IntTools, | |
36 | CArray1OfReal from IntTools, | |
37 | CommonPrt from IntTools, | |
38 | FClass2d from IntTools, | |
39 | SequenceOfRoots from IntTools, | |
40 | SequenceOfCommonPrts from IntTools, | |
4e57c75e | 41 | Context from BOPInt, |
4f189102 P |
42 | Range from IntTools |
43 | ||
7fd59977 | 44 | --raises |
45 | ||
46 | is | |
47 | Create | |
48 | returns EdgeFace from IntTools; | |
49 | ---Purpose: | |
50 | --- Empty Constructor | |
51 | --- | |
52 | ||
53 | SetEdge (me:out; anEdge:Edge from TopoDS); | |
54 | ---Purpose: | |
55 | --- Initializes algorithm by the edge anEdge | |
56 | --- | |
57 | ||
58 | SetTolE (me:out; aTolEdge1:Real from Standard); | |
59 | ---Purpose: | |
60 | --- Initializes algorithm by edge tolerance | |
61 | --- | |
62 | ||
63 | SetFace (me:out; aFace:Face from TopoDS); | |
64 | ---Purpose: | |
65 | --- Initializes algorithm by the face aFace | |
66 | --- | |
67 | ||
68 | SetTolF (me:out; aTolFace:Real from Standard); | |
69 | ---Purpose: | |
70 | --- Initializes algorithm by face tolerance | |
71 | --- | |
72 | ||
73 | SetDiscretize (me:out; aDiscret:Integer from Standard); | |
74 | ---Purpose: | |
75 | --- Initializes algorithm by discretization value | |
76 | --- | |
77 | ||
78 | SetDeflection (me:out; aDeflection:Real from Standard); | |
79 | ---Purpose: | |
80 | --- Initializes algorithm by deflection value | |
81 | --- | |
82 | ||
83 | SetEpsilonT (me:out; anEpsT:Real from Standard); | |
84 | ---Purpose: | |
85 | --- Initializes algorithm by parameter tolerance | |
86 | --- | |
87 | ||
88 | SetEpsilonNull (me:out; anEpsNull:Real from Standard); | |
89 | ---Purpose: | |
90 | --- Initializes algorithm by distance tolerance | |
91 | --- | |
92 | ||
93 | SetRange (me:out; aRange:Range from IntTools); | |
94 | ---Purpose: | |
95 | --- Sets boundaries for edge. | |
96 | --- The algorithm processes edge inside these boundaries. | |
97 | --- | |
98 | ||
99 | SetRange (me:out; aFirst, aLast:Real from Standard); | |
100 | ---Purpose: | |
101 | --- Sets boundaries for edge. | |
102 | --- The algorithm processes edge inside these boundaries. | |
103 | --- | |
104 | ||
4f189102 | 105 | SetContext (me: in out; |
4e57c75e | 106 | theContext: Context from BOPInt); |
7fd59977 | 107 | ---Purpose: |
4f189102 | 108 | --- Sets the intersecton context |
7fd59977 | 109 | --- |
4f189102 P |
110 | |
111 | Context (me) | |
4e57c75e | 112 | returns Context from BOPInt; |
4f189102 P |
113 | ---C++:return const & |
114 | ---Purpose: | |
115 | --- Gets the intersecton context | |
116 | --- | |
117 | ||
7fd59977 | 118 | Perform (me:out); |
119 | ---Purpose: | |
120 | --- Launches the process | |
121 | --- | |
122 | ||
123 | IsDone (me) | |
124 | returns Boolean from Standard; | |
125 | ---Purpose: | |
126 | --- Returns true if computation was done | |
127 | --- successfully, otherwise returns false | |
128 | --- | |
129 | ||
130 | ErrorStatus(me) | |
131 | returns Integer from Standard; | |
132 | ---Purpose: | |
133 | --- Returns code of completion | |
134 | --- 0 - means successful completion | |
135 | --- 1 - the process was not started | |
136 | --- 2,3,4,5 - invalid source data for the algorithm | |
137 | --- 6 - discretization failed | |
138 | --- 7 - no projectable ranges found | |
139 | --- 11 - distance computing error | |
140 | --- | |
141 | ||
142 | CommonParts(me) | |
143 | returns SequenceOfCommonPrts from IntTools; | |
144 | ---C++: return const& | |
145 | ---Purpose: | |
146 | --- Returns results | |
147 | --- | |
148 | ||
149 | Range (me) | |
150 | returns Range from IntTools; | |
151 | ---C++: return const& | |
152 | ---Purpose: | |
153 | --- Returns boundaries for edge | |
154 | --- | |
155 | ||
156 | -- | |
157 | IsEqDistance(myclass; | |
158 | aP: Pnt from gp; | |
159 | aS: Surface from BRepAdaptor; | |
160 | aT: Real from Standard; | |
161 | aD:out Real from Standard) | |
162 | returns Boolean from Standard; | |
163 | ---Purpose: | |
164 | --- | |
165 | --- | |
166 | -- | |
167 | ||
168 | ----------------------------------------------------- | |
169 | -- Block of private methods of the algorithm -- | |
170 | ----------------------------------------------------- | |
171 | ||
172 | CheckData (me:out) is private; | |
173 | ||
174 | Prepare (me:out) is private; | |
175 | ||
176 | IsProjectable (me; t:Real from Standard) | |
177 | returns Boolean from Standard | |
178 | is private; | |
179 | ||
180 | FindProjectableRoot (me:out; | |
181 | t1,t2:Real from Standard; | |
182 | f1,f2:Integer from Standard; | |
183 | tRoot:out Real from Standard) | |
184 | is private; | |
185 | ||
186 | DistanceFunction (me:out;t:Real from Standard) | |
187 | returns Real from Standard | |
188 | is private; | |
189 | ||
190 | DerivativeFunction (me:out;t:Real from Standard) | |
191 | returns Real from Standard | |
192 | is private; | |
193 | ||
194 | PrepareArgsFuncArrays (me:out;t1,t2:Real from Standard) | |
195 | is private; | |
196 | ||
197 | ||
198 | AddDerivativePoints (me:out; t,f:CArray1OfReal from IntTools) | |
199 | is private; | |
200 | ||
201 | ||
202 | FindSimpleRoot (me:out; IP:Integer from Standard; | |
203 | ta, tb, fA:Real from Standard) | |
204 | returns Real from Standard | |
205 | is private; | |
206 | ||
207 | FindGoldRoot (me:out; ta, tb, coeff:Real from Standard) | |
208 | returns Real from Standard | |
209 | is private; | |
210 | ||
211 | MakeType (me:out; | |
212 | aCP: out CommonPrt from IntTools) | |
213 | returns Integer from Standard | |
214 | is private; | |
215 | ||
216 | ||
217 | IsIntersection (me:out; ta,tb:Real from Standard) | |
218 | is private; | |
219 | ||
220 | FindDerivativeRoot (me:out;t,f:CArray1OfReal from IntTools) | |
221 | is private; | |
222 | ||
223 | -- | |
224 | RemoveIdenticalRoots(me:out) | |
225 | is private; | |
226 | ||
227 | CheckTouch (me: out; | |
228 | aCP: CommonPrt from IntTools; | |
229 | aTX:out Real from Standard) | |
230 | returns Boolean from Standard | |
231 | is private; | |
232 | ||
233 | CheckTouchVertex (me:out; | |
234 | aCP: CommonPrt from IntTools; | |
235 | aTX:out Real from Standard) | |
236 | returns Boolean from Standard | |
237 | is private; | |
238 | -- | |
239 | ||
240 | fields | |
241 | -- Data | |
242 | myEdge : Edge from TopoDS; | |
243 | myFace : Face from TopoDS; | |
244 | myTolE : Real from Standard; | |
245 | myTolF : Real from Standard; | |
246 | ||
247 | myDiscret : Integer from Standard; | |
248 | ||
249 | myEpsT : Real from Standard; | |
250 | myEpsNull : Real from Standard; | |
251 | myDeflection : Real from Standard; | |
252 | ||
253 | -- data curves | |
254 | myC : Curve from BRepAdaptor; | |
255 | myTmin : Real from Standard; | |
256 | myTmax : Real from Standard; | |
257 | ||
258 | myS : Surface from BRepAdaptor; | |
259 | ||
260 | myCriteria : Real from Standard; | |
261 | ||
262 | -- IsDone | |
263 | myIsDone : Boolean from Standard; | |
264 | myErrorStatus : Integer from Standard; | |
265 | ||
266 | --- internal members | |
4e57c75e | 267 | myContext : Context from BOPInt; |
7fd59977 | 268 | myProjectableRanges: SequenceOfRanges from IntTools; |
269 | myFClass2d : FClass2d from IntTools; | |
270 | myFuncArray : CArray1OfReal from IntTools; | |
271 | myArgsArray : CArray1OfReal from IntTools; | |
272 | mySequenceOfRoots : SequenceOfRoots from IntTools; | |
273 | mySeqOfCommonPrts : SequenceOfCommonPrts from IntTools; | |
274 | ||
275 | myPar1 : Real from Standard; | |
276 | myParallel : Boolean from Standard; | |
7fd59977 | 277 | |
278 | myRange : Range from IntTools; | |
279 | ||
280 | end EdgeFace; |