void BasicOpenGLView::removeGeometry(std::string m_GeometryFileName) { if(mGeometries.find(m_GeometryFileName) != mGeometries.end()) { delete mGeometries[m_GeometryFileName]; } mGeometries.erase(m_GeometryFileName); emit removedGeometry(m_GeometryFileName); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { ui = new Ui::MainWindow(); rayDialog = 0; animationTimer = NULL; ui->setupUi(this); // we create a simple timer, with the widget being its parent animationTimer = new QTimer(this); // the timer will send a signal timeout at regular intervals. // whenever this timeout signal occurs, we want it to call our drawOpenGL // function connect(animationTimer, SIGNAL(timeout()), this, SLOT(drawOpenGL())); // we start the timer with a timeout interval of 20ms animationTimer->start(20); connect(ui->oglwidget, SIGNAL(addedNewGeometry(std::string)), this, SLOT(newGeometryAdded(std::string))); connect(ui->oglwidget, SIGNAL(removedGeometry(std::string)), this, SLOT(geometryRemoved(std::string))); connect(ui->addModel, SIGNAL(clicked()), this, SLOT(addGeometry())); connect(ui->removeModel, SIGNAL(clicked()), this, SLOT(removeGeometry())); connect(ui->XRotSlider, SIGNAL(valueChanged(int)), this, SLOT(rotateGeometryX(int))); connect(ui->YRotSlider, SIGNAL(valueChanged(int)), this, SLOT(rotateGeometryY(int))); connect(ui->ZRotSlider, SIGNAL(valueChanged(int)), this, SLOT(rotateGeometryZ(int))); connect(ui->XTransSlider, SIGNAL(valueChanged(int)), this, SLOT(translateGeometryX(int))); connect(ui->YTransSlider, SIGNAL(valueChanged(int)), this, SLOT(translateGeometryY(int))); connect(ui->ZTransSlider, SIGNAL(valueChanged(int)), this, SLOT(translateGeometryZ(int))); connect(ui->orthoProj, SIGNAL(stateChanged(int)), this, SLOT(setOrtho(int))); connect(ui->postMult, SIGNAL(stateChanged(int)), this, SLOT(setPost(int))); connect(ui->traceButton, SIGNAL(clicked()), this, SLOT(addTraceDialog())); }