0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / GC / GC_MakeLine.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _GC_MakeLine_HeaderFile
18 #define _GC_MakeLine_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <GC_Root.hxx>
25 class Geom_Line;
26 class StdFail_NotDone;
27 class gp_Ax1;
28 class gp_Lin;
29 class gp_Pnt;
30 class gp_Dir;
31
32
33 //! This class implements the following algorithms used
34 //! to create a Line from Geom.
35 //! * Create a Line parallel to another and passing
36 //! through a point.
37 //! * Create a Line passing through 2 points.
38 //! A MakeLine object provides a framework for:
39 //! -   defining the construction of the line,
40 //! -   implementing the construction algorithm, and
41 //! -   consulting the results. In particular, the Value
42 //! function returns the constructed line.
43 class GC_MakeLine  : public GC_Root
44 {
45 public:
46
47   DEFINE_STANDARD_ALLOC
48
49   
50
51   //! Creates a line located in 3D space with the axis placement A1.
52   //! The Location of A1 is the origin of the line.
53   Standard_EXPORT GC_MakeLine(const gp_Ax1& A1);
54   
55
56   //! Creates a line from a non persistent line from package gp.
57   Standard_EXPORT GC_MakeLine(const gp_Lin& L);
58   
59
60   //! P is the origin and V is the direction of the line.
61   Standard_EXPORT GC_MakeLine(const gp_Pnt& P, const gp_Dir& V);
62   
63   //! Make a Line from Geom <TheLin> parallel to another
64   //! Lin <Lin> and passing through a Pnt <Point>.
65   Standard_EXPORT GC_MakeLine(const gp_Lin& Lin, const gp_Pnt& Point);
66   
67   //! Make a Line from Geom <TheLin> passing through 2
68   //! Pnt <P1>,<P2>.
69   //! It returns false if <p1> and <P2> are confused.
70   //! Warning
71   //! If the points P1 and P2 are coincident (that is, when
72   //! IsDone returns false), the Status function returns gce_ConfusedPoints.
73   Standard_EXPORT GC_MakeLine(const gp_Pnt& P1, const gp_Pnt& P2);
74   
75   //! Returns the constructed line.
76   //! Exceptions StdFail_NotDone if no line is constructed.
77   Standard_EXPORT const Handle(Geom_Line)& Value() const;
78 operator const Handle(Geom_Line)& () const { return Value(); }
79
80
81
82
83 protected:
84
85
86
87
88
89 private:
90
91
92
93   Handle(Geom_Line) TheLine;
94
95
96 };
97
98
99
100
101
102
103
104 #endif // _GC_MakeLine_HeaderFile