1 -- File: IntTools_EdgeEdge.cdl
2 -- Created: Thu Oct 26 10:08:05 2000
3 -- Author: Peter KURNEV
5 ---Copyright: Matra Datavision 2000
8 class EdgeEdge from IntTools
10 ---Purpose: The class provides Edge/Edge algorithm to determine
11 -- common parts between two edges in 3-d space.
12 -- Common parts can be : Vertices or Edges.
16 Curve from BRepAdaptor,
17 SequenceOfRoots from IntTools,
18 SequenceOfRanges from IntTools,
19 CArray1OfReal from IntTools,
20 CommonPrt from IntTools,
21 SequenceOfCommonPrts from IntTools,
27 returns EdgeEdge from IntTools;
32 SetEdge1 (me:out; anEdge:Edge from TopoDS);
34 --- Sets the first edge
37 SetTolerance1 (me:out; aTolEdge1:Real from Standard);
39 --- Sets the value of tolerance pipe for the first edge
42 SetEdge2 (me:out; anEdge:Edge from TopoDS);
44 --- Sets the second edge
47 SetTolerance2 (me:out; aTolEdge2:Real from Standard);
49 --- Sets the value of tolerance pipe for the first edge
52 SetDiscretize (me:out; aDiscret:Integer from Standard);
54 --- Sets the number of division for the shortest
55 --- edge among the two. The deflection is not taken
59 SetDeflection (me:out; aDeflection:Real from Standard);
61 --- Sets the value of maximum reative deflection between
62 --- the two nearest points on a curve.
65 SetEpsilonT (me:out; anEpsT:Real from Standard);
67 --- Sets the criteria of equality of two arguments,
68 --- i.e. |t2-t1|<anEpsT will mean that t2=t1
71 SetEpsilonNull (me:out; anEpsNull:Real from Standard);
73 --- Sets the criteria of equality of two functions' values
74 --- i.e. |f(t2)-f(t1)|<anEpsNull will mean that f(t2)=f(t1)
77 SetRange1 (me:out; aRange:Range from IntTools);
79 SetRange2 (me:out; aRange:Range from IntTools);
81 SetRange1 (me:out; aFirst, aLast:Real from Standard);
83 SetRange2 (me:out; aFirst, aLast:Real from Standard);
87 --- The main method of the algorithm to determine
88 --- common parts between two edges in 3-d space
92 returns Boolean from Standard;
94 --- True if the common parts are found
98 returns Boolean from Standard;
100 --- False if the common parts are coherented with Edge1, Edge2
104 returns Integer from Standard;
105 ---Purpose: Returns the number that corresponds to the error.
106 --- The list of error-codes is in ...cxx file
110 returns SequenceOfCommonPrts from IntTools;
111 ---C++: return const&
113 --- Returns the common parts (Output)
117 returns Range from IntTools;
118 ---C++: return const&
121 returns Range from IntTools;
122 ---C++: return const&
124 -----------------------------------------------------
125 -- Block of private methods of the algorithm --
126 -----------------------------------------------------
128 CheckData (me:out) is private;
130 --- Fool-proof chechking the input data.
131 --- The following data is not available
132 --- * Degenerated edges is not available;
133 --- * Egdes, that don't contain 3d-curve.
136 Prepare (me:out) is private;
138 --- Preparing the main fields for the algorithm
139 --- * From-Curve (myCFrom,myTminFrom,myTmaxFrom),
140 --- * To -Curve (myCTo ,myTminTo ,myTmaxTo ),
141 --- * myCreiteria=myTol1+myTol2 ,
142 --- * myProjectableRanges.
145 IsProjectable (me; t:Real from Standard)
146 returns Integer from Standard is private;
148 --- Returns the flag 1 if it is possible to project
149 --- the point from the From-Curve at the parameter t
151 --- Othrwise it returns 0.
154 FindProjectableRoot (me:out;
155 t1,t2:Real from Standard;
156 f1,f2:Integer from Standard;
157 tRoot:out Real from Standard) is private;
159 --- Find a bound of a projectable range for the From-Curve
160 --- using bisection method.
161 --- t1, t2 - interval for searching along t.
162 --- f1, f2 - values of the function IsProjectable()
167 DistanceFunction (me:out;t:Real from Standard)
168 returns Real from Standard is private;
170 --- Calculates the DistanceFunction D(t).
171 --- D(t)=D1(t) - myCriteria;
173 --- D1(t) - the lower distance between a point from
174 --- the From-Curve at parameter t and
175 --- projection point of this point on To-Curve;
176 --- myCriteria=myTol1+myTol2.
179 DerivativeFunction (me:out;t:Real from Standard)
180 returns Real from Standard is private;
182 --- Calculates the first derivative of
183 --- the DistanceFunction D(t).
187 FindSimpleRoot (me:out; IP:Integer from Standard;
188 ta, tb, fA:Real from Standard)
189 returns Real from Standard is private;
191 --- Find the Root of the function on given interval
192 --- of the argument [ta,tb] using bisection method .
194 --- =1 - use DistanceFunction;
195 --- =2 - use DerivativeFunction;
198 FindGoldRoot (me:out; ta, tb, coeff:Real from Standard)
199 returns Real from Standard is private;
201 --- Find the Root of the function on given interval
202 --- of the argument [ta,tb] using Fibonacci method .
205 FindRangeOnCurve2 (me:out;
206 aCP:out CommonPrt from IntTools)
207 returns Integer from Standard is private;
209 --- Find the range on the curve Curve-To that corresponds
210 --- to the given range on the curve Curve-From.
213 GetParameterOnCurve2 (me;
214 aT1:Real from Standard;
215 aT2:out Real from Standard)
216 returns Integer from Standard is private ;
218 --- Find the value of the parameter on the curve Curve-To
219 --- that corresponds to the given parameter on the curve
223 TreatVertexType (me:out; am1, am2:Real from Standard;
224 aCP:out CommonPrt from IntTools)
225 returns Integer from Standard is private;
227 IsIntersection (me:out;
228 t1 : Real from Standard;
229 t2 : Real from Standard) is private ;
231 FindDerivativeRoot (me:out;
232 t,f:CArray1OfReal from IntTools)
235 RemoveIdenticalRoots(me:out)
239 aCP: CommonPrt from IntTools;
240 t1 : out Real from Standard;
241 t2 : out Real from Standard)
242 returns Boolean from Standard
246 aCP: CommonPrt from IntTools;
247 t1 : out Real from Standard;
248 t2 : out Real from Standard)
249 returns Boolean from Standard
252 CheckInterval(me:out;
253 t1 : Real from Standard;
254 t2 : Real from Standard)
255 returns Boolean from Standard
259 ComputeLineLine(me:out)
265 myEdge1 : Edge from TopoDS;
266 myEdge2 : Edge from TopoDS;
267 myTol1 : Real from Standard;
268 myTol2 : Real from Standard;
270 myDiscret : Integer from Standard;
272 myEpsT : Real from Standard;
273 myEpsNull : Real from Standard;
274 myDeflection : Real from Standard;
277 myCFrom : Curve from BRepAdaptor;
278 myTminFrom : Real from Standard;
279 myTmaxFrom : Real from Standard;
280 myTolFrom : Real from Standard;
282 myCTo : Curve from BRepAdaptor;
283 myTminTo : Real from Standard;
284 myTmaxTo : Real from Standard;
285 myTolTo : Real from Standard;
287 myCriteria : Real from Standard;
289 myIsDone : Boolean from Standard;
290 myErrorStatus : Integer from Standard;
293 myProjectableRanges: SequenceOfRanges from IntTools;
294 myFuncArray : CArray1OfReal from IntTools;
295 myArgsArray : CArray1OfReal from IntTools;
297 mySequenceOfRoots : SequenceOfRoots from IntTools;
298 mySeqOfCommonPrts : SequenceOfCommonPrts from IntTools;
300 myOrder : Boolean from Standard; -- 0-strait; 1-reversed
301 myPar1 : Real from Standard;
302 myParallel : Boolean from Standard;
303 myAllNullFlag : Boolean from Standard;
305 myRange1 : Range from IntTools;
306 myRange2 : Range from IntTools;