7fd59977 |
1 | // File: GC_MakeHyperbola.cxx |
2 | // Created: Fri Oct 2 16:36:22 1992 |
3 | // Author: Remi GILET |
4 | // <reg@topsn3> |
5 | |
6 | #include <GC_MakeHyperbola.ixx> |
7 | #include <gce_MakeHypr.hxx> |
8 | #include <StdFail_NotDone.hxx> |
9 | |
10 | GC_MakeHyperbola::GC_MakeHyperbola(const gp_Hypr& H) |
11 | { |
12 | TheError = gce_Done; |
13 | TheHyperbola = new Geom_Hyperbola(H); |
14 | } |
15 | |
16 | GC_MakeHyperbola::GC_MakeHyperbola(const gp_Ax2& A2 , |
17 | const Standard_Real MajorRadius, |
18 | const Standard_Real MinorRadius) |
19 | { |
20 | if (MajorRadius < 0. || MinorRadius < 0.0) { TheError = gce_NegativeRadius; } |
21 | else { |
22 | TheError = gce_Done; |
23 | TheHyperbola = new Geom_Hyperbola(gp_Hypr(A2,MajorRadius,MinorRadius)); |
24 | } |
25 | } |
26 | |
27 | GC_MakeHyperbola::GC_MakeHyperbola(const gp_Pnt& S1 , |
28 | const gp_Pnt& S2 , |
29 | const gp_Pnt& Center ) { |
30 | gce_MakeHypr H = gce_MakeHypr(S1,S2,Center); |
31 | TheError = H.Status(); |
32 | if (TheError == gce_Done) { |
33 | TheHyperbola = new Geom_Hyperbola(H.Value()); |
34 | } |
35 | } |
36 | |
37 | const Handle(Geom_Hyperbola)& GC_MakeHyperbola::Value() const |
38 | { |
39 | StdFail_NotDone_Raise_if(!TheError == gce_Done,""); |
40 | return TheHyperbola; |
41 | } |
42 | |
43 | const Handle(Geom_Hyperbola)& GC_MakeHyperbola::Operator() const |
44 | { |
45 | return Value(); |
46 | } |
47 | |
48 | GC_MakeHyperbola::operator Handle(Geom_Hyperbola) () const |
49 | { |
50 | return Value(); |
51 | } |
52 | |