src/toolsets/viewtoolset.cpp

changeset 1231
ce0c9f2e6b9c
parent 1224
5a31b6d4bf81
--- a/src/toolsets/viewtoolset.cpp	Thu Jan 11 11:41:40 2018 +0200
+++ b/src/toolsets/viewtoolset.cpp	Thu Jan 11 15:09:44 2018 +0200
@@ -98,17 +98,17 @@
 
 void ViewToolset::resetView()
 {
-	m_window->renderer()->resetAngles();
-	m_window->renderer()->update();
+	m_window->currentRenderer()->resetAngles();
+	m_window->currentRenderer()->update();
 }
 
 void ViewToolset::screenshot()
 {
 	const char* imageformats = "PNG images(*.png);;JPG images(*.jpg);;BMP images(*.bmp);;"
 		"PPM images(*.ppm);;X11 Bitmaps(*.xbm);;X11 Pixmaps(*.xpm);;All Files(*.*)";
-	int width = m_window->renderer()->width();
-	int height = m_window->renderer()->height();
-	QByteArray capture = m_window->renderer()->capturePixels();
+	int width = m_window->currentRenderer()->width();
+	int height = m_window->currentRenderer()->height();
+	QByteArray capture = m_window->currentRenderer()->capturePixels();
 	const uchar* imagedata = reinterpret_cast<const uchar*>(capture.constData());
 	// GL and Qt formats have R and B swapped. Also, GL flips Y - correct it as well.
 	QImage image = QImage(imagedata, width, height, QImage::Format_ARGB32).rgbSwapped().mirrored();
@@ -128,7 +128,7 @@
 {
 	config->setDrawAxes(not config->drawAxes());
 	m_window->updateActions();
-	m_window->renderer()->update();
+	m_window->currentRenderer()->update();
 }
 
 void ViewToolset::visibilityToggle()
@@ -152,7 +152,7 @@
 void ViewToolset::wireframe()
 {
 	config->setDrawWireframe(not config->drawWireframe());
-	m_window->renderer()->refresh();
+	m_window->currentRenderer()->refresh();
 }
 
 void ViewToolset::setOverlay()
@@ -162,33 +162,33 @@
 	if (not dlg.exec())
 		return;
 
-	m_window->renderer()->setupOverlay((ECamera) dlg.camera(), dlg.fpath(), dlg.ofsx(),
+	m_window->currentRenderer()->setupOverlay((ECamera) dlg.camera(), dlg.fpath(), dlg.ofsx(),
 		dlg.ofsy(), dlg.lwidth(), dlg.lheight());
 }
 
 void ViewToolset::clearOverlay()
 {
-	m_window->renderer()->clearOverlay();
+	m_window->currentRenderer()->clearOverlay();
 }
 
 void ViewToolset::drawAngles()
 {
 	config->setDrawAngles(not config->drawAngles());
-	m_window->renderer()->refresh();
+	m_window->currentRenderer()->refresh();
 }
 
 void ViewToolset::setDrawDepth()
 {
-	if (m_window->renderer()->camera() == EFreeCamera)
+	if (m_window->currentRenderer()->camera() == EFreeCamera)
 		return;
 
 	bool ok;
 	double depth = QInputDialog::getDouble(m_window, "Set Draw Depth",
-		format("Depth value for %1:", m_window->renderer()->currentCameraName()),
-		m_window->renderer()->getDepthValue(), -10000.0f, 10000.0f, 3, &ok);
+		format("Depth value for %1:", m_window->currentRenderer()->currentCameraName()),
+		m_window->currentRenderer()->getDepthValue(), -10000.0f, 10000.0f, 3, &ok);
 
 	if (ok)
-		m_window->renderer()->setDepthValue(depth);
+		m_window->currentRenderer()->setDepthValue(depth);
 }
 
 #if 0
@@ -248,7 +248,7 @@
 		config->setRandomColors(false);
 
 	m_window->updateActions();
-	m_window->renderer()->refresh();
+	m_window->currentRenderer()->refresh();
 }
 
 void ViewToolset::jumpTo()
@@ -279,7 +279,7 @@
 		config->setBfcRedGreenView(false);
 
 	m_window->updateActions();
-	m_window->renderer()->refresh();
+	m_window->currentRenderer()->refresh();
 }
 
 void ViewToolset::drawSurfaces()

mercurial