|
|
|||
File indexing completed on 2026-09-12 09:17:11
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_Circ2dTanOnRad_HeaderFile 0018 #define _Geom2dGcc_Circ2dTanOnRad_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_DefineAlloc.hxx> 0022 #include <Standard_Handle.hxx> 0023 0024 #include <Standard_Integer.hxx> 0025 #include <gp_Circ2d.hxx> 0026 #include <NCollection_Array1.hxx> 0027 #include <GccEnt_Position.hxx> 0028 #include <gp_Pnt2d.hxx> 0029 class Geom2dGcc_QualifiedCurve; 0030 class Geom2dAdaptor_Curve; 0031 class Geom2d_Point; 0032 class GccAna_Circ2dTanOnRad; 0033 class Geom2dGcc_Circ2dTanOnRadGeo; 0034 class gp_Circ2d; 0035 class gp_Pnt2d; 0036 0037 //! This class implements the algorithms used to 0038 //! create a 2d circle tangent to a 2d entity, 0039 //! centered on a 2d entity and with a given radius. 0040 //! More than one argument must be a curve. 0041 //! The arguments of all construction methods are : 0042 //! - The qualified element for the tangency constrains 0043 //! (QualifiedCirc, QualifiedLin, QualifiedCurvPoints). 0044 //! - The Center element (circle, line, curve). 0045 //! - A real Tolerance. 0046 //! Tolerance is only used in the limits cases. 0047 //! For example : 0048 //! We want to create a circle tangent to an OutsideCurv Cu1 0049 //! centered on a line OnLine with a radius Radius and with 0050 //! a tolerance Tolerance. 0051 //! If we did not used Tolerance it is impossible to 0052 //! find a solution in the following case : OnLine is 0053 //! outside Cu1. There is no intersection point between Cu1 0054 //! and OnLine. The distance between the line and the 0055 //! circle is greater than Radius. 0056 //! With Tolerance we will give a solution if the 0057 //! distance between Cu1 and OnLine is lower than or 0058 //! equal Tolerance. 0059 class Geom2dGcc_Circ2dTanOnRad 0060 { 0061 public: 0062 DEFINE_STANDARD_ALLOC 0063 0064 //! Constructs one or more 2D circles of radius Radius, 0065 //! centered on the 2D curve OnCurv and: 0066 //! - tangential to the curve Qualified1 0067 Standard_EXPORT Geom2dGcc_Circ2dTanOnRad(const Geom2dGcc_QualifiedCurve& Qualified1, 0068 const Geom2dAdaptor_Curve& OnCurv, 0069 const double Radius, 0070 const double Tolerance); 0071 0072 //! Constructs one or more 2D circles of radius Radius, 0073 //! centered on the 2D curve OnCurv and: 0074 //! passing through the point Point1. 0075 //! OnCurv is an adapted curve, i.e. an object which is an 0076 //! interface between: 0077 //! - the services provided by a 2D curve from the package Geom2d, 0078 //! - and those required on the curve by the construction algorithm. 0079 //! Similarly, the qualified curve Qualified1 is created from 0080 //! an adapted curve. 0081 //! Adapted curves are created in the following way: 0082 //! occ::handle<Geom2d_Curve> myCurveOn = ... ; 0083 //! Geom2dAdaptor_Curve OnCurv ( myCurveOn ) ; 0084 //! The algorithm is then constructed with this object: 0085 //! occ::handle<Geom2d_Curve> myCurve1 = ... 0086 //! ; 0087 //! Geom2dAdaptor_Curve Adapted1 ( myCurve1 ) ; 0088 //! Geom2dGcc_QualifiedCurve 0089 //! Qualified1 = Geom2dGcc::Outside(Adapted1); 0090 //! double Radius = ... , Tolerance = ... ; 0091 //! Geom2dGcc_Circ2dTanOnRad 0092 //! myAlgo ( Qualified1 , OnCurv , Radius , Tolerance ) ; 0093 //! if ( myAlgo.IsDone() ) 0094 //! { int Nbr = myAlgo.NbSolutions() ; 0095 //! gp_Circ2d Circ ; 0096 //! for ( int i = 1 ; 0097 //! i <= nbr ; i++ ) 0098 //! { Circ = myAlgo.ThisSolution (i) ; 0099 //! ... 0100 //! } 0101 //! } 0102 Standard_EXPORT Geom2dGcc_Circ2dTanOnRad(const occ::handle<Geom2d_Point>& Point1, 0103 const Geom2dAdaptor_Curve& OnCurv, 0104 const double Radius, 0105 const double Tolerance); 0106 0107 Standard_EXPORT void Results(const GccAna_Circ2dTanOnRad& Circ); 0108 0109 Standard_EXPORT void Results(const Geom2dGcc_Circ2dTanOnRadGeo& Circ); 0110 0111 //! Returns true if the construction algorithm does not fail 0112 //! (even if it finds no solution). 0113 //! Note: IsDone protects against a failure arising from a 0114 //! more internal intersection algorithm which has reached 0115 //! its numeric limits. 0116 Standard_EXPORT bool IsDone() const; 0117 0118 //! Returns the number of circles, representing solutions 0119 //! computed by this algorithm. 0120 //! Exceptions: StdFail_NotDone if the construction fails. 0121 Standard_EXPORT int NbSolutions() const; 0122 0123 //! Returns the solution number Index and raises OutOfRange 0124 //! exception if Index is greater than the number of solutions. 0125 //! Be careful: the Index is only a way to get all the 0126 //! solutions, but is not associated to these outside the context 0127 //! of the algorithm-object. 0128 //! Exceptions 0129 //! Standard_OutOfRange if Index is less than zero or 0130 //! greater than the number of solutions computed by this algorithm. 0131 //! StdFail_NotDone if the construction fails. 0132 Standard_EXPORT gp_Circ2d ThisSolution(const int Index) const; 0133 0134 //! Returns the qualifier Qualif1 of the tangency argument 0135 //! for the solution of index Index computed by this algorithm. 0136 //! The returned qualifier is: 0137 //! - that specified at the start of construction when the 0138 //! solutions are defined as enclosed, enclosing or 0139 //! outside with respect to the arguments, or 0140 //! - that computed during construction (i.e. enclosed, 0141 //! enclosing or outside) when the solutions are defined 0142 //! as unqualified with respect to the arguments, or 0143 //! - GccEnt_noqualifier if the tangency argument is a point. 0144 //! Exceptions 0145 //! Standard_OutOfRange if Index is less than zero or 0146 //! greater than the number of solutions computed by this algorithm. 0147 //! StdFail_NotDone if the construction fails. 0148 Standard_EXPORT void WhichQualifier(const int Index, GccEnt_Position& Qualif1) const; 0149 0150 //! Returns information about the tangency point between the 0151 //! result number Index and the first argument. 0152 //! ParSol is the intrinsic parameter of the point on the solution curv. 0153 //! ParArg is the intrinsic parameter of the point on the argument curv. 0154 //! PntSol is the tangency point on the solution curv. 0155 //! PntArg is the tangency point on the argument curv. 0156 //! Exceptions 0157 //! Standard_OutOfRange if Index is less than zero or 0158 //! greater than the number of solutions computed by this algorithm. 0159 //! StdFail_NotDone if the construction fails. 0160 Standard_EXPORT void Tangency1(const int Index, 0161 double& ParSol, 0162 double& ParArg, 0163 gp_Pnt2d& PntSol) const; 0164 0165 //! Returns the center PntSol on the second argument (i.e. 0166 //! line or circle) of the solution of index Index computed by 0167 //! this algorithm. 0168 //! ParArg is the intrinsic parameter of the point on the argument curv. 0169 //! PntSol is the center point of the solution curv. 0170 //! PntArg is the projection of PntSol on the argument curv. 0171 //! Exceptions: 0172 //! Standard_OutOfRange if Index is less than zero or 0173 //! greater than the number of solutions computed by this algorithm. 0174 //! StdFail_NotDone if the construction fails. 0175 Standard_EXPORT void CenterOn3(const int Index, double& ParArg, gp_Pnt2d& PntSol) const; 0176 0177 //! Returns true if the solution of index Index and the first 0178 //! argument of this algorithm are the same (i.e. there are 2 0179 //! identical circles). 0180 //! If Rarg is the radius of the first argument, Rsol is the 0181 //! radius of the solution and dist is the distance between 0182 //! the two centers, we consider the two circles to be 0183 //! identical if |Rarg - Rsol| and dist are less than 0184 //! or equal to the tolerance criterion given at the time of 0185 //! construction of this algorithm. 0186 //! OutOfRange is raised if Index is greater than the number of solutions. 0187 //! notDone is raised if the construction algorithm did not succeed. 0188 Standard_EXPORT bool IsTheSame1(const int Index) const; 0189 0190 private: 0191 bool WellDone; 0192 int NbrSol; 0193 NCollection_Array1<gp_Circ2d> cirsol; 0194 NCollection_Array1<GccEnt_Position> qualifier1; 0195 NCollection_Array1<int> TheSame1; 0196 NCollection_Array1<gp_Pnt2d> pnttg1sol; 0197 NCollection_Array1<double> par1sol; 0198 NCollection_Array1<double> pararg1; 0199 NCollection_Array1<gp_Pnt2d> pntcen3; 0200 NCollection_Array1<double> parcen3; 0201 }; 0202 0203 #endif // _Geom2dGcc_Circ2dTanOnRad_HeaderFile
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|