1 -- Created on: 1993-03-24
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License 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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Direction from Geom2d inherits Vector from Geom2d
20 -- The class Direction specifies a vector that is never null.
21 -- It is a unit vector.
30 raises ConstructionError from Standard
35 Create (X, Y :Real) returns Direction
36 --- Purpose : Creates a unit vector with it 2 cartesian coordinates.
37 raises ConstructionError;
39 -- Raised if Sqrt( X*X + Y*Y) <= Resolution from gp.
41 Create (V : Dir2d) returns Direction;
42 --- Purpose : Creates a persistent copy of <me>.
46 SetCoord (me : mutable; X, Y : Real)
47 --- Purpose : Assigns the coordinates X and Y to this unit vector,
48 -- then normalizes it.
50 -- Standard_ConstructionError if Sqrt(X*X +
51 -- Y*Y) is less than or equal to gp::Resolution().
52 raises ConstructionError;
55 SetDir2d (me : mutable; V : Dir2d);
56 --- Purpose : Converts the gp_Dir2d unit vector V into this unit vector.
59 SetX (me : mutable; X : Real)
61 -- Assigns a value to the X coordinate of this unit vector, then normalizes it.
63 -- Standard_ConstructionError if the value assigned
64 -- causes the magnitude of the vector to become less
65 -- than or equal to gp::Resolution().
66 raises ConstructionError;
69 SetY (me : mutable; Y : Real)
70 --- Purpose : Assigns a value to the Y coordinate of this unit vector, then normalizes it.
72 -- Standard_ConstructionError if the value assigned
73 -- causes the magnitude of the vector to become less
74 -- than or equal to gp::Resolution().
75 raises ConstructionError;
78 Dir2d (me) returns Dir2d;
79 --- Purpose : Converts this unit vector into a gp_Dir2d unit vector.
82 Magnitude (me) returns Real;
83 --- Purpose : returns 1.0
86 SquareMagnitude (me) returns Real;
87 --- Purpose : returns 1.0
90 Crossed (me; Other : Vector) returns Real;
91 --- Purpose : Computes the cross product between <me> and <Other>.
92 ---C++: alias operator ^
95 Transform (me : mutable; T : Trsf2d);
97 ---Purpose: Applies the transformation T to this unit vector, then normalizes it.
100 Copy (me) returns like me;
101 ---Purpose: Creates a new object which is a copy of this unit vector.