-- $Date: 2004/01/11 00:59:06 $
-- $Revision: 1.7 $
-- $Author: jcrocholl $

with Real_Numbers; use Real_Numbers;
with Real_Vectors; use Real_Vectors;
with Lines; use Lines;

-- Straight lines.
package Straights is

   -- Straight line.
   type Straight_Record is new Line_Record with null record;

   -- Access type for straight lines.
   type Straight is access Straight_Record;

   -- Create a straight line.
   function Create
     (To : in Vector-- End point of the line.
     return Line;     -- The newly created straight line.

   -- Calculate the length of this line. Results are cached for
   -- reuse. So make sure the starting point always remain the same
   -- between calls.
   function Length
     (Start : in Vector;              -- Starting point of the line.
      This  : access Straight_Record-- Get this line's length.
     return Real;                     -- The distance from start to end point.

   -- Scale a line by a given factor.
   procedure Scale
     (This   : access Straight_Record;
      Factor : in Real);

   -- Translate a line by a given offset.
   procedure Translate
     (This   : access Straight_Record-- Translate this line.
      Offset : in Vector);             -- Translating offset.

   -- Get one point from a straight line.
   function Way_Point
     (Start : in Vector;              -- Starting point of the line.
      This  : access Straight_Record-- Definition of the line.
      Part  : in Real)                -- Parametrization variable from 0 to 1.
     return Vector;                   -- The point on the line.

   -- Format a straight line for postscript output.
   function Postscript
     (This : access Straight_Record-- Format this line.
     return String;                  -- The resulting postscript code.

end Straights;