Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:31

0001 // Created on: 1991-03-22
0002 // Created by: Philippe DAUTRY
0003 // Copyright (c) 1991-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 _GccAna_Circ2dTanOnRad_HeaderFile
0018 #define _GccAna_Circ2dTanOnRad_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
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 <GccEnt_Position.hxx>
0030 class GccEnt_QualifiedCirc;
0031 class gp_Lin2d;
0032 class GccEnt_QualifiedLin;
0033 class gp_Pnt2d;
0034 class gp_Circ2d;
0035 
0036 
0037 //! This class implements the algorithms used to
0038 //! create a 2d circle tangent to a 2d entity,
0039 //! centered on a curv and with a given radius.
0040 //! The arguments of all construction methods are :
0041 //! - The qualified element for the tangency constrains
0042 //! (QualifiedCirc, QualifiedLin, Points).
0043 //! - The Center element (circle, line).
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 OutsideCirc C1
0048 //! centered on a line OnLine with a radius Radius and with
0049 //! a tolerance Tolerance.
0050 //! If we did not use Tolerance it is impossible to
0051 //! find a solution in the following case : OnLine is
0052 //! outside C1. There is no intersection point between C1
0053 //! and OnLine. The distance between the line and the
0054 //! circle is greater than Radius.
0055 //! With Tolerance we will give a solution if the
0056 //! distance between C1 and OnLine is lower than or
0057 //! equal Tolerance.
0058 class GccAna_Circ2dTanOnRad 
0059 {
0060 public:
0061 
0062   DEFINE_STANDARD_ALLOC
0063 
0064   
0065   //! This methods implements the algorithms used to create
0066   //! 2d Circles tangent to a circle and centered on a 2d Line
0067   //! with a given radius.
0068   //! Tolerance is used to find solution in every limit cases.
0069   //! For example Tolerance is used in the case of EnclosedCirc when
0070   //! Radius-R1+dist is greater Tolerance (dist is the distance
0071   //! between the line and the location of the circ, R1 is the
0072   //! radius of the circ) because there is no solution.
0073   //! raises NegativeValue in case of NegativeRadius.
0074   Standard_EXPORT GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualified1, const gp_Lin2d& OnLine, const Standard_Real Radius, const Standard_Real Tolerance);
0075   
0076   //! This methods implements the algorithms used to create
0077   //! 2d Circles tangent to a 2d Line and centered on a 2d Line
0078   //! with a given radius.
0079   //! Tolerance is used to find solution in every limit cases.
0080   //! raises NegativeValue in case of NegativeRadius.
0081   Standard_EXPORT GccAna_Circ2dTanOnRad(const GccEnt_QualifiedLin& Qualified1, const gp_Lin2d& OnLine, const Standard_Real Radius, const Standard_Real Tolerance);
0082   
0083   //! This methods implements the algorithms used to create
0084   //! 2d Circles passing through a 2d Point and centered on a
0085   //! 2d Line with a given radius.
0086   //! Tolerance is used to find solution in every limit cases.
0087   Standard_EXPORT GccAna_Circ2dTanOnRad(const gp_Pnt2d& Point1, const gp_Lin2d& OnLine, const Standard_Real Radius, const Standard_Real Tolerance);
0088   
0089   //! This methods implements the algorithms used to create
0090   //! 2d Circles tangent to a circle and centered on a 2d Circle
0091   //! with a given radius.
0092   //! Tolerance is used to find solution in every limit cases.
0093   //! raises NegativeValue in case of NegativeRadius.
0094   Standard_EXPORT GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualified1, const gp_Circ2d& OnCirc, const Standard_Real Radius, const Standard_Real Tolerance);
0095   
0096   //! This methods implements the algorithms used to create
0097   //! 2d Circles tangent to a 2d Line and centered on a 2d Line
0098   //! with a given radius.
0099   //! Tolerance is used to find solution in every limit cases.
0100   //! raises NegativeValue in case of NegativeRadius.
0101   Standard_EXPORT GccAna_Circ2dTanOnRad(const GccEnt_QualifiedLin& Qualified1, const gp_Circ2d& OnCirc, const Standard_Real Radius, const Standard_Real Tolerance);
0102   
0103   //! This methods implements the algorithms used to create
0104   //! 2d Circles passing through a 2d Point and centered on a
0105   //! 2d Line with a given radius.
0106   //! Tolerance is used to find solution in every limit cases.
0107   //! raises NegativeValue in case of NegativeRadius.
0108   Standard_EXPORT GccAna_Circ2dTanOnRad(const gp_Pnt2d& Point1, const gp_Circ2d& OnCirc, const Standard_Real Radius, const Standard_Real Tolerance);
0109   
0110   //! Returns true if the construction algorithm does not fail
0111   //! (even if it finds no solution).
0112   //! Note: IsDone protects against a failure arising from a
0113   //! more internal intersection algorithm, which has
0114   //! reached its numeric limits.
0115   Standard_EXPORT Standard_Boolean IsDone() const;
0116   
0117   //! This method returns the number of circles, representing solutions.
0118   //! Raises NotDone if the construction algorithm didn't succeed.
0119   Standard_EXPORT Standard_Integer NbSolutions() const;
0120   
0121   //! Returns the solution number Index and raises OutOfRange
0122   //! exception if Index is greater than the number of solutions.
0123   //! Be careful: the Index is only a way to get all the
0124   //! solutions, but is not associated to these outside the
0125   //! context of the algorithm-object.
0126   //! Raises NotDone if the construction algorithm  didn't succeed.
0127   //! It raises OutOfRange if Index is greater than the
0128   //! number of solutions
0129   Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const;
0130   
0131   //! Returns the qualifier Qualif1 of the tangency argument
0132   //! for the solution of index Index computed by this algorithm.
0133   //! The returned qualifier is:
0134   //! -   that specified at the start of construction when the
0135   //! solutions are defined as enclosed, enclosing or
0136   //! outside with respect to the argument, or
0137   //! -   that computed during construction (i.e. enclosed,
0138   //! enclosing or outside) when the solutions are defined
0139   //! as unqualified with respect to the argument, or
0140   //! -   GccEnt_noqualifier if the tangency argument is a point.
0141   //! Exceptions
0142   //! Standard_OutOfRange if Index is less than zero or
0143   //! greater than the number of solutions computed by this algorithm.
0144   //! StdFail_NotDone if the construction fails.
0145   Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const;
0146   
0147   //! Returns information about the tangency point between the
0148   //! result number Index and the first argument.
0149   //! ParSol is the intrinsic parameter of the point on the
0150   //! solution curv.
0151   //! ParArg is the intrinsic parameter of the point on the
0152   //! argument curv.
0153   //! PntSol is the tangency point on the solution curv.
0154   //! PntArg is the tangency point on the argument curv.
0155   //! Raises NotDone if the construction algorithm didn't succeed.
0156   //! It raises OutOfRange if Index is greater than the
0157   //! number of solutions.
0158   Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
0159   
0160   //! Returns information about the center (on the curv)
0161   //! of the result.
0162   //! ParArg is the intrinsic parameter of the point on
0163   //! the argument curv.
0164   //! PntSol is the center point of the solution curv.
0165   //! Raises NotDone if the construction algorithm  didn't succeed.
0166   //! It raises OutOfRange if Index is greater than the
0167   //! number of solutions.
0168   Standard_EXPORT void CenterOn3 (const Standard_Integer Index, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
0169   
0170   //! Returns True if the solution number Index is equal to
0171   //! the first argument and False in the other cases.
0172   //! Raises NotDone if the construction algorithm  didn't succeed.
0173   //! It raises OutOfRange if Index is greater than the
0174   //! number of solutions.
0175   Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const;
0176 
0177 
0178 
0179 
0180 protected:
0181 
0182 
0183 
0184 
0185 
0186 private:
0187 
0188 
0189 
0190   Standard_Boolean WellDone;
0191   Standard_Integer NbrSol;
0192   TColgp_Array1OfCirc2d cirsol;
0193   GccEnt_Array1OfPosition qualifier1;
0194   TColStd_Array1OfInteger TheSame1;
0195   TColgp_Array1OfPnt2d pnttg1sol;
0196   TColgp_Array1OfPnt2d pntcen3;
0197   TColStd_Array1OfReal par1sol;
0198   TColStd_Array1OfReal pararg1;
0199   TColStd_Array1OfReal parcen3;
0200 
0201 
0202 };
0203 
0204 
0205 
0206 
0207 
0208 
0209 
0210 #endif // _GccAna_Circ2dTanOnRad_HeaderFile