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 #include <QtGui>
00031 #include "mainwindow.h"
00032
00033 MainWindow::MainWindow (QWidget * parent):QMainWindow (parent)
00034 {
00035 ui.setupUi (this);
00036
00037
00038
00039 connect (ui.drawModeComboBox, SIGNAL (currentIndexChanged(int)),
00040 ui.glArea, SLOT (selectDrawMode(int)));
00041
00042 connect (ui.loadTetrahedronPushButton, SIGNAL (clicked()),
00043 ui.glArea, SLOT (loadTetrahedron()));
00044
00045 connect (ui.loadDodecahedronPushButton, SIGNAL (clicked()),
00046 ui.glArea, SLOT (loadDodecahedron()));
00047
00048
00049 connect (ui.loadMeshPushButton, SIGNAL (clicked()),
00050 this, SLOT (chooseMesh()));
00051 connect (this, SIGNAL (loadMesh(QString)),
00052 ui.glArea, SLOT(loadMesh(QString)));
00053
00054
00055 connect (ui.glArea, SIGNAL (setStatusBar(QString)),
00056 ui.statusbar, SLOT (showMessage(QString)));
00057 }
00058
00059
00060 void MainWindow::chooseMesh()
00061 {
00062 QString fileName = QFileDialog::getOpenFileName(this,
00063 tr("Open Mesh"), QDir::currentPath(),
00064 tr("Poly Model (*.ply)"));
00065 if(!fileName.isEmpty())
00066 emit loadMesh(fileName);
00067 }