b311480e |
1 | -- Copyright (c) 1991-1999 Matra Datavision |
973c2be1 |
2 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
3 | -- |
973c2be1 |
4 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
5 | -- |
d5f74e42 |
6 | -- This library is free software; you can redistribute it and/or modify it under |
7 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
8 | -- by the Free Software Foundation, with special exception defined in the file |
9 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
10 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
11 | -- |
973c2be1 |
12 | -- Alternatively, this file may be used under the terms of Open CASCADE |
13 | -- commercial license or contractual agreement. |
7fd59977 |
14 | |
087da3bd |
15 | class Circ from gp |
7fd59977 |
16 | |
17 | --- Purpose : |
18 | -- Describes a circle in 3D space. |
19 | -- A circle is defined by its radius and positioned in space |
20 | -- with a coordinate system (a gp_Ax2 object) as follows: |
21 | -- - the origin of the coordinate system is the center of the circle, and |
22 | -- - the origin, "X Direction" and "Y Direction" of the |
23 | -- coordinate system define the plane of the circle. |
24 | -- This positioning coordinate system is the "local |
25 | -- coordinate system" of the circle. Its "main Direction" |
26 | -- gives the normal vector to the plane of the circle. The |
27 | -- "main Axis" of the coordinate system is referred to as |
28 | -- the "Axis" of the circle. |
29 | -- Note: when a gp_Circ circle is converted into a |
30 | -- Geom_Circle circle, some implicit properties of the |
31 | -- circle are used explicitly: |
32 | -- - the "main Direction" of the local coordinate system |
33 | -- gives an implicit orientation to the circle (and defines |
34 | -- its trigonometric sense), |
35 | -- - this orientation corresponds to the direction in |
36 | -- which parameter values increase, |
37 | -- - the starting point for parameterization is that of the |
38 | -- "X Axis" of the local coordinate system (i.e. the "X Axis" of the circle). |
39 | -- See Also |
40 | -- gce_MakeCirc which provides functions for more complex circle constructions |
41 | -- Geom_Circle which provides additional functions for |
42 | -- constructing circles and works, in particular, with the |
43 | -- parametric equations of circles |
44 | |
45 | uses Ax1 from gp, |
46 | Ax2 from gp, |
47 | Pln from gp, |
48 | Pnt from gp, |
49 | Trsf from gp, |
50 | Vec from gp |
51 | |
52 | raises ConstructionError from Standard |
53 | |
54 | is |
55 | |
56 | |
57 | Create returns Circ; |
58 | ---C++: inline |
59 | --- Purpose : Creates an indefinite circle. |
60 | |
61 | Create (A2 : Ax2; Radius : Real) returns Circ |
62 | ---C++: inline |
63 | --- Purpose : |
64 | -- A2 locates the circle and gives its orientation in 3D space. |
65 | -- Warnings : |
66 | -- It is not forbidden to create a circle with Radius = 0.0 Raises ConstructionError if Radius < 0.0 |
67 | raises ConstructionError; |
68 | |
69 | SetAxis (me : in out; A1 : Ax1) |
70 | ---C++: inline |
71 | --- Purpose : |
72 | -- Changes the main axis of the circle. It is the axis |
73 | -- perpendicular to the plane of the circle. |
74 | -- Raises ConstructionError if the direction of A1 |
75 | -- is parallel to the "XAxis" of the circle. |
76 | raises ConstructionError |
77 | |
78 | is static; |
79 | |
80 | SetLocation (me : in out; P :Pnt) is static; |
81 | ---C++:inline |
82 | --- Purpose : |
83 | -- Changes the "Location" point (center) of the circle. |
84 | |
85 | SetPosition (me : in out; A2 : Ax2) is static; |
86 | ---C++:inline |
87 | --- Purpose : Changes the position of the circle. |
88 | |
89 | SetRadius (me : out; Radius : Real) |
90 | ---C++: inline |
91 | ---Purpose: Modifies the radius of this circle. |
92 | -- Warning. This class does not prevent the creation of a circle where Radius is null. |
93 | -- Exceptions |
94 | -- Standard_ConstructionError if Radius is negative. |
95 | raises ConstructionError |
96 | is static; |
97 | |
98 | Area (me) returns Real is static; |
99 | ---C++: inline |
100 | --- Purpose : Computes the area of the circle. |
101 | |
102 | Axis (me) returns Ax1 is static; |
103 | ---C++: inline |
104 | --- Purpose : |
105 | -- Returns the main axis of the circle. |
106 | -- It is the axis perpendicular to the plane of the circle, |
107 | -- passing through the "Location" point (center) of the circle. |
108 | ---C++: return const& |
109 | |
110 | Length (me) returns Real is static; |
111 | ---C++: inline |
112 | --- Purpose : Computes the circumference of the circle. |
113 | |
114 | Location (me) returns Pnt is static; |
115 | ---C++: inline |
116 | --- Purpose : |
117 | -- Returns the center of the circle. It is the |
118 | -- "Location" point of the local coordinate system |
119 | -- of the circle |
120 | ---C++: return const& |
121 | |
122 | Position (me) returns Ax2 is static; |
123 | --- Purpose : |
124 | -- Returns the position of the circle. |
125 | -- It is the local coordinate system of the circle. |
126 | ---C++: inline |
127 | ---C++: return const& |
128 | |
129 | |
130 | Radius (me) returns Real is static; |
131 | ---C++: inline |
132 | ---Purpose: Returns the radius of this circle. |
133 | |
134 | XAxis (me) returns Ax1 is static; |
135 | ---C++: inline |
136 | --- Purpose : |
137 | -- Returns the "XAxis" of the circle. |
138 | -- This axis is perpendicular to the axis of the conic. |
139 | -- This axis and the "Yaxis" define the plane of the conic. |
140 | |
141 | YAxis (me) returns Ax1 is static; |
142 | ---C++: inline |
143 | --- Purpose : |
144 | -- Returns the "YAxis" of the circle. |
145 | -- This axis and the "Xaxis" define the plane of the conic. |
146 | -- The "YAxis" is perpendicular to the "Xaxis". |
147 | |
148 | Distance (me; P : Pnt) returns Real is static; |
149 | ---C++: inline |
150 | --- Purpose : |
151 | -- Computes the minimum of distance between the point P and |
152 | -- any point on the circumference of the circle. |
153 | |
154 | SquareDistance (me; P : Pnt) returns Real is static; |
155 | ---C++: inline |
156 | --- Purpose : |
157 | -- Computes the square distance between <me> and the point P. |
158 | |
159 | Contains (me; P : Pnt; LinearTolerance : Real) returns Boolean |
160 | is static; |
161 | ---C++: inline |
162 | --- Purpose : |
163 | -- Returns True if the point P is on the circumference. |
164 | -- The distance between <me> and <P> must be lower or |
165 | -- equal to LinearTolerance. |
166 | |
167 | |
168 | |
169 | Mirror (me : in out; P : Pnt) is static; |
170 | |
171 | Mirrored (me; P : Pnt) returns Circ is static; |
172 | |
173 | --- Purpose : |
174 | -- Performs the symmetrical transformation of a circle |
175 | -- with respect to the point P which is the center of the |
176 | -- symmetry. |
177 | |
178 | |
179 | Mirror (me : in out; A1 : Ax1) is static; |
180 | |
181 | Mirrored (me; A1 : Ax1) returns Circ is static; |
182 | |
183 | |
184 | |
185 | --- Purpose : |
186 | -- Performs the symmetrical transformation of a circle with |
187 | -- respect to an axis placement which is the axis of the |
188 | -- symmetry. |
189 | |
190 | |
191 | |
192 | Mirror (me : in out; A2 : Ax2) is static; |
193 | |
194 | Mirrored (me; A2 : Ax2) returns Circ is static; |
195 | |
196 | --- Purpose : |
197 | -- Performs the symmetrical transformation of a circle with respect |
198 | -- to a plane. The axis placement A2 locates the plane of the |
199 | -- of the symmetry : (Location, XDirection, YDirection). |
200 | |
201 | |
202 | Rotate (me : in out; A1 : Ax1; Ang : Real) is static; |
203 | ---C++: inline |
204 | |
205 | Rotated (me; A1 : Ax1; Ang : Real) returns Circ is static; |
206 | ---C++: inline |
207 | --- Purpose : |
208 | -- Rotates a circle. A1 is the axis of the rotation. |
209 | -- Ang is the angular value of the rotation in radians. |
210 | |
211 | |
212 | |
213 | Scale (me : in out; P : Pnt; S : Real) is static; |
214 | ---C++: inline |
215 | |
216 | Scaled (me; P : Pnt; S : Real) returns Circ is static; |
217 | ---C++: inline |
218 | --- Purpose : |
219 | -- Scales a circle. S is the scaling value. |
220 | -- Warnings : |
221 | -- If S is negative the radius stay positive but |
222 | -- the "XAxis" and the "YAxis" are reversed as for |
223 | -- an ellipse. |
224 | |
225 | |
226 | Transform (me : in out; T : Trsf) is static; |
227 | ---C++: inline |
228 | |
229 | Transformed (me; T : Trsf) returns Circ is static; |
230 | ---C++: inline |
231 | --- Purpose : |
232 | -- Transforms a circle with the transformation T from class Trsf. |
233 | |
234 | |
235 | Translate (me : in out; V : Vec) is static; |
236 | ---C++: inline |
237 | |
238 | Translated (me; V : Vec) returns Circ is static; |
239 | ---C++: inline |
240 | --- Purpose : |
241 | -- Translates a circle in the direction of the vector V. |
242 | -- The magnitude of the translation is the vector's magnitude. |
243 | |
244 | |
245 | |
246 | |
247 | Translate (me : in out; P1, P2 : Pnt) is static; |
248 | ---C++: inline |
249 | |
250 | Translated (me; P1, P2 : Pnt) returns Circ is static; |
251 | ---C++: inline |
252 | --- Purpose : |
253 | -- Translates a circle from the point P1 to the point P2. |
254 | |
255 | |
256 | |
257 | fields |
258 | |
259 | pos : Ax2; |
260 | radius : Real; |
261 | |
262 | end; |