Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "mainwindow.h"
00032 #include <QFileDialog>
00033
00034 MainWindow::MainWindow (QWidget * parent):QMainWindow (parent)
00035 {
00036 ui.setupUi (this);
00037
00038
00039
00040 connect (ui.drawModeComboBox, SIGNAL (currentIndexChanged(int)),
00041 ui.glArea, SLOT (selectDrawMode(int)));
00042
00043 connect (ui.loadTetrahedronPushButton, SIGNAL (clicked()),
00044 ui.glArea, SLOT (loadTetrahedron()));
00045
00046 connect (ui.loadDodecahedronPushButton, SIGNAL (clicked()),
00047 ui.glArea, SLOT (loadDodecahedron()));
00048
00049
00050 connect (ui.loadMeshPushButton, SIGNAL (clicked()),
00051 this, SLOT (chooseMesh()));
00052 connect (this, SIGNAL (loadMesh(QString)),
00053 ui.glArea, SLOT(loadMesh(QString)));
00054
00055
00056 connect (ui.glArea, SIGNAL (setStatusBar(QString)),
00057 ui.statusbar, SLOT (showMessage(QString)));
00058 }
00059
00060
00061 void MainWindow::chooseMesh()
00062 {
00063 QString fileName = QFileDialog::getOpenFileName(this,
00064 tr("Open Mesh"), QDir::currentPath(),
00065 tr("Poly Model (*.ply)"));
00066 if(!fileName.isEmpty())
00067 emit loadMesh(fileName);
00068 }