X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvSlicer.cxx;h=1e133d6f863cfd8dcad8ec52fa6c02a01cbe8296;hb=0a29eafc4e4b1ecbbb4580e7f8341751cfc6591c;hp=2224a9ac9748dd6abb32b09a79185048f93137fc;hpb=2c80239b9508f34ec733115f2513522b887ca658;p=clitk.git diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 2224a9a..1e133d6 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -66,6 +66,9 @@ #include #include #include +#if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10) +# include +#endif vtkCxxRevisionMacro(vvSlicer, "DummyRevision"); vtkStandardNewMacro(vvSlicer); @@ -138,6 +141,10 @@ vvSlicer::vvSlicer() this->InstallPipeline(); mLinkOverlayWindowLevel = true; + +#if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10) + this->GetImageActor()->GetMapper()->BorderOn(); +#endif } //------------------------------------------------------------------------------ @@ -361,7 +368,10 @@ void vvSlicer::SetOverlay(vvImage::Pointer overlay) mOverlayActor->SetPickable(0); mOverlayActor->SetVisibility(true); mOverlayActor->SetOpacity(0.5); - } +#if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10) + mOverlayActor->GetMapper()->BorderOn(); +#endif + } //stupid but necessary : the Overlay need to be rendered before fusion if (mFusionActor) { @@ -397,7 +407,7 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion) if (!mFusionMapper) mFusionMapper = vtkSmartPointer::New(); - + vtkSmartPointer lut = vtkLookupTable::New(); lut->SetRange(0, 1); lut->SetValueRange(0, 1); @@ -412,6 +422,9 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion) mFusionActor->SetPickable(0); mFusionActor->SetVisibility(true); mFusionActor->SetOpacity(0.7); +#if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10) + mFusionActor->GetMapper()->BorderOn(); +#endif this->GetRenderer()->AddActor(mFusionActor); } @@ -671,8 +684,6 @@ void vvSlicer::SetTSlice(int t) else if ((unsigned int)t >= mImage->GetVTKImages().size()) t = mImage->GetVTKImages().size() -1; - if (mCurrentTSlice == t) return; - mCurrentTSlice = t; mImageReslice->SetInput( mImage->GetVTKImages()[mCurrentTSlice] ); if (mVF && mVFActor->GetVisibility()) { @@ -1177,6 +1188,7 @@ void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImag corner1[i] = mCurrent[i]; corner2[i] = mCurrent[i]; } + this->Renderer->WorldToView(corner1[0], corner1[1], corner1[2]); this->Renderer->WorldToView(corner2[0], corner2[1], corner2[2]);