1 // Created on: 1991-03-28
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_Circ2dTanCenGeo_HeaderFile
18 #define _Geom2dGcc_Circ2dTanCenGeo_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 <TColgp_Array1OfPnt2d.hxx>
29 #include <TColStd_Array1OfReal.hxx>
30 #include <Standard_Real.hxx>
31 #include <GccEnt_Position.hxx>
32 class Standard_OutOfRange;
33 class GccEnt_BadQualifier;
34 class StdFail_NotDone;
35 class Geom2dGcc_QCurve;
40 //! This class implements the algorithms used to
41 //! create 2d circles tangent to a curve and
42 //! centered on a point.
43 //! The arguments of all construction methods are :
44 //! - The qualified element for the tangency constrains
46 //! -The center point Pcenter.
47 //! - A real Tolerance.
48 //! Tolerance is only used in the limits cases.
50 //! We want to create a circle tangent to an EnclosedCurv C1
51 //! with a tolerance Tolerance.
52 //! If we did not use Tolerance it is impossible to
53 //! find a solution in the following case : Pcenter is
55 //! With Tolerance we will give a solution if the distance
56 //! between C1 and Pcenter is lower than or equal Tolerance/2.
57 class Geom2dGcc_Circ2dTanCenGeo
64 //! This method implements the algorithms used to
65 //! create 2d circles tangent to a circle and
66 //! centered on a point.
67 Standard_EXPORT Geom2dGcc_Circ2dTanCenGeo(const Geom2dGcc_QCurve& Qualified1, const gp_Pnt2d& Pcenter, const Standard_Real Tolerance);
69 //! This method returns True if the construction
70 //! algorithm succeeded.
71 Standard_EXPORT Standard_Boolean IsDone() const;
73 //! Returns the number of solutions and raises NotDone
74 //! exception if the algorithm didn't succeed.
75 //! It raises NotDone if the construction algorithm
77 Standard_EXPORT Standard_Integer NbSolutions() const;
79 //! Returns the solution number Index and raises OutOfRange
80 //! exception if Index is greater than the number of solutions.
81 //! Be careful: the Index is only a way to get all the
82 //! solutions, but is not associated to these outside the
83 //! context of the algorithm-object.
84 //! It raises NotDone if the construction algorithm
86 //! It raises OutOfRange if Index is greater than the
87 //! number of solutions or less than zero.
88 Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const;
90 Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const;
92 //! Returns information about the tangency point between the
93 //! result number Index and the first argument.
94 //! ParSol is the intrinsic parameter of the point PntSol
95 //! on the solution curv.
96 //! ParArg is the intrinsic parameter of the point PntArg
97 //! on the argument curv.
98 //! It raises NotDone if the construction algorithm
100 //! It raises OutOfRange if Index is greater than the
101 //! number of solutions or less than zero.
102 Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
117 Standard_Boolean WellDone;
118 Standard_Integer NbrSol;
119 TColgp_Array1OfCirc2d cirsol;
120 GccEnt_Array1OfPosition qualifier1;
121 TColgp_Array1OfPnt2d pnttg1sol;
122 TColStd_Array1OfReal par1sol;
123 TColStd_Array1OfReal pararg1;
134 #endif // _Geom2dGcc_Circ2dTanCenGeo_HeaderFile