b311480e |
1 | -- Created on: 1992-08-26 |
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 | -- |
973c2be1 |
8 | -- This library is free software; you can redistribute it and / or modify it |
9 | -- under the terms of the GNU Lesser General Public 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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class MakeCone from gce inherits Root from gce |
18 | |
19 | ---Purpose : This class implements the following algorithms used |
20 | -- to create a Cone from gp. |
21 | -- * Create a Cone coaxial to another and passing |
22 | -- through a point. |
23 | -- * Create a Cone coaxial to another at a distance |
24 | -- <Dist>. |
25 | -- * Create a Cone by 4 points. |
26 | -- * Create a Cone by its axis and 2 points. |
27 | -- * Create a Cone by 2 points and 2 radius. |
28 | -- * Create a Cone by an Ax2 an angle and the radius of |
29 | -- its reference section. |
30 | |
31 | uses Pnt from gp, |
32 | Ax1 from gp, |
33 | Lin from gp, |
34 | Cone from gp, |
35 | Ax2 from gp, |
36 | Real from Standard |
37 | |
38 | raises NotDone from StdFail |
39 | |
40 | is |
41 | |
42 | Create (A2 : Ax2 from gp ; |
43 | Ang : Real from Standard ; |
44 | Radius : Real from Standard ) returns MakeCone; |
45 | --- Purpose : |
46 | -- Creates an infinite conical surface. A2 locates the cone |
47 | -- in the space and defines the reference plane of the surface. |
48 | -- Ang is the conical surface semi-angle between 0 and PI/2 radians. |
49 | -- Radius is the radius of the circle in the reference plane of |
50 | -- the cone. |
51 | -- If Radius is lower than 0.0 the status is " |
52 | -- If Ang < Resolution from gp or Ang >= (PI/2) - Resolution. |
53 | |
54 | Create(Cone : Cone from gp; |
55 | Point : Pnt from gp) returns MakeCone; |
56 | ---Purpose : Makes a Cone from gp <TheCone> coaxial to another |
57 | -- Cone <Cone> and passing through a Pnt <Point>. |
58 | |
59 | Create(Cone : Cone from gp ; |
60 | Dist : Real from Standard) returns MakeCone; |
61 | ---Purpose : Makes a Cone from gp <TheCone> coaxial to another |
62 | -- Cone <Cone> at the distance <Dist> which can |
63 | -- be greater or lower than zero. |
64 | |
65 | Create(P1 : Pnt from gp; |
66 | P2 : Pnt from gp; |
67 | P3 : Pnt from gp; |
68 | P4 : Pnt from gp) returns MakeCone; |
69 | ---Purpose : Makes a Cone from gp <TheCone> by four points <P1>, |
70 | -- <P2>,<P3> and <P4>. |
71 | -- Its axis is <P1P2> and the radius of its base is |
72 | -- the distance between <P3> and <P1P2>. |
73 | -- The distance between <P4> and <P1P2> is the radius of |
74 | -- the section passing through <P4>. |
75 | -- If <P1> and <P2> are confused or <P3> and <P4> are |
76 | -- confused we have the status "ConfusedPoints" |
77 | -- if <P1>,<P2>,<P3>,<P4> are colinear we have the |
78 | -- status "ColinearPoints" |
79 | -- If <P3P4> is perpendicular to <P1P2> we have the |
80 | -- status "NullAngle". |
81 | -- <P3P4> is colinear to <P1P2> we have the status |
82 | -- "NullAngle". |
83 | |
84 | Create(Axis : Ax1 from gp; |
85 | P1,P2 : Pnt from gp) returns MakeCone; |
86 | ---Purpose: Makes a Cone by its axis <Axis> and and two points. |
87 | -- The distance between <P1> and the axis is the radius |
88 | -- of the section passing through <P1>. |
89 | -- The distance between <P2> and the axis is the radius |
90 | -- of the section passing through <P2>. |
91 | -- If <P1P2> is colinear to <Axis> we have the status |
92 | -- "NullAngle" |
93 | -- If <P3P4> is perpendicular to <Axis> we have the status |
94 | -- "NullAngle" |
95 | -- If <P1> and <P2> are confused we have the status |
96 | -- "ConfusedPoints" |
97 | |
98 | Create(Axis : Lin from gp; |
99 | P1,P2 : Pnt from gp) returns MakeCone; |
100 | ---Purpose: Makes a Cone by its axis <Axis> and and two points. |
101 | -- The distance between <P1> and the axis is the radius |
102 | -- of the section passing through <P1> |
103 | -- The distance between <P2> and the axis is the radius |
104 | -- of the section passing through <P2> |
105 | -- If <P1P2> is colinear to <Axis> we have the status |
106 | -- "NullAngle" |
107 | -- If <P3P4> is perpendicular to <Axis> we have the status |
108 | -- "NullAngle" |
109 | -- If <P1> and <P2> are confused we have the status |
110 | -- "ConfusedPoints" |
111 | |
112 | Create(P1 : Pnt from gp ; |
113 | P2 : Pnt from gp ; |
114 | R1 : Real from Standard; |
115 | R2 : Real from Standard) returns MakeCone; |
116 | ---Purpose: Makes a Cone with two points and two radius. |
117 | -- The axis of the solution is the line passing through |
118 | -- <P1> and <P2>. |
119 | -- <R1> is the radius of the section passing through <P1> |
120 | -- and <R2> the radius of the section passing through <P2>. |
121 | -- If <P1> and <P2> are confused we have the status "NullAxis". |
122 | -- Warning |
123 | -- If an error occurs (that is, when IsDone returns |
124 | -- false), the Status function returns: |
125 | -- - gce_NegativeRadius if Radius, R1 or R2 is less than 0.0; |
126 | -- - gce_BadAngle if Ang is less than |
127 | -- gp::Resolution() or greater than Pi/2.- gp::Resolution(); |
128 | -- - gce_ConfusedPoints if P1 and P2 or P3 and P4 are coincident; |
129 | -- - gce_NullAxis if the points P1 and P2, are coincident (5th syntax only); |
130 | -- - gce_NullAngle if: |
131 | -- - the vector joining P1 to P2 is parallel to either |
132 | -- Axis or the line joining P3 to P4, or |
133 | -- - R1 and R2 are equal, (that is, their difference is |
134 | -- less than gp::Resolution()); or |
135 | -- - gce_NullRadius if: |
136 | -- - the vector joining P1 to P2 is perpendicular to the line joining P3 to P4, |
137 | -- - the vector joining P1 to P2 is perpendicular to Axis, or |
138 | -- - P1, P2, P3, and P4 are collinear. |
139 | |
140 | Value(me) returns Cone from gp |
141 | raises NotDone |
142 | is static; |
143 | ---C++: return const& |
144 | ---Purpose: Returns the constructed cone. |
145 | -- Exceptions StdFail_NotDone if no cone is constructed. |
146 | |
147 | Operator(me) returns Cone from gp |
148 | is static; |
149 | ---C++: return const& |
150 | ---C++: alias "Standard_EXPORT operator gp_Cone() const;" |
151 | |
152 | fields |
153 | |
154 | TheCone : Cone from gp; |
155 | --The solution from gp. |
156 | |
157 | end MakeCone; |