Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-04-03
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_Lin2dTanPar_HeaderFile
0018 #define _GccAna_Lin2dTanPar_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <TColgp_Array1OfLin2d.hxx>
0025 #include <GccEnt_Array1OfPosition.hxx>
0026 #include <TColgp_Array1OfPnt2d.hxx>
0027 #include <TColStd_Array1OfReal.hxx>
0028 #include <GccEnt_Position.hxx>
0029 class gp_Pnt2d;
0030 class gp_Lin2d;
0031 class GccEnt_QualifiedCirc;
0032 
0033 
0034 //! This class implements the algorithms used to create 2d
0035 //! line tangent to a circle or a point and parallel to
0036 //! another line.
0037 //! The solution has the same orientation as the
0038 //! second argument.
0039 //! Describes functions for building a 2D line parallel to a line and:
0040 //! -   tangential to a circle, or
0041 //! -   passing through a point.
0042 //! A Lin2dTanPar object provides a framework for:
0043 //! -   defining the construction of 2D line(s),
0044 //! -   implementing the construction algorithm, and consulting the result(s).
0045 class GccAna_Lin2dTanPar 
0046 {
0047 public:
0048 
0049   DEFINE_STANDARD_ALLOC
0050 
0051   
0052   //! This method implements the algorithms used to create a 2d
0053   //! line passing through a point and parallel to
0054   //! another line.
0055   Standard_EXPORT GccAna_Lin2dTanPar(const gp_Pnt2d& ThePoint, const gp_Lin2d& Lin1);
0056   
0057   //! This method implements the algorithms used to create a 2d
0058   //! line tangent to a circle and parallel to another line.
0059   //! It raises BadQualifier in case of EnclosedCirc.
0060   //! Exceptions
0061   //! GccEnt_BadQualifier if a qualifier is inconsistent with
0062   //! the argument it qualifies (for example, enclosed for a circle).
0063   Standard_EXPORT GccAna_Lin2dTanPar(const GccEnt_QualifiedCirc& Qualified1, const gp_Lin2d& Lin1);
0064   
0065   //! Returns True if the algorithm succeeded.
0066   Standard_EXPORT Standard_Boolean IsDone() const;
0067   
0068   //! Returns the number of solutions.
0069   //! Raises NotDone if the construction algorithm  didn't succeed.
0070   Standard_EXPORT Standard_Integer NbSolutions() const;
0071   
0072   //! Returns the solution number Index and raises OutOfRange
0073   //! exception if Index is greater than the number of solutions.
0074   //! Be careful: the Index is only a way to get all the
0075   //! solutions, but is not associated to those outside the
0076   //! context of the algorithm-object.
0077   //! raises NotDone if the construction algorithm
0078   //! didn't succeed.
0079   //! It raises OutOfRange if Index is greater than the
0080   //! number of solutions.
0081   Standard_EXPORT gp_Lin2d ThisSolution (const Standard_Integer Index) const;
0082   
0083   //! Returns the information about the qualifiers of the
0084   //! tangency arguments concerning the solution number Index.
0085   //! It returns the real qualifiers (the qualifiers given to the
0086   //! constructor method in case of enclosed, enclosing and outside
0087   //! and the qualifiers computed in case of unqualified).
0088   //! Raises NotDone if the construction algorithm
0089   //! didn't succeed.
0090   //! It raises OutOfRange if Index is greater than the
0091   //! number of solutions.
0092   Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const;
0093   
0094   //! Returns information about the tangency point between the
0095   //! result number Index and the first argument.
0096   //! ParSol is the intrinsic parameter of the point on the
0097   //! solution curv.
0098   //! ParArg is the intrinsic parameter of the point on the
0099   //! argument curv.
0100   //! ParArg is equal 0 when the solution is passing through
0101   //! a point. Raises NotDone if the construction algorithm
0102   //! didn't succeed.
0103   //! It raises OutOfRange if Index is greater than the
0104   //! number of solutions.
0105   Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& Pnt) const;
0106 
0107 
0108 
0109 
0110 protected:
0111 
0112 
0113 
0114 
0115 
0116 private:
0117 
0118 
0119 
0120   Standard_Boolean WellDone;
0121   Standard_Integer NbrSol;
0122   TColgp_Array1OfLin2d linsol;
0123   GccEnt_Array1OfPosition qualifier1;
0124   TColgp_Array1OfPnt2d pnttg1sol;
0125   TColStd_Array1OfReal par1sol;
0126   TColStd_Array1OfReal pararg1;
0127 
0128 
0129 };
0130 
0131 
0132 
0133 
0134 
0135 
0136 
0137 #endif // _GccAna_Lin2dTanPar_HeaderFile