qvolray
diff src/ui.cc @ 28:aeef3c2ae472
the slice widget works fine
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 14 Apr 2012 16:35:30 +0300 |
parents | 011ac823600c |
children | 93d889a3726a |
line diff
1.1 --- a/src/ui.cc Sat Apr 14 06:37:31 2012 +0300 1.2 +++ b/src/ui.cc Sat Apr 14 16:35:30 2012 +0300 1.3 @@ -1,19 +1,20 @@ 1.4 #include <stdio.h> 1.5 #include <stdlib.h> 1.6 +#include <vector> 1.7 #include <QtGui> 1.8 #include "ui.h" 1.9 1.10 static Volume *volume; 1.11 - 1.12 -static MainGLView *maingl; 1.13 +std::vector<QGLWidget*> glwlist; 1.14 1.15 MainWindow::MainWindow() 1.16 { 1.17 setWindowTitle("Volume Renderer"); 1.18 1.19 - // OpenGL view 1.20 + // OpenGL view (this must be initialized first) 1.21 maingl = new MainGLView; 1.22 setCentralWidget(maingl); 1.23 + glwlist.push_back(maingl); 1.24 1.25 // side-window 1.26 sidewin = new SideWindow; 1.27 @@ -65,7 +66,8 @@ 1.28 { 1.29 QGroupBox *groupbox = new QGroupBox("Volume slice"); 1.30 { 1.31 - slice_view = new SliceGLView(maingl); 1.32 + slice_view = new SliceGLView(glwlist[0]); 1.33 + glwlist.push_back(slice_view); 1.34 1.35 QCheckBox *chk_clip = new QCheckBox("clip"); 1.36 chk_clip->setChecked(false); 1.37 @@ -104,7 +106,10 @@ 1.38 volray_setvalue(VOLRAY_ZCLIP, checked); 1.39 } 1.40 1.41 + 1.42 void post_redisplay() 1.43 { 1.44 - maingl->updateGL(); 1.45 + for(auto glw : glwlist) { 1.46 + glw->updateGL(); 1.47 + } 1.48 }