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_Lin2d2Tan_HeaderFile
18 #define _Geom2dGcc_Lin2d2Tan_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
23 #include <Standard_Integer.hxx>
24 #include <TColgp_Array1OfLin2d.hxx>
25 #include <GccEnt_Array1OfPosition.hxx>
26 #include <TColgp_Array1OfPnt2d.hxx>
27 #include <TColStd_Array1OfReal.hxx>
28 #include <GccEnt_Position.hxx>
29 class Geom2dGcc_QualifiedCurve;
32 class Geom2dGcc_Lin2d2TanIter;
33 class Geom2dAdaptor_Curve;
36 //! This class implements the algorithms used to
37 //! create 2d lines tangent to 2 other elements which
38 //! can be circles, curves or points.
39 //! More than one argument must be a curve.
40 //! Describes functions for building a 2D line:
41 //! - tangential to 2 curves, or
42 //! - tangential to a curve and passing through a point.
43 //! A Lin2d2Tan object provides a framework for:
44 //! - defining the construction of 2D line(s),
45 //! - implementing the construction algorithm, and
46 //! - consulting the result(s).
48 //! Note: Some constructors may check the type of the qualified argument
49 //! and raise BadQualifier Error in case of incorrect couple (qualifier, curv).
50 class Geom2dGcc_Lin2d2Tan
57 //! This class implements the algorithms used to create 2d
58 //! line tangent to two curves.
59 //! Tolang is used to determine the tolerance for the tangency points.
60 Standard_EXPORT Geom2dGcc_Lin2d2Tan(const Geom2dGcc_QualifiedCurve& Qualified1, const Geom2dGcc_QualifiedCurve& Qualified2, const Standard_Real Tolang);
62 //! This class implements the algorithms used to create 2d
63 //! lines passing through a point and tangent to a curve.
64 //! Tolang is used to determine the tolerance for the tangency points.
65 Standard_EXPORT Geom2dGcc_Lin2d2Tan(const Geom2dGcc_QualifiedCurve& Qualified1, const gp_Pnt2d& ThePoint, const Standard_Real Tolang);
67 //! This class implements the algorithms used to create 2d
68 //! line tangent to two curves.
69 //! Tolang is used to determine the tolerance for the tangency points.
70 //! Param1 is used for the initial guess on the first curve.
71 //! Param2 is used for the initial guess on the second curve.
72 Standard_EXPORT Geom2dGcc_Lin2d2Tan(const Geom2dGcc_QualifiedCurve& Qualified1, const Geom2dGcc_QualifiedCurve& Qualified2, const Standard_Real Tolang, const Standard_Real Param1, const Standard_Real Param2);
74 //! This class implements the algorithms used to create 2d
75 //! lines passing through a point and tangent to a curve.
76 //! Tolang is used to determine the tolerance for the tangency points.
77 //! Param2 is used for the initial guess on the curve.
78 Standard_EXPORT Geom2dGcc_Lin2d2Tan(const Geom2dGcc_QualifiedCurve& Qualified1, const gp_Pnt2d& ThePoint, const Standard_Real Tolang, const Standard_Real Param1);
80 //! Returns true if the construction algorithm does not fail
81 //! (even if it finds no solution).
82 //! Note: IsDone protects against a failure arising from a
83 //! more internal intersection algorithm, which has
84 //! reached its numeric limits.
85 Standard_EXPORT Standard_Boolean IsDone() const;
87 //! Returns the number of lines, representing solutions computed by this algorithm.
88 //! Exceptions StdFail_NotDone if the construction fails.R
89 Standard_EXPORT Standard_Integer NbSolutions() const;
91 //! Returns a line, representing the solution of index Index computed by this algorithm.
93 //! This indexing simply provides a means of consulting the
94 //! solutions. The index values are not associated with
95 //! these solutions outside the context of the algorithm object.
97 //! Standard_OutOfRange if Index is less than zero or
98 //! greater than the number of solutions computed by this algorithm.
99 //! StdFail_NotDone if the construction fails.
100 Standard_EXPORT gp_Lin2d ThisSolution (const Standard_Integer Index) const;
102 //! Returns the qualifiers Qualif1 and Qualif2 of the
103 //! tangency arguments for the solution of index Index
104 //! computed by this algorithm.
105 //! The returned qualifiers are:
106 //! - those specified at the start of construction when the
107 //! solutions are defined as enclosing or outside with
108 //! respect to the arguments, or
109 //! - those computed during construction (i.e. enclosing or
110 //! outside) when the solutions are defined as unqualified
111 //! with respect to the arguments, or
112 //! - GccEnt_noqualifier if the tangency argument is a point.
114 //! Standard_OutOfRange if Index is less than zero or
115 //! greater than the number of solutions computed by this algorithm.
116 //! StdFail_NotDone if the construction fails.
117 Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1, GccEnt_Position& Qualif2) const;
119 //! Returns information about the tangency point between the
120 //! result and the first argument.
121 //! ParSol is the intrinsic parameter of the point PntSol on
122 //! the solution curv.
123 //! ParArg is the intrinsic parameter of the point PntSol on the argument curv.
125 //! Standard_OutOfRange if Index is less than zero or
126 //! greater than the number of solutions computed by this algorithm.
127 //! StdFail_NotDone if the construction fails.
128 Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
130 //! Returns information about the tangency point between the
131 //! result and the first argument.
132 //! ParSol is the intrinsic parameter of the point PntSol on the solution curv.
133 //! ParArg is the intrinsic parameter of the point PntSol on the argument curv.
135 //! Standard_OutOfRange if Index is less than zero or
136 //! greater than the number of solutions computed by this algorithm.
137 //! StdFail_NotDone if the construction fails.
138 Standard_EXPORT void Tangency2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
152 Standard_EXPORT Standard_Boolean Add (const Standard_Integer theIndex, const Geom2dGcc_Lin2d2TanIter& theLin, const Standard_Real theTol, const Geom2dAdaptor_Curve& theC1, const Geom2dAdaptor_Curve& theC2);
155 Standard_Boolean WellDone;
156 Standard_Integer NbrSol;
157 TColgp_Array1OfLin2d linsol;
158 GccEnt_Array1OfPosition qualifier1;
159 GccEnt_Array1OfPosition qualifier2;
160 TColgp_Array1OfPnt2d pnttg1sol;
161 TColgp_Array1OfPnt2d pnttg2sol;
162 TColStd_Array1OfReal par1sol;
163 TColStd_Array1OfReal par2sol;
164 TColStd_Array1OfReal pararg1;
165 TColStd_Array1OfReal pararg2;
176 #endif // _Geom2dGcc_Lin2d2Tan_HeaderFile