9f1950f2fcf92fda149ec959a38c464cf579022c
[occt.git] / src / GCE2d / GCE2d_MakeParabola.cdl
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 class MakeParabola from GCE2d inherits Root from GCE2d
18
19         ---Purpose :This class implements the following algorithms used to 
20         --          create Parabola from Geom2d.
21         --          * Create an Parabola from two apex  and the center.
22         --  Defines the parabola in the parameterization range  :
23         --  ]-infinite,+infinite[
24         --  The vertex of the parabola is the "Location" point of the 
25         --  local coordinate system "XAxis" of the parabola. 
26         --  The "XAxis" of the parabola is its axis of symmetry.
27         --  The "Xaxis" is oriented from the vertex of the parabola to the 
28         --  Focus of the parabola.
29         --  The equation of the parabola in the local coordinate system is
30         --  Y**2 = (2*P) * X
31         --  P is the distance between the focus and the directrix of the 
32         --  parabola called Parameter). 
33         --  The focal length F = P/2 is the distance between the vertex 
34         --  and the focus of the parabola.
35
36 uses Pnt2d    from gp,
37      Parab2d  from gp,
38      Ax2d     from gp,
39      Ax22d    from gp,
40      Parabola from Geom2d
41
42 raises NotDone from StdFail
43
44 is
45
46 Create (Prb : Parab2d from gp) returns MakeParabola;
47         --- Purpose : Creates a parabola from a non persistent one.
48
49 Create (Axis       : Ax22d from gp        ; 
50         Focal      : Real from Standard   ) returns MakeParabola;
51         --- Purpose : Creates a parabola with its local coordinate system and it's focal 
52         --  length "Focal".
53         --  The "Location" point of "Axis" is the vertex of the parabola
54         --- Status is "NegativeFocusLength" if Focal < 0.0
55
56 Create (MirrorAxis : Ax2d    from gp      ; 
57         Focal      : Real    from Standard;
58         Sense      : Boolean from Standard) returns MakeParabola;
59         --- Purpose : Creates a parabola with its "MirrorAxis" and it's focal length "Focal".
60         --  MirrorAxis is the axis of symmetry of the curve, it is the
61         --  "XAxis". The "YAxis" is parallel to the directrix of the
62         --  parabola. The "Location" point of "MirrorAxis" is the vertex of the parabola
63         --- Status is "NegativeFocusLength" if Focal < 0.0
64
65 Create (D     : Ax22d from gp  ; 
66         F     : Pnt2d from gp  ) returns MakeParabola;
67         --- Purpose : Creates a parabola with the local coordinate system and the focus point.
68         --  The sense of parametrization is given by Sense.
69
70 Create (D     : Ax2d  from gp                        ; 
71         F     : Pnt2d from gp                        ;
72         Sense : Boolean from Standard = Standard_True) returns MakeParabola;
73         --- Purpose :
74         --  D is the directrix of the parabola and F the focus point.
75         --  The symmetry axis "XAxis" of the parabola is normal to the
76         --  directrix and pass through the focus point F, but its
77         --  "Location" point is the vertex of the parabola.
78         --  The "YAxis" of the parabola is parallel to D and its "Location"
79         --  point is the vertex of the parabola.
80
81 Create(S1,O  : Pnt2d from gp) returns MakeParabola;
82         ---Purpose: Make a parabola with focal point S1 and 
83         --          center O
84         --          The branch of the parabola returned will have <S1> as
85         --          focal point
86         -- The implicit orientation of the parabola is:
87         -- -   the same one as the parabola Prb,
88         -- -   the sense defined by the coordinate system Axis or the directrix D,
89         -- -   the trigonometric sense if Sense is not given or is true, or
90         -- -   the opposite sense if Sense is false.
91         -- Warning
92         -- The MakeParabola class does not prevent the
93         -- construction of a parabola with a null focal distance.
94         -- If an error occurs (that is, when IsDone returns
95         -- false), the Status function returns:
96         -- -   gce_NullFocusLength if Focal is less than 0.0, or
97         -- -   gce_NullAxis if points S1 and O are coincident.
98         
99 Value(me) returns Parabola from Geom2d
100     raises NotDone
101     is static;
102         ---C++: return const&
103         ---Purpose: Returns the constructed parabola.
104         -- Exceptions StdFail_NotDone if no parabola is constructed.
105     
106 Operator(me) returns Parabola from Geom2d
107     is static;
108         ---C++: return const&
109         ---C++: alias "Standard_EXPORT operator Handle_Geom2d_Parabola() const;"
110
111 fields
112
113     TheParabola : Parabola from Geom2d;
114     --The solution from Geom2d.
115     
116 end MakeParabola;