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