1 // Created on: 1992-09-28
2 // Created by: Remi GILET
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _GCE2d_MakeLine_HeaderFile
18 #define _GCE2d_MakeLine_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <GCE2d_Root.hxx>
25 #include <Geom2d_Line.hxx>
27 class StdFail_NotDone;
34 //! This class implements the following algorithms used
35 //! to create a Line from Geom2d.
36 //! * Create a Line parallel to another and passing
38 //! * Create a Line passing through 2 points.
39 class GCE2d_MakeLine : public GCE2d_Root
47 //! Creates a line located in 2D space with the axis placement A.
48 //! The Location of A is the origin of the line.
49 Standard_EXPORT GCE2d_MakeLine(const gp_Ax2d& A);
52 //! Creates a line from a non persistent line from package gp.
53 Standard_EXPORT GCE2d_MakeLine(const gp_Lin2d& L);
56 //! P is the origin and V is the direction of the line.
57 Standard_EXPORT GCE2d_MakeLine(const gp_Pnt2d& P, const gp_Dir2d& V);
59 //! Make a Line from Geom2d <TheLin> parallel to another
60 //! Lin <Lin> and passing through a Pnt <Point>.
61 Standard_EXPORT GCE2d_MakeLine(const gp_Lin2d& Lin, const gp_Pnt2d& Point);
63 //! Make a Line from Geom2d <TheLin> parallel to another
64 //! Lin <Lin> at a distance <Dist>.
65 Standard_EXPORT GCE2d_MakeLine(const gp_Lin2d& Lin, const Standard_Real Dist);
67 //! Make a Line from Geom2d <TheLin> passing through 2
69 //! It returns false if <p1> and <P2> are confused.
71 //! If points P1 and P2 coincident (that is, when IsDone
72 //! returns false), the Status function returns gce_ConfusedPoints.
73 Standard_EXPORT GCE2d_MakeLine(const gp_Pnt2d& P1, const gp_Pnt2d& P2);
75 //! Returns the constructed line.
76 //! Exceptions StdFail_NotDone if no line is constructed.
77 Standard_EXPORT const Handle(Geom2d_Line)& Value() const;
79 operator const Handle(Geom2d_Line)& () const { return Value(); }
82 Handle(Geom2d_Line) TheLine;
85 #endif // _GCE2d_MakeLine_HeaderFile