My Project
mainwindow.h
Go to the documentation of this file.
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
4 #include <QMainWindow>
5 #include "basicComponents.h"
6 #include "figures.h"
7 #include "complexComponents.h"
8 
9 namespace Ui {
10 class MainWindow;
11 }
12 
13 class MainWindow : public QMainWindow
14 {
15 Q_OBJECT
16 
17 public:
18 
20 explicit MainWindow(QWidget *parent = 0);
21 
23 ~MainWindow();
24 
26 void setVertices(std::vector<Vertice> &out_vertices,std::vector<std::vector<unsigned int> > &faces_vertices);
27 
29 void setWireFrame(WireFrame wf);
30 
31 // void render2D(std::vector<Vertice> & out_vertices,std::vector<std::vector<unsigned int>> & faces_vertices, QPainter & painter,int plane );
32 
34 void render2DinLabel(Fig3D & fig_to_render,unsigned int plane);
35 
37 void renderAllViews(Fig3D & fig_to_render);
38 
40 void incX();
41 
43 void incY();
44 
46 void incZ();
47 
49 void decX();
50 
52 void decY();
53 
55 void decZ();
56 
58 void zoomin();
59 
61 void zoomout();
62 
64 void update();
65 
67 void mousePressEvent(QMouseEvent *event) override;
68 
70 void mouseMoveEvent(QMouseEvent *event) override;
71 
73 void renderFromEdges(vector<Edge> edges,int plane);
74 
76 void render2Dto3D(WireFrame wf,Fig3D fig);
77 
78 int mode;
79 
81 void connectSliderandButtons();
82 
83 public slots:
84 
86 void setXRotation(int angle);
87 
89 void setYRotation(int angle);
90 
92 void setZRotation(int angle);
93 
94 signals:
95 
97 void xRotationChanged(int angle);
98 
100 void yRotationChanged(int angle);
101 
103 void zRotationChanged(int angle);
104 
105 // void setFig3D()
106 
107 private:
108 Ui::MainWindow *ui;
109 double x_rot=0,y_rot=0,z_rot=0;
110 QPoint m_lastPos;
111 double x_off=0,y_off=0,z_off=0;
112 double scale_factor=1.0;
113 
114 Fig3D fig;
115 WireFrame wf;
116 };
117 
118 #endif // MAINWINDOW_H
Definition: mainwindow.h:9
int mode
Definition: mainwindow.h:78
Definition: complexComponents.h:24
Definition: figures.h:11
Definition: mainwindow.h:13