/* * TDDD86 Lab 3b - gusso230 (group 11) * This file contains the tour structure. * You can insert points using two algorithms (nearest neighbour and smallest * increase), get the total length of the tour and draw the tour. */ #ifndef TOUR_H #define TOUR_H #include "Node.h" #include "Point.h" class Tour { public: Tour(); // create an empty tour ~Tour(); // free all nodes void show() const; // print the tour to stdout void draw(QGraphicsScene *scene) const; // draw the tour on `scene` int size() const; // return number of points on tour double distance() const; // return total distance of tour void insertNearest(Point p); // insert `p` using nearestNeighbour void insertSmallest(Point p); // insert `p` using insertSmallest private: Node *first; // first node }; #endif // TOUR_H