1 // Created on: 1991-03-21
2 // Created by: Philippe DAUTRY
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License 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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _GccAna_Circ2d2TanRad_HeaderFile
18 #define _GccAna_Circ2d2TanRad_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <GccEnt_Array1OfPosition.hxx>
26 #include <TColStd_Array1OfInteger.hxx>
27 #include <Standard_Integer.hxx>
28 #include <TColgp_Array1OfCirc2d.hxx>
29 #include <TColgp_Array1OfPnt2d.hxx>
30 #include <TColStd_Array1OfReal.hxx>
31 #include <Standard_Real.hxx>
32 #include <GccEnt_Position.hxx>
33 class Standard_NegativeValue;
34 class Standard_OutOfRange;
35 class GccEnt_BadQualifier;
36 class StdFail_NotDone;
37 class GccEnt_QualifiedCirc;
38 class GccEnt_QualifiedLin;
43 //! This class implements the algorithms used to
44 //! create 2d circles tangent to 2
45 //! points/lines/circles and with a given radius.
46 //! For each construction methods arguments are:
47 //! - Two Qualified elements for tangency constraints.
48 //! (for example EnclosedCirc if we want the
49 //! solution inside the argument EnclosedCirc).
50 //! - Two Reals. One (Radius) for the radius and the
51 //! other (Tolerance) for the tolerance.
52 //! Tolerance is only used for the limit cases.
54 //! We want to create a circle inside a circle C1 and
55 //! inside a circle C2 with a radius Radius and a
56 //! tolerance Tolerance.
57 //! If we do not use Tolerance it is impossible to
58 //! find a solution in the following case : C2 is
59 //! inside C1 and there is no intersection point
60 //! between the two circles.
61 //! With Tolerance it gives a solution if the lowest
62 //! distance between C1 and C2 is lower than or equal
64 class GccAna_Circ2d2TanRad
71 //! This method implements the algorithms used to
72 //! create 2d circles TANgent to two 2d circle with a
74 //! It raises NegativeValue if Radius is lower than zero.
75 Standard_EXPORT GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified1, const GccEnt_QualifiedCirc& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance);
77 //! This method implements the algorithms used to
78 //! create 2d circles TANgent to a 2d circle and a 2d line
79 //! with a radius of Radius.
80 //! It raises NegativeValue if Radius is lower than zero.
81 Standard_EXPORT GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified1, const GccEnt_QualifiedLin& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance);
83 //! This method implements the algorithms used to
84 //! create 2d circles TANgent to a 2d circle and a point
85 //! with a radius of Radius.
86 //! It raises NegativeValue if Radius is lower than zero.
87 Standard_EXPORT GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified1, const gp_Pnt2d& Point2, const Standard_Real Radius, const Standard_Real Tolerance);
89 //! This method implements the algorithms used to
90 //! create 2d circles TANgent to a 2d line and a point
91 //! with a radius of Radius.
92 //! It raises NegativeValue if Radius is lower than zero.
93 Standard_EXPORT GccAna_Circ2d2TanRad(const GccEnt_QualifiedLin& Qualified1, const gp_Pnt2d& Point2, const Standard_Real Radius, const Standard_Real Tolerance);
95 //! This method implements the algorithms used to
96 //! create 2d circles TANgent to two 2d lines
97 //! with a radius of Radius.
98 //! It raises NegativeValue if Radius is lower than zero.
99 Standard_EXPORT GccAna_Circ2d2TanRad(const GccEnt_QualifiedLin& Qualified1, const GccEnt_QualifiedLin& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance);
101 //! This method implements the algorithms used to
102 //! create 2d circles passing through two points with a
103 //! radius of Radius.
104 //! It raises NegativeValue if Radius is lower than zero.
105 Standard_EXPORT GccAna_Circ2d2TanRad(const gp_Pnt2d& Point1, const gp_Pnt2d& Point2, const Standard_Real Radius, const Standard_Real Tolerance);
107 //! This method returns True if the algorithm succeeded.
108 //! Note: IsDone protects against a failure arising from a
109 //! more internal intersection algorithm, which has reached its numeric limits.
110 Standard_EXPORT Standard_Boolean IsDone() const;
112 //! This method returns the number of circles, representing solutions computed by this algorithm.
114 //! StdFail_NotDone if the construction fails. of solutions.
115 Standard_EXPORT Standard_Integer NbSolutions() const;
117 //! Returns the solution number Index.
118 //! Be careful: the Index is only a way to get all the
119 //! solutions, but is not associated to those outside the context
120 //! of the algorithm-object. Raises OutOfRange exception if Index is greater
121 //! than the number of solutions.
122 //! It raises NotDone if the construction algorithm did not
124 Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const;
126 //! Returns the information about the qualifiers of
127 //! the tangency arguments concerning the solution number Index.
128 //! It returns the real qualifiers (the qualifiers given to the
129 //! constructor method in case of enclosed, enclosing and outside
130 //! and the qualifiers computedin case of unqualified).
131 Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1, GccEnt_Position& Qualif2) const;
133 //! Returns information about the tangency point between the
134 //! result number Index and the first argument.
135 //! ParSol is the intrinsic parameter of the point PntSol on the solution.
136 //! ParArg is the intrinsic parameter of the point PntSol on the first
137 //! argument. Raises OutOfRange if Index is greater than the number
139 //! It raises NotDone if the construction algorithm did not succeed
140 Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
142 //! Returns information about the tangency point between the
143 //! result number Index and the second argument.
144 //! ParSol is the intrinsic parameter of the point PntSol on
146 //! ParArg is the intrinsic parameter of the point PntArg on
147 //! the second argument. Raises OutOfRange if Index is greater than the number
149 //! It raises NotDone if the construction algorithm did not succeed.
150 Standard_EXPORT void Tangency2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
152 //! Returns True if the solution number Index is equal to
153 //! the first argument. Raises OutOfRange if Index is greater than the number
155 //! It raises NotDone if the construction algorithm did not
157 Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const;
159 //! Returns True if the solution number Index is equal to
160 //! the second argument. Raises OutOfRange if Index is greater than the number
162 //! It raises NotDone if the construction algorithm did not succeed.
163 Standard_EXPORT Standard_Boolean IsTheSame2 (const Standard_Integer Index) const;
178 Standard_Boolean WellDone;
179 GccEnt_Array1OfPosition qualifier1;
180 GccEnt_Array1OfPosition qualifier2;
181 TColStd_Array1OfInteger TheSame1;
182 TColStd_Array1OfInteger TheSame2;
183 Standard_Integer NbrSol;
184 TColgp_Array1OfCirc2d cirsol;
185 TColgp_Array1OfPnt2d pnttg1sol;
186 TColgp_Array1OfPnt2d pnttg2sol;
187 TColStd_Array1OfReal par1sol;
188 TColStd_Array1OfReal par2sol;
189 TColStd_Array1OfReal pararg1;
190 TColStd_Array1OfReal pararg2;
201 #endif // _GccAna_Circ2d2TanRad_HeaderFile