0024784: Move documentation in CDL files to proper location
[occt.git] / src / gce / gce_MakeDir2d.cdl
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
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 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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class MakeDir2d from gce inherits Root from gce
18
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).
25
26 uses Pnt2d from gp,
27      Vec2d from gp,
28      Dir2d from gp,
29      XY    from gp,
30      Real  from Standard
31
32 raises NotDone from StdFail
33
34 is
35
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.
39
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.
44
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 ) 
48     --            <= Resolution
49
50 Create(P1     :     Pnt2d from gp;
51        P2     :     Pnt2d from gp) returns MakeDir2d;
52     ---Purpose : Make a Dir2d from gp <TheDir> passing through 2 
53     --           Pnt <P1>,<P2>.
54     --           Status is "ConfusedPoints" if <P1> and <P2> are confused.
55     -- Warning
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).
64         
65 Value(me) returns Dir2d from gp
66     raises NotDone
67     is static;
68      ---C++: return const&
69      ---Purpose: Returns the constructed unit vector.
70      -- Exceptions StdFail_NotDone if no unit vector is constructed.
71
72 Operator(me) returns Dir2d from gp
73     is static;
74     ---C++: return const&
75     ---C++: alias "Standard_EXPORT operator gp_Dir2d() const;"
76
77 fields
78
79     TheDir2d : Dir2d from gp;
80     --The solution from gp.
81     
82 end MakeDir2d;