# HG changeset patch # User John Tsiombikas # Date 1334158512 -10800 # Node ID 2d0dfb5751dc240ecd52156eeca7526d9c53f3b5 # Parent 4c62be57fc1afc8324c291aca77763de38aae460 foo diff -r 4c62be57fc1a -r 2d0dfb5751dc sdr/demo.p.glsl --- a/sdr/demo.p.glsl Wed Apr 11 16:59:45 2012 +0300 +++ b/sdr/demo.p.glsl Wed Apr 11 18:35:12 2012 +0300 @@ -3,7 +3,7 @@ vec3 pos = gl_TexCoord[0].xyz * 2.0 - 1.0; float len = length(pos); - float val = 0.2 / (len * len); + float val = 0.1 / (len * len); gl_FragColor = vec4(-pos / len, val); } diff -r 4c62be57fc1a -r 2d0dfb5751dc src/ui.cc --- a/src/ui.cc Wed Apr 11 16:59:45 2012 +0300 +++ b/src/ui.cc Wed Apr 11 18:35:12 2012 +0300 @@ -62,16 +62,31 @@ SideWindow::SideWindow() { - QSlider *zslider = new QSlider(Qt::Horizontal); - zslider->setRange(0, 256); - zslider->setValue(volray_getvalue(VOLRAY_ZCURSOR) * 256.0); - connect(zslider, SIGNAL(valueChanged(int)), this, SLOT(zslider_change(int))); + QGroupBox *groupbox = new QGroupBox("Volume slice"); + { + QCheckBox *chk_clip = new QCheckBox("clip"); + chk_clip->setChecked(false); + connect(chk_clip, SIGNAL(stateChanged(int)), this, SLOT(clip_change(int))); - QVBoxLayout *vbox = new QVBoxLayout; - vbox->addWidget(zslider); + QSlider *zslider = new QSlider(Qt::Horizontal); + zslider->setRange(0, 256); + zslider->setValue(volray_getvalue(VOLRAY_ZCURSOR) * 256.0); + connect(zslider, SIGNAL(valueChanged(int)), this, SLOT(zslider_change(int))); + + QVBoxLayout *vbox = new QVBoxLayout; + vbox->addWidget(chk_clip); + vbox->addWidget(zslider); + + groupbox->setLayout(vbox); + } QWidget *win = new QWidget; setWidget(win); + + QVBoxLayout *vbox = new QVBoxLayout; + vbox->addWidget(groupbox); + vbox->addStretch(); + win->setLayout(vbox); } @@ -80,6 +95,10 @@ volray_setvalue(VOLRAY_ZCURSOR, (float)val / 256.0); } +void SideWindow::clip_change(int checked) +{ + volray_setvalue(VOLRAY_ZCLIP, checked); +} void post_redisplay() { diff -r 4c62be57fc1a -r 2d0dfb5751dc src/ui.h --- a/src/ui.h Wed Apr 11 16:59:45 2012 +0300 +++ b/src/ui.h Wed Apr 11 18:35:12 2012 +0300 @@ -25,6 +25,7 @@ Q_OBJECT private slots: void zslider_change(int val); + void clip_change(int checked); public: SideWindow(); diff -r 4c62be57fc1a -r 2d0dfb5751dc src/volray.cc --- a/src/volray.cc Wed Apr 11 16:59:45 2012 +0300 +++ b/src/volray.cc Wed Apr 11 18:35:12 2012 +0300 @@ -96,6 +96,8 @@ post_redisplay(); break; + case VOLRAY_ZCLIP: + default: break; }