From 5eed88050bfd70c97a047b7eb5c22d83d39ba945 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Thu, 20 Jan 2011 10:26:45 +0200 Subject: [PATCH] Changed: #1193 added ability changing render mode. --- .../3d/object_viewer_qt/src/main_window.cpp | 20 +++++++++++++++++++ .../3d/object_viewer_qt/src/main_window.h | 3 +++ .../src/particle_control_form.ui | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp index 615d7026b..25475ed0c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp @@ -649,6 +649,26 @@ void CMainWindow::updateRender() } } +void CMainWindow::keyPressEvent(QKeyEvent *keyEvent) +{ + if (keyEvent->key() == Qt::Key_F1) + { + // Change render mode + switch (Modules::objView().getDriver()->getPolygonMode()) + { + case NL3D::UDriver::Filled: + Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Line); + break; + case NL3D::UDriver::Line: + Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Point); + break; + case NL3D::UDriver::Point: + Modules::objView().getDriver()->setPolygonMode (NL3D::UDriver::Filled); + break; + } + } + QMainWindow::keyPressEvent(keyEvent); +} } /* namespace NLQT */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/main_window.h index a63a1bbad..b7801a117 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/main_window.h @@ -81,6 +81,9 @@ private Q_SLOTS: void updateStatusBar(); void updateRender(); +protected: + virtual void keyPressEvent(QKeyEvent *keyEvent); + private: void createActions(); void createMenus(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/particle_control_form.ui b/code/nel/tools/3d/object_viewer_qt/src/particle_control_form.ui index 75936fe87..ec1505bce 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/particle_control_form.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/particle_control_form.ui @@ -110,7 +110,7 @@ - 1 + 0