Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-09-28
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 _GCE2d_MakeLine_HeaderFile
0018 #define _GCE2d_MakeLine_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GCE2d_Root.hxx>
0025 #include <Geom2d_Line.hxx>
0026 
0027 class gp_Ax2d;
0028 class gp_Lin2d;
0029 class gp_Pnt2d;
0030 class gp_Dir2d;
0031 
0032 
0033 //! This class implements the following algorithms used
0034 //! to create a Line from Geom2d.
0035 //! * Create a Line parallel to another and passing
0036 //! through a point.
0037 //! * Create a Line passing through 2 points.
0038 class GCE2d_MakeLine  : public GCE2d_Root
0039 {
0040 public:
0041 
0042   DEFINE_STANDARD_ALLOC
0043 
0044   
0045 
0046   //! Creates a line located in 2D space with the axis placement A.
0047   //! The Location of A is the origin of the line.
0048   Standard_EXPORT GCE2d_MakeLine(const gp_Ax2d& A);
0049   
0050 
0051   //! Creates a line from a non persistent line from package gp.
0052   Standard_EXPORT GCE2d_MakeLine(const gp_Lin2d& L);
0053   
0054 
0055   //! P is the origin and V is the direction of the line.
0056   Standard_EXPORT GCE2d_MakeLine(const gp_Pnt2d& P, const gp_Dir2d& V);
0057   
0058   //! Make a Line from Geom2d <TheLin> parallel to another
0059   //! Lin <Lin> and passing through a Pnt <Point>.
0060   Standard_EXPORT GCE2d_MakeLine(const gp_Lin2d& Lin, const gp_Pnt2d& Point);
0061   
0062   //! Make a Line from Geom2d <TheLin> parallel to another
0063   //! Lin <Lin> at a distance <Dist>.
0064   Standard_EXPORT GCE2d_MakeLine(const gp_Lin2d& Lin, const Standard_Real Dist);
0065   
0066   //! Make a Line from Geom2d <TheLin> passing through 2
0067   //! Pnt <P1>,<P2>.
0068   //! It returns false if <p1> and <P2> are confused.
0069   //! Warning
0070   //! If points P1 and P2 coincident (that is, when IsDone
0071   //! returns false), the Status function returns gce_ConfusedPoints.
0072   Standard_EXPORT GCE2d_MakeLine(const gp_Pnt2d& P1, const gp_Pnt2d& P2);
0073   
0074   //! Returns the constructed line.
0075   //! Exceptions StdFail_NotDone if no line is constructed.
0076   Standard_EXPORT const Handle(Geom2d_Line)& Value() const;
0077 
0078   operator const Handle(Geom2d_Line)& () const { return Value(); }
0079 
0080 private:
0081   Handle(Geom2d_Line) TheLine;
0082 };
0083 
0084 #endif // _GCE2d_MakeLine_HeaderFile