Test for 0022778: Bug in BRepMesh
[occt.git] / src / Graphic3d / Graphic3d_Vector.cdl
1 -- Created by: NW,JPB,CAL
2 -- Copyright (c) 1991-1999 Matra Datavision
3 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
4 --
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
9 --
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 --
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
19
20
21 class Vector from Graphic3d
22
23         ---Purpose: This class allows the creation and update
24         --          of a 3D vector.
25
26 uses
27
28         Vertex  from Graphic3d
29
30 raises
31
32         VectorError     from Graphic3d
33
34 is
35
36         Create
37                 returns Vector from Graphic3d;
38         ---Level: Public
39         ---Purpose: Creates a vector with 1.0, 0.0, 0.0 coordinates.
40
41         Create ( AX, AY, AZ     : Real from Standard )
42                 returns Vector from Graphic3d;
43         ---Level: Public
44         ---Purpose: Creates a vector with <AX>, <AY>, <AZ> coordinates.
45
46         Create ( APoint1, APoint2       : Vertex from Graphic3d )
47                 returns Vector from Graphic3d;
48         ---Level: Public
49         ---Purpose: Creates a vector from 2 points <APoint1> and <APoint2>.
50
51         ---------------------------------------------------
52         -- Category: Methods to modify the class definition
53         ---------------------------------------------------
54
55         Normalize ( me  : in out )
56         ---Level: Public
57         ---Purpose: Normalises <me>.
58         --  Category: Methods to modify the class definition
59         --  Warning: Raises VectorError if <me> is null.
60         raises VectorError from Graphic3d is static;
61
62         SetCoord ( me                   : in out;
63                    Xnew, Ynew, Znew     : Real from Standard )
64                 is static;
65         ---Level: Public
66         ---Purpose: Modifies the coordinates of the vector <me>.
67         ---Category: Methods to modify the class definition
68
69         SetXCoord ( me          : in out;
70                     Xnew        : Real from Standard )
71                 is static;
72         ---Level: Public
73         ---Purpose: Modifies the X coordinate of the vector <me>.
74         ---Category: Methods to modify the class definition
75
76         SetYCoord ( me          : in out;
77                     Ynew        : Real from Standard )
78                 is static;
79         ---Level: Public
80         ---Purpose: Modifies the Y coordinate of the vector <me>.
81         ---Category: Methods to modify the class definition
82
83         SetZCoord ( me          : in out;
84                     Znew        : Real from Standard )
85                 is static;
86         ---Level: Public
87         ---Purpose: Modifies the Z coordinate of the vector <me>.
88         ---Category: Methods to modify the class definition
89
90         ----------------------------
91         -- Category: Inquire methods
92         ----------------------------
93
94         Coord ( me;
95                 AX, AY, AZ      : out Real from Standard )
96                 is static;
97         ---Level: Public
98         ---Purpose: Returns the coordinates of the vector <me>.
99         ---Category: Inquire methods
100
101         IsNormalized ( me )
102                 returns Boolean from Standard
103                 is static;
104         ---Level: Public
105         ---Purpose: Returns Standard_True if <me> has length 1.
106         ---Category: Inquire methods
107
108         LengthZero ( me )
109                 returns Boolean from Standard
110                 is static;
111         ---Level: Public
112         ---Purpose: Returns Standard_True if <me> has length zero.
113         ---Category: Inquire methods
114
115         X ( me )
116                 returns Real from Standard
117                 is static;
118         ---Level: Public
119         ---Purpose: Returns the X coordinates of the vector <me>.
120         ---Category: Inquire methods
121
122         Y ( me )
123                 returns Real from Standard
124                 is static;
125         ---Level: Public
126         ---Purpose: Returns the Y coordinate of the vector <me>.
127         ---Category: Inquire methods
128
129         Z ( me )
130                 returns Real from Standard
131                 is static;
132         ---Level: Public
133         ---Purpose: Returns the Z coordinate of the vector <me>.
134         ---Category: Inquire methods
135
136         --------------------------
137         -- Category: Class methods
138         --------------------------
139
140         IsParallel ( myclass;
141                      AV1        : Vector from Graphic3d;
142                      AV2        : Vector from Graphic3d )
143                 returns Boolean from Standard;
144         ---Level: Public
145         ---Purpose: Returns Standard_True if the vector <AV1> and
146         --          <AV2> are parallel.
147         ---Category: Class methods
148
149         NormeOf ( myclass;
150                   AX, AY, AZ    : Real from Standard )
151                 returns Real from Standard;
152         ---Level: Public
153         ---Purpose: Returns the norm of the vector <AX>, <AY>, <AZ>.
154         ---Category: Class methods
155
156         NormeOf ( myclass;
157                   AVector       : Vector from Graphic3d )
158                 returns Real from Standard;
159         ---Level: Public
160         ---Purpose: Returns the norm of the vector <AVector>.
161         ---Category: Class methods
162
163 --\f
164
165 fields
166
167 --
168 -- Class        :       Graphic3d_Vector
169 --
170 -- Purpose      :       Declaration of variables specific to vectors
171 --
172 -- Reminder     :       A vector is defined by its components or by
173 --                      two points
174 --                      It can be normalised.
175 --
176
177         -- the coordinates of a vector
178         MyX             :       ShortReal from Standard;
179         MyY             :       ShortReal from Standard;
180         MyZ             :       ShortReal from Standard;
181
182         -- the norm of a vector
183         MyNorme         :       ShortReal from Standard;
184
185 end Vector;