b311480e |
1 | -- Created on: 1993-03-24 |
2 | -- Created by: Philippe DAUTRY |
3 | -- Copyright (c) 1993-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 | |
7fd59977 |
22 | |
23 | |
24 | class Circle from Geom2d inherits Conic from Geom2d |
25 | |
26 | --- Purpose : Describes a circle in the plane (2D space). |
27 | -- A circle is defined by its radius and, as with any conic |
28 | -- curve, is positioned in the plane with a coordinate |
29 | -- system (gp_Ax22d object) where the origin is the |
30 | -- center of the circle. |
31 | -- The coordinate system is the local coordinate |
32 | -- system of the circle. |
33 | -- The orientation (direct or indirect) of the local |
34 | -- coordinate system gives an explicit orientation to the |
35 | -- circle, determining the direction in which the |
36 | -- parameter increases along the circle. |
37 | -- The Geom2d_Circle circle is parameterized by an angle: |
38 | -- P(U) = O + R*Cos(U)*XDir + R*Sin(U)*YDir |
39 | -- where: |
40 | -- - P is the point of parameter U, |
41 | -- - O, XDir and YDir are respectively the origin, "X |
42 | -- Direction" and "Y Direction" of its local coordinate system, |
43 | -- - R is the radius of the circle. |
44 | -- The "X Axis" of the local coordinate system therefore |
45 | -- defines the origin of the parameter of the circle. The |
46 | -- parameter is the angle with this "X Direction". |
47 | -- A circle is a closed and periodic curve. The period is |
48 | -- 2.*Pi and the parameter range is [ 0,2.*Pi [. |
49 | -- See Also |
50 | -- GCE2d_MakeCircle which provides functions for |
51 | -- more complex circle constructions |
52 | -- gp_Ax22d and gp_Circ2d for an equivalent, non-parameterized data structure. |
53 | |
54 | uses Ax2d from gp, |
55 | Ax22d from gp, |
56 | Circ2d from gp, |
57 | Pnt2d from gp, |
58 | Trsf2d from gp, |
59 | Vec2d from gp, |
60 | Geometry from Geom2d |
61 | |
62 | |
63 | raises ConstructionError from Standard, |
64 | RangeError from Standard |
65 | |
66 | is |
67 | |
68 | |
69 | Create (C : Circ2d) returns mutable Circle; |
70 | --- Purpose : Constructs a circle by conversion of the gp_Circ2d circle C. |
71 | |
72 | |
73 | Create (A : Ax2d; Radius : Real; |
74 | Sense: Boolean from Standard = Standard_True) |
75 | returns mutable Circle |
76 | --- Purpose : Constructs a circle of radius Radius, whose center is the origin of axis |
77 | -- A; A is the "X Axis" of the local coordinate system |
78 | -- of the circle; this coordinate system is direct if |
79 | -- Sense is true (default value) or indirect if Sense is false. |
80 | -- Note: It is possible to create a circle where Radius is equal to 0.0. |
81 | -- Exceptions Standard_ConstructionError if Radius is negative. |
82 | raises ConstructionError; |
83 | |
84 | |
85 | Create (A : Ax22d; Radius : Real) returns mutable Circle |
86 | --- Purpose : Constructs a circle |
87 | -- of radius Radius, where the coordinate system A |
88 | -- locates the circle and defines its orientation in the plane such that: |
89 | -- - the center of the circle is the origin of A, |
90 | -- - the orientation (direct or indirect) of A gives the |
91 | -- orientation of the circle. |
92 | raises ConstructionError; |
93 | |
94 | |
95 | SetCirc2d (me : mutable; C : Circ2d); |
96 | --- Purpose : |
97 | -- Converts the gp_Circ2d circle C into this circle. |
98 | |
99 | SetRadius (me : mutable; R : Real) |
100 | --- Warnings : Assigns the value R to the radius of this circle. |
101 | -- Note: It is possible to have a circle with a radius equal to 0.0. |
102 | -- Exceptions Standard_ConstructionError if R is negative. |
103 | raises ConstructionError; |
104 | |
105 | |
106 | Circ2d (me) returns Circ2d; |
107 | --- Purpose : |
108 | -- Returns the non persistent circle from gp with the same |
109 | -- geometric properties as <me>. |
110 | |
111 | Radius(me) returns Real |
112 | is static; |
113 | ---Purpose: Returns the radius of this circle. |
114 | |
115 | ReversedParameter(me; U : Real) returns Real is redefined static; |
116 | ---Purpose: Computes the parameter on the reversed circle for |
117 | -- the point of parameter U on this circle. |
118 | -- For a circle, the returned value is: 2.*Pi - U. |
119 | |
120 | |
121 | Eccentricity (me) returns Real is redefined static; |
122 | --- Purpose : Returns 0., which is the eccentricity of any circle. |
123 | |
124 | |
125 | FirstParameter (me) returns Real is redefined static; |
126 | --- Purpose : Returns 0.0 |
127 | |
128 | |
129 | LastParameter (me) returns Real is redefined static; |
130 | --- Purpose : Returns 2*PI. |
131 | |
132 | |
133 | IsClosed (me) returns Boolean is redefined static; |
134 | --- Purpose : returns True. |
135 | |
136 | |
137 | IsPeriodic (me) returns Boolean is redefined static; |
138 | --- Purpose : returns True. The period of a circle is 2.*Pi. |
139 | |
140 | |
141 | D0(me; U : Real; P : out Pnt2d) is redefined static; |
142 | ---Purpose: Returns in P the point of parameter U. |
143 | -- P = C + R * Cos (U) * XDir + R * Sin (U) * YDir |
144 | -- where C is the center of the circle , XDir the XDirection and |
145 | -- YDir the YDirection of the circle's local coordinate system. |
146 | |
147 | |
148 | D1 (me; U : Real; P : out Pnt2d; V1 : out Vec2d) is redefined static; |
149 | --- Purpose : |
150 | -- Returns the point P of parameter U and the first derivative V1. |
151 | |
152 | |
153 | D2 (me; U : Real; P : out Pnt2d; V1, V2 : out Vec2d) is redefined static; |
154 | --- Purpose : |
155 | -- Returns the point P of parameter U, the first and second |
156 | -- derivatives V1 and V2. |
157 | |
158 | |
159 | D3 (me; U : Real; P : out Pnt2d; V1, V2, V3 : out Vec2d) is redefined static; |
160 | --- Purpose : |
161 | -- Returns the point P of parameter u, the first second and third |
162 | -- derivatives V1 V2 and V3. |
163 | |
164 | |
165 | DN (me; U : Real; N : Integer) returns Vec2d |
166 | --- Purpose : For the point of parameter U of this circle, computes |
167 | -- the vector corresponding to the Nth derivative. |
168 | -- Exceptions: Standard_RangeError if N is less than 1. |
169 | raises RangeError |
170 | is redefined static; |
171 | |
172 | |
173 | |
174 | Transform (me : mutable; T : Trsf2d) is redefined static; |
175 | ---Purpose: Applies the transformation T to this circle. |
176 | |
177 | |
178 | Copy (me) returns mutable like me |
179 | is redefined static; |
180 | ---Purpose: Creates a new object which is a copy of this circle. |
181 | |
182 | fields |
183 | |
184 | radius : Real; |
185 | |
186 | end; |
187 | |