Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/GccAna_Lin2dTanObl.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-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_Lin2dTanObl_HeaderFile
0018 #define _GccAna_Lin2dTanObl_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <gp_Lin2d.hxx>
0025 #include <NCollection_Array1.hxx>
0026 #include <GccEnt_Position.hxx>
0027 #include <gp_Pnt2d.hxx>
0028 class gp_Pnt2d;
0029 class gp_Lin2d;
0030 class GccEnt_QualifiedCirc;
0031 
0032 //! This class implements the algorithms used to
0033 //! create 2d line tangent to a circle or a point and
0034 //! making an angle with a line.
0035 //! The angle is in radians.
0036 //! The origin of the solution is the tangency point
0037 //! with the first argument.
0038 //! Its direction is making an angle Angle with the
0039 //! second argument.
0040 class GccAna_Lin2dTanObl
0041 {
0042 public:
0043   DEFINE_STANDARD_ALLOC
0044 
0045   //! This class implements the algorithms used to
0046   //! create 2d line passing through a point and
0047   //! making an angle with a line.
0048   Standard_EXPORT GccAna_Lin2dTanObl(const gp_Pnt2d& ThePoint,
0049                                      const gp_Lin2d& TheLine,
0050                                      const double    TheAngle);
0051 
0052   //! This class implements the algorithms used to
0053   //! create 2d line tangent to a circle and
0054   //! making an angle with a line.
0055   //! Exceptions
0056   //! GccEnt_BadQualifier if a qualifier is inconsistent with
0057   //! the argument it qualifies (for example, enclosed for a circle).
0058   Standard_EXPORT GccAna_Lin2dTanObl(const GccEnt_QualifiedCirc& Qualified1,
0059                                      const gp_Lin2d&             TheLine,
0060                                      const double                TheAngle);
0061 
0062   //! Returns True if the algorithm succeeded.
0063   //! Note: IsDone protects against a failure arising from a
0064   //! more internal intersection algorithm, which has reached
0065   //! its numeric limits.
0066   Standard_EXPORT bool IsDone() const;
0067 
0068   //! Returns the number of lines, representing solutions computed by this algorithm.
0069   //! Raises NotDone if the construction algorithm didn't succeed.
0070   Standard_EXPORT int NbSolutions() const;
0071 
0072   //! Returns the solution number Index.
0073   //! Be careful: the Index is only a way to get all the
0074   //! solutions, but is not associated to these outside the
0075   //! context of the algorithm-object.
0076   //! raises NotDone if the construction algorithm didn't succeed.
0077   //! It raises OutOfRange if Index is greater than the number of solutions.
0078   Standard_EXPORT gp_Lin2d ThisSolution(const int Index) const;
0079 
0080   //! Returns the qualifier Qualif1 of the tangency argument
0081   //! for the solution of index Index computed by this algorithm.
0082   //! The returned qualifier is:
0083   //! -   that specified at the start of construction when the
0084   //! solutions are defined as enclosing or outside with
0085   //! respect to the argument, or
0086   //! -   that computed during construction (i.e. enclosing or
0087   //! outside) when the solutions are defined as unqualified
0088   //! with respect to the argument, or
0089   //! -   GccEnt_noqualifier if the tangency argument is a point.
0090   //! Exceptions
0091   //! Standard_OutOfRange if Index is less than zero or
0092   //! greater than the number of solutions computed by this algorithm.
0093   //! StdFail_NotDone if the construction fails.
0094   Standard_EXPORT void WhichQualifier(const int Index, GccEnt_Position& Qualif1) const;
0095 
0096   //! Returns information about the tangency point between the
0097   //! result number Index and the first argument.
0098   //! ParSol is the intrinsic parameter of the point ParSol on
0099   //! the solution curv.
0100   //! ParArg is the intrinsic parameter of the point ParArg on
0101   //! the argument curv. Raises NotDone if the construction algorithm
0102   //! didn't succeed.
0103   //! It raises OutOfRange if Index is greater than the number of solutions.
0104   Standard_EXPORT void Tangency1(const int Index,
0105                                  double&   ParSol,
0106                                  double&   ParArg,
0107                                  gp_Pnt2d& PntSol) const;
0108 
0109   //! Returns information about the intersection between the
0110   //! result number Index and the third argument.
0111   //! Raises NotDone if the construction algorithm didn't succeed.
0112   //! It raises OutOfRange if Index is greater than the number of solutions.
0113   Standard_EXPORT void Intersection2(const int Index,
0114                                      double&   ParSol,
0115                                      double&   ParArg,
0116                                      gp_Pnt2d& PntSol) const;
0117 
0118 private:
0119   bool                                WellDone;
0120   int                                 NbrSol;
0121   NCollection_Array1<gp_Lin2d>        linsol;
0122   NCollection_Array1<GccEnt_Position> qualifier1;
0123   NCollection_Array1<gp_Pnt2d>        pnttg1sol;
0124   NCollection_Array1<gp_Pnt2d>        pntint2sol;
0125   NCollection_Array1<double>          par1sol;
0126   NCollection_Array1<double>          par2sol;
0127   NCollection_Array1<double>          pararg1;
0128   NCollection_Array1<double>          pararg2;
0129 };
0130 
0131 #endif // _GccAna_Lin2dTanObl_HeaderFile