42cf5bc1 |
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 |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Geom2dGcc_Circ2dTanCenGeo_HeaderFile |
18 | #define _Geom2dGcc_Circ2dTanCenGeo_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
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; |
36 | class gp_Pnt2d; |
37 | class gp_Circ2d; |
38 | |
39 | |
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 |
45 | //! (QualifiedCurv). |
46 | //! -The center point Pcenter. |
47 | //! - A real Tolerance. |
48 | //! Tolerance is only used in the limits cases. |
49 | //! For example : |
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 |
54 | //! outside C1. |
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 |
58 | { |
59 | public: |
60 | |
61 | DEFINE_STANDARD_ALLOC |
62 | |
63 | |
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); |
68 | |
69 | //! This method returns True if the construction |
70 | //! algorithm succeeded. |
71 | Standard_EXPORT Standard_Boolean IsDone() const; |
72 | |
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 |
76 | //! didn't succeed. |
77 | Standard_EXPORT Standard_Integer NbSolutions() const; |
78 | |
79 | //! Returns the solution number Index and raises OutOfRange |
80 | //! exception if Index is greater than the number of solutions. |
a25d5aaa |
81 | //! Be careful: the Index is only a way to get all the |
82 | //! solutions, but is not associated to these outside the |
42cf5bc1 |
83 | //! context of the algorithm-object. |
84 | //! It raises NotDone if the construction algorithm |
85 | //! didn't succeed. |
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; |
89 | |
90 | Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const; |
91 | |
21c7c457 |
92 | //! Returns information about the tangency point between the |
42cf5bc1 |
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 |
99 | //! didn't succeed. |
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; |
103 | |
104 | |
105 | |
106 | |
107 | protected: |
108 | |
109 | |
110 | |
111 | |
112 | |
113 | private: |
114 | |
115 | |
116 | |
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; |
124 | |
125 | |
126 | }; |
127 | |
128 | |
129 | |
130 | |
131 | |
132 | |
133 | |
134 | #endif // _Geom2dGcc_Circ2dTanCenGeo_HeaderFile |