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