42cf5bc1 |
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_MakeSegment_HeaderFile |
18 | #define _GC_MakeSegment_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <GC_Root.hxx> |
d1a67b9d |
25 | #include <Geom_TrimmedCurve.hxx> |
26 | |
42cf5bc1 |
27 | class gp_Pnt; |
28 | class gp_Lin; |
29 | |
30 | |
31 | //! Implements construction algorithms for a line |
32 | //! segment in 3D space. |
33 | //! Makes a segment of Line from the 2 points <P1> and <P2>. |
34 | //! The result is a Geom_TrimmedCurve curve. |
35 | //! A MakeSegment object provides a framework for: |
36 | //! - defining the construction of the line segment, |
37 | //! - implementing the construction algorithm, and |
38 | //! - consulting the results. In particular, the Value |
39 | //! function returns the constructed line segment. |
40 | class GC_MakeSegment : public GC_Root |
41 | { |
42 | public: |
43 | |
44 | DEFINE_STANDARD_ALLOC |
45 | |
46 | |
47 | //! Make a segment of Line from the 2 points <P1> and <P2>. |
48 | //! It returns NullObject if <P1> and <P2> are confused. |
49 | Standard_EXPORT GC_MakeSegment(const gp_Pnt& P1, const gp_Pnt& P2); |
50 | |
51 | //! Make a segment of Line from the line <Line1> |
52 | //! between the two parameters U1 and U2. |
53 | //! It returns NullObject if <U1> is equal <U2>. |
54 | Standard_EXPORT GC_MakeSegment(const gp_Lin& Line, const Standard_Real U1, const Standard_Real U2); |
55 | |
56 | //! Make a segment of Line from the line <Line1> |
57 | //! between the point <Point> and the parameter Ulast. |
58 | //! It returns NullObject if <U1> is equal <U2>. |
59 | Standard_EXPORT GC_MakeSegment(const gp_Lin& Line, const gp_Pnt& Point, const Standard_Real Ulast); |
60 | |
61 | //! Make a segment of Line from the line <Line1> |
62 | //! between the two points <P1> and <P2>. |
63 | //! It returns NullObject if <U1> is equal <U2>. |
64 | Standard_EXPORT GC_MakeSegment(const gp_Lin& Line, const gp_Pnt& P1, const gp_Pnt& P2); |
65 | |
66 | //! Returns the constructed line segment. |
67 | Standard_EXPORT const Handle(Geom_TrimmedCurve)& Value() const; |
42cf5bc1 |
68 | |
d1a67b9d |
69 | operator const Handle(Geom_TrimmedCurve)& () const { return Value(); } |
42cf5bc1 |
70 | |
71 | private: |
42cf5bc1 |
72 | Handle(Geom_TrimmedCurve) TheSegment; |
42cf5bc1 |
73 | }; |
74 | |
42cf5bc1 |
75 | #endif // _GC_MakeSegment_HeaderFile |