No Description

mainwindow.cpp 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include <QPainter>
  4. #include <QPen>
  5. #include <QCoreApplication>
  6. //#include <QJsonDocument>
  7. #include <QFile>
  8. #include <QDebug>
  9. //#include <QJsonArray>
  10. //#include <QJsonObject>
  11. #include <QDesktopWidget>
  12. #include <QVector>
  13. #include <QPoint>
  14. #include <string>
  15. #include <QPolygon>
  16. #include <census.h>
  17. #include <city.h>
  18. #include <country.h>
  19. #include <doublepoint.h>
  20. #include <gispoi.h>
  21. using namespace std;
  22. Country PR;
  23. MainWindow::MainWindow(QWidget *parent) :
  24. QMainWindow(parent),
  25. ui(new Ui::MainWindow)
  26. {
  27. srand(time(NULL));
  28. myMap = new Map(this);
  29. myMap->show();
  30. ui->setupUi(this);
  31. // just hidding the toolbars to have a bigger drawing area.
  32. QList<QToolBar *> toolbars = this->findChildren<QToolBar *>();
  33. foreach(QToolBar *t, toolbars) t->hide();
  34. QList<QStatusBar *> statusbars = this->findChildren<QStatusBar *>();
  35. foreach(QStatusBar *t, statusbars) t->hide();
  36. resize(myMap->width(), myMap->height());
  37. }
  38. void MainWindow::drawPoints(GISPOI* gisLocations, unsigned int size) {
  39. myMap->drawPoints(gisLocations, size);
  40. }
  41. void MainWindow::drawLine(const GISPOI &city01, const GISPOI &city02) {
  42. myMap->drawLine(city01, city02);
  43. }
  44. MainWindow::~MainWindow()
  45. {
  46. delete ui;
  47. if (myMap != NULL) delete myMap;
  48. }