diff options
author | don bright <hugh.m.bright@gmail.com> | 2013-02-21 01:56:30 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2013-02-21 01:56:30 (GMT) |
commit | fc2d9341fac6948716b328b75f3366313bd2545a (patch) | |
tree | 4c40b79dc3250b655f6284ed8db1b787657c69ce /src/mainwin.cc | |
parent | b7d1c94dc1462dae0b7a23ddffe1f91c57308aa8 (diff) |
begin process of unifying GLView and OffscreenView. renames, objrot, objtran
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r-- | src/mainwin.cc | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc index d5af643..bd17402 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -190,8 +190,8 @@ MainWindow::MainWindow(const QString &filename) editor->setTabStopWidth(30); editor->setLineWrapping(true); // Not designable - this->glview->statusLabel = new QLabel(this); - statusBar()->addWidget(this->glview->statusLabel); + this->qglview->statusLabel = new QLabel(this); + statusBar()->addWidget(this->qglview->statusLabel); animate_timer = new QTimer(this); connect(animate_timer, SIGNAL(timeout()), this, SLOT(updateTVal())); @@ -291,7 +291,7 @@ MainWindow::MainWindow(const QString &filename) this->viewActionOpenCSG->setVisible(false); #else connect(this->viewActionOpenCSG, SIGNAL(triggered()), this, SLOT(viewModeOpenCSG())); - if (!this->glview->hasOpenCSGSupport()) { + if (!this->qglview->hasOpenCSGSupport()) { this->viewActionOpenCSG->setEnabled(false); } #endif @@ -343,9 +343,9 @@ MainWindow::MainWindow(const QString &filename) connect(editor->document(), SIGNAL(contentsChanged()), this, SLOT(animateUpdateDocChanged())); connect(editor->document(), SIGNAL(modificationChanged(bool)), this, SLOT(setWindowModified(bool))); connect(editor->document(), SIGNAL(modificationChanged(bool)), fileActionSave, SLOT(setEnabled(bool))); - connect(this->glview, SIGNAL(doAnimateUpdate()), this, SLOT(animateUpdate())); + connect(this->qglview, SIGNAL(doAnimateUpdate()), this, SLOT(animateUpdate())); - connect(Preferences::inst(), SIGNAL(requestRedraw()), this->glview, SLOT(updateGL())); + connect(Preferences::inst(), SIGNAL(requestRedraw()), this->qglview, SLOT(updateGL())); connect(Preferences::inst(), SIGNAL(fontChanged(const QString&,uint)), this, SLOT(setFont(const QString&,uint))); connect(Preferences::inst(), SIGNAL(openCSGSettingsChanged()), @@ -595,7 +595,7 @@ bool MainWindow::compile(bool reload, bool procevents) if (!compileTopLevelDocument(reload)) return false; // Invalidate renderers before we kill the CSG tree - this->glview->setRenderer(NULL); + this->qglview->setRenderer(NULL); delete this->opencsgRenderer; this->opencsgRenderer = NULL; delete this->thrownTogetherRenderer; @@ -759,7 +759,7 @@ void MainWindow::compileCSG(bool procevents) this->opencsgRenderer = new OpenCSGRenderer(this->root_chain, this->highlights_chain, this->background_chain, - this->glview->shaderinfo); + this->qglview->shaderinfo); } this->thrownTogetherRenderer = new ThrownTogetherRenderer(this->root_chain, this->highlights_chain, @@ -942,7 +942,7 @@ void MainWindow::pasteViewportTranslation() { QTextCursor cursor = editor->textCursor(); QString txt; - txt.sprintf("[ %.2f, %.2f, %.2f ]", -this->glview->object_trans_x, -this->glview->object_trans_y, -this->glview->object_trans_z); + txt.sprintf("[ %.2f, %.2f, %.2f ]", -this->qglview->object_trans_x, -this->qglview->object_trans_y, -this->qglview->object_trans_z); cursor.insertText(txt); } @@ -951,7 +951,7 @@ void MainWindow::pasteViewportRotation() QTextCursor cursor = editor->textCursor(); QString txt; txt.sprintf("[ %.2f, %.2f, %.2f ]", - fmodf(360 - this->glview->object_rot_x + 90, 360), fmodf(360 - this->glview->object_rot_y, 360), fmodf(360 - this->glview->object_rot_z, 360)); + fmodf(360 - this->qglview->object_rot_x + 90, 360), fmodf(360 - this->qglview->object_rot_y, 360), fmodf(360 - this->qglview->object_rot_z, 360)); cursor.insertText(txt); } @@ -960,15 +960,15 @@ void MainWindow::updateTemporalVariables() this->root_ctx.set_variable("$t", Value(this->e_tval->text().toDouble())); Value::VectorType vpt; - vpt.push_back(Value(-this->glview->object_trans_x)); - vpt.push_back(Value(-this->glview->object_trans_y)); - vpt.push_back(Value(-this->glview->object_trans_z)); + vpt.push_back(Value(-this->qglview->object_trans_x)); + vpt.push_back(Value(-this->qglview->object_trans_y)); + vpt.push_back(Value(-this->qglview->object_trans_z)); this->root_ctx.set_variable("$vpt", Value(vpt)); Value::VectorType vpr; - vpr.push_back(Value(fmodf(360 - this->glview->object_rot_x + 90, 360))); - vpr.push_back(Value(fmodf(360 - this->glview->object_rot_y, 360))); - vpr.push_back(Value(fmodf(360 - this->glview->object_rot_z, 360))); + vpr.push_back(Value(fmodf(360 - this->qglview->object_rot_x + 90, 360))); + vpr.push_back(Value(fmodf(360 - this->qglview->object_rot_y, 360))); + vpr.push_back(Value(fmodf(360 - this->qglview->object_rot_z, 360))); root_ctx.set_variable("$vpr", Value(vpr)); } @@ -1147,7 +1147,7 @@ void MainWindow::actionCompile() } if (viewActionAnimate->isChecked() && e_dump->isChecked()) { - QImage img = this->glview->grabFrameBuffer(); + QImage img = this->qglview->grabFrameBuffer(); QString filename; double s = this->e_fsteps->text().toDouble(); double t = this->e_tval->text().toDouble(); @@ -1176,7 +1176,7 @@ void MainWindow::actionRenderCGAL() return; } - this->glview->setRenderer(NULL); + this->qglview->setRenderer(NULL); delete this->cgalRenderer; this->cgalRenderer = NULL; if (this->root_N) { @@ -1452,7 +1452,7 @@ void MainWindow::actionExportCSG() void MainWindow::actionExportImage() { - QImage img = this->glview->grabFrameBuffer(); + QImage img = this->qglview->grabFrameBuffer(); setCurrentOutput(); QString img_filename = QFileDialog::getSaveFileName(this, @@ -1497,10 +1497,10 @@ void MainWindow::viewModeActionsUncheck() */ void MainWindow::viewModeOpenCSG() { - if (this->glview->hasOpenCSGSupport()) { + if (this->qglview->hasOpenCSGSupport()) { viewModeActionsUncheck(); viewActionOpenCSG->setChecked(true); - this->glview->setRenderer(this->opencsgRenderer ? (Renderer *)this->opencsgRenderer : (Renderer *)this->thrownTogetherRenderer); + this->qglview->setRenderer(this->opencsgRenderer ? (Renderer *)this->opencsgRenderer : (Renderer *)this->thrownTogetherRenderer); } else { viewModeThrownTogether(); } @@ -1514,17 +1514,17 @@ void MainWindow::viewModeCGALSurface() { viewModeActionsUncheck(); viewActionCGALSurfaces->setChecked(true); - this->glview->setShowFaces(true); - this->glview->setRenderer(this->cgalRenderer); - this->glview->updateGL(); + this->qglview->setShowFaces(true); + this->qglview->setRenderer(this->cgalRenderer); + this->qglview->updateGL(); } void MainWindow::viewModeCGALGrid() { viewModeActionsUncheck(); viewActionCGALGrid->setChecked(true); - this->glview->setShowFaces(false); - this->glview->setRenderer(this->cgalRenderer); + this->qglview->setShowFaces(false); + this->qglview->setRenderer(this->cgalRenderer); } #endif /* ENABLE_CGAL */ @@ -1533,31 +1533,31 @@ void MainWindow::viewModeThrownTogether() { viewModeActionsUncheck(); viewActionThrownTogether->setChecked(true); - this->glview->setRenderer(this->thrownTogetherRenderer); + this->qglview->setRenderer(this->thrownTogetherRenderer); } void MainWindow::viewModeShowEdges() { QSettings settings; settings.setValue("view/showEdges",viewActionShowEdges->isChecked()); - this->glview->setShowEdges(viewActionShowEdges->isChecked()); - this->glview->updateGL(); + this->qglview->setShowEdges(viewActionShowEdges->isChecked()); + this->qglview->updateGL(); } void MainWindow::viewModeShowAxes() { QSettings settings; settings.setValue("view/showAxes",viewActionShowAxes->isChecked()); - this->glview->setShowAxes(viewActionShowAxes->isChecked()); - this->glview->updateGL(); + this->qglview->setShowAxes(viewActionShowAxes->isChecked()); + this->qglview->updateGL(); } void MainWindow::viewModeShowCrosshairs() { QSettings settings; settings.setValue("view/showCrosshairs",viewActionShowCrosshairs->isChecked()); - this->glview->setShowCrosshairs(viewActionShowCrosshairs->isChecked()); - this->glview->updateGL(); + this->qglview->setShowCrosshairs(viewActionShowCrosshairs->isChecked()); + this->qglview->updateGL(); } void MainWindow::viewModeAnimate() @@ -1595,66 +1595,66 @@ void MainWindow::animateUpdate() void MainWindow::viewAngleTop() { - this->glview->object_rot_x = 90; - this->glview->object_rot_y = 0; - this->glview->object_rot_z = 0; - this->glview->updateGL(); + this->qglview->object_rot_x = 90; + this->qglview->object_rot_y = 0; + this->qglview->object_rot_z = 0; + this->qglview->updateGL(); } void MainWindow::viewAngleBottom() { - this->glview->object_rot_x = 270; - this->glview->object_rot_y = 0; - this->glview->object_rot_z = 0; - this->glview->updateGL(); + this->qglview->object_rot_x = 270; + this->qglview->object_rot_y = 0; + this->qglview->object_rot_z = 0; + this->qglview->updateGL(); } void MainWindow::viewAngleLeft() { - this->glview->object_rot_x = 0; - this->glview->object_rot_y = 0; - this->glview->object_rot_z = 90; - this->glview->updateGL(); + this->qglview->object_rot_x = 0; + this->qglview->object_rot_y = 0; + this->qglview->object_rot_z = 90; + this->qglview->updateGL(); } void MainWindow::viewAngleRight() { - this->glview->object_rot_x = 0; - this->glview->object_rot_y = 0; - this->glview->object_rot_z = 270; - this->glview->updateGL(); + this->qglview->object_rot_x = 0; + this->qglview->object_rot_y = 0; + this->qglview->object_rot_z = 270; + this->qglview->updateGL(); } void MainWindow::viewAngleFront() { - this->glview->object_rot_x = 0; - this->glview->object_rot_y = 0; - this->glview->object_rot_z = 0; - this->glview->updateGL(); + this->qglview->object_rot_x = 0; + this->qglview->object_rot_y = 0; + this->qglview->object_rot_z = 0; + this->qglview->updateGL(); } void MainWindow::viewAngleBack() { - this->glview->object_rot_x = 0; - this->glview->object_rot_y = 0; - this->glview->object_rot_z = 180; - this->glview->updateGL(); + this->qglview->object_rot_x = 0; + this->qglview->object_rot_y = 0; + this->qglview->object_rot_z = 180; + this->qglview->updateGL(); } void MainWindow::viewAngleDiagonal() { - this->glview->object_rot_x = 35; - this->glview->object_rot_y = 0; - this->glview->object_rot_z = -25; - this->glview->updateGL(); + this->qglview->object_rot_x = 35; + this->qglview->object_rot_y = 0; + this->qglview->object_rot_z = -25; + this->qglview->updateGL(); } void MainWindow::viewCenter() { - this->glview->object_trans_x = 0; - this->glview->object_trans_y = 0; - this->glview->object_trans_z = 0; - this->glview->updateGL(); + this->qglview->object_trans_x = 0; + this->qglview->object_trans_y = 0; + this->qglview->object_trans_z = 0; + this->qglview->updateGL(); } void MainWindow::viewPerspective() @@ -1663,8 +1663,8 @@ void MainWindow::viewPerspective() settings.setValue("view/orthogonalProjection",false); viewActionPerspective->setChecked(true); viewActionOrthogonal->setChecked(false); - this->glview->setOrthoMode(false); - this->glview->updateGL(); + this->qglview->setOrthoMode(false); + this->qglview->updateGL(); } void MainWindow::viewOrthogonal() @@ -1673,8 +1673,8 @@ void MainWindow::viewOrthogonal() settings.setValue("view/orthogonalProjection",true); viewActionPerspective->setChecked(false); viewActionOrthogonal->setChecked(true); - this->glview->setOrthoMode(true); - this->glview->updateGL(); + this->qglview->setOrthoMode(true); + this->qglview->updateGL(); } void MainWindow::hideConsole() @@ -1751,7 +1751,7 @@ void MainWindow::helpLibrary() } - this->openglbox->setDetailedText(libinfo + this->glview->getRendererInfo()); + this->openglbox->setDetailedText(libinfo + QString(this->qglview->getRendererInfo())); this->openglbox->show(); } |