1 -- Created on: 1993-03-24
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Line from Geom2d inherits Curve from Geom2d
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:
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.
31 -- GCE2d_MakeLine which provides functions for more
32 -- complex line constructions
34 -- gp_Lin2d for an equivalent, non-parameterized data structure.
47 raises RangeError from Standard
51 Create (A : Ax2d) returns Line;
53 -- Creates a line located in 2D space with the axis placement A.
54 -- The Location of A is the origin of the line.
57 Create (L : Lin2d) returns Line;
59 -- Creates a line by conversion of the gp_Lin2d line L.
62 Create (P : Pnt2d; V : Dir2d) returns Line;
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).
68 SetLin2d (me : mutable; L : Lin2d);
70 -- Set <me> so that <me> has the same geometric properties as L.
73 SetDirection (me : mutable; V : Dir2d);
74 --- Purpose : changes the direction of the line.
77 Direction (me) returns Dir2d from gp;
78 --- Purpose : changes the direction of the line.
79 ---C++: return const &
81 SetLocation (me : mutable; P : Pnt2d);
83 -- Changes the "Location" point (origin) of the line.
85 Location (me) returns Pnt2d from gp;
87 -- Changes the "Location" point (origin) of the line.
88 ---C++: return const &
90 SetPosition (me : mutable; A : Ax2d);
92 -- Changes the "Location" and a the "Direction" of <me>.
94 Position(me) returns Ax2d from gp
95 ---C++: return const &
98 Lin2d (me) returns Lin2d;
100 -- Returns non persistent line from gp with the same geometric
101 -- properties as <me>
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.
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.
115 FirstParameter (me) returns Real;
116 --- Purpose : Returns RealFirst from Standard.
119 LastParameter (me) returns Real;
120 --- Purpose : Returns RealLast from Standard
123 IsClosed (me) returns Boolean;
124 --- Purpose : Returns False
127 IsPeriodic (me) returns Boolean;
128 --- Purpose : Returns False
131 Continuity (me) returns Shape from GeomAbs;
132 --- Purpose : Returns GeomAbs_CN, which is the global continuity of any line.
135 Distance (me; P : Pnt2d) returns Real;
136 --- Purpose : Computes the distance between <me> and the point P.
139 IsCN (me; N : Integer) returns Boolean;
140 --- Purpose : Returns True.
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.
147 D1 (me; U : Real; P : out Pnt2d; V1 : out Vec2d);
149 -- Returns the point P of parameter u and the first derivative V1.
152 D2 (me; U : Real; P : out Pnt2d; V1, V2 : out Vec2d);
154 -- Returns the point P of parameter U, the first and second
155 -- derivatives V1 and V2. V2 is a vector with null magnitude
159 D3 (me; U : Real; P : out Pnt2d; V1, V2, V3 : out Vec2d);
161 -- V2 and V3 are vectors with null magnitude for a line.
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.
174 Transform (me : mutable; T : Trsf2d);
175 ---Purpose: Applies the transformation T to this line.
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.
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.
198 Copy (me) returns like me;
199 ---Purpose: Creates a new object, which is a copy of this line.