Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-08-26
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 _gce_MakeLin2d_HeaderFile
0018 #define _gce_MakeLin2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Lin2d.hxx>
0025 #include <gce_Root.hxx>
0026 class gp_Ax2d;
0027 class gp_Pnt2d;
0028 class gp_Dir2d;
0029 
0030 
0031 //! This class implements the following algorithms used
0032 //! to create Lin2d from gp.
0033 //!
0034 //! * Create a Lin2d parallel to another and passing
0035 //! through a point.
0036 //! * Create a Lin2d parallel to another at the distance
0037 //! Dist.
0038 //! * Create a Lin2d passing through 2 points.
0039 //! * Create a Lin2d from its axis (Ax1 from gp).
0040 //! * Create a Lin2d from a point and a direction.
0041 //! * Create a Lin2d from its equation.
0042 class gce_MakeLin2d  : public gce_Root
0043 {
0044 public:
0045 
0046   DEFINE_STANDARD_ALLOC
0047 
0048   
0049   //! Creates a line located with A.
0050   Standard_EXPORT gce_MakeLin2d(const gp_Ax2d& A);
0051   
0052 
0053   //! <P> is the location point (origin) of the line and
0054   //! <V> is the direction of the line.
0055   Standard_EXPORT gce_MakeLin2d(const gp_Pnt2d& P, const gp_Dir2d& V);
0056   
0057 
0058   //! Creates the line from the equation A*X + B*Y + C = 0.0
0059   //! the status is "NullAxis"if Sqrt(A*A + B*B) <= Resolution from gp.
0060   Standard_EXPORT gce_MakeLin2d(const Standard_Real A, const Standard_Real B, const Standard_Real C);
0061   
0062   //! Make a Lin2d from gp <TheLin> parallel to another
0063   //! Lin2d <Lin> at a distance <Dist>.
0064   //! If Dist is greater than zero the result is on the
0065   //! right of the Line <Lin>, else the result is on the
0066   //! left of the Line <Lin>.
0067   Standard_EXPORT gce_MakeLin2d(const gp_Lin2d& Lin, const Standard_Real Dist);
0068   
0069   //! Make a Lin2d from gp <TheLin> parallel to another
0070   //! Lin2d <Lin> and passing through a Pnt2d <Point>.
0071   Standard_EXPORT gce_MakeLin2d(const gp_Lin2d& Lin, const gp_Pnt2d& Point);
0072   
0073   //! Make a Lin2d from gp <TheLin> passing through 2
0074   //! Pnt2d <P1>,<P2>.
0075   //! It returns false if <P1> and <P2> are confused.
0076   //! Warning
0077   //! If an error occurs (that is, when IsDone returns
0078   //! false), the Status function returns:
0079   //! -   gce_NullAxis if Sqrt(A*A + B*B) is less
0080   //! than or equal to gp::Resolution(), or
0081   //! -   gce_ConfusedPoints if points P1 and P2 are coincident.
0082   Standard_EXPORT gce_MakeLin2d(const gp_Pnt2d& P1, const gp_Pnt2d& P2);
0083   
0084   //! Returns the constructed line.
0085   //! Exceptions StdFail_NotDone if no line is constructed.
0086   Standard_EXPORT gp_Lin2d Value() const;
0087   
0088   Standard_EXPORT gp_Lin2d Operator() const;
0089 Standard_EXPORT operator gp_Lin2d() const;
0090 
0091 
0092 
0093 
0094 protected:
0095 
0096 
0097 
0098 
0099 
0100 private:
0101 
0102 
0103 
0104   gp_Lin2d TheLin2d;
0105 
0106 
0107 };
0108 
0109 
0110 
0111 
0112 
0113 
0114 
0115 #endif // _gce_MakeLin2d_HeaderFile