diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/MainWindow.h | 1 | ||||
| -rw-r--r-- | src/MainWindow.ui | 7 | ||||
| -rw-r--r-- | src/QGLView.cc | 11 | ||||
| -rw-r--r-- | src/QGLView.h | 1 | ||||
| -rw-r--r-- | src/mainwin.cc | 7 | 
5 files changed, 24 insertions, 3 deletions
| diff --git a/src/MainWindow.h b/src/MainWindow.h index 4f88fbf..ac999bf 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -164,6 +164,7 @@ public slots:  	void viewCenter();  	void viewPerspective();  	void viewOrthogonal(); +        void viewResetView();  	void hideConsole();  	void animateUpdateDocChanged();  	void animateUpdate(); diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 68bc064..4cb043f 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -213,6 +213,8 @@      <addaction name="viewActionDiagonal"/>      <addaction name="viewActionCenter"/>      <addaction name="separator"/> +    <addaction name="viewActionResetView"/> +    <addaction name="separator"/>      <addaction name="viewActionPerspective"/>      <addaction name="viewActionOrthogonal"/>      <addaction name="separator"/> @@ -697,6 +699,11 @@      <string>Show Library Folder...</string>     </property>    </action> +  <action name="viewActionResetView"> +   <property name="text"> +    <string>Reset View</string> +   </property> +  </action>   </widget>   <customwidgets>    <customwidget> diff --git a/src/QGLView.cc b/src/QGLView.cc index 5cb2e1b..6ffd586 100644 --- a/src/QGLView.cc +++ b/src/QGLView.cc @@ -64,9 +64,7 @@ static bool running_under_wine = false;  void QGLView::init()  {    cam.type = Camera::GIMBAL; -  cam.object_rot << 35, 0, -25; -  cam.object_trans << 0, 0, 0; -  cam.viewer_distance = 500; +  resetView();    this->mouse_drag_active = false;    this->statusLabel = NULL; @@ -83,6 +81,13 @@ void QGLView::init()  #endif  } +void QGLView::resetView() +{ +  cam.object_rot << 35, 0, -25; +  cam.object_trans << 0, 0, 0; +  cam.viewer_distance = 500; +} +  void QGLView::initializeGL()  {    GLenum err = glewInit(); diff --git a/src/QGLView.h b/src/QGLView.h index f3e3681..12be085 100644 --- a/src/QGLView.h +++ b/src/QGLView.h @@ -41,6 +41,7 @@ public:  	}  	std::string getRendererInfo() const;  	bool save(const char *filename); +        void resetView();  public:  	QLabel *statusLabel; diff --git a/src/mainwin.cc b/src/mainwin.cc index 65c511f..5b986b1 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -334,6 +334,7 @@ MainWindow::MainWindow(const QString &filename)  	connect(this->viewActionBack, SIGNAL(triggered()), this, SLOT(viewAngleBack()));  	connect(this->viewActionDiagonal, SIGNAL(triggered()), this, SLOT(viewAngleDiagonal()));  	connect(this->viewActionCenter, SIGNAL(triggered()), this, SLOT(viewCenter())); +	connect(this->viewActionResetView, SIGNAL(triggered()), this, SLOT(viewResetView()));  	connect(this->viewActionPerspective, SIGNAL(triggered()), this, SLOT(viewPerspective()));  	connect(this->viewActionOrthogonal, SIGNAL(triggered()), this, SLOT(viewOrthogonal()));  	connect(this->viewActionHide, SIGNAL(triggered()), this, SLOT(hideConsole())); @@ -1772,6 +1773,12 @@ void MainWindow::viewOrthogonal()  	this->qglview->updateGL();  } +void MainWindow::viewResetView() +{ +	this->qglview->resetView(); +	this->qglview->updateGL(); +} +  void MainWindow::hideConsole()  {  	QSettings settings; | 
