/* * 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: /* * Create an empty tour. */ Tour(); /* * Free all nodes in the tour. */ ~Tour(); /* * Print the tour to stdout. */ void show() const; /* * Draw the tour to `scene`. */ void draw(QGraphicsScene *scene) const; /* * Return the number of nodes in tour. */ int size() const; /* * Return the total distance of the tour. */ double distance() const; /* * Insert `p` using the "nearest neighbour" heuristic. */ void insertNearest(Point p); /* * Insert `p` using the "smallest increase" heuristic. */ void insertSmallest(Point p); private: Node *first; // first node }; #endif // TOUR_H