1 // Created on: 1991-04-03
2 // Created by: Remi GILET
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 _Geom2dGcc_Circ2dTanOnRadGeo_HeaderFile
18 #define _Geom2dGcc_Circ2dTanOnRadGeo_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <TColgp_Array1OfCirc2d.hxx>
27 #include <GccEnt_Array1OfPosition.hxx>
28 #include <TColStd_Array1OfInteger.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 Geom2dGcc_QCurve;
40 class GccEnt_QualifiedCirc;
41 class Geom2dAdaptor_Curve;
42 class GccEnt_QualifiedLin;
46 //! This class implements the algorithms used to
47 //! create a 2d circle tangent to a 2d entity,
48 //! centered on a 2d entity and with a given radius.
49 //! More than one argument must be a curve.
50 //! The arguments of all construction methods are :
51 //! - The qualified element for the tangency constrains
52 //! (QualifiedCirc, QualifiedLin, QualifiedCurvPoints).
53 //! - The Center element (circle, line, curve).
54 //! - A real Tolerance.
55 //! Tolerance is only used in the limits cases.
57 //! We want to create a circle tangent to an OutsideCurv Cu1
58 //! centered on a line OnLine with a radius Radius and with
59 //! a tolerance Tolerance.
60 //! If we did not use Tolerance it is impossible to
61 //! find a solution in the following case : OnLine is
62 //! outside Cu1. There is no intersection point between Cu1
63 //! and OnLine. The distance between the line and the
64 //! circle is greater than Radius.
65 //! With Tolerance we will give a solution if the
66 //! distance between Cu1 and OnLine is lower than or
68 class Geom2dGcc_Circ2dTanOnRadGeo
75 //! This methods implements the algorithms used to create
76 //! 2d Circles tangent to a curve and centered on a 2d Line
77 //! with a given radius.
78 //! Tolerance is used to find solution in every limit cases.
79 //! raises NegativeValue in case of NegativeRadius.
80 Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Qualified1, const gp_Lin2d& OnLine, const Standard_Real Radius, const Standard_Real Tolerance);
82 //! This methods implements the algorithms used to create
83 //! 2d Circles tangent to a curve and centered on a 2d Circle
84 //! with a given radius.
85 //! Tolerance is used to find solution in every limit cases.
86 //! raises NegativeValue in case of NegativeRadius.
87 Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Qualified1, const gp_Circ2d& OnCirc, const Standard_Real Radius, const Standard_Real Tolerance);
89 //! This methods implements the algorithms used to create
90 //! 2d Circles tangent to a circle and centered on a 2d curve
91 //! with a given radius.
92 //! Tolerance is used to find solution in every limit cases.
93 //! raises NegativeValue in case of NegativeRadius.
94 Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedCirc& Qualified1, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Radius, const Standard_Real Tolerance);
96 //! This methods implements the algorithms used to create
97 //! 2d Circles tangent to a 2d Line and centered on a 2d curve
98 //! with a given radius.
99 //! Tolerance is used to find solution in every limit cases.
100 //! raises NegativeValue in case of NegativeRadius.
101 Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedLin& Qualified1, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Radius, const Standard_Real Tolerance);
103 //! This methods implements the algorithms used to create
104 //! 2d Circles tangent to a 2d curve and centered on a 2d curve
105 //! with a given radius.
106 //! Tolerance is used to find solution in every limit cases.
107 //! raises NegativeValue in case of NegativeRadius.
108 Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Qualified1, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Radius, const Standard_Real Tolerance);
110 //! This methods implements the algorithms used to create
111 //! 2d Circles passing through a 2d point and centered on a
112 //! 2d curve with a given radius.
113 //! Tolerance is used to find solution in every limit cases.
114 //! raises NegativeValue in case of NegativeRadius.
115 Standard_EXPORT Geom2dGcc_Circ2dTanOnRadGeo(const gp_Pnt2d& Point1, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Radius, const Standard_Real Tolerance);
117 //! This method returns True if the construction
118 //! algorithm succeeded.
119 Standard_EXPORT Standard_Boolean IsDone() const;
121 //! This method returns the number of solutions.
122 //! It raises NotDone if the construction algorithm
124 Standard_EXPORT Standard_Integer NbSolutions() const;
126 //! Returns the solution number Index and raises OutOfRange
127 //! exception if Index is greater than the number of solutions.
128 //! Be careful: the Index is only a way to get all the
129 //! solutions, but is not associated to theses outside the
130 //! context of the algorithm-object.
131 //! It raises NotDone if the construction algorithm
133 //! It raises OutOfRange if Index is greater than the
134 //! number of solutions.
135 Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const;
137 Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const;
139 //! Returns information about the tangency point between the
140 //! result number Index and the first argument.
141 //! ParSol is the intrinsic parameter of the point on the
143 //! ParArg is the intrinsic parameter of the point on the
145 //! PntSol is the tangency point on the solution curv.
146 //! PntArg is the tangency point on the argument curv.
147 //! It raises NotDone if the construction algorithm
149 //! It raises OutOfRange if Index is greater than the
150 //! number of solutions.
151 Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
153 //! Returns information about the center (on the curv)
155 //! ParArg is the intrinsic parameter of the point on
156 //! the argument curv.
157 //! PntSol is the center point of the solution curv.
158 //! It raises NotDone if the construction algorithm
160 //! It raises OutOfRange if Index is greater than the
161 //! number of solutions.
162 Standard_EXPORT void CenterOn3 (const Standard_Integer Index, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
164 //! Returns True if the solution number Index is equal to
165 //! the first argument and False in the other cases.
166 //! It raises NotDone if the construction algorithm
168 //! It raises OutOfRange if Index is greater than the
169 //! number of solutions.
170 Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const;
185 Standard_Boolean WellDone;
186 Standard_Integer NbrSol;
187 TColgp_Array1OfCirc2d cirsol;
188 GccEnt_Array1OfPosition qualifier1;
189 TColStd_Array1OfInteger TheSame1;
190 TColgp_Array1OfPnt2d pnttg1sol;
191 TColgp_Array1OfPnt2d pntcen3;
192 TColStd_Array1OfReal par1sol;
193 TColStd_Array1OfReal pararg1;
194 TColStd_Array1OfReal parcen3;
205 #endif // _Geom2dGcc_Circ2dTanOnRadGeo_HeaderFile