Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-03-21
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_Circ2d2TanRad_HeaderFile
0018 #define _GccAna_Circ2d2TanRad_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <GccEnt_Array1OfPosition.hxx>
0024 #include <TColStd_Array1OfInteger.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <TColgp_Array1OfCirc2d.hxx>
0027 #include <TColgp_Array1OfPnt2d.hxx>
0028 #include <TColStd_Array1OfReal.hxx>
0029 #include <GccEnt_Position.hxx>
0030 class GccEnt_QualifiedCirc;
0031 class GccEnt_QualifiedLin;
0032 class gp_Pnt2d;
0033 class gp_Circ2d;
0034 
0035 
0036 //! This class implements the algorithms used to
0037 //! create 2d circles tangent to 2
0038 //! points/lines/circles and with a given radius.
0039 //! For each construction methods arguments are:
0040 //! - Two Qualified elements for tangency constraints.
0041 //! (for example EnclosedCirc if we want the
0042 //! solution inside the argument EnclosedCirc).
0043 //! - Two Reals. One (Radius) for the radius and the
0044 //! other (Tolerance) for the tolerance.
0045 //! Tolerance is only used for the limit cases.
0046 //! For example :
0047 //! We want to create a circle inside a circle C1 and
0048 //! inside a circle C2 with a radius Radius and a
0049 //! tolerance Tolerance.
0050 //! If we do not use Tolerance it is impossible to
0051 //! find a solution in the following case : C2 is
0052 //! inside C1 and there is no intersection point
0053 //! between the two circles.
0054 //! With Tolerance it gives a solution if the lowest
0055 //! distance between C1 and C2 is lower than or equal
0056 //! Tolerance.
0057 class GccAna_Circ2d2TanRad 
0058 {
0059 public:
0060 
0061   DEFINE_STANDARD_ALLOC
0062 
0063   
0064   //! This method implements the algorithms used to
0065   //! create 2d circles TANgent to two 2d circle with a
0066   //! radius of Radius.
0067   //! It raises NegativeValue if Radius is lower than zero.
0068   Standard_EXPORT GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified1, const GccEnt_QualifiedCirc& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance);
0069   
0070   //! This method implements the algorithms used to
0071   //! create 2d circles TANgent to a 2d circle and a 2d line
0072   //! with a radius of Radius.
0073   //! It raises NegativeValue if Radius is lower than zero.
0074   Standard_EXPORT GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified1, const GccEnt_QualifiedLin& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance);
0075   
0076   //! This method implements the algorithms used to
0077   //! create 2d circles TANgent to a 2d circle and a point
0078   //! with a radius of Radius.
0079   //! It raises NegativeValue if Radius is lower than zero.
0080   Standard_EXPORT GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified1, const gp_Pnt2d& Point2, const Standard_Real Radius, const Standard_Real Tolerance);
0081   
0082   //! This method implements the algorithms used to
0083   //! create 2d circles TANgent to a 2d line and a point
0084   //! with a radius of Radius.
0085   //! It raises NegativeValue if Radius is lower than zero.
0086   Standard_EXPORT GccAna_Circ2d2TanRad(const GccEnt_QualifiedLin& Qualified1, const gp_Pnt2d& Point2, const Standard_Real Radius, const Standard_Real Tolerance);
0087   
0088   //! This method implements the algorithms used to
0089   //! create 2d circles TANgent to two 2d lines
0090   //! with a radius of Radius.
0091   //! It raises NegativeValue if Radius is lower than zero.
0092   Standard_EXPORT GccAna_Circ2d2TanRad(const GccEnt_QualifiedLin& Qualified1, const GccEnt_QualifiedLin& Qualified2, const Standard_Real Radius, const Standard_Real Tolerance);
0093   
0094   //! This method implements the algorithms used to
0095   //! create 2d circles passing through two points with a
0096   //! radius of Radius.
0097   //! It raises NegativeValue if Radius is lower than zero.
0098   Standard_EXPORT GccAna_Circ2d2TanRad(const gp_Pnt2d& Point1, const gp_Pnt2d& Point2, const Standard_Real Radius, const Standard_Real Tolerance);
0099   
0100   //! This method returns True if the algorithm succeeded.
0101   //! Note: IsDone protects against a failure arising from a
0102   //! more internal intersection algorithm, which has reached its numeric limits.
0103   Standard_EXPORT Standard_Boolean IsDone() const;
0104   
0105   //! This method returns the number of circles, representing solutions computed by this algorithm.
0106   //! Exceptions
0107   //! StdFail_NotDone if the construction fails. of solutions.
0108   Standard_EXPORT Standard_Integer NbSolutions() const;
0109   
0110   //! Returns the solution number Index.
0111   //! Be careful: the Index is only a way to get all the
0112   //! solutions, but is not associated to those outside the context
0113   //! of the algorithm-object. Raises OutOfRange exception if Index is greater
0114   //! than the number of solutions.
0115   //! It raises NotDone if the construction algorithm did not
0116   //! succeed.
0117   Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const;
0118   
0119   //! Returns the information about the qualifiers of
0120   //! the tangency arguments concerning the solution number Index.
0121   //! It returns the real qualifiers (the qualifiers given to the
0122   //! constructor method in case of enclosed, enclosing and outside
0123   //! and the qualifiers computedin case of unqualified).
0124   Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1, GccEnt_Position& Qualif2) const;
0125   
0126   //! Returns information about the tangency point between the
0127   //! result number Index and the first argument.
0128   //! ParSol is the intrinsic parameter of the point PntSol on the solution.
0129   //! ParArg is the intrinsic parameter of the point PntSol on the first
0130   //! argument. Raises OutOfRange if Index is greater than the number
0131   //! of solutions.
0132   //! It raises NotDone if the construction algorithm did not succeed
0133   Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
0134   
0135   //! Returns information about the tangency point between the
0136   //! result number Index and the second argument.
0137   //! ParSol is the intrinsic parameter of the point PntSol on
0138   //! the solution.
0139   //! ParArg is the intrinsic parameter of the point PntArg on
0140   //! the second argument. Raises OutOfRange if Index is greater than the number
0141   //! of solutions.
0142   //! It raises NotDone if the construction algorithm did not succeed.
0143   Standard_EXPORT void Tangency2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
0144   
0145   //! Returns True if the solution number Index is equal to
0146   //! the first argument. Raises OutOfRange if Index is greater than the number
0147   //! of solutions.
0148   //! It raises NotDone if the construction algorithm did not
0149   //! succeed.
0150   Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const;
0151   
0152   //! Returns True if the solution number Index is equal to
0153   //! the second argument. Raises OutOfRange if Index is greater than the number
0154   //! of solutions.
0155   //! It raises NotDone if the construction algorithm did not  succeed.
0156   Standard_EXPORT Standard_Boolean IsTheSame2 (const Standard_Integer Index) const;
0157 
0158 
0159 
0160 
0161 protected:
0162 
0163 
0164 
0165 
0166 
0167 private:
0168 
0169 
0170 
0171   Standard_Boolean WellDone;
0172   GccEnt_Array1OfPosition qualifier1;
0173   GccEnt_Array1OfPosition qualifier2;
0174   TColStd_Array1OfInteger TheSame1;
0175   TColStd_Array1OfInteger TheSame2;
0176   Standard_Integer NbrSol;
0177   TColgp_Array1OfCirc2d cirsol;
0178   TColgp_Array1OfPnt2d pnttg1sol;
0179   TColgp_Array1OfPnt2d pnttg2sol;
0180   TColStd_Array1OfReal par1sol;
0181   TColStd_Array1OfReal par2sol;
0182   TColStd_Array1OfReal pararg1;
0183   TColStd_Array1OfReal pararg2;
0184 
0185 
0186 };
0187 
0188 
0189 
0190 
0191 
0192 
0193 
0194 #endif // _GccAna_Circ2d2TanRad_HeaderFile