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 Ax2d from gp inherits Storable
26 -- Describes an axis in the plane (2D space).
27 -- An axis is defined by:
28 -- - its origin (also referred to as its "Location point"), and
29 -- - its unit vector (referred to as its "Direction").
30 -- An axis implicitly defines a direct, right-handed
31 -- coordinate system in 2D space by:
33 -- - its "Direction" (giving the "X Direction" of the coordinate system), and
34 -- - the unit vector normal to "Direction" (positive angle
35 -- measured in the trigonometric sense).
37 -- - to describe 2D geometric entities (for example, the
38 -- axis which defines angular coordinates on a circle).
39 -- It serves for the same purpose as the STEP function
40 -- "axis placement one axis", or
41 -- - to define geometric transformations (axis of
42 -- symmetry, axis of rotation, and so on).
43 -- Note: to define a left-handed 2D coordinate system, use gp_Ax22d.
45 uses Dir2d, Pnt2d, Trsf2d, Vec2d
52 --- Purpose : Creates an axis object representing X axis of
53 -- the reference co-ordinate system.
55 Create (P : Pnt2d; V : Dir2d) returns Ax2d;
58 -- Creates an Ax2d. <P> is the "Location" point of
59 -- the axis placement and V is the "Direction" of
60 -- the axis placement.
63 SetLocation (me : out; Locat : Pnt2d) is static;
65 --- Purpose : Changes the "Location" point (origin) of <me>.
67 SetDirection (me : out; V : Dir2d) is static;
69 --- Purpose : Changes the direction of <me>.
71 Location (me) returns Pnt2d is static;
73 --- Purpose : Returns the origin of <me>.
76 Direction (me) returns Dir2d is static;
78 --- Purpose : Returns the direction of <me>.
81 IsCoaxial (me; Other : Ax2d; AngularTolerance, LinearTolerance : Real)
86 -- . the angle between <me> and <Other> is lower or equal
87 -- to <AngularTolerance> and
88 -- . the distance between <me>.Location() and <Other> is lower
89 -- or equal to <LinearTolerance> and
90 -- . the distance between <Other>.Location() and <me> is lower
91 -- or equal to LinearTolerance.
94 IsNormal (me; Other : Ax2d; AngularTolerance : Real) returns Boolean
97 --- Purpose : Returns true if this axis and the axis Other are normal to
98 -- each other. That is, if the angle between the two axes is equal to Pi/2 or -Pi/2.
99 -- Note: the tolerance criterion is given by AngularTolerance.
102 IsOpposite (me; Other : Ax2d; AngularTolerance : Real) returns Boolean
105 --- Purpose : Returns true if this axis and the axis Other are parallel,
106 -- and have opposite orientations. That is, if the angle
107 -- between the two axes is equal to Pi or -Pi.
108 -- Note: the tolerance criterion is given by AngularTolerance.
110 IsParallel (me; Other : Ax2d; AngularTolerance : Real) returns Boolean
113 --- Purpose : Returns true if this axis and the axis Other are parallel,
114 -- and have either the same or opposite orientations. That
115 -- is, if the angle between the two axes is equal to 0, Pi or -Pi.
116 -- Note: the tolerance criterion is given by AngularTolerance.
118 Angle (me; Other : Ax2d) returns Real is static;
121 -- Computes the angle, in radians, between this axis and
122 -- the axis Other. The value of the angle is between -Pi and Pi.
124 Reverse (me : in out) is static;
126 --- Purpose : Reverses the direction of <me> and assigns the result to this axis.
129 Reversed (me) returns Ax2d is static;
132 -- Computes a new axis placement with a direction opposite to
133 -- the direction of <me>.
136 Mirror (me : in out; P : Pnt2d) is static;
138 Mirrored (me; P : Pnt2d) returns Ax2d is static;
142 -- Performs the symmetrical transformation of an axis
143 -- placement with respect to the point P which is the
144 -- center of the symmetry.
148 Mirror (me : in out; A : Ax2d) is static;
150 Mirrored (me; A : Ax2d) returns Ax2d is static;
152 -- Performs the symmetrical transformation of an axis
153 -- placement with respect to an axis placement which
154 -- is the axis of the symmetry.
160 Rotate (me : in out; P : Pnt2d; Ang : Real) is static;
163 Rotated (me; P : Pnt2d; Ang : Real) returns Ax2d is static;
166 -- Rotates an axis placement. <P> is the center of the
167 -- rotation . Ang is the angular value of the rotation
173 Scale (me : in out; P : Pnt2d; S : Real) is static;
175 Scaled (me; P : Pnt2d; S : Real) returns Ax2d is static;
178 -- Applies a scaling transformation on the axis placement.
179 -- The "Location" point of the axisplacement is modified.
180 -- The "Direction" is reversed if the scale is negative.
186 Transform (me : in out; T : Trsf2d) is static;
189 Transformed(me; T : Trsf2d) returns Ax2d is static;
191 --- Purpose : Transforms an axis placement with a Trsf.
195 Translate (me : in out; V : Vec2d) is static;
198 Translated (me; V : Vec2d) returns Ax2d is static;
201 -- Translates an axis placement in the direction of the vector
202 -- <V>. The magnitude of the translation is the vector's magnitude.
204 Translate (me : in out; P1, P2 : Pnt2d) is static;
207 Translated (me; P1, P2 : Pnt2d) returns Ax2d is static;
210 -- Translates an axis placement from the point <P1> to the