b311480e |
1 | -- Created on: 1992-08-26 |
2 | -- Created by: Remi GILET |
3 | -- Copyright (c) 1992-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | class MakeCylinder from gce inherits Root from gce |
23 | |
24 | ---Purpose : This class implements the following algorithms used |
25 | -- to create a Cylinder from gp. |
26 | -- * Create a Cylinder coaxial to another and passing |
27 | -- through a point. |
28 | -- * Create a Cylinder coaxial to another at a distance |
29 | -- <Dist>. |
30 | -- * Create a Cylinder with 3 points. |
31 | -- * Create a Cylinder by its axis and radius. |
32 | -- * Create a cylinder by its circular base. |
33 | |
34 | uses Pnt from gp, |
35 | Ax1 from gp, |
36 | Ax2 from gp, |
37 | Circ from gp, |
38 | Cylinder from gp, |
39 | Real from Standard |
40 | |
41 | raises NotDone from StdFail |
42 | |
43 | is |
44 | |
45 | Create (A2 : Ax2 from gp ; |
46 | Radius : Real from Standard) returns MakeCylinder; |
47 | --- Purpose :<A2> is the local cartesian coordinate system of <me>. |
48 | -- The status is "NegativeRadius" if R < 0.0 |
49 | |
50 | Create(Cyl : Cylinder from gp; |
51 | Point : Pnt from gp) returns MakeCylinder; |
52 | ---Purpose : Makes a Cylinder from gp <TheCylinder> coaxial to another |
53 | -- Cylinder <Cylinder> and passing through a Pnt <Point>. |
54 | |
55 | Create(Cyl : Cylinder from gp ; |
56 | Dist : Real from Standard) returns MakeCylinder; |
57 | ---Purpose : Makes a Cylinder from gp <TheCylinder> coaxial to another |
58 | -- Cylinder <Cylinder> at the distance <Dist> which can |
59 | -- be greater or lower than zero. |
60 | -- The radius of the result is the absolute value of the |
61 | -- radius of <Cyl> plus <Dist> |
62 | |
63 | Create(P1 : Pnt from gp; |
64 | P2 : Pnt from gp; |
65 | P3 : Pnt from gp) returns MakeCylinder; |
66 | ---Purpose : Makes a Cylinder from gp <TheCylinder> with 3 points |
67 | -- <P1>,<P2>,<P3>. |
68 | -- Its axis is <P1P2> and its radius is the distance |
69 | -- between <P3> and <P1P2> |
70 | |
71 | Create(Axis : Ax1 from gp ; |
72 | Radius : Real from Standard) returns MakeCylinder; |
73 | ---Purpose: Makes a Cylinder by its axis <Axis> and radius <Radius>. |
74 | |
75 | Create(Circ : Circ from gp) returns MakeCylinder; |
76 | ---Purpose: Makes a Cylinder by its circular base. |
77 | -- Warning |
78 | -- If an error occurs (that is, when IsDone returns |
79 | -- false), the Status function returns: |
80 | -- - gce_NegativeRadius if: |
81 | -- - Radius is less than 0.0, or |
82 | -- - Dist is negative and has an absolute value |
83 | -- which is greater than the radius of Cyl; or |
84 | -- - gce_ConfusedPoints if points P1 and P2 are coincident. |
85 | |
86 | Value(me) returns Cylinder from gp |
87 | raises NotDone |
88 | is static; |
89 | ---C++: return const& |
90 | ---Purpose: Returns the constructed cylinder. |
91 | -- Exceptions StdFail_NotDone if no cylinder is constructed. |
92 | |
93 | Operator(me) returns Cylinder from gp |
94 | is static; |
95 | ---C++: return const& |
96 | ---C++: alias "Standard_EXPORT operator gp_Cylinder() const;" |
97 | |
98 | fields |
99 | |
100 | TheCylinder : Cylinder from gp; |
101 | --The solution from gp. |
102 | |
103 | end MakeCylinder; |