1 -- Created on: 1992-08-26
2 -- Created by: Remi GILET
3 -- Copyright (c) 1992-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 MakeDir2d from gce inherits Root from gce
19 ---Purpose : This class implements the following algorithms used
20 -- to create a Dir2d from gp.
21 -- * Create a Dir2d with 2 points.
22 -- * Create a Dir2d with a Vec2d.
23 -- * Create a Dir2d with a XY from gp.
24 -- * Create a Dir2d with a 2 Reals (Coordinates).
32 raises NotDone from StdFail
36 Create (V : Vec2d from gp) returns MakeDir2d;
37 --- Purpose : Normalizes the vector V and creates a direction.
38 -- Status is "NullVector" if V.Magnitude() <= Resolution.
40 Create (Coord : XY from gp) returns MakeDir2d;
41 --- Purpose : Creates a direction from a triplet of coordinates.
42 -- Status is "NullVector" if Coord.Modulus() <=
43 -- Resolution from gp.
45 Create ( Xv, Yv : Real from Standard) returns MakeDir2d;
46 --- Purpose : Creates a direction with its 3 cartesian coordinates.
47 -- Status is "NullVector" if Sqrt(Xv*Xv + Yv*Yv )
50 Create(P1 : Pnt2d from gp;
51 P2 : Pnt2d from gp) returns MakeDir2d;
52 ---Purpose : Make a Dir2d from gp <TheDir> passing through 2
54 -- Status is "ConfusedPoints" if <P1> and <P2> are confused.
56 -- If an error occurs (that is, when IsDone returns
57 -- false), the Status function returns:
58 -- - gce_ConfusedPoints if points P1 and P2 are coincident, or
59 -- - gce_NullVector if one of the following is less
60 -- than or equal to gp::Resolution():
61 -- - the magnitude of vector V,
62 -- - the modulus of Coord,
63 -- - Sqrt(Xv*Xv + Yv*Yv).
65 Value(me) returns Dir2d from gp
69 ---Purpose: Returns the constructed unit vector.
70 -- Exceptions StdFail_NotDone if no unit vector is constructed.
72 Operator(me) returns Dir2d from gp
75 ---C++: alias "Standard_EXPORT operator gp_Dir2d() const;"
79 TheDir2d : Dir2d from gp;
80 --The solution from gp.