PHPolyLine.h
#ifndef PHPOLYLINE_H
#define PHPOLYLINE_H
//---------------------------------------------------------------------------------------
// Class: PHPolyLine header
//
// Created by: Jane M. Burward-Hoy and Federica Messer
//
// Purpose: a poly line class (still to be completed).
// PHPolyLine is declared here. It is a template that can be use to create a list of
// pointers. This list is an array of basepoints of lines.
//
// Last update: 11/12/99
//
//------------------------------------------------------------------------------------
#include <iostream.h>
#include "PHPoint.h"
#include "phool.h"
#include "PHPointerList.h"
class PHPolyLine
{
public:
PHPolyLine();
/* PHPolyLine(PHPolyLine& ); */
/* PHPolyLine& operator=(const PHPolyLine &); */
~PHPolyLine();
PHPoint* getPoint(const size_t) const;
void clear() {return polyline.clear();}
void clearAndDestroy() {return polyline.clearAndDestroy();}
size_t numPoints() const { return polyline.length(); }
double length(size_t , size_t) const;
PHPoint* removeLastPoint() {return polyline.removeLast();}
PHPoint* removePointAt(size_t index) {return polyline.removeAt(index);}
PHBoolean appendPoint(PHPoint* ptr) {return polyline.append(ptr);}
friend ostream& operator<< (ostream &, PHPolyLine &);
private:
PHPointerList<PHPoint> polyline;
};
#endif /* PHPolyLine_H */