1 -- Copyright (c) 1991-1999 Matra Datavision
2 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
4 -- The content of this file is subject to the Open CASCADE Technology Public
5 -- License Version 6.5 (the "License"). You may not use the content of this file
6 -- except in compliance with the License. Please obtain a copy of the License
7 -- at http://www.opencascade.org and read it completely before using this file.
9 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 -- The Original Code and all software distributed under the License is
13 -- distributed on an "AS IS" basis, without warranty of any kind, and the
14 -- Initial Developer hereby disclaims all such warranties, including without
15 -- limitation, any warranties of merchantability, fitness for a particular
16 -- purpose or non-infringement. Please see the License for the specific terms
17 -- and conditions governing the rights and limitations under the License.
23 class Circ2d from gp inherits Storable
24 --- Purpose : Describes a circle in the plane (2D space).
25 -- A circle is defined by its radius and positioned in the
26 -- plane with a coordinate system (a gp_Ax22d object) as follows:
27 -- - the origin of the coordinate system is the center of the circle, and
28 -- - the orientation (direct or indirect) of the coordinate
29 -- system gives an implicit orientation to the circle (and
30 -- defines its trigonometric sense).
31 -- This positioning coordinate system is the "local
32 -- coordinate system" of the circle.
33 -- Note: when a gp_Circ2d circle is converted into a
34 -- Geom2d_Circle circle, some implicit properties of the
35 -- circle are used explicitly:
36 -- - the implicit orientation corresponds to the direction in
37 -- which parameter values increase,
38 -- - the starting point for parameterization is that of the "X
39 -- Axis" of the local coordinate system (i.e. the "X Axis" of the circle).
41 -- GccAna and Geom2dGcc packages which provide
42 -- functions for constructing circles defined by geometric constraints
43 -- gce_MakeCirc2d which provides functions for more
44 -- complex circle constructions
45 -- Geom2d_Circle which provides additional functions for
46 -- constructing circles and works, with the parametric
47 -- equations of circles in particular gp_Ax22d
57 raises ConstructionError from Standard
62 Create returns Circ2d;
64 --- Purpose : creates an indefinite circle.
68 Sense : Boolean from Standard = Standard_True) returns Circ2d
71 -- The location point of XAxis is the center of the circle.
73 -- It is not forbidden to create a circle with Radius = 0.0 Raises ConstructionError if Radius < 0.0.
75 raises ConstructionError;
76 --- Purpose : Raised if Radius < 0.0.
78 Create (Axis : Ax22d; Radius : Real) returns Circ2d
81 -- Axis defines the Xaxis and Yaxis of the circle which defines
82 -- the origin and the sense of parametrization.
83 -- The location point of Axis is the center of the circle.
85 -- It is not forbidden to create a circle with Radius = 0.0 Raises ConstructionError if Radius < 0.0.
86 raises ConstructionError;
87 --- Purpose : Raised if Radius < 0.0.
89 SetLocation (me : in out; P : Pnt2d) is static;
91 --- Purpose : Changes the location point (center) of the circle.
93 SetXAxis (me : in out; A : Ax2d) is static;
95 --- Purpose : Changes the X axis of the circle.
97 SetAxis (me : in out; A : Ax22d) is static;
99 --- Purpose : Changes the X axis of the circle.
101 SetYAxis (me : in out; A : Ax2d) is static;
103 --- Purpose : Changes the Y axis of the circle.
105 SetRadius (me : in out; Radius : Real)
107 ---Purpose: Modifies the radius of this circle.
108 -- This class does not prevent the creation of a circle where
111 -- Standard_ConstructionError if Radius is negative.
112 raises ConstructionError
115 Area (me) returns Real is static;
117 --- Purpose : Computes the area of the circle.
119 Coefficients (me; A, B, C, D, E, F : out Real) is static;
122 -- Returns the normalized coefficients from the implicit equation
124 -- A * (X**2) + B * (Y**2) + 2*C*(X*Y) + 2*D*X + 2*E*Y + F = 0.0
126 Contains (me; P : Pnt2d; LinearTolerance : Real) returns Boolean
129 --- Purpose : Does <me> contain P ?
130 -- Returns True if the distance between P and any point on
131 -- the circumference of the circle is lower of equal to
132 -- <LinearTolerance>.
134 Distance (me; P : Pnt2d) returns Real is static;
137 -- Computes the minimum of distance between the point P and any
138 -- point on the circumference of the circle.
140 SquareDistance (me; P : Pnt2d) returns Real is static;
143 -- Computes the square distance between <me> and the point P.
145 Length (me) returns Real is static;
146 --- Purpose : computes the circumference of the circle.
149 Location (me) returns Pnt2d is static;
151 --- Purpose : Returns the location point (center) of the circle.
152 ---C++: return const&
154 Radius (me) returns Real is static;
155 --- Purpose : Returns the radius value of the circle.
158 Axis (me) returns Ax22d is static;
159 --- Purpose : returns the position of the circle.
161 ---C++: return const&
163 Position (me) returns Ax22d is static;
164 --- Purpose : returns the position of the circle. Idem Axis(me).
166 ---C++: return const&
168 XAxis (me) returns Ax2d is static;
170 --- Purpose : returns the X axis of the circle.
172 YAxis (me) returns Ax2d is static;
174 --- Purpose : Returns the Y axis of the circle.
176 --- Purpose : Reverses the direction of the circle.
178 Reverse (me : in out) is static;
180 --- Purpose: Reverses the orientation of the local coordinate system
181 -- of this circle (the "Y Direction" is reversed) and therefore
182 --- changes the implicit orientation of this circle.
183 -- Reverse assigns the result to this circle,
184 Reversed (me) returns Circ2d is static;
186 ---Purpose: Reverses the orientation of the local coordinate system
187 -- of this circle (the "Y Direction" is reversed) and therefore
188 -- changes the implicit orientation of this circle.
189 -- Reversed creates a new circle.
191 IsDirect (me) returns Boolean is static;
193 --- Purpose : Returns true if the local coordinate system is direct
194 -- and false in the other case.
197 Mirror (me : in out; P : Pnt2d) is static;
199 Mirrored (me; P : Pnt2d) returns Circ2d is static;
203 -- Performs the symmetrical transformation of a circle with respect
204 -- to the point P which is the center of the symmetry
208 Mirror (me : in out; A : Ax2d) is static;
210 Mirrored (me; A : Ax2d) returns Circ2d is static;
213 -- Performs the symmetrical transformation of a circle with respect
214 -- to an axis placement which is the axis of the symmetry.
216 Rotate (me : in out; P : Pnt2d; Ang : Real) is static;
219 Rotated (me; P : Pnt2d; Ang : Real) returns Circ2d is static;
222 -- Rotates a circle. P is the center of the rotation.
223 -- Ang is the angular value of the rotation in radians.
226 Scale (me : in out; P : Pnt2d; S : Real) is static;
229 Scaled (me; P : Pnt2d; S : Real) returns Circ2d is static;
232 -- Scales a circle. S is the scaling value.
234 -- If S is negative the radius stay positive but
235 -- the "XAxis" and the "YAxis" are reversed as for
238 Transform (me : in out; T : Trsf2d) is static;
240 Transformed (me; T : Trsf2d) returns Circ2d is static;
243 -- Transforms a circle with the transformation T from class Trsf2d.
248 Translate (me : in out; V : Vec2d) is static;
251 Translated (me; V : Vec2d) returns Circ2d is static;
254 -- Translates a circle in the direction of the vector V.
255 -- The magnitude of the translation is the vector's magnitude.
259 Translate (me : in out; P1, P2 : Pnt2d) is static;
262 Translated (me; P1, P2 : Pnt2d) returns Circ2d is static;
265 -- Translates a circle from the point P1 to the point P2.