Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-03-18
0002 // Created by: Remi GILET
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_Circ2dTanCen_HeaderFile
0018 #define _GccAna_Circ2dTanCen_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_Pnt2d;
0032 class gp_Lin2d;
0033 class gp_Circ2d;
0034 
0035 
0036 //! This class implements the algorithms used to
0037 //! create 2d circles tangent to an entity and
0038 //! centered on a point.
0039 //! The arguments of all construction methods are :
0040 //! - The qualified element for the tangency constrains
0041 //! (QualifiedCirc, Line, Point).
0042 //! - The center point Pcenter.
0043 //! - A real Tolerance.
0044 //! Tolerance is only used in the limits cases.
0045 //! For example :
0046 //! We want to create a circle tangent to an EnclosedCirc C1
0047 //! with a tolerance Tolerance.
0048 //! If we did not used Tolerance it is impossible to
0049 //! find a solution in the following case : Pcenter is
0050 //! outside C1.
0051 //! With Tolerance we will give a solution if the distance
0052 //! between C1 and Pcenter is lower than or equal Tolerance.
0053 class GccAna_Circ2dTanCen 
0054 {
0055 public:
0056 
0057   DEFINE_STANDARD_ALLOC
0058 
0059   
0060   //! This method implements the algorithms used to
0061   //! create 2d circles tangent to a circle and
0062   //! centered on a point.
0063   Standard_EXPORT GccAna_Circ2dTanCen(const GccEnt_QualifiedCirc& Qualified1, const gp_Pnt2d& Pcenter, const Standard_Real Tolerance);
0064   
0065   //! This method implements the algorithms used to
0066   //! create 2d circles tangent to a line and
0067   //! centered on a point.
0068   Standard_EXPORT GccAna_Circ2dTanCen(const gp_Lin2d& Linetan, const gp_Pnt2d& Pcenter);
0069   
0070   //! This method implements the algorithms used to
0071   //! create 2d circles passing through a point and
0072   //! centered on a point.
0073   //! Tolerance is a tolerance criterion used by the algorithm
0074   //! to find a solution when, mathematically, the problem
0075   //! posed does not have a solution, but where there is
0076   //! numeric uncertainty attached to the arguments.
0077   //! In these algorithms Tolerance is only used in very
0078   //! specific cases where the center of the solution is very
0079   //! close to the circle to which it is tangential, and where the
0080   //! solution is therefore a very small circle.
0081   //! Exceptions
0082   //! GccEnt_BadQualifier if a qualifier is inconsistent with
0083   //! the argument it qualifies (for example, enclosing for a line).
0084   Standard_EXPORT GccAna_Circ2dTanCen(const gp_Pnt2d& Point1, const gp_Pnt2d& Pcenter);
0085   
0086   //! This method returns True if the construction
0087   //! algorithm succeeded.
0088   //! Note: IsDone protects against a failure arising from a
0089   //! more internal intersection algorithm, which has reached
0090   //! its numeric limits.
0091   Standard_EXPORT Standard_Boolean IsDone() const;
0092   
0093   //! Returns the number of circles, representing solutions
0094   //! computed by this algorithm and raises NotDone
0095   //! exception if the algorithm didn't succeed.
0096   Standard_EXPORT Standard_Integer NbSolutions() const;
0097   
0098   //! Returns the circle, representing the solution number Index and raises OutOfRange
0099   //! exception if Index is greater than the number of solutions.
0100   //! Be careful: the Index is only a way to get all the
0101   //! solutions, but is not associated to these outside the
0102   //! context of the algorithm-object.
0103   //! Raises NotDone if the construction algorithm didn't succeed.
0104   //! It raises OutOfRange if Index is greater than the
0105   //! number of solutions or less than zer
0106   Standard_EXPORT gp_Circ2d ThisSolution (const Standard_Integer Index) const;
0107   
0108   //! Returns the qualifier Qualif1 of the tangency argument
0109   //! for the solution of index Index computed by this algorithm.
0110   //! The returned qualifier is:
0111   //! -   that specified at the start of construction when the
0112   //! solutions are defined as enclosed, enclosing or
0113   //! It returns the real qualifiers (the qualifiers given to the
0114   //! constructor method in case of enclosed, enclosing and outside
0115   //! and the qualifiers computedin case of unqualified).
0116   Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const;
0117   
0118   //! Returns information about the tangency point between the
0119   //! result number Index and the first argument.
0120   //! ParSol is the intrinsic parameter of the point PntSol
0121   //! on the solution curv.
0122   //! ParArg is the intrinsic parameter of the point PntArg
0123   //! on the argument curv.
0124   //! It raises NotDone if the construction algorithm
0125   //! didn't succeed.
0126   //! It raises OutOfRange if Index is greater than the
0127   //! number of solutions or less than zero.
0128   Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
0129   
0130   //! Returns True if the solution number Index is equal to
0131   //! the first argument.
0132   //! It raises NotDone if the construction algorithm
0133   //! didn't succeed.
0134   //! It raises OutOfRange if Index is greater than the
0135   //! number of solutions or less than zero.
0136   Standard_EXPORT Standard_Boolean IsTheSame1 (const Standard_Integer Index) const;
0137 
0138 
0139 
0140 
0141 protected:
0142 
0143 
0144 
0145 
0146 
0147 private:
0148 
0149 
0150 
0151   Standard_Boolean WellDone;
0152   Standard_Integer NbrSol;
0153   TColgp_Array1OfCirc2d cirsol;
0154   GccEnt_Array1OfPosition qualifier1;
0155   TColStd_Array1OfInteger TheSame1;
0156   TColgp_Array1OfPnt2d pnttg1sol;
0157   TColStd_Array1OfReal par1sol;
0158   TColStd_Array1OfReal pararg1;
0159 
0160 
0161 };
0162 
0163 
0164 
0165 
0166 
0167 
0168 
0169 #endif // _GccAna_Circ2dTanCen_HeaderFile