Nenhuma descrição

drawingWindow.h 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QMainWindow>
  4. #include <vector>
  5. #include "tessellation.h"
  6. #include "line.h"
  7. using namespace std;
  8. namespace Ui {
  9. class DrawingWindow;
  10. };
  11. /// \~English
  12. /// A class to create a drawing window to draw tessellations.
  13. /// \~Spanish
  14. /// Una clase para crear una ventana de dibujos para dibujar mosaicos
  15. class DrawingWindow : public QMainWindow
  16. {
  17. Q_OBJECT
  18. public:
  19. /// \fn DrawingWindow::DrawingWindow(QWidget *parent)
  20. /// \~English
  21. /// \brief Constructor
  22. /// \~Spanish
  23. /// \brief Constructor
  24. explicit DrawingWindow(QWidget *parent = 0);
  25. /// \fn DrawingWindow::~DrawingWindow()
  26. /// \~English
  27. /// \brief Destructor
  28. /// \~Spanish
  29. /// \brief Destructor
  30. ~DrawingWindow();
  31. /// \fn void DrawingWindow::addTessellation(Tessellation &t)
  32. /// \~English
  33. /// \brief Add a tessalation to the window
  34. /// \param t a tessellation object
  35. /// \~Spanish
  36. /// \brief Anade un mosaico a la ventana
  37. /// \param t un objeto de tipo tessellation (mosaico)
  38. void addTessellation(Tessellation &t);
  39. /// \fn void DrawingWindow::addLine(int x0, int y0, int x1, int y1, int width, QColor color)
  40. /// \~English
  41. /// \brief Add a line to the window, specifying coordinates
  42. /// of the starting and end points.
  43. /// \param x0 starting coordinate x
  44. /// \param y0 starting coordinate y
  45. /// \param x1 end coordinate x
  46. /// \param y1 end coordinate y
  47. /// \param width line width
  48. /// \param color line color
  49. /// \~Spanish
  50. /// \brief Anade una linea a la ventana, especificando las coordenadas
  51. /// de los puntos iniciales y finales
  52. /// \param x0 coordenada inicial x
  53. /// \param y0 coordenada inicial y
  54. /// \param x1 coordenada final x
  55. /// \param y1 coordenada final y
  56. /// \param width ancho de la linea
  57. /// \param color color de la linea
  58. void addLine(int x0, int y0, int x1, int y1, int width, QColor color);
  59. /// \fn void DrawingWindow::addLinePolar(int x0, int y0, int length, double angle, int width, QColor color)
  60. /// \~English
  61. /// \brief Add a line to the window, specifying coordinates
  62. /// of the starting point, the length and angle.
  63. /// \param x0 starting coordinate x
  64. /// \param y0 starting coordinate y
  65. /// \param length - length of the line
  66. /// \param angle - angle of the line
  67. /// \param width - line width
  68. /// \param color - line color
  69. /// \~Spanish
  70. /// \brief Anade una linea a la ventana, especifica las coordenadas
  71. /// de el punto inicial, el largo y el angulo
  72. /// \param x0 coordenada inicial x
  73. /// \param y0 coordenada inicial y
  74. /// \param length - largo de la linea
  75. /// \param angle - angulo de la linea
  76. /// \param width - ancho de la linea
  77. /// \param color - color de la linea
  78. void addLinePolar(int x0, int y0, int length, double angle, int width, QColor color);
  79. private:
  80. Ui::DrawingWindow *ui;
  81. vector <Tessellation* > *vT; /**< vector of tesselation / vector de mosaicos */
  82. vector <Tessellation *> *myTessellation; /**< vector of tesselation / vector de mosaicos */
  83. vector <Line *> *vL; /**< vector of line / vector de lineas */
  84. protected:
  85. /// \fn void DrawingWindow::paintEvent(QPaintEvent *)
  86. /// \~English
  87. /// \brief Paints event.
  88. /// \~Spanish
  89. /// \brief Evento de pintar
  90. void paintEvent(QPaintEvent *);
  91. };
  92. #endif // MAINWINDOW_H