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_MakeHyperbola_HeaderFile |
18 | #define _GC_MakeHyperbola_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_Hyperbola.hxx> |
26 | |
42cf5bc1 |
27 | class StdFail_NotDone; |
28 | class gp_Hypr; |
29 | class gp_Ax2; |
30 | class gp_Pnt; |
31 | |
32 | |
33 | //! This class implements construction algorithms for a hyperbola in |
34 | //! 3D space. The result is a Geom_Hyperbola hyperbola. |
35 | //! A MakeHyperbola object provides a framework for: |
36 | //! - defining the construction of the hyperbola, |
37 | //! - implementing the construction algorithm, and |
38 | //! - consulting the results. In particular, the Value |
39 | //! function returns the constructed hyperbola. |
40 | //! To define the main branch of an hyperbola. |
41 | //! The parameterization range is ]-infinite,+infinite[ |
42 | //! It is possible to get the other branch and the two conjugate |
43 | //! branches of the main branch. |
44 | //! |
45 | //! ^YAxis |
46 | //! | |
47 | //! FirstConjugateBranch |
48 | //! | |
49 | //! Other | Main |
50 | //! --------------------- C ------------------------------>XAxis |
51 | //! Branch | Branch |
52 | //! | |
53 | //! SecondConjugateBranch |
54 | //! | |
55 | //! |
56 | //! The major radius is the distance between the Location point |
57 | //! of the hyperbola C and the apex of the Main Branch (or the |
58 | //! Other branch). The major axis is the XAxis. |
59 | //! The minor radius is the distance between the Location point |
60 | //! of the hyperbola C and the apex of the First (or Second) |
61 | //! Conjugate branch. The minor axis is the YAxis. |
62 | //! The major radius can be lower than the minor radius. |
63 | class GC_MakeHyperbola : public GC_Root |
64 | { |
65 | public: |
66 | |
67 | DEFINE_STANDARD_ALLOC |
68 | |
69 | |
70 | |
71 | //! Creates an Hyperbola from a non persistent hyperbola from package gp by conversion. |
72 | Standard_EXPORT GC_MakeHyperbola(const gp_Hypr& H); |
73 | |
74 | //! Constructs a hyperbola centered on the origin of the coordinate system |
75 | //! A2, with major and minor radii MajorRadius and MinorRadius, where: |
76 | //! the plane of the hyperbola is defined by the "X Axis" and "Y Axis" of A2, |
77 | //! - its major axis is the "X Axis" of A2. |
78 | Standard_EXPORT GC_MakeHyperbola(const gp_Ax2& A2, const Standard_Real MajorRadius, const Standard_Real MinorRadius); |
79 | |
80 | //! Constructs a hyperbola centered on the point Center, where |
81 | //! - the plane of the hyperbola is defined by Center, S1 and S2, |
82 | //! - its major axis is defined by Center and S1, |
83 | //! - its major radius is the distance between Center and S1, and |
84 | //! - its minor radius is the distance between S2 and the major axis; |
85 | Standard_EXPORT GC_MakeHyperbola(const gp_Pnt& S1, const gp_Pnt& S2, const gp_Pnt& Center); |
86 | |
87 | //! Returns the constructed hyperbola. |
88 | //! Exceptions StdFail_NotDone if no hyperbola is constructed. |
89 | Standard_EXPORT const Handle(Geom_Hyperbola)& Value() const; |
42cf5bc1 |
90 | |
d1a67b9d |
91 | operator const Handle(Geom_Hyperbola)& () const { return Value(); } |
92 | operator const Handle(Geom_Curve)& () const { return Value(); } |
42cf5bc1 |
93 | |
94 | private: |
42cf5bc1 |
95 | Handle(Geom_Hyperbola) TheHyperbola; |
42cf5bc1 |
96 | }; |
97 | |
42cf5bc1 |
98 | #endif // _GC_MakeHyperbola_HeaderFile |