1 -- Created by: NW,JPB,CAL
2 -- Copyright (c) 1991-1999 Matra Datavision
3 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
21 class Vector from Graphic3d
23 ---Purpose: This class allows the creation and update
32 VectorError from Graphic3d
37 returns Vector from Graphic3d;
39 ---Purpose: Creates a vector with 1.0, 0.0, 0.0 coordinates.
41 Create ( AX, AY, AZ : Real from Standard )
42 returns Vector from Graphic3d;
44 ---Purpose: Creates a vector with <AX>, <AY>, <AZ> coordinates.
46 Create ( APoint1, APoint2 : Vertex from Graphic3d )
47 returns Vector from Graphic3d;
49 ---Purpose: Creates a vector from 2 points <APoint1> and <APoint2>.
51 ---------------------------------------------------
52 -- Category: Methods to modify the class definition
53 ---------------------------------------------------
55 Normalize ( me : in out )
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;
62 SetCoord ( me : in out;
63 Xnew, Ynew, Znew : Real from Standard )
66 ---Purpose: Modifies the coordinates of the vector <me>.
67 ---Category: Methods to modify the class definition
69 SetXCoord ( me : in out;
70 Xnew : Real from Standard )
73 ---Purpose: Modifies the X coordinate of the vector <me>.
74 ---Category: Methods to modify the class definition
76 SetYCoord ( me : in out;
77 Ynew : Real from Standard )
80 ---Purpose: Modifies the Y coordinate of the vector <me>.
81 ---Category: Methods to modify the class definition
83 SetZCoord ( me : in out;
84 Znew : Real from Standard )
87 ---Purpose: Modifies the Z coordinate of the vector <me>.
88 ---Category: Methods to modify the class definition
90 ----------------------------
91 -- Category: Inquire methods
92 ----------------------------
95 AX, AY, AZ : out Real from Standard )
98 ---Purpose: Returns the coordinates of the vector <me>.
99 ---Category: Inquire methods
102 returns Boolean from Standard
105 ---Purpose: Returns Standard_True if <me> has length 1.
106 ---Category: Inquire methods
109 returns Boolean from Standard
112 ---Purpose: Returns Standard_True if <me> has length zero.
113 ---Category: Inquire methods
116 returns Real from Standard
119 ---Purpose: Returns the X coordinates of the vector <me>.
120 ---Category: Inquire methods
123 returns Real from Standard
126 ---Purpose: Returns the Y coordinate of the vector <me>.
127 ---Category: Inquire methods
130 returns Real from Standard
133 ---Purpose: Returns the Z coordinate of the vector <me>.
134 ---Category: Inquire methods
136 --------------------------
137 -- Category: Class methods
138 --------------------------
140 IsParallel ( myclass;
141 AV1 : Vector from Graphic3d;
142 AV2 : Vector from Graphic3d )
143 returns Boolean from Standard;
145 ---Purpose: Returns Standard_True if the vector <AV1> and
146 -- <AV2> are parallel.
147 ---Category: Class methods
150 AX, AY, AZ : Real from Standard )
151 returns Real from Standard;
153 ---Purpose: Returns the norm of the vector <AX>, <AY>, <AZ>.
154 ---Category: Class methods
157 AVector : Vector from Graphic3d )
158 returns Real from Standard;
160 ---Purpose: Returns the norm of the vector <AVector>.
161 ---Category: Class methods
168 -- Class : Graphic3d_Vector
170 -- Purpose : Declaration of variables specific to vectors
172 -- Reminder : A vector is defined by its components or by
174 -- It can be normalised.
177 -- the coordinates of a vector
178 MyX : ShortReal from Standard;
179 MyY : ShortReal from Standard;
180 MyZ : ShortReal from Standard;
182 -- the norm of a vector
183 MyNorme : ShortReal from Standard;