From: tbaudier Date: Fri, 4 Dec 2015 13:51:20 +0000 (+0100) Subject: Merge branch 'VTK6_Qt5' into VTK6_Qt5_Crop X-Git-Tag: v1.4.0~90 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9768b4757920c85042b8fd9710f3ddfc2e9bf5d4;p=clitk.git Merge branch 'VTK6_Qt5' into VTK6_Qt5_Crop --- 9768b4757920c85042b8fd9710f3ddfc2e9bf5d4 diff --cc vv/vvSlicer.cxx index 4acddce,c7e5e02..0237ccf --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@@ -1096,11 -1094,9 +1094,10 @@@ void vvSlicer::UpdateDisplayExtent( // Image actor this->ImageActor->SetVisibility(mImageVisibility); - #if VTK_MAJOR_VERSION <= 5 this->ImageActor->SetDisplayExtent(w_ext); - #else + #if VTK_MAJOR_VERSION >= 6 vtkSmartPointer mapperOpenGL= vtkSmartPointer::New(); + try { mapperOpenGL = dynamic_cast(GetImageActor()->GetMapper()); } catch (const std::bad_cast& e) { @@@ -1110,18 -1106,12 +1107,17 @@@ } if (mFirstSetSliceOrientation) { copyExtent(ext, mRegisterExtent); - 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; - mapperOpenGL->SetCroppingRegion(w_croppingRegion); + mapperOpenGL->SetCroppingRegion(w_croppingRegion); } #endif @@@ -1138,7 -1128,7 +1134,7 @@@ #if VTK_MAJOR_VERSION <= 5 bool out = ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetWholeExtent()); #else - bool out = ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT())); - bool out = ClipDisplayedExtent(overExtent, this->GetExtent()); ++ bool out = ClipDisplayedExtent(overExtent, mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT())); #endif mOverlayActor->SetVisibility(!out); mOverlayActor->SetDisplayExtent( overExtent ); @@@ -1158,7 -1148,7 +1154,7 @@@ #if VTK_MAJOR_VERSION <= 5 bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetWholeExtent()); #else - bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT())); - bool out = ClipDisplayedExtent(fusExtent, this->GetExtent()); ++ bool out = ClipDisplayedExtent(fusExtent, mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT())); #endif mFusionActor->SetVisibility(!out); mFusionActor->SetDisplayExtent( fusExtent );