|
||||
File indexing completed on 2025-01-18 10:03:34
0001 // Created on: 1992-10-20 0002 // Created by: Remi GILET 0003 // Copyright (c) 1992-1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _Geom2dGcc_Circ2d3Tan_HeaderFile 0018 #define _Geom2dGcc_Circ2d3Tan_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_DefineAlloc.hxx> 0022 #include <Standard_Handle.hxx> 0023 0024 #include <TColgp_Array1OfCirc2d.hxx> 0025 #include <GccEnt_Array1OfPosition.hxx> 0026 #include <TColStd_Array1OfInteger.hxx> 0027 #include <TColgp_Array1OfPnt2d.hxx> 0028 #include <TColStd_Array1OfReal.hxx> 0029 #include <Standard_Integer.hxx> 0030 #include <GccEnt_Position.hxx> 0031 class Geom2dGcc_QualifiedCurve; 0032 class Geom2d_Point; 0033 class GccAna_Circ2d3Tan; 0034 class gp_Circ2d; 0035 class gp_Pnt2d; 0036 0037 0038 //! This class implements the algorithms used to 0039 //! create 2d circles tangent to 3 points/lines/circles/ 0040 //! curves with one curve or more. 0041 //! The arguments of all construction methods are : 0042 //! - The three qualifiied elements for the 0043 //! tangency constrains (QualifiedCirc, QualifiedLine, 0044 //! Qualifiedcurv, Points). 0045 //! - A parameter for each QualifiedCurv. 0046 //! Describes functions for building a 2D circle: 0047 //! - tangential to 3 curves, or 0048 //! - tangential to 2 curves and passing through a point, or 0049 //! - tangential to a curve and passing through 2 points, or 0050 //! - passing through 3 points. 0051 //! A Circ2d3Tan object provides a framework for: 0052 //! - defining the construction of 2D circles(s), 0053 //! - implementing the construction algorithm, and 0054 //! - consulting the result(s). 0055 class Geom2dGcc_Circ2d3Tan 0056 { 0057 public: 0058 0059 DEFINE_STANDARD_ALLOC 0060 0061 0062 //! Constructs one or more 2D circles 0063 //! tangential to three curves Qualified1, Qualified2 and 0064 //! Qualified3, where Param1, Param2 and Param3 are 0065 //! used, respectively, as the initial values of the 0066 //! parameters on Qualified1, Qualified2 and Qualified3 0067 //! of the tangency point between these arguments and 0068 //! the solution sought, if the algorithm chooses an 0069 //! iterative method to find the solution (i.e. if either 0070 //! Qualified1, Qualified2 or Qualified3 is more complex 0071 //! than a line or a circle). 0072 Standard_EXPORT Geom2dGcc_Circ2d3Tan(const Geom2dGcc_QualifiedCurve& Qualified1, const Geom2dGcc_QualifiedCurve& Qualified2, const Geom2dGcc_QualifiedCurve& Qualified3, const Standard_Real Tolerance, const Standard_Real Param1, const Standard_Real Param2, const Standard_Real Param3); 0073 0074 //! Constructs one or more 2D circles 0075 //! tangential to two curves Qualified1 and Qualified2 0076 //! and passing through the point Point, where Param1 0077 //! and Param2 are used, respectively, as the initial 0078 //! values of the parameters on Qualified1 and 0079 //! Qualified2 of the tangency point between this 0080 //! argument and the solution sought, if the algorithm 0081 //! chooses an iterative method to find the solution (i.e. if 0082 //! either Qualified1 or Qualified2 is more complex than 0083 //! a line or a circle). 0084 Standard_EXPORT Geom2dGcc_Circ2d3Tan(const Geom2dGcc_QualifiedCurve& Qualified1, const Geom2dGcc_QualifiedCurve& Qualified2, const Handle(Geom2d_Point)& Point, const Standard_Real Tolerance, const Standard_Real Param1, const Standard_Real Param2); 0085 0086 //! Constructs one or more 2D circles tangential to the curve Qualified1 and passing 0087 //! through two points Point1 and Point2, where Param1 0088 //! is used as the initial value of the parameter on 0089 //! Qualified1 of the tangency point between this 0090 //! argument and the solution sought, if the algorithm 0091 //! chooses an iterative method to find the solution (i.e. if 0092 //! Qualified1 is more complex than a line or a circle) 0093 Standard_EXPORT Geom2dGcc_Circ2d3Tan(const Geom2dGcc_QualifiedCurve& Qualified1, const Handle(Geom2d_Point)& Point1, const Handle(Geom2d_Point)& Point2, const Standard_Real Tolerance, const Standard_Real Param1); 0094 0095 //! Constructs one or more 2D circles passing through three points Point1, Point2 and Point3. 0096 //! Tolerance is a tolerance criterion used by the algorithm 0097 //! to find a solution when, mathematically, the problem 0098 //! posed does not have a solution, but where there is 0099 //! numeric uncertainty attached to the arguments. 0100 //! For example, take: 0101 //! - two circles C1 and C2, such that C2 is inside C1, 0102 //! and almost tangential to C1; there is in fact no point 0103 //! of intersection between C1 and C2; and 0104 //! - a circle C3 outside C1. 0105 //! You now want to find a circle which is tangential to C1, 0106 //! C2 and C3: a pure mathematical resolution will not find 0107 //! a solution. This is where the tolerance criterion is used: 0108 //! the algorithm considers that C1 and C2 are tangential if 0109 //! the shortest distance between these two circles is less 0110 //! than or equal to Tolerance. Thus, the algorithm finds a solution. 0111 //! Warning 0112 //! An iterative algorithm is used if Qualified1, Qualified2 or 0113 //! Qualified3 is more complex than a line or a circle. In 0114 //! such cases, the algorithm constructs only one solution. 0115 //! Exceptions 0116 //! GccEnt_BadQualifier if a qualifier is inconsistent with 0117 //! the argument it qualifies (for example, enclosing for a line). 0118 Standard_EXPORT Geom2dGcc_Circ2d3Tan(const Handle(Geom2d_Point)& Point1, const Handle(Geom2d_Point)& Point2, const Handle(Geom2d_Point)& Point3, const Standard_Real Tolerance); 0119 0120 Standard_EXPORT void Results (const GccAna_Circ2d3Tan& Circ, const Standard_Integer Rank1, const Standard_Integer Rank2, const Standard_Integer Rank3); 0121 0122 //! Returns true if the construction algorithm does not fail (even if it finds no solution). 0123 //! Note: IsDone protects against a failure arising from a 0124 //! more internal intersection algorithm, which has reached its numeric limits. 0125 Standard_EXPORT Standard_Boolean IsDone() const; 0126 0127 //! This method returns the number of solutions. 0128 //! NotDone is raised if the algorithm failed. 0129 Standard_EXPORT Standard_Integer NbSolutions() const; 0130 0131 //! Returns the solution number Index and raises OutOfRange 0132 //! exception if Index is greater than the number of solutions. 0133 //! Be careful: the Index is only a way to get all the 0134 //! solutions, but is not associated to these outside the context 0135 //! of the algorithm-object. 0136 Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const; 0137 0138 //! It returns the information about the qualifiers of the tangency 0139 //! arguments concerning the solution number Index. 0140 //! It returns the real qualifiers (the qualifiers given to the 0141 //! constructor method in case of enclosed, enclosing and outside 0142 //! and the qualifiers computedin case of unqualified). 0143 Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1, GccEnt_Position& Qualif2, GccEnt_Position& Qualif3) const; 0144 0145 //! Returns information about the tangency point between the 0146 //! result and the first argument. 0147 //! ParSol is the intrinsic parameter of the point PntSol on the solution curv. 0148 //! ParArg is the intrinsic parameter of the point PntSol on the argument curv. 0149 Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const; 0150 0151 //! Returns information about the tangency point between the 0152 //! result and the second argument. 0153 //! ParSol is the intrinsic parameter of the point PntSol on the solution curv. 0154 //! ParArg is the intrinsic parameter of the point PntSol on the argument curv. 0155 Standard_EXPORT void Tangency2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const; 0156 0157 //! Returns information about the tangency point between the 0158 //! result and the third argument. 0159 //! ParSol is the intrinsic parameter of the point PntSol on the solution curv. 0160 //! ParArg is the intrinsic parameter of the point PntSol on the argument curv. 0161 Standard_EXPORT void Tangency3 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const; 0162 0163 //! Returns True if the solution is equal to the first argument. 0164 Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const; 0165 0166 //! Returns True if the solution is equal to the second argument. 0167 Standard_EXPORT Standard_Boolean IsTheSame2 (const Standard_Integer Index) const; 0168 0169 //! Returns True if the solution is equal to the third argument. 0170 //! If Rarg is the radius of the first, second or third 0171 //! argument, Rsol is the radius of the solution and dist 0172 //! is the distance between the two centers, we consider 0173 //! the two circles to be identical if |Rarg - Rsol| and 0174 //! dist are less than or equal to the tolerance criterion 0175 //! given at the time of construction of this algorithm. 0176 //! Exceptions 0177 //! Standard_OutOfRange if Index is less than zero or 0178 //! greater than the number of solutions computed by this algorithm. 0179 //! StdFail_NotDone if the construction fails. 0180 Standard_EXPORT Standard_Boolean IsTheSame3 (const Standard_Integer Index) const; 0181 0182 0183 0184 0185 protected: 0186 0187 0188 0189 0190 0191 private: 0192 0193 0194 0195 TColgp_Array1OfCirc2d cirsol; 0196 Standard_Real NbrSol; 0197 Standard_Boolean WellDone; 0198 GccEnt_Array1OfPosition qualifier1; 0199 GccEnt_Array1OfPosition qualifier2; 0200 GccEnt_Array1OfPosition qualifier3; 0201 TColStd_Array1OfInteger TheSame1; 0202 TColStd_Array1OfInteger TheSame2; 0203 TColStd_Array1OfInteger TheSame3; 0204 TColgp_Array1OfPnt2d pnttg1sol; 0205 TColgp_Array1OfPnt2d pnttg2sol; 0206 TColgp_Array1OfPnt2d pnttg3sol; 0207 TColStd_Array1OfReal par1sol; 0208 TColStd_Array1OfReal par2sol; 0209 TColStd_Array1OfReal par3sol; 0210 TColStd_Array1OfReal pararg1; 0211 TColStd_Array1OfReal pararg2; 0212 TColStd_Array1OfReal pararg3; 0213 0214 0215 }; 0216 0217 0218 0219 0220 0221 0222 0223 #endif // _Geom2dGcc_Circ2d3Tan_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |