Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-25 08:29:29

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_Lin2dTanPer_HeaderFile
0018 #define _GccAna_Lin2dTanPer_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 gp_Circ2d;
0032 class GccEnt_QualifiedCirc;
0033 
0034 //! This class implements the algorithms used to
0035 //! create 2d lines tangent to a circle or a point and
0036 //! perpendicular to a line or a circle.
0037 //! Describes functions for building a 2D line perpendicular
0038 //! to a line and:
0039 //! -   tangential to a circle, or
0040 //! -   passing through a point.
0041 //! A Lin2dTanPer object provides a framework for:
0042 //! -   defining the construction of 2D line(s),
0043 //! -   implementing the construction algorithm, and
0044 //! -   consulting the result(s).
0045 class GccAna_Lin2dTanPer
0046 {
0047 public:
0048   DEFINE_STANDARD_ALLOC
0049 
0050   //! This method implements the algorithms used to
0051   //! create 2d lines passing through a point and
0052   //! perpendicular to a line.
0053   Standard_EXPORT GccAna_Lin2dTanPer(const gp_Pnt2d& ThePnt, const gp_Lin2d& TheLin);
0054 
0055   //! This method implements the algorithms used to
0056   //! create 2d lines passing through a point and
0057   //! perpendicular to a circle.
0058   Standard_EXPORT GccAna_Lin2dTanPer(const gp_Pnt2d& ThePnt, const gp_Circ2d& TheCircle);
0059 
0060   //! This method implements the algorithms used to
0061   //! create 2d lines tangent to a circle and
0062   //! perpendicular to a line.
0063   Standard_EXPORT GccAna_Lin2dTanPer(const GccEnt_QualifiedCirc& Qualified1,
0064                                      const gp_Lin2d&             TheLin);
0065 
0066   //! This method implements the algorithms used to
0067   //! create 2d lines tangent to a circle and
0068   //! perpendicular to a circle.
0069   Standard_EXPORT GccAna_Lin2dTanPer(const GccEnt_QualifiedCirc& Qualified1,
0070                                      const gp_Circ2d&            TheCircle);
0071 
0072   //! Returns True if the algorithm succeeded.
0073   Standard_EXPORT Standard_Boolean IsDone() const;
0074 
0075   //! Returns the number of solutions.
0076   //! Raises NotDone if the construction algorithm didn't succeed.
0077   Standard_EXPORT Standard_Integer NbSolutions() const;
0078 
0079   //! Returns the qualifier Qualif1 of the tangency argument
0080   //! for the solution of index Index computed by this algorithm.
0081   //! The returned qualifier is:
0082   //! -   that specified at the start of construction when the
0083   //! solutions are defined as enclosing or outside with
0084   //! respect to the argument, or
0085   //! -   that computed during construction (i.e. enclosing or
0086   //! outside) when the solutions are defined as unqualified
0087   //! with respect to the argument, or
0088   //! -   GccEnt_noqualifier if the tangency argument is a point.
0089   //! Exceptions
0090   //! Standard_OutOfRange if Index is less than zero or
0091   //! greater than the number of solutions computed by this algorithm.
0092   //! StdFail_NotDone if the construction fails.
0093   Standard_EXPORT void WhichQualifier(const Standard_Integer Index, GccEnt_Position& Qualif1) const;
0094 
0095   //! Returns the solution number Index and raises OutOfRange
0096   //! exception if Index is greater than the number of solutions.
0097   //! Be careful: the Index is only a way to get all the
0098   //! solutions, but is not associated to those outside the
0099   //! context of the algorithm-object.
0100   //! Raises NotDone if the construction algorithm
0101   //! didn't succeed.
0102   //! It raises OutOfRange if Index is greater than the
0103   //! number of solutions.
0104   Standard_EXPORT gp_Lin2d ThisSolution(const Standard_Integer Index) const;
0105 
0106   //! Returns information about the tangency point between the
0107   //! result number Index and the first argument.
0108   //! ParSol is the intrinsic parameter of the point on the
0109   //! solution curv.
0110   //! ParArg is the intrinsic parameter of the point on the
0111   //! argument curv.
0112   //! If the first argument is a point ParArg is equal zero.
0113   //! raises NotDone if the construction algorithm didn't succeed.
0114   //! It raises OutOfRange if Index is greater than the
0115   //! number of solutions.
0116   Standard_EXPORT void Tangency1(const Standard_Integer Index,
0117                                  Standard_Real&         ParSol,
0118                                  Standard_Real&         ParArg,
0119                                  gp_Pnt2d&              Pnt) const;
0120 
0121   //! Returns information about the intersection between the
0122   //! solution number Index and the second argument.
0123   //! It returns the first intersection in a case of
0124   //! Lin2dTanPer which is perpendicular to a circle .
0125   //! ParSol is the intrinsic parameter of the point on the
0126   //! solution curv.
0127   //! ParArg is the intrinsic parameter of the point on the
0128   //! argument curv. Raises NotDone if the construction algorithm
0129   //! didn't succeed.
0130   //! It raises OutOfRange if Index is greater than the
0131   //! number of solutions.
0132   Standard_EXPORT void Intersection2(const Standard_Integer Index,
0133                                      Standard_Real&         ParSol,
0134                                      Standard_Real&         ParArg,
0135                                      gp_Pnt2d&              PntSol) const;
0136 
0137 protected:
0138 private:
0139   Standard_Boolean        WellDone;
0140   Standard_Integer        NbrSol;
0141   TColgp_Array1OfLin2d    linsol;
0142   GccEnt_Array1OfPosition qualifier1;
0143   TColgp_Array1OfPnt2d    pnttg1sol;
0144   TColgp_Array1OfPnt2d    pntint2sol;
0145   TColStd_Array1OfReal    par1sol;
0146   TColStd_Array1OfReal    par2sol;
0147   TColStd_Array1OfReal    pararg1;
0148   TColStd_Array1OfReal    pararg2;
0149 };
0150 
0151 #endif // _GccAna_Lin2dTanPer_HeaderFile