1 // Created on: 1991-03-29 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_Circ2d2TanOnGeo_HeaderFile 18 #define _Geom2dGcc_Circ2d2TanOnGeo_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 <TColStd_Array1OfInteger.hxx> 29 #include <TColgp_Array1OfPnt2d.hxx> 30 #include <TColStd_Array1OfReal.hxx> 31 #include <Standard_Real.hxx> 32 #include <GccEnt_Position.hxx> 33 class GccEnt_QualifiedCirc; 34 class Geom2dAdaptor_Curve; 35 class GccEnt_QualifiedLin; 36 class gp_Pnt2d; 37 class gp_Circ2d; 38 39 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 (lines, circles or points). 47 //! - The center line (a curve). 48 //! - The parameter for each tangency argument which 49 //! is a curve. 50 //! - The tolerance. 51 class Geom2dGcc_Circ2d2TanOnGeo 52 { 53 public: 54 55 DEFINE_STANDARD_ALLOC 56 57 58 //! This method implements the algorithms used to 59 //! create 2d circles TANgent to two 2d circles and 60 //! having the center ON a curve. 61 Standard_EXPORT Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& Qualified1, const GccEnt_QualifiedCirc& Qualified2, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Tolerance); 62 63 //! This method implements the algorithms used to 64 //! create 2d circles TANgent to a 2d circle and a 2d line 65 //! having the center ON a curve. 66 Standard_EXPORT Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& Qualified1, const GccEnt_QualifiedLin& Qualified2, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Tolerance); 67 68 //! This method implements the algorithms used to 69 //! create 2d circles TANgent to a 2d circle and a point 70 //! having the center ON a curve. 71 Standard_EXPORT Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& Qualified1, const gp_Pnt2d& Point2, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Tolerance); 72 73 //! This method implements the algorithms used to 74 //! create 2d circles TANgent to two 2d lines 75 //! having the center ON a curve. 76 Standard_EXPORT Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedLin& Qualified1, const GccEnt_QualifiedLin& Qualified2, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Tolerance); 77 78 //! This method implements the algorithms used to 79 //! create 2d circles TANgent to a 2d line and a point 80 //! having the center ON a 2d line. 81 Standard_EXPORT Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedLin& Qualified1, const gp_Pnt2d& Qualified2, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Tolerance); 82 83 //! This method implements the algorithms used to 84 //! create 2d circles TANgent to two points 85 //! having the center ON a 2d line. 86 Standard_EXPORT Geom2dGcc_Circ2d2TanOnGeo(const gp_Pnt2d& Point1, const gp_Pnt2d& Point2, const Geom2dAdaptor_Curve& OnCurv, const Standard_Real Tolerance); 87 88 //! This method returns True if the construction 89 //! algorithm succeeded. 90 Standard_EXPORT Standard_Boolean IsDone() const; 91 92 //! This method returns the number of solutions. 93 //! It raises NotDone if the construction algorithm 94 //! didn't succeed. 95 Standard_EXPORT Standard_Integer NbSolutions() const; 96 97 //! Returns the solution number Index and raises OutOfRange 98 //! exception if Index is greater than the number of solutions. 99 //! Be careful: the Index is only a way to get all the 100 //! solutions, but is not associated to those outside the 101 //! context of the algorithm-object. 102 //! It raises NotDone if the construction algorithm 103 //! didn't succeed. 104 //! It raises OutOfRange if Index is greater than the 105 //! number of solutions. 106 Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const; 107 108 //! It returns the information about the qualifiers of 109 //! the tangency 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). 114 Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1, GccEnt_Position& Qualif2) const; 115 116 //! Returns information about the tangency point between the 117 //! result number Index and the first argument. 118 //! ParSol is the intrinsic parameter of the point on the 119 //! solution curv. 120 //! ParArg is the intrinsic parameter of the point on the 121 //! argument curv. 122 //! PntSol is the tangency point on the solution curv. 123 //! PntArg is the tangency point on the argument curv. 124 //! It raises NotDone if the construction algorithm 125 //! didn't succeed. 126 //! It raises OutOfRange if Index is greater than the 127 //! number of solutions. 128 Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const; 129 130 //! Returns information about the tangency point between the 131 //! result number Index and the second argument. 132 //! ParSol is the intrinsic parameter of the point on the 133 //! solution curv. 134 //! ParArg is the intrinsic parameter of the point on the 135 //! argument curv. 136 //! PntSol is the tangency point on the solution curv. 137 //! PntArg is the tangency point on the argument curv. 138 //! It raises NotDone if the construction algorithm 139 //! didn't succeed. 140 //! It raises OutOfRange if Index is greater than the 141 //! number of solutions. 142 Standard_EXPORT void Tangency2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const; 143 144 //! Returns information about the center (on the curv) 145 //! of the result. 146 //! ParArg is the intrinsic parameter of the point on 147 //! the argument curv. 148 //! PntSol is the center point of the solution curv. 149 //! It raises NotDone if the construction algorithm 150 //! didn't succeed. 151 //! It raises OutOfRange if Index is greater than the 152 //! number of solutions. 153 Standard_EXPORT void CenterOn3 (const Standard_Integer Index, Standard_Real& ParArg, gp_Pnt2d& PntSol) const; 154 155 //! Returns True if the solution number Index is equal to 156 //! the first argument and False in the other cases. 157 //! It raises NotDone if the construction algorithm 158 //! didn't succeed. 159 //! It raises OutOfRange if Index is greater than the 160 //! number of solutions. 161 Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const; 162 163 //! Returns True if the solution number Index is equal to 164 //! the second argument and False in the other cases. 165 //! It raises NotDone if the construction algorithm 166 //! didn't succeed. 167 //! It raises OutOfRange if Index is greater than the 168 //! number of solutions. 169 Standard_EXPORT Standard_Boolean IsTheSame2 (const Standard_Integer Index) const; 170 171 172 173 174 protected: 175 176 177 178 179 180 private: 181 182 183 184 Standard_Boolean WellDone; 185 Standard_Integer NbrSol; 186 TColgp_Array1OfCirc2d cirsol; 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 200 201 }; 202 203 204 205 206 207 208 209 #endif // _Geom2dGcc_Circ2d2TanOnGeo_HeaderFile 210