qvolray
changeset 22:2d0dfb5751dc
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 11 Apr 2012 18:35:12 +0300 |
parents | 4c62be57fc1a |
children | 53aca4775514 |
files | sdr/demo.p.glsl src/ui.cc src/ui.h src/volray.cc |
diffstat | 4 files changed, 29 insertions(+), 7 deletions(-) [+] |
line diff
1.1 --- a/sdr/demo.p.glsl Wed Apr 11 16:59:45 2012 +0300 1.2 +++ b/sdr/demo.p.glsl Wed Apr 11 18:35:12 2012 +0300 1.3 @@ -3,7 +3,7 @@ 1.4 vec3 pos = gl_TexCoord[0].xyz * 2.0 - 1.0; 1.5 1.6 float len = length(pos); 1.7 - float val = 0.2 / (len * len); 1.8 + float val = 0.1 / (len * len); 1.9 1.10 gl_FragColor = vec4(-pos / len, val); 1.11 }
2.1 --- a/src/ui.cc Wed Apr 11 16:59:45 2012 +0300 2.2 +++ b/src/ui.cc Wed Apr 11 18:35:12 2012 +0300 2.3 @@ -62,16 +62,31 @@ 2.4 2.5 SideWindow::SideWindow() 2.6 { 2.7 - QSlider *zslider = new QSlider(Qt::Horizontal); 2.8 - zslider->setRange(0, 256); 2.9 - zslider->setValue(volray_getvalue(VOLRAY_ZCURSOR) * 256.0); 2.10 - connect(zslider, SIGNAL(valueChanged(int)), this, SLOT(zslider_change(int))); 2.11 + QGroupBox *groupbox = new QGroupBox("Volume slice"); 2.12 + { 2.13 + QCheckBox *chk_clip = new QCheckBox("clip"); 2.14 + chk_clip->setChecked(false); 2.15 + connect(chk_clip, SIGNAL(stateChanged(int)), this, SLOT(clip_change(int))); 2.16 2.17 - QVBoxLayout *vbox = new QVBoxLayout; 2.18 - vbox->addWidget(zslider); 2.19 + QSlider *zslider = new QSlider(Qt::Horizontal); 2.20 + zslider->setRange(0, 256); 2.21 + zslider->setValue(volray_getvalue(VOLRAY_ZCURSOR) * 256.0); 2.22 + connect(zslider, SIGNAL(valueChanged(int)), this, SLOT(zslider_change(int))); 2.23 + 2.24 + QVBoxLayout *vbox = new QVBoxLayout; 2.25 + vbox->addWidget(chk_clip); 2.26 + vbox->addWidget(zslider); 2.27 + 2.28 + groupbox->setLayout(vbox); 2.29 + } 2.30 2.31 QWidget *win = new QWidget; 2.32 setWidget(win); 2.33 + 2.34 + QVBoxLayout *vbox = new QVBoxLayout; 2.35 + vbox->addWidget(groupbox); 2.36 + vbox->addStretch(); 2.37 + 2.38 win->setLayout(vbox); 2.39 } 2.40 2.41 @@ -80,6 +95,10 @@ 2.42 volray_setvalue(VOLRAY_ZCURSOR, (float)val / 256.0); 2.43 } 2.44 2.45 +void SideWindow::clip_change(int checked) 2.46 +{ 2.47 + volray_setvalue(VOLRAY_ZCLIP, checked); 2.48 +} 2.49 2.50 void post_redisplay() 2.51 {