42cf5bc1 |
1 | // Created on: 1992-08-26 |
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 _gce_MakeLin_HeaderFile |
18 | #define _gce_MakeLin_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <gp_Lin.hxx> |
25 | #include <gce_Root.hxx> |
42cf5bc1 |
26 | class gp_Ax1; |
27 | class gp_Pnt; |
28 | class gp_Dir; |
42cf5bc1 |
29 | |
30 | |
31 | //! This class implements the following algorithms used |
32 | //! to create a Lin from gp. |
33 | //! * Create a Lin parallel to another and passing |
34 | //! through a point. |
35 | //! * Create a Lin passing through 2 points. |
36 | //! * Create a lin from its axis (Ax1 from gp). |
37 | //! * Create a lin from a point and a direction. |
38 | class gce_MakeLin : public gce_Root |
39 | { |
40 | public: |
41 | |
42 | DEFINE_STANDARD_ALLOC |
43 | |
44 | |
45 | //! Creates a line located along the axis A1. |
46 | Standard_EXPORT gce_MakeLin(const gp_Ax1& A1); |
47 | |
48 | |
49 | //! <P> is the location point (origin) of the line and |
50 | //! <V> is the direction of the line. |
51 | Standard_EXPORT gce_MakeLin(const gp_Pnt& P, const gp_Dir& V); |
52 | |
53 | //! Make a Lin from gp <TheLin> parallel to another |
54 | //! Lin <Lin> and passing through a Pnt <Point>. |
55 | Standard_EXPORT gce_MakeLin(const gp_Lin& Lin, const gp_Pnt& Point); |
56 | |
57 | //! Make a Lin from gp <TheLin> passing through 2 |
58 | //! Pnt <P1>,<P2>. |
59 | //! It returns false if <p1> and <P2> are confused. |
60 | Standard_EXPORT gce_MakeLin(const gp_Pnt& P1, const gp_Pnt& P2); |
61 | |
62 | //! Returns the constructed line. |
63 | //! Exceptions StdFail_NotDone is raised if no line is constructed. |
64 | Standard_EXPORT const gp_Lin& Value() const; |
65 | |
66 | Standard_EXPORT const gp_Lin& Operator() const; |
67 | Standard_EXPORT operator gp_Lin() const; |
68 | |
69 | |
70 | |
71 | |
72 | protected: |
73 | |
74 | |
75 | |
76 | |
77 | |
78 | private: |
79 | |
80 | |
81 | |
82 | gp_Lin TheLin; |
83 | |
84 | |
85 | }; |
86 | |
87 | |
88 | |
89 | |
90 | |
91 | |
92 | |
93 | #endif // _gce_MakeLin_HeaderFile |