0024510: Remove unused local variables
[occt.git] / src / GccAna / GccAna_Circ2d2TanOn_5.cxx
CommitLineData
b311480e 1// Created on: 1992-01-02
2// Created by: Remi GILET
3// Copyright (c) 1992-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
973c2be1 8// This library is free software; you can redistribute it and / or modify it
9// under the terms of the GNU Lesser General Public version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <GccAna_Circ2d2TanOn.jxx>
18
19#include <ElCLib.hxx>
20#include <gp_Dir2d.hxx>
21#include <gp_Ax2d.hxx>
22#include <IntAna2d_AnaIntersection.hxx>
23#include <IntAna2d_IntPoint.hxx>
24
25//=========================================================================
0d969553
Y
26// Creation of a circle passing by : 2 points Point1 and Point2. +
27// Centered on : 1 straight line OnLine. +
28// with a Tolerance of precision : Tolerance. +
7fd59977 29// +
0d969553
Y
30// Create L1 straight line of points equidistant from Point1 and Point2. +
31// Then create solutions cirsol such as : +
32// cirsol is all circle with center at the intersections of +
33// L1 with OnLine and the radius the distance between Point1 and the point +
34// calculated above. +
7fd59977 35//=========================================================================
36
37GccAna_Circ2d2TanOn::
38 GccAna_Circ2d2TanOn (const gp_Pnt2d& Point1 ,
39 const gp_Pnt2d& Point2 ,
40 const gp_Lin2d& OnLine ,
41 const Standard_Real Tolerance ):
42 cirsol(1,2) ,
43 qualifier1(1,2) ,
44 qualifier2(1,2),
45 TheSame1(1,2) ,
46 TheSame2(1,2) ,
47 pnttg1sol(1,2) ,
48 pnttg2sol(1,2) ,
49 pntcen(1,2) ,
50 par1sol(1,2) ,
51 par2sol(1,2) ,
52 pararg1(1,2) ,
53 pararg2(1,2) ,
54 parcen3(1,2)
55{
56 TheSame1.Init(0);
57 TheSame2.Init(0);
58 WellDone = Standard_False;
59 NbrSol = 0;
60
61 gp_Dir2d dirx(1.,0.);
62 Standard_Real dist = Point1.Distance(Point2);
63 if (dist < Abs(Tolerance)) { WellDone = Standard_True; }
64 else {
65 gp_Lin2d L1(gp_Pnt2d((Point1.XY()+Point2.XY())/2.0),
66 gp_Dir2d(Point1.Y()-Point2.Y(),Point2.X()-Point1.X()));
67 IntAna2d_AnaIntersection Intp(L1,OnLine);
68 if (Intp.IsDone()) {
69 if (!Intp.IsEmpty()) {
70 for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
71 NbrSol++;
72 gp_Ax2d axe(Intp.Point(i).Value(),dirx);
73 cirsol(NbrSol)=gp_Circ2d(axe,Point1.Distance(Intp.Point(i).Value()));
74// ====================================================================
75 qualifier1(NbrSol) = GccEnt_noqualifier;
76 qualifier2(NbrSol) = GccEnt_noqualifier;
77 pnttg1sol(NbrSol) = Point1;
78 pnttg2sol(NbrSol) = Point2;
79 pntcen(NbrSol) = cirsol(NbrSol).Location();
80 pararg1(NbrSol) = 0.;
81 pararg2(NbrSol) = 0.;
82 par1sol(NbrSol)=ElCLib::Parameter(cirsol(NbrSol),pnttg1sol(NbrSol));
83 par2sol(NbrSol)=ElCLib::Parameter(cirsol(NbrSol),pnttg2sol(NbrSol));
84 parcen3(NbrSol)=ElCLib::Parameter(OnLine,pntcen(NbrSol));
85 }
86 }
87 WellDone = Standard_True;
88 }
89 }
90}
91
92
93
94
95
96