0024510: Remove unused local variables
[occt.git] / src / GccAna / GccAna_Lin2d2Tan.cxx
1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 //
4 // This file is part of Open CASCADE Technology software library.
5 //
6 // This library is free software; you can redistribute it and / or modify it
7 // under the terms of the GNU Lesser General Public version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
11 //
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
14
15 //=========================================================================
16 //   Straight line tangent to two circles or tangent to a circle and passing    +
17 //   through point.                                                        +
18 //=========================================================================
19
20 #include <GccAna_Lin2d2Tan.ixx>
21
22 #include <ElCLib.hxx>
23 #include <gp_XY.hxx>
24 #include <gp_Dir2d.hxx>
25 #include <gp_Vec2d.hxx>
26 #include <gp_Circ2d.hxx>
27 #include <Standard_OutOfRange.hxx>
28 #include <StdFail_NotDone.hxx>
29 #include <GccEnt_BadQualifier.hxx>
30
31 //=========================================================================
32 //   Straight line passing through two points.                                      +
33 //   ===============================                                      +
34 //=========================================================================
35
36 GccAna_Lin2d2Tan::
37    GccAna_Lin2d2Tan (const gp_Pnt2d&             ThePoint1,
38                      const gp_Pnt2d&             ThePoint2 ,
39                      const Standard_Real         Tolerance ):
40    linsol(1,1),
41    qualifier1(1,1),
42    qualifier2(1,1) ,
43    pnttg1sol(1,1),
44    pnttg2sol(1,1),
45    par1sol(1,1),
46    par2sol(1,1),
47    pararg1(1,1),
48    pararg2(1,1)
49 {
50
51    Standard_Real Tol = Abs(Tolerance);
52    WellDone = Standard_False;
53    NbrSol = 0;
54    Standard_Real dist = ThePoint1.Distance(ThePoint2);
55    qualifier1(1) = GccEnt_noqualifier;
56    qualifier2(1) = GccEnt_noqualifier;
57    if (dist >= Tol) {
58      gp_Dir2d dir(ThePoint2.X()-ThePoint1.X(),ThePoint2.Y()-ThePoint1.Y());
59      linsol(1) = gp_Lin2d(ThePoint1,dir);
60 //   ===================================
61      WellDone = Standard_True;
62      NbrSol = 1;
63      pnttg1sol(1) = ThePoint1;
64      pnttg2sol(1) = ThePoint2;
65      par1sol(NbrSol)=ElCLib::Parameter(linsol(NbrSol),pnttg1sol(NbrSol));
66      par2sol(NbrSol)=ElCLib::Parameter(linsol(NbrSol),pnttg2sol(NbrSol));
67      pararg1(1)   = 0.0;
68      pararg2(1)   = 0.0;
69    }
70  }
71
72 //=========================================================================
73 //   Straight line tangent to a circle passing by a point.                +
74 //   =================================================                    +
75 //   Basing on the qualifier attached to circle Qualified1 (C1) define    +
76 //   the direction of the tangent to be calculated.                       +
77 //   This tangent will have connection point P1 (point of tangency with the circle. +
78 //   It has angle A (sinus R1/dist or -R1/dist) with straight line        +
79 //   passing by the center of the circle and ThePoint.                    +
80 //=========================================================================
81
82 GccAna_Lin2d2Tan::
83    GccAna_Lin2d2Tan (const GccEnt_QualifiedCirc& Qualified1,
84                      const gp_Pnt2d&             ThePoint  ,
85                      const Standard_Real         Tolerance ):
86    linsol(1,2),
87    qualifier1(1,2),
88    qualifier2(1,2),
89    pnttg1sol(1,2),
90    pnttg2sol(1,2),
91    par1sol(1,2),
92    par2sol(1,2),
93    pararg1(1,2),
94    pararg2(1,2) 
95 {
96
97    Standard_Real Tol = Abs(Tolerance);
98    WellDone = Standard_False;
99    NbrSol = 0;
100    if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || 
101          Qualified1.IsOutside() || Qualified1.IsUnqualified())) {
102      GccEnt_BadQualifier::Raise();
103      return;
104    }
105    gp_Circ2d C1 = Qualified1.Qualified();
106    Standard_Real R1 = C1.Radius();
107
108    if (Qualified1.IsEnclosed()) { GccEnt_BadQualifier::Raise(); }
109 // ============================
110    else if (Tol < R1-ThePoint.Distance(C1.Location())) { 
111      WellDone = Standard_True; 
112    }
113    else if (Abs(ThePoint.Distance(C1.Location())-R1) <= Tol) {
114      gp_Dir2d dir(gp_Vec2d(C1.Location(),ThePoint));
115      linsol(1) = gp_Lin2d(ThePoint,gp_Dir2d(Standard_Real(-dir.Y()),
116                                             Standard_Real(dir.X())));
117 //   =====================================================================
118      qualifier1(1) = Qualified1.Qualifier();
119      qualifier2(1) = GccEnt_noqualifier;
120      WellDone = Standard_True;
121      NbrSol = 1;
122      pnttg1sol(1) = ThePoint;
123      pnttg2sol(1) = ThePoint;
124    }
125    else {
126      Standard_Real signe = 1;
127      Standard_Real dist = ThePoint.Distance(C1.Location());
128      Standard_Real d = dist - Sqrt(dist*dist - R1*R1);
129      if (Qualified1.IsEnclosing()) {
130 //   =============================
131        signe = 1;
132        NbrSol = 1;
133      }
134      else if (Qualified1.IsOutside()) {
135        signe = -1;
136        NbrSol = 1;
137      }
138      else if (Qualified1.IsUnqualified()) {
139 //   ====================================
140        signe = 1;
141        NbrSol = 2;
142      }
143      for (Standard_Integer i = 1 ; i <= NbrSol ; i++) {
144        gp_Pnt2d P1(C1.Location().Rotated(ThePoint,ASin(signe*R1/dist)));
145        gp_Dir2d D1(gp_Vec2d(P1,ThePoint));
146        P1=gp_Pnt2d(P1.XY() + d*D1.XY());
147        linsol(i) = gp_Lin2d(P1,gp_Dir2d(gp_Vec2d(P1,ThePoint)));
148 //     ========================================================
149        qualifier1(i) = Qualified1.Qualifier();
150        qualifier2(i) = GccEnt_noqualifier;
151         pnttg1sol(i) = P1;
152         pnttg2sol(i) = ThePoint;
153         signe = -signe;
154       }
155       WellDone = Standard_True;
156     }
157     for (Standard_Integer i = 1 ; i <= NbrSol ; i++) {
158       par1sol(i)=ElCLib::Parameter(linsol(i),pnttg1sol(i));
159       par2sol(i)=ElCLib::Parameter(linsol(i),pnttg2sol(i));
160       pararg1(i)=ElCLib::Parameter(C1,pnttg1sol(i));
161       pararg2(i) = 0.;
162     }
163   }
164
165  //=========================================================================
166  //   Straight line tangent to two circles.                                +
167  //   ====================================                                 +
168  //   In the boundary cas (two interior circles are tangent to each other) +
169  //   take the straight line orthogonal to the straight line connecting    +
170  //   two circles.                                                         +
171  //   In other cases subject the center of C1 (Qualified1) or of           +
172  //   C2 (Qualified2), provided that R1 is greater than R2, to a           +
173  //   rotation of angle A with sinus(A) = (R1+R2)/dist or                  +
174  //                            sinus(A) = (R1-R2)/dist or                  +
175  //                            sinus(A) = (R2-R1)/dist or                  +
176  //                            sinus(A) = (-R1-R2)/dist                    +
177  //   The point found this way is P1 or P2.                                +
178  //   The direction of the straight line to be calculated  should  pass by +
179  //   the center of rotation (center of C1 or of C2) and P1 or P2.         +
180  //   Then translate the straight line to make it tangent to C1.           +
181  //=========================================================================
182
183  GccAna_Lin2d2Tan::
184     GccAna_Lin2d2Tan (const GccEnt_QualifiedCirc& Qualified1,
185                       const GccEnt_QualifiedCirc& Qualified2,
186                       const Standard_Real         Tolerance ):
187     linsol(1,4),
188     qualifier1(1,4),
189     qualifier2(1,4) ,
190     pnttg1sol(1,4),
191     pnttg2sol(1,4),
192     par1sol(1,4),
193     par2sol(1,4),
194     pararg1(1,4),
195     pararg2(1,4)
196 {
197
198     Standard_Real Tol = Abs(Tolerance);
199     WellDone = Standard_False;
200     NbrSol = 0;
201     if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || 
202           Qualified1.IsOutside() || Qualified1.IsUnqualified()) ||
203         !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || 
204           Qualified2.IsOutside() || Qualified2.IsUnqualified())) {
205       GccEnt_BadQualifier::Raise();
206       return;
207     }
208     gp_Circ2d C1 = Qualified1.Qualified();
209     gp_Circ2d C2 = Qualified2.Qualified();
210
211     if (Qualified1.IsEnclosed() || Qualified2.IsEnclosed()) {
212  // =======================================================
213       GccEnt_BadQualifier::Raise();
214     }
215     else {
216       Standard_Real R1 = C1.Radius();
217       Standard_Real R2 = C2.Radius();
218       gp_Dir2d D1;
219       Standard_Integer signe = 1;
220       Standard_Real dist = C1.Location().Distance(C2.Location());
221       if (Tol < Max(R1,R2)-dist-Min(R1,R2) ) { WellDone = Standard_True; }
222       else if (!Qualified1.IsUnqualified() || !Qualified2.IsUnqualified()) {
223  //   ====================================================================
224         if (Qualified1.IsEnclosing() && Qualified2.IsEnclosing()) {
225  //     =========================================================
226           if (Abs(dist+Min(R1,R2)-Max(R1,R2)) <= Tol && dist >= Tol) {
227             if (R1<R2) { D1 = gp_Dir2d(gp_Vec2d(C2.Location(),C1.Location()));}
228             else { D1 = gp_Dir2d(gp_Vec2d(C1.Location(),C2.Location())); }
229             gp_Pnt2d P1(C1.Location().XY()+R1*D1.XY());
230             linsol(1) = gp_Lin2d(P1,gp_Dir2d(-D1.Y(),D1.X()));
231  //         =================================================
232             qualifier1(1) = Qualified1.Qualifier();
233             qualifier2(1) = Qualified2.Qualifier();
234             pnttg1sol(1) = P1;
235             pnttg2sol(1) = P1;
236             WellDone = Standard_True;
237             NbrSol = 1;
238           }
239           else {
240             gp_Pnt2d P1(C2.Location().Rotated(C1.Location(),
241                                               ASin((R1-R2)/dist)));
242             D1 = gp_Dir2d(gp_Vec2d(C1.Location(),P1));
243             P1=gp_Pnt2d((C1.Location().XY()+gp_XY(R1*D1.Y(),-R1*D1.X())));
244             linsol(1) = gp_Lin2d(P1,D1);
245  //         ===========================
246             qualifier1(1) = Qualified1.Qualifier();
247             qualifier2(1) = Qualified1.Qualifier();
248             pnttg1sol(1) = P1;
249             pnttg2sol(1) = gp_Pnt2d(C2.Location().XY()+
250                                     gp_XY(R2*D1.Y(),-R2*D1.X()));
251             WellDone = Standard_True;
252             NbrSol = 1;
253           }
254         }
255         else if ((Qualified1.IsEnclosing() && Qualified2.IsOutside()) ||
256  //     ================================================================
257                  (Qualified2.IsEnclosing() && Qualified1.IsOutside())) {
258  //              =====================================================
259           if (Qualified1.IsEnclosing() && Qualified2.IsOutside()) {
260             signe = 1;
261           }
262           else {
263             signe = -1;
264           }
265           if (R1+R2-dist > Tol) { WellDone = Standard_True; }
266           else if (Abs(dist-R1-R2)<Tol && dist>Tol) {
267             D1 = gp_Dir2d(gp_Vec2d(C1.Location(),C2.Location()));
268             gp_Pnt2d P1(C1.Location().XY()+R1*D1.XY());
269             linsol(1) = gp_Lin2d(P1,gp_Dir2d(-D1.Y(),D1.X()));
270 //          =================================================
271             qualifier1(1) = Qualified1.Qualifier();
272             qualifier2(1) = Qualified1.Qualifier();
273             pnttg1sol(1) = P1;
274             pnttg2sol(1) = P1;
275             WellDone = Standard_True;
276             NbrSol = 1;
277           }
278           else {
279             gp_Pnt2d P1(C2.Location().Rotated(C1.Location(),
280                                               ASin(signe*(R1+R2)/dist)));
281             D1 = gp_Dir2d(gp_Vec2d(C1.Location(),P1));
282             P1=gp_Pnt2d(C1.Location().XY()+signe*(gp_XY(R1*D1.Y(),
283                                                         -R1*D1.X())));
284             linsol(1) = gp_Lin2d(P1,D1);
285  //         ===========================
286             qualifier1(1) = Qualified1.Qualifier();
287             qualifier2(1) = Qualified1.Qualifier();
288             pnttg1sol(1) = P1;
289             pnttg2sol(1) = gp_Pnt2d(C2.Location().XY()+
290                                     signe*(gp_XY(-R2*D1.Y(),R2*D1.X())));
291             WellDone = Standard_True;
292             NbrSol = 1;
293           }
294         }
295         else if (Qualified1.IsOutside() && Qualified2.IsOutside()) {
296  //     =========================================================
297           if (Abs(dist+Min(R1,R2)-Max(R1,R2)) < Tol && dist > Tol) {
298             if (R1<R2) { D1 = gp_Dir2d(gp_Vec2d(C2.Location(),C1.Location()));}
299             else { D1 = gp_Dir2d(gp_Vec2d(C1.Location(),C2.Location())); }
300             linsol(1) = gp_Lin2d(gp_Pnt2d(C1.Location().XY()+R1*D1.XY()),
301  //         =============================================================
302                                  gp_Dir2d(D1.Y(),-D1.X()));
303  //                              =========================
304             qualifier1(1) = Qualified1.Qualifier();
305             qualifier2(1) = Qualified1.Qualifier();
306             pnttg1sol(1) = gp_Pnt2d(C1.Location().XY()+R1*D1.XY());
307             pnttg2sol(1) = pnttg1sol(1);
308             WellDone = Standard_True;
309             NbrSol = 1;
310           }
311           else {
312             gp_Pnt2d P1(C2.Location().Rotated(C1.Location(),
313                                               ASin((R2-R1)/dist)));
314             D1 = gp_Dir2d(gp_Vec2d(C1.Location(),P1));
315             P1 = gp_Pnt2d(C1.Location().XY()+gp_XY(-R1*D1.Y(),R1*D1.X()));
316             linsol(1) = gp_Lin2d(P1,D1);
317  //         ===========================
318             qualifier1(1) = Qualified1.Qualifier();
319             qualifier2(1) = Qualified1.Qualifier();
320             pnttg1sol(1) = P1;
321             pnttg2sol(1) = gp_Pnt2d(C2.Location().XY()+
322                                     (gp_XY(-R2*D1.Y(),R2*D1.X())));
323             WellDone = Standard_True;
324             NbrSol = 1;
325           }
326         }
327         else {
328           if ((Qualified1.IsUnqualified() && Qualified2.IsEnclosing()) ||
329  //       ===============================================================
330               (Qualified2.IsUnqualified() && Qualified1.IsEnclosing())) {
331  //           =========================================================
332             if (Qualified2.IsUnqualified()) { signe = 1; }
333             else { signe = -1; }
334             if (Abs(dist+Min(R1,R2)-Max(R1,R2)) < Tol && dist > Tol) {
335               if (R1<R2) { D1=gp_Dir2d(gp_Vec2d(C2.Location(),C1.Location()));}
336               else { D1 = gp_Dir2d(gp_Vec2d(C1.Location(),C2.Location())); }
337               linsol(1) = gp_Lin2d(gp_Pnt2d(C1.Location().XY()+R1*D1.XY()),
338  //           =============================================================
339                                    gp_Dir2d(-D1.Y(),D1.X()));
340  //                                =========================
341               qualifier1(1) = Qualified1.Qualifier();
342               qualifier2(1) = Qualified1.Qualifier();
343               pnttg1sol(1) = gp_Pnt2d(C1.Location().XY()+R1*D1.XY());
344               pnttg2sol(1) = pnttg1sol(1);
345               WellDone = Standard_True;
346               NbrSol = 1;
347             }
348             else {
349               gp_Pnt2d P1(C2.Location().Rotated(C1.Location(),
350                                                 ASin((R1-R2)/dist)));
351               D1 = gp_Dir2d(gp_Vec2d(C1.Location(),P1));
352               P1 = gp_Pnt2d(C1.Location().XY()+gp_XY(R1*D1.Y(),-R1*D1.X()));
353               linsol(1) = gp_Lin2d(P1,D1);
354  //           ===========================
355               qualifier1(1) = Qualified1.Qualifier();
356               qualifier2(1) = Qualified1.Qualifier();
357               pnttg1sol(1) = P1;
358               pnttg2sol(1) = gp_Pnt2d(C2.Location().XY()+
359                                       signe*(gp_XY(R2*D1.Y(),-R2*D1.X())));
360               WellDone = Standard_True;
361               NbrSol = 1;
362               if (Min(R1,R2)+Max(R1,R2)<dist) {
363                 gp_Pnt2d P2(C2.Location().Rotated(C1.Location(),
364                                                   ASin(signe*(R1+R2)/dist)));
365                 gp_Dir2d D2(gp_Vec2d(C1.Location(),P2));
366                 P2=gp_Pnt2d(C1.Location().XY()+
367                             signe*(gp_XY(R1*D2.Y(),-R1*D2.X())));
368                 linsol(2) = gp_Lin2d(P2,D2);
369  //             ===========================
370                 qualifier1(1) = Qualified1.Qualifier();
371                 qualifier2(1) = Qualified1.Qualifier();
372                 pnttg1sol(2) = P1;
373                 pnttg2sol(2) = gp_Pnt2d(C2.Location().XY()+
374                                         (gp_XY(-R2*D2.Y(),R2*D2.X())));
375                 NbrSol = 2;
376               }
377             }
378           }
379           else if ((Qualified1.IsUnqualified() && Qualified2.IsOutside()) ||
380  //       ==================================================================
381               (Qualified2.IsUnqualified() && Qualified1.IsOutside())) {
382  //           =======================================================
383             if (Qualified2.IsUnqualified()) { signe = 1; }
384             else { signe = -1; }
385             if (Abs(dist+Min(R1,R2)-Max(R1,R2)) <= Tol && dist >= Tol) {
386               if (R1<R2) { D1=gp_Dir2d(gp_Vec2d(C2.Location(),C1.Location()));}
387               else { D1 = gp_Dir2d(gp_Vec2d(C1.Location(),C2.Location())); }
388               linsol(1) = gp_Lin2d(gp_Pnt2d(C1.Location().XY()+R1*D1.XY()),
389  //           =============================================================
390                                    gp_Dir2d(D1.Y(),-D1.X()));
391  //                                =========================
392               qualifier1(1) = Qualified1.Qualifier();
393               qualifier2(1) = Qualified1.Qualifier();
394               pnttg1sol(1) = gp_Pnt2d(C1.Location().XY()+R1*D1.XY());
395               pnttg2sol(1) = pnttg1sol(1);
396               WellDone = Standard_True;
397               NbrSol = 1;
398             }
399             else {
400               gp_Pnt2d P1(C2.Location().Rotated(C1.Location(),
401                                                 ASin(signe*(R2-R1)/dist)));
402               D1 = gp_Dir2d(gp_Vec2d(C1.Location(),P1));
403               P1 = gp_Pnt2d(C1.Location().XY()+gp_XY(-R1*D1.Y(),R1*D1.X()));
404               linsol(1) = gp_Lin2d(P1,D1);
405  //           ===========================
406               qualifier1(1) = Qualified1.Qualifier();
407               qualifier2(1) = Qualified1.Qualifier();
408               pnttg1sol(1) = P1;
409               pnttg2sol(1) = gp_Pnt2d(C2.Location().XY()+
410                                       signe*(gp_XY(-R2*D1.Y(),R2*D1.X())));
411               WellDone = Standard_True;
412               NbrSol = 1;
413               if (Min(R1,R2)+Max(R1,R2)<dist) {
414                 gp_Pnt2d P2(C2.Location().Rotated(C1.Location(),
415                                                   ASin(signe*(-R2-R1)/dist)));
416                 gp_Dir2d D2(gp_Vec2d(C1.Location(),P2));
417                 P2=gp_Pnt2d(C1.Location().XY()+
418                             signe*(gp_XY(-R1*D2.Y(),R1*D2.X())));
419                 linsol(2) = gp_Lin2d(P2,D2);
420  //             ===========================
421                 qualifier1(1) = Qualified1.Qualifier();
422                 qualifier2(1) = Qualified1.Qualifier();
423                 pnttg1sol(2) = P2;
424                 pnttg2sol(2) = gp_Pnt2d(C2.Location().XY()+
425                                         signe*(gp_XY(R2*D2.Y(),-R2*D2.X())));
426                 NbrSol = 2;
427               }
428             }
429           }
430         }
431       }
432       else {
433         for (Standard_Integer i = 1 ; i <= 2 ; i++) {
434           signe = -signe;
435           NbrSol++;
436           gp_Pnt2d P1(C2.Location().Rotated(C1.Location(),
437                                             ASin(signe*(R2-R1)/dist)));
438           D1 = gp_Dir2d(gp_Vec2d(C1.Location(),P1));
439           P1 = gp_Pnt2d(C1.Location().XY()+signe*gp_XY(-R1*D1.Y(),R1*D1.X()));
440           linsol(NbrSol) = gp_Lin2d(P1,D1);
441  //       ===========================
442           qualifier1(NbrSol) = Qualified1.Qualifier();
443           qualifier2(NbrSol) = Qualified1.Qualifier();
444           pnttg1sol(NbrSol) = P1;
445           pnttg2sol(NbrSol) = gp_Pnt2d(C2.Location().XY()+
446                                        signe*(gp_XY(-R2*D1.Y(),R2*D1.X())));
447           WellDone = Standard_True;
448           if (Min(R1,R2)+Max(R1,R2)<dist) {
449             gp_Pnt2d P2(C2.Location().Rotated(C1.Location(),
450                                               ASin(signe*(R2+R1)/dist)));
451             gp_Dir2d D2(gp_Vec2d(C1.Location(),P2));
452             P2=gp_Pnt2d(C1.Location().XY()+
453                         signe*(gp_XY(R1*D2.Y(),-R1*D2.X())));
454             NbrSol++;
455             linsol(NbrSol) = gp_Lin2d(P2,D2);
456  //         ================================
457             qualifier1(NbrSol) = Qualified1.Qualifier();
458             qualifier2(NbrSol) = Qualified1.Qualifier();
459             pnttg1sol(NbrSol) = P2;
460             pnttg2sol(NbrSol) = gp_Pnt2d(C2.Location().XY()+
461                                          signe*(gp_XY(-R2*D2.Y(),R2*D2.X())));
462          }
463        }
464      }
465    }
466    for (Standard_Integer i = 1 ; i <= NbrSol ; i++) {
467      par1sol(i)=ElCLib::Parameter(linsol(i),pnttg1sol(i));
468      par2sol(i)=ElCLib::Parameter(linsol(i),pnttg2sol(i));
469      pararg1(i)=ElCLib::Parameter(C1,pnttg1sol(i));
470      pararg2(i)=ElCLib::Parameter(C2,pnttg2sol(i));
471    }
472  }
473
474 Standard_Boolean GccAna_Lin2d2Tan::
475    IsDone () const { return WellDone; }
476
477 Standard_Integer GccAna_Lin2d2Tan::
478    NbSolutions () const { return NbrSol; }
479
480 gp_Lin2d GccAna_Lin2d2Tan::
481    ThisSolution (const Standard_Integer Index) const {
482
483    if (Index > NbrSol || Index <= 0) { Standard_OutOfRange::Raise(); }
484    return linsol(Index);
485  }
486
487 void GccAna_Lin2d2Tan::
488   WhichQualifier(const Standard_Integer Index   ,
489                        GccEnt_Position& Qualif1 ,
490                        GccEnt_Position& Qualif2 ) const
491 {
492   if (!WellDone) { StdFail_NotDone::Raise(); }
493    else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
494    else {
495      Qualif1 = qualifier1(Index);
496      Qualif2 = qualifier2(Index);
497    }
498 }
499
500 void GccAna_Lin2d2Tan::
501    Tangency1 (const Standard_Integer Index,
502               Standard_Real& ParSol,
503               Standard_Real& ParArg,
504               gp_Pnt2d& PntSol) const {
505    if (!WellDone) { StdFail_NotDone::Raise(); }
506    else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
507    else {
508      ParSol = par1sol(Index);
509      ParArg = pararg1(Index);
510      PntSol = gp_Pnt2d(pnttg1sol(Index));
511    }
512  }
513
514 void GccAna_Lin2d2Tan::
515    Tangency2 (const Standard_Integer   Index  ,
516                     Standard_Real&     ParSol ,
517                     Standard_Real&     ParArg ,
518                     gp_Pnt2d& PntSol ) const {
519    if (!WellDone) { StdFail_NotDone::Raise(); }
520    else if (Index <= 0 ||Index > NbrSol) { Standard_OutOfRange::Raise(); }
521    else {
522      ParSol = par2sol(Index);
523      ParArg = pararg2(Index);
524      PntSol = gp_Pnt2d(pnttg2sol(Index));
525    }
526  }