b311480e |
1 | // Created on: 1992-10-02 |
2 | // Created by: Remi GILET |
3 | // Copyright (c) 1992-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
42cf5bc1 |
17 | |
18 | #include <GCE2d_MakeParabola.hxx> |
7fd59977 |
19 | #include <gce_MakeParab2d.hxx> |
42cf5bc1 |
20 | #include <Geom2d_Parabola.hxx> |
21 | #include <gp_Ax2d.hxx> |
22 | #include <gp_Ax22d.hxx> |
23 | #include <gp_Parab2d.hxx> |
24 | #include <gp_Pnt2d.hxx> |
7fd59977 |
25 | #include <StdFail_NotDone.hxx> |
26 | |
27 | GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Parab2d& Prb) |
28 | { |
29 | TheError = gce_Done; |
30 | TheParabola = new Geom2d_Parabola(Prb); |
31 | } |
32 | |
33 | GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& MirrorAxis, |
34 | const Standard_Real Focal , |
35 | const Standard_Boolean Sense ) |
36 | { |
37 | if (Focal <0.0) { TheError = gce_NullFocusLength; } |
38 | else { |
39 | TheError = gce_Done; |
40 | TheParabola = new Geom2d_Parabola(MirrorAxis,Focal,Sense); |
41 | } |
42 | } |
43 | |
44 | GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax22d& Axis , |
45 | const Standard_Real Focal) |
46 | { |
47 | if (Focal <0.0) { TheError = gce_NullFocusLength; } |
48 | else { |
49 | TheError = gce_Done; |
50 | TheParabola = new Geom2d_Parabola(Axis,Focal); |
51 | } |
52 | } |
53 | |
54 | GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax22d& Axis , |
55 | const gp_Pnt2d& F ) |
56 | { |
57 | TheError = gce_Done; |
58 | gp_Parab2d para(Axis,F); |
59 | TheParabola = new Geom2d_Parabola(para); |
60 | } |
61 | |
62 | GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& D , |
63 | const gp_Pnt2d& F , |
64 | const Standard_Boolean Sense ) |
65 | { |
66 | TheError = gce_Done; |
67 | gp_Parab2d para(D,F,Sense); |
68 | TheParabola = new Geom2d_Parabola(para); |
69 | } |
70 | |
71 | |
72 | GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Pnt2d& S1 , |
73 | const gp_Pnt2d& O ) { |
74 | gce_MakeParab2d P = gce_MakeParab2d(S1,O); |
75 | TheError = P.Status(); |
76 | if (TheError == gce_Done) { |
77 | TheParabola = new Geom2d_Parabola(P.Value()); |
78 | } |
79 | } |
80 | |
81 | const Handle(Geom2d_Parabola)& GCE2d_MakeParabola::Value() const |
82 | { |
82fc327c |
83 | StdFail_NotDone_Raise_if(TheError != gce_Done,""); |
7fd59977 |
84 | return TheParabola; |
85 | } |