Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-10-20
0002 // Created by: Remi GILET
0003 // Copyright (c) 1992-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 _Geom2dGcc_Lin2dTanObl_HeaderFile
0018 #define _Geom2dGcc_Lin2dTanObl_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 Geom2dGcc_QualifiedCurve;
0030 class gp_Lin2d;
0031 class gp_Pnt2d;
0032 class Geom2dGcc_Lin2dTanOblIter;
0033 class Geom2dAdaptor_Curve;
0034 
0035 
0036 //! This class implements the algorithms used to
0037 //! create 2d line tangent to a curve QualifiedCurv and
0038 //! doing an angle Angle with a line TheLin.
0039 //! The angle must be in Radian.
0040 //! Describes functions for building a 2D line making a given
0041 //! angle with a line and tangential to a curve.
0042 //! A Lin2dTanObl object provides a framework for:
0043 //! -   defining the construction of 2D line(s),
0044 //! -   implementing the construction algorithm, and
0045 //! -   consulting the result(s).
0046 class Geom2dGcc_Lin2dTanObl 
0047 {
0048 public:
0049 
0050   DEFINE_STANDARD_ALLOC
0051 
0052   
0053   //! This class implements the algorithm used to
0054   //! create 2d line tangent to a curve and doing an
0055   //! angle Angle with the line TheLin.
0056   //! Angle must be in Radian.
0057   //! Tolang is the angular tolerance.
0058   Standard_EXPORT Geom2dGcc_Lin2dTanObl(const Geom2dGcc_QualifiedCurve& Qualified1, const gp_Lin2d& TheLin, const Standard_Real TolAng, const Standard_Real Angle);
0059   
0060   //! This class implements the algorithm used to
0061   //! create 2d line tangent to a curve and doing an
0062   //! angle Angle with the line TheLin.
0063   //! Angle must be in Radian.
0064   //! Param2 is the initial guess on the curve QualifiedCurv.
0065   //! Tolang is the angular tolerance.
0066   //! Warning
0067   //! An iterative algorithm is used if Qualified1 is more
0068   //! complex than a line or a circle. In such cases, the
0069   //! algorithm constructs only one solution.
0070   //! Exceptions
0071   //! GccEnt_BadQualifier if a qualifier is inconsistent with
0072   //! the argument it qualifies (for example, enclosed for a circle).
0073   Standard_EXPORT Geom2dGcc_Lin2dTanObl(const Geom2dGcc_QualifiedCurve& Qualified1, const gp_Lin2d& TheLin, const Standard_Real TolAng, const Standard_Real Param1, const Standard_Real Angle);
0074   
0075   //! Returns true if the construction algorithm does not fail
0076   //! (even if it finds no solution).
0077   //! Note: IsDone protects against a failure arising from a
0078   //! more internal intersection algorithm, which has reached its numeric limits.
0079   Standard_EXPORT Standard_Boolean IsDone() const;
0080   
0081   //! Returns the number of lines, representing solutions computed by this algorithm.
0082   //! Exceptions
0083   //! StdFail_NotDone if the construction fails.
0084   Standard_EXPORT Standard_Integer NbSolutions() const;
0085   
0086   //! Returns a line, representing the solution of index Index
0087   //! computed by this algorithm.
0088   //! Exceptions
0089   //! Standard_OutOfRange if Index is less than zero or
0090   //! greater than the number of solutions computed by this algorithm.
0091   //! StdFail_NotDone if the construction fails.
0092   Standard_EXPORT gp_Lin2d ThisSolution (const Standard_Integer Index) const;
0093   
0094   //! Returns the qualifier Qualif1 of the tangency argument
0095   //! for the solution of index Index computed by this algorithm.
0096   //! The returned qualifier is:
0097   //! -   that specified at the start of construction when the
0098   //! solutions are defined as enclosing or outside with
0099   //! respect to the argument, or
0100   //! -   that computed during construction (i.e. enclosing or
0101   //! outside) when the solutions are defined as unqualified
0102   //! with respect to the argument, or
0103   //! -   GccEnt_noqualifier if the tangency argument is a point.
0104   //! Exceptions
0105   //! Standard_OutOfRange if Index is less than zero or
0106   //! greater than the number of solutions computed by this algorithm.
0107   //! StdFail_NotDone if the construction fails.
0108   Standard_EXPORT void WhichQualifier (const Standard_Integer Index, GccEnt_Position& Qualif1) const;
0109   
0110   //! Returns information about the tangency point between the
0111   //! result and the first argument.
0112   //! ParSol is the intrinsic parameter of the point PntSol on
0113   //! the solution curv.
0114   //! ParArg is the intrinsic parameter of the point PntSol on
0115   //! the argument curv.
0116   Standard_EXPORT void Tangency1 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
0117   
0118   //! Returns the point of intersection PntSol between the
0119   //! solution of index Index and the second argument (the line) of this algorithm.
0120   //! ParSol is the parameter of the point PntSol on the
0121   //! solution. ParArg is the parameter of the point PntSol on the second argument (the line).
0122   //! Exceptions
0123   //! StdFail_NotDone if the construction fails.
0124   //! Geom2dGcc_IsParallel if the solution and the second
0125   //! argument (the line) are parallel.
0126   //! Standard_OutOfRange if Index is less than zero or
0127   //! greater than the number of solutions computed by this algorithm.
0128   Standard_EXPORT void Intersection2 (const Standard_Integer Index, Standard_Real& ParSol, Standard_Real& ParArg, gp_Pnt2d& PntSol) const;
0129   
0130   //! Returns true if the line and the solution are parallel. This
0131   //! is the case when the angle given at the time of
0132   //! construction is equal to 0 or Pi.
0133   //! Exceptions StdFail_NotDone if the construction fails.
0134   Standard_EXPORT Standard_Boolean IsParallel2() const;
0135 
0136 
0137 
0138 
0139 protected:
0140 
0141 
0142 
0143 
0144 
0145 private:
0146 
0147   
0148   Standard_EXPORT Standard_Boolean Add (const Standard_Integer theIndex, const Geom2dGcc_Lin2dTanOblIter& theLin, const Standard_Real theTol, const Geom2dAdaptor_Curve& theC1);
0149 
0150 
0151   Standard_Boolean WellDone;
0152   Standard_Boolean Paral2;
0153   Standard_Integer NbrSol;
0154   TColgp_Array1OfLin2d linsol;
0155   GccEnt_Array1OfPosition qualifier1;
0156   TColgp_Array1OfPnt2d pnttg1sol;
0157   TColgp_Array1OfPnt2d pntint2sol;
0158   TColStd_Array1OfReal par1sol;
0159   TColStd_Array1OfReal par2sol;
0160   TColStd_Array1OfReal pararg1;
0161   TColStd_Array1OfReal pararg2;
0162 
0163 
0164 };
0165 
0166 
0167 
0168 
0169 
0170 
0171 
0172 #endif // _Geom2dGcc_Lin2dTanObl_HeaderFile