No Description

map.h 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef MAP_H
  2. #define MAP_H
  3. #include <QWidget>
  4. #include <QMap>
  5. #include <QRgb>
  6. // #include <census.h>
  7. #include <country.h>
  8. #include <gispoi.h>
  9. #include <QVector>
  10. #include <QPair>
  11. /// This is the actual widget in charge of drawing the map
  12. class Map : public QWidget
  13. {
  14. Q_OBJECT
  15. public:
  16. /// \fn Map(QWidget *parent = 0);
  17. /// \~English
  18. /// \brief default constructor
  19. /// \~Spanish
  20. /// \brief constructor por defecto
  21. ///
  22. explicit Map(QWidget *parent = 0);
  23. /// \fn drawPoints(GISPOI *v, unsigned int size);
  24. /// \~English
  25. /// \brief sets the array of GIS locations and sets its size
  26. /// \~Spanish
  27. /// \brief establece el arreglo de localizaciones de GIS y su tamaño
  28. ///
  29. void drawPoints(GISPOI *v, unsigned int size)
  30. { gisLocations = v; numLocations = size; }
  31. /// \fn drawLine(const GISPOI &city01, const GISPOI &city02)
  32. /// \~English
  33. /// \brief adds a line from city01 to city02
  34. /// \~Spanish
  35. /// \brief añade una linea entre los centroides de city01 a city02
  36. ///
  37. void drawLine(const GISPOI &city01, const GISPOI &city02) {
  38. this->cityLines.push_back(
  39. QPair<const GISPOI *, const GISPOI *> (&city01, &city02));
  40. }
  41. ~Map();
  42. signals:
  43. private:
  44. Country *myCountry;
  45. QMap<QString,QRgb> *cityColorMap;
  46. GISPOI *gisLocations;
  47. unsigned int numLocations;
  48. bool drawRoutes;
  49. QVector < QPair<const GISPOI *,const GISPOI *> > cityLines;
  50. protected:
  51. void paintEvent(QPaintEvent *event);
  52. public slots:
  53. };
  54. #endif // MAP_H