/*	File: Polyline.h
 *
 *	Interface Description:
 *		Provides a concrete class Polyline which is a kind of a stretchable
 *		figure.
 *		See also Figure.h, StretchF.h.
 *	History:
 *		Date:		 Author:	 Change:
 *		97-05-12	 KHU		 Creation.
 */

#ifndef POLYLINE_H_
#define POLYLINE_H_

#include "StretchF.h"

	class Polyline : virtual public StretchableFigure
	{
	protected:
		// Attributes:

		int nbrOfPoints;
			// Invariant: nbrOfPoints > 1.

		CoordinatePair * delta;			// Dynamic array of CoordinatePair.

		// Commands:

		void Draw ();

	public:
		// Queries:

		int NbrOfPoints () const
		{
			return nbrOfPoints;
		};

		Float Extent () const;

		CoordinatePair Point (int nbr) const;
			// Precondition: 0 <= nbr < nbrOfPoints.

		// Commands:

		void Stretch (/* IN */ const CoordinatePair & factor);

		// Constructors:

		Polyline (/* IN */ const CoordinatePair point [], int nbrOfPoints);
			// Precondition: nbrOfPoints > 1.

		// Destructors:

		~Polyline ();

	protected:
		void CheckInvariant ();

	}; // Polyline

#endif // POLYLINE_H_