b311480e |
1 | -- Created on: 1993-03-24 |
2 | -- Created by: JCV |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
10 | -- |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
13 | -- |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
7fd59977 |
22 | |
23 | |
24 | class Line from Geom2d inherits Curve from Geom2d |
25 | |
26 | --- Purpose : Describes an infinite line in the plane (2D space). |
27 | -- A line is defined and positioned in the plane with an |
28 | -- axis (gp_Ax2d object) which gives it an origin and a unit vector. |
29 | -- The Geom2d_Line line is parameterized as follows: |
30 | -- P (U) = O + U*Dir |
31 | -- where: |
32 | -- - P is the point of parameter U, |
33 | -- - O is the origin and Dir the unit vector of its positioning axis. |
34 | -- The parameter range is ] -infinite, +infinite [. |
35 | -- The orientation of the line is given by the unit vector |
36 | -- of its positioning axis. |
37 | -- See Also |
38 | -- GCE2d_MakeLine which provides functions for more |
39 | -- complex line constructions |
40 | -- gp_Ax2d |
41 | -- gp_Lin2d for an equivalent, non-parameterized data structure. |
42 | |
43 | |
44 | uses Ax2d from gp, |
45 | Dir2d from gp, |
46 | Lin2d from gp, |
47 | Pnt2d from gp, |
48 | Vec2d from gp, |
49 | Trsf2d from gp, |
50 | Geometry from Geom2d, |
51 | Shape from GeomAbs |
52 | |
53 | |
54 | raises RangeError from Standard |
55 | |
56 | is |
57 | |
58 | Create (A : Ax2d) returns mutable Line; |
59 | --- Purpose : |
60 | -- Creates a line located in 2D space with the axis placement A. |
61 | -- The Location of A is the origin of the line. |
62 | |
63 | |
64 | Create (L : Lin2d) returns mutable Line; |
65 | --- Purpose : |
66 | -- Creates a line by conversion of the gp_Lin2d line L. |
67 | |
68 | |
69 | Create (P : Pnt2d; V : Dir2d) returns mutable Line; |
70 | --- Purpose : Constructs a line passing through point P and parallel to |
71 | -- vector V (P and V are, respectively, the origin |
72 | -- and the unit vector of the positioning axis of the line). |
73 | |
74 | |
75 | SetLin2d (me : mutable; L : Lin2d); |
76 | --- Purpose : |
77 | -- Set <me> so that <me> has the same geometric properties as L. |
78 | |
79 | |
80 | SetDirection (me : mutable; V : Dir2d); |
81 | --- Purpose : changes the direction of the line. |
82 | |
83 | |
84 | Direction (me) returns Dir2d from gp; |
85 | --- Purpose : changes the direction of the line. |
86 | ---C++: return const & |
87 | |
88 | SetLocation (me : mutable; P : Pnt2d); |
89 | --- Purpose : |
90 | -- Changes the "Location" point (origin) of the line. |
91 | |
92 | Location (me) returns Pnt2d from gp; |
93 | --- Purpose : |
94 | -- Changes the "Location" point (origin) of the line. |
95 | ---C++: return const & |
96 | |
97 | SetPosition (me : mutable; A : Ax2d); |
98 | --- Purpose : |
99 | -- Changes the "Location" and a the "Direction" of <me>. |
100 | |
101 | Position(me) returns Ax2d from gp |
102 | ---C++: return const & |
103 | is static; |
104 | |
105 | Lin2d (me) returns Lin2d; |
106 | --- Purpose : |
107 | -- Returns non persistent line from gp with the same geometric |
108 | -- properties as <me> |
109 | |
110 | |
111 | Reverse (me : mutable); |
112 | --- Purpose : Changes the orientation of this line. As a result, the |
113 | -- unit vector of the positioning axis of this line is reversed. |
114 | |
115 | |
116 | ReversedParameter(me; U : Real) returns Real; |
117 | ---Purpose: Computes the parameter on the reversed line for the |
118 | -- point of parameter U on this line. |
119 | -- For a line, the returned value is -U. |
120 | |
121 | |
122 | FirstParameter (me) returns Real; |
123 | --- Purpose : Returns RealFirst from Standard. |
124 | |
125 | |
126 | LastParameter (me) returns Real; |
127 | --- Purpose : Returns RealLast from Standard |
128 | |
129 | |
130 | IsClosed (me) returns Boolean; |
131 | --- Purpose : Returns False |
132 | |
133 | |
134 | IsPeriodic (me) returns Boolean; |
135 | --- Purpose : Returns False |
136 | |
137 | |
138 | Continuity (me) returns Shape from GeomAbs; |
139 | --- Purpose : Returns GeomAbs_CN, which is the global continuity of any line. |
140 | |
141 | |
142 | Distance (me; P : Pnt2d) returns Real; |
143 | --- Purpose : Computes the distance between <me> and the point P. |
144 | |
145 | |
146 | IsCN (me; N : Integer) returns Boolean; |
147 | --- Purpose : Returns True. |
148 | |
149 | D0(me; U : Real; P : out Pnt2d); |
150 | ---Purpose: Returns in P the point of parameter U. |
151 | -- P (U) = O + U * Dir where O is the "Location" point of the |
152 | -- line and Dir the direction of the line. |
153 | |
154 | D1 (me; U : Real; P : out Pnt2d; V1 : out Vec2d); |
155 | --- Purpose : |
156 | -- Returns the point P of parameter u and the first derivative V1. |
157 | |
158 | |
159 | D2 (me; U : Real; P : out Pnt2d; V1, V2 : out Vec2d); |
160 | --- Purpose : |
161 | -- Returns the point P of parameter U, the first and second |
162 | -- derivatives V1 and V2. V2 is a vector with null magnitude |
163 | -- for a line. |
164 | |
165 | |
166 | D3 (me; U : Real; P : out Pnt2d; V1, V2, V3 : out Vec2d); |
167 | --- Purpose : |
168 | -- V2 and V3 are vectors with null magnitude for a line. |
169 | |
170 | |
171 | DN (me; U : Real; N : Integer) returns Vec2d |
172 | --- Purpose : For the point of parameter U of this line, computes |
173 | -- the vector corresponding to the Nth derivative. |
174 | -- Note: if N is greater than or equal to 2, the result is a |
175 | -- vector with null magnitude. |
176 | -- Exceptions Standard_RangeError if N is less than 1. |
177 | raises RangeError; |
178 | |
179 | |
180 | |
181 | Transform (me : mutable; T : Trsf2d); |
182 | ---Purpose: Applies the transformation T to this line. |
183 | |
184 | |
185 | TransformedParameter(me; U : Real; T : Trsf2d from gp) returns Real |
186 | ---Purpose: Computes the parameter on the line transformed by |
187 | -- T for the point of parameter U on this line. |
188 | -- For a line, the returned value is equal to U multiplied |
189 | -- by the scale factor of transformation T. |
190 | is redefined; |
191 | |
192 | ParametricTransformation(me; T : Trsf2d from gp) returns Real |
193 | ---Purpose: Returns the coefficient required to compute the |
194 | -- parametric transformation of this line when |
195 | -- transformation T is applied. This coefficient is the |
196 | -- ratio between the parameter of a point on this line |
197 | -- and the parameter of the transformed point on the |
198 | -- new line transformed by T. |
199 | -- For a line, the returned value is the scale factor of the transformation T. |
200 | is redefined; |
201 | |
202 | |
203 | |
204 | |
205 | Copy (me) returns mutable like me; |
206 | ---Purpose: Creates a new object, which is a copy of this line. |
207 | |
208 | fields |
209 | |
210 | pos : Ax2d; |
211 | |
212 | end; |