Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/GccAna_Circ2d2TanRad.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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