0024428: Implementation of LGPL license
[occt.git] / src / Geom2d / Geom2d_Vector.cdl
1 -- Created on: 1993-03-24
2 -- Created by: JCV
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 deferred class Vector from Geom2d inherits Geometry from Geom2d
18
19         --- Purpose :  The abstract class Vector describes the common
20         -- behavior of vectors in 2D space.
21         -- The Geom2d package provides two concrete
22         -- classes of vectors: Geom2d_Direction (unit vector)
23         -- and Geom2d_VectorWithMagnitude.
24
25 uses Ax2d  from gp, 
26      Pnt2d from gp,
27      Vec2d from gp
28
29 raises DomainError             from Standard,
30        VectorWithNullMagnitude from gp
31
32 is
33
34
35   Reverse (me : mutable);
36         --- Purpose : Reverses the vector <me>.
37
38
39   Reversed (me) returns mutable like me
40         --- Purpose : Returns a copy of <me> reversed.
41      is static;
42
43
44   Angle (me; Other : Vector)   returns Real
45         --- Purpose : Computes the angular value, in radians, between this
46         -- vector and vector Other. The result is a value
47         -- between -Pi and Pi. The orientation is from this
48         -- vector to vector Other.
49         --    Raises VectorWithNullMagnitude if one of the two vectors is a vector with
50         --  null magnitude because the angular value is indefinite.
51         raises VectorWithNullMagnitude;
52        
53   Coord (me; X, Y : out Real);
54         --- Purpose : Returns the coordinates of <me>.
55
56
57   Magnitude (me)  returns Real
58         --- Purpose : Returns the  Magnitude of <me>.
59      is deferred;
60
61
62   SquareMagnitude (me)  returns Real
63         --- Purpose : Returns the square magnitude of <me>.
64      is deferred;
65
66   
67   X (me)  returns Real;
68         --- Purpose : Returns the X coordinate of <me>.
69
70
71   Y (me)  returns Real;
72         --- Purpose : Returns the Y coordinate of <me>.
73
74
75   Crossed (me; Other : Vector)   returns Real
76         --- Purpose : Cross product of <me> with the vector <Other>.
77      is deferred;
78
79
80   Dot (me; Other : Vector)  returns Real;
81         --- Purpose : Returns the scalar product of 2 Vectors.
82
83
84   Vec2d (me)  returns Vec2d;
85         --- Purpose : Returns a non persistent copy of <me>.
86
87
88
89 fields
90
91   gpVec2d : Vec2d is protected;
92
93 end;