|
||||
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_Circ2dTanCen_HeaderFile 0018 #define _Geom2dGcc_Circ2dTanCen_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_DefineAlloc.hxx> 0022 #include <Standard_Handle.hxx> 0023 0024 #include <Standard_Integer.hxx> 0025 #include <TColgp_Array1OfCirc2d.hxx> 0026 #include <GccEnt_Array1OfPosition.hxx> 0027 #include <TColStd_Array1OfInteger.hxx> 0028 #include <TColgp_Array1OfPnt2d.hxx> 0029 #include <TColStd_Array1OfReal.hxx> 0030 #include <GccEnt_Position.hxx> 0031 class Geom2dGcc_QualifiedCurve; 0032 class Geom2d_Point; 0033 class gp_Circ2d; 0034 class gp_Pnt2d; 0035 0036 0037 //! This class implements the algorithms used to 0038 //! create 2d circles tangent to a curve and 0039 //! centered on a point. 0040 //! The arguments of all construction methods are : 0041 //! - The qualified element for the tangency constrains 0042 //! (QualifiedCurv). 0043 //! -The center point Pcenter. 0044 //! - A real Tolerance. 0045 //! Tolerance is only used in the limits cases. 0046 //! For example : 0047 //! We want to create a circle tangent to an EnclosedCurv C1 0048 //! with a tolerance Tolerance. 0049 //! If we did not used Tolerance it is impossible to 0050 //! find a solution in the following case : Pcenter is 0051 //! outside C1. 0052 //! With Tolerance we will give a solution if the distance 0053 //! between C1 and Pcenter is lower than or equal Tolerance/2. 0054 class Geom2dGcc_Circ2dTanCen 0055 { 0056 public: 0057 0058 DEFINE_STANDARD_ALLOC 0059 0060 0061 //! Constructs one or more 2D circles tangential to the 0062 //! curve Qualified1 and centered on the point Pcenter. 0063 //! Tolerance is a tolerance criterion used by the algorithm 0064 //! to find a solution when, mathematically, the problem 0065 //! posed does not have a solution, but where there is 0066 //! numeric uncertainty attached to the arguments. 0067 //! Tolerance is only used in these algorithms in very 0068 //! specific cases where the center of the solution is very 0069 //! close to the circle to which it is tangential, and where the 0070 //! solution is thus a very small circle. 0071 //! Exceptions 0072 //! GccEnt_BadQualifier if a qualifier is inconsistent with 0073 //! the argument it qualifies (for example, enclosing for a line). 0074 Standard_EXPORT Geom2dGcc_Circ2dTanCen(const Geom2dGcc_QualifiedCurve& Qualified1, const Handle(Geom2d_Point)& Pcenter, const Standard_Real Tolerance); 0075 0076 //! Returns true if the construction algorithm does not fail 0077 //! (even if it finds no solution). 0078 //! Note: IsDone protects against a failure arising from a 0079 //! more internal intersection algorithm, which has reached 0080 //! its numeric limits. 0081 Standard_EXPORT Standard_Boolean IsDone() const; 0082 0083 //! Returns the number of circles, representing solutions 0084 //! computed by this algorithm. 0085 //! Exceptions 0086 //! StdFail_NotDone if the construction fails. 0087 Standard_EXPORT Standard_Integer NbSolutions() const; 0088 0089 //! Returns a circle, representing the solution of index 0090 //! Index computed by this algorithm. 0091 //! Warning 0092 //! This indexing simply provides a means of consulting the 0093 //! solutions. The index values are not associated with 0094 //! these solutions outside the context of the algorithm object. 0095 //! Exceptions 0096 //! Standard_OutOfRange if Index is less than zero or 0097 //! greater than the number of solutions computed by this algorithm. 0098 //! StdFail_NotDone if the construction fails 0099 Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const; 0100 0101 //! Returns the qualifier Qualif1 of the tangency argument 0102 //! for the solution of index Index computed by this algorithm. 0103 //! The returned qualifier is: 0104 //! - that specified at the start of construction when the 0105 //! solutions are defined as enclosed, enclosing or 0106 //! outside with respect to the argument, or 0107 //! - that computed during construction (i.e. enclosed, 0108 //! enclosing or outside) when the solutions are defined 0109 //! as unqualified with respect to the argument. 0110 //! Exceptions 0111 //! Standard_OutOfRange if Index is less than zero or 0112 //! greater than the number of solutions computed by this algorithm. 0113 //! StdFail_NotDone if the construction fails. 0114 Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const; 0115 0116 //! Returns information about the tangency point between the 0117 //! result number Index and the first argument. 0118 //! ParSol is the intrinsic parameter of the point PntSol on the solution curv. 0119 //! ParArg is the intrinsic parameter of the point PntSol on the argument curv. 0120 //! Exceptions 0121 //! Standard_OutOfRange if Index is less than zero or 0122 //! greater than the number of solutions computed by this algorithm. 0123 //! StdFail_NotDone if the construction fails. 0124 Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const; 0125 0126 //! Returns true if the solution of index Index and the first 0127 //! argument of this algorithm are the same (i.e. there are 2 0128 //! identical circles). 0129 //! If Rarg is the radius of the first argument, Rsol is the 0130 //! radius of the solution and dist is the distance between 0131 //! the two centers, we consider the two circles to be 0132 //! identical if |Rarg - Rsol| and dist are less than 0133 //! or equal to the tolerance criterion given at the time of 0134 //! construction of this algorithm. 0135 //! NotDone is raised if the construction algorithm didn't succeed. 0136 //! OutOfRange is raised if Index is greater than the 0137 //! number of solutions. 0138 Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const; 0139 0140 0141 0142 0143 protected: 0144 0145 0146 0147 0148 0149 private: 0150 0151 0152 0153 Standard_Boolean WellDone; 0154 Standard_Integer NbrSol; 0155 TColgp_Array1OfCirc2d cirsol; 0156 GccEnt_Array1OfPosition qualifier1; 0157 TColStd_Array1OfInteger TheSame1; 0158 TColgp_Array1OfPnt2d pnttg1sol; 0159 TColStd_Array1OfReal par1sol; 0160 TColStd_Array1OfReal pararg1; 0161 0162 0163 }; 0164 0165 0166 0167 0168 0169 0170 0171 #endif // _Geom2dGcc_Circ2dTanCen_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |