-- $Date: 2004/01/10 08:48:20 $
-- $Revision: 1.12 $
-- $Author: jcrocholl $

with Straights; use Straights;
with Cubics; use Cubics;

package body Outlines is

   ----------------------------
   -- Step-by-step construction
   ----------------------------

   -- Add a straight line to an outline.
   procedure Add_Straight
     (This : in out Outline-- Add to this outline.
      To   : in Vector)      -- End point of straight line.
   is
      L : Line := Create(To);
   begin
      Push(This, L);
   end Add_Straight;

   -- Add a cubic bezier curve to an outline.
   procedure Add_Cubic
     (This      : in out Outline-- Add to this outline.
      Control_A : in Vector;      -- Control point A of bezier curve.
      Control_B : in Vector;      -- Control point B of bezier curve.
      To        : in Vector)      -- End point of bezier curve.
   is
      L : Line := Create(To, Control_A, Control_B);
   begin
      Push(This, L);
   end Add_Cubic;

   -------------------
   -- Postscript input
   -------------------

   -- Parse a PostScript description of an Outline.
   function Read
     (From : in Parser-- The parser to read from.
     return Outline     -- The newly created Outline.
   is
   begin
      return Empty_List;
   end Read;

   ---------------------
   -- Outline conversion
   ---------------------

   -- Approximate every cubic bezier curve by possibly multiple
   -- straight lines.
   --
   -- Input parameter Tolerance specifies the maximum acceptable error
   -- between the original cubic bezier curve and the approximation.
   procedure Straighten
     (This      : in out Outline-- The outline to straighten.
      Tolerance : in Real)        -- Maximum error tolerance.
   is
   begin
      null;
   end Straighten;

end Outlines;