qvolray
diff src/ui.cc @ 30:40df2cdc6323
transfer function window
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 14 Apr 2012 22:10:30 +0300 |
parents | 93d889a3726a |
children | c1dd5b120504 |
line diff
1.1 --- a/src/ui.cc Sat Apr 14 20:52:53 2012 +0300 1.2 +++ b/src/ui.cc Sat Apr 14 22:10:30 2012 +0300 1.3 @@ -3,6 +3,10 @@ 1.4 #include <vector> 1.5 #include <QtGui> 1.6 #include "ui.h" 1.7 +#include "ui_maingl.h" 1.8 +#include "ui_sliceview.h" 1.9 +#include "ui_xferview.h" 1.10 + 1.11 1.12 static Volume *volume; 1.13 std::vector<QGLWidget*> glwlist; 1.14 @@ -64,16 +68,18 @@ 1.15 1.16 SideWindow::SideWindow() 1.17 { 1.18 - QGroupBox *groupbox = new QGroupBox("Volume slice"); 1.19 + QGroupBox *group_slice = new QGroupBox("Volume slice"); 1.20 { 1.21 slice_view = new SliceGLView(glwlist[0]); 1.22 glwlist.push_back(slice_view); 1.23 1.24 QCheckBox *chk_clip = new QCheckBox("clip"); 1.25 + chk_clip->setStatusTip("Enable clipping at the current slice"); 1.26 chk_clip->setChecked(false); 1.27 connect(chk_clip, SIGNAL(stateChanged(int)), this, SLOT(clip_change(int))); 1.28 1.29 QSlider *zslider = new QSlider(Qt::Horizontal); 1.30 + zslider->setStatusTip("Change current Z slice"); 1.31 zslider->setRange(0, 256); 1.32 zslider->setValue(volray_getvalue(VolRayOpt::ZCURSOR) * 256.0); 1.33 connect(zslider, SIGNAL(valueChanged(int)), this, SLOT(zslider_change(int))); 1.34 @@ -83,14 +89,26 @@ 1.35 vbox->addWidget(chk_clip); 1.36 vbox->addWidget(zslider); 1.37 1.38 - groupbox->setLayout(vbox); 1.39 + group_slice->setLayout(vbox); 1.40 + } 1.41 + 1.42 + QGroupBox *group_xfer = new QGroupBox("Transfer function"); 1.43 + { 1.44 + XFerGLView *xfer_view = new XFerGLView(glwlist[0]); 1.45 + glwlist.push_back(xfer_view); 1.46 + 1.47 + QVBoxLayout *vbox = new QVBoxLayout; 1.48 + vbox->addWidget(xfer_view); 1.49 + 1.50 + group_xfer->setLayout(vbox); 1.51 } 1.52 1.53 QWidget *win = new QWidget; 1.54 setWidget(win); 1.55 1.56 QVBoxLayout *vbox = new QVBoxLayout; 1.57 - vbox->addWidget(groupbox); 1.58 + vbox->addWidget(group_slice); 1.59 + vbox->addWidget(group_xfer); 1.60 vbox->addStretch(); 1.61 1.62 win->setLayout(vbox);