1 // Created on: 1992-10-20
2 // Created by: Remi GILET
3 // Copyright (c) 1992-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_Circ2d2TanOn_HeaderFile
18 #define _Geom2dGcc_Circ2d2TanOn_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TColgp_Array1OfCirc2d.hxx>
25 #include <Standard_Integer.hxx>
26 #include <GccEnt_Array1OfPosition.hxx>
27 #include <TColStd_Array1OfInteger.hxx>
28 #include <TColgp_Array1OfPnt2d.hxx>
29 #include <TColStd_Array1OfReal.hxx>
30 #include <GccEnt_Position.hxx>
31 class Geom2dGcc_QualifiedCurve;
32 class Geom2dAdaptor_Curve;
34 class GccAna_Circ2d2TanOn;
35 class Geom2dGcc_Circ2d2TanOnGeo;
40 //! This class implements the algorithms used to
41 //! create 2d circles TANgent to 2 entities and
42 //! having the center ON a curve.
43 //! The order of the tangency argument is always
44 //! QualifiedCirc, QualifiedLin, QualifiedCurv, Pnt2d.
45 //! the arguments are :
46 //! - The two tangency arguments.
47 //! - The center line.
48 //! - The parameter for each tangency argument which
51 class Geom2dGcc_Circ2d2TanOn
58 //! This method implements the algorithms used to
59 //! create 2d circles TANgent to two curves and
60 //! having the center ON a 2d curve.
61 //! Param1 is the initial guess on the first curve QualifiedCurv.
62 //! Param1 is the initial guess on the second curve QualifiedCurv.
63 //! ParamOn is the initial guess on the center curve OnCurv.
64 //! Tolerance is used for the limit cases.
65 Standard_EXPORT Geom2dGcc_Circ2d2TanOn(const Geom2dGcc_QualifiedCurve& Qualified1, const Geom2dGcc_QualifiedCurve& Qualified2, const Geom2dAdaptor_Curve& OnCurve, const Standard_Real Tolerance, const Standard_Real Param1, const Standard_Real Param2, const Standard_Real ParamOn);
67 //! This method implements the algorithms used to
68 //! create 2d circles TANgent to one curve and one point and
69 //! having the center ON a 2d curve.
70 //! Param1 is the initial guess on the first curve QualifiedCurv.
71 //! ParamOn is the initial guess on the center curve OnCurv.
72 //! Tolerance is used for the limit cases.
73 Standard_EXPORT Geom2dGcc_Circ2d2TanOn(const Geom2dGcc_QualifiedCurve& Qualified1, const Handle(Geom2d_Point)& Point, const Geom2dAdaptor_Curve& OnCurve, const Standard_Real Tolerance, const Standard_Real Param1, const Standard_Real ParamOn);
75 //! This method implements the algorithms used to
76 //! create 2d circles TANgent to two points and
77 //! having the center ON a 2d curve.
78 //! Tolerance is used for the limit cases.
79 Standard_EXPORT Geom2dGcc_Circ2d2TanOn(const Handle(Geom2d_Point)& Point1, const Handle(Geom2d_Point)& Point2, const Geom2dAdaptor_Curve& OnCurve, const Standard_Real Tolerance);
81 Standard_EXPORT void Results (const GccAna_Circ2d2TanOn& Circ);
83 Standard_EXPORT void Results (const Geom2dGcc_Circ2d2TanOnGeo& Circ);
85 //! Returns true if the construction algorithm does not fail
86 //! (even if it finds no solution).
87 //! Note: IsDone protects against a failure arising from a
88 //! more internal intersection algorithm, which has
89 //! reached its numeric limits.
90 Standard_EXPORT Standard_Boolean IsDone() const;
92 //! This method returns the number of solutions.
93 //! NotDone is raised if the algorithm failed.
94 Standard_EXPORT Standard_Integer NbSolutions() const;
96 //! Returns the solution number Index and raises OutOfRange
97 //! exception if Index is greater than the number of solutions.
98 //! Be careful: the Index is only a way to get all the
99 //! solutions, but is not associated to these outside the context
100 //! of the algorithm-object.
102 //! Standard_OutOfRange if Index is less than or equal
103 //! to zero or greater than the number of solutions
104 //! computed by this algorithm.
105 //! StdFail_NotDone if the construction fails.
106 Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const;
108 //! It returns the information about the qualifiers of
110 //! arguments concerning the solution number Index.
111 //! It returns the real qualifiers (the qualifiers given to the
112 //! constructor method in case of enclosed, enclosing and outside
113 //! and the qualifiers computedin case of unqualified).
115 //! Standard_OutOfRange if Index is less than zero or
116 //! greater than the number of solutions computed by this algorithm.
117 //! StdFail_NotDone if the construction fails.
118 Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1, GccEnt_Position& Qualif2) const;
120 //! Returns information about the tangency point between the
121 //! result and the first argument.
122 //! ParSol is the intrinsic parameter of the point PntSol on the solution curv.
123 //! ParArg is the intrinsic parameter of the point PntSol on the argument curv.
124 Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
126 //! Returns information about the tangency point between the
127 //! result and the second argument.
128 //! ParSol is the intrinsic parameter of the point PntSol on the solution curv.
129 //! ParArg is the intrinsic parameter of the point PntSol on the argument curv.
130 Standard_EXPORT void Tangency2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
132 //! Returns the center PntSol of the solution of index Index
133 //! computed by this algorithm.
134 //! ParArg is the parameter of the point PntSol on the third argument.
136 //! Standard_OutOfRange if Index is less than zero or
137 //! greater than the number of solutions computed by this algorithm.
138 //! StdFail_NotDone if the construction fails.
139 Standard_EXPORT void CenterOn3 (const Standard_Integer Index, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
141 //! Returns true if the solution of index Index and,
142 //! respectively, the first or second argument of this
143 //! algorithm are the same (i.e. there are 2 identical circles).
144 //! If Rarg is the radius of the first or second argument,
145 //! Rsol is the radius of the solution and dist is the
146 //! distance between the two centers, we consider the two
147 //! circles to be identical if |Rarg - Rsol| and dist
148 //! are less than or equal to the tolerance criterion given at
149 //! the time of construction of this algorithm.
151 //! Standard_OutOfRange if Index is less than zero or
152 //! greater than the number of solutions computed by this algorithm.
153 //! StdFail_NotDone if the construction fails.
154 Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const;
156 //! Returns true if the solution of index Index and,
157 //! respectively, the first or second argument of this
158 //! algorithm are the same (i.e. there are 2 identical circles).
159 //! If Rarg is the radius of the first or second argument,
160 //! Rsol is the radius of the solution and dist is the
161 //! distance between the two centers, we consider the two
162 //! circles to be identical if |Rarg - Rsol| and dist
163 //! are less than or equal to the tolerance criterion given at
164 //! the time of construction of this algorithm.
166 //! Standard_OutOfRange if Index is less than zero or
167 //! greater than the number of solutions computed by this algorithm.
168 //! StdFail_NotDone if the construction fails.
169 Standard_EXPORT Standard_Boolean IsTheSame2 (const Standard_Integer Index) const;
184 Standard_Boolean WellDone;
185 TColgp_Array1OfCirc2d cirsol;
186 Standard_Integer NbrSol;
187 GccEnt_Array1OfPosition qualifier1;
188 GccEnt_Array1OfPosition qualifier2;
189 TColStd_Array1OfInteger TheSame1;
190 TColStd_Array1OfInteger TheSame2;
191 TColgp_Array1OfPnt2d pnttg1sol;
192 TColgp_Array1OfPnt2d pnttg2sol;
193 TColgp_Array1OfPnt2d pntcen;
194 TColStd_Array1OfReal par1sol;
195 TColStd_Array1OfReal par2sol;
196 TColStd_Array1OfReal pararg1;
197 TColStd_Array1OfReal pararg2;
198 TColStd_Array1OfReal parcen3;
199 Standard_Boolean Invert;
210 #endif // _Geom2dGcc_Circ2d2TanOn_HeaderFile