From 8fa0e2864d3d1737a48c7a90c482be82110cb158 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Wed, 2 Dec 2015 12:06:36 +0100 Subject: [PATCH] Real-time cropping works --- vv/vvSlicer.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 9258fdb..4acddce 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -1099,8 +1099,8 @@ void vvSlicer::UpdateDisplayExtent() #if VTK_MAJOR_VERSION <= 5 this->ImageActor->SetDisplayExtent(w_ext); #else - cout << mReducedExtent[0] << " " << mReducedExtent[1] << " " << mReducedExtent[2] << " " << mReducedExtent[3] << " " << mReducedExtent[4] << " " << mReducedExtent[5] << endl; vtkSmartPointer mapperOpenGL= vtkSmartPointer::New(); + try { mapperOpenGL = dynamic_cast(GetImageActor()->GetMapper()); } catch (const std::bad_cast& e) { @@ -1113,7 +1113,11 @@ void vvSlicer::UpdateDisplayExtent() this->ImageActor->SetDisplayExtent(w_ext); //initialisation } else { int w_croppingRegion[6]; - copyExtent(mRegisterExtent, w_croppingRegion); + if (mUseReducedExtent) { + copyExtent(mReducedExtent, w_croppingRegion); + } else { + copyExtent(mRegisterExtent, w_croppingRegion); + } this->ImageActor->SetDisplayExtent(w_ext); w_croppingRegion[ this->SliceOrientation*2 ] = this->Slice; w_croppingRegion[ this->SliceOrientation*2+1 ] = this->Slice; -- 2.47.1