//-------------------------------------------------------------------- // // Laboratory 2 ptlist.h // // Class declaration for the array implementation of the Point // List ADT // //-------------------------------------------------------------------- using namespace std; const int maxListSize = 10; // Default maximum list size //const int maxListSize = 5000; // Maximum list size for inlab 1 //-------------------------------------------------------------------- class Point { public: Point ( float x0 = 0, float y0 = 0 ) // Constructor { x = x0; y = y0; } float x, y; // Point coordinates (can be accessed directly) }; //-------------------------------------------------------------------- class PointList { public: // Constructor PointList (); // List manipulation operations void append ( Point newPoint ); // Append point to list void clear (); // Clear list // List status operations bool isEmpty () const; // List is empty bool isFull () const; // List is full // List iteration operations void gotoBeginning (); // Go to beginning void gotoEnd (); // Go to end bool gotoNext (); // Go to next point bool gotoPrior (); // Go to prior point Point getCursor () const; // Return point // Output the list structure -- used in testing/debugging void showStructure () const; // In-lab operations bool isTranslation ( const PointList &otherList ); // Translation void insertAtBeginning ( Point newPoint ); // Insert begin. private: // Data members int size, // Actual number of points in the list cursor; // Cursor array index Point points[maxListSize]; // Array containing the points };