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