From 58ff4b2d68e8d357669628bb231d2691d14f1b45 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Mon, 19 Apr 2010 07:23:20 +0000 Subject: [PATCH] - add get extent and orientation --- vv/vvSlicer.cxx | 28 ++++++++++++++++++++++++++++ vv/vvSlicer.h | 5 ++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index a5c2641..9552a38 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -566,6 +566,9 @@ void vvSlicer::SetTSlice(int t) t = 0; else if ((unsigned int)t >= mImage->GetVTKImages().size()) t = mImage->GetVTKImages().size() -1; + + if (mCurrentTSlice == t) return; + mCurrentTSlice = t; this->SetInput(mImage->GetVTKImages()[t]); if (mVF && mVFActor->GetVisibility()) @@ -635,6 +638,27 @@ void vvSlicer::SetSliceOrientation(int orientation) SetContourSlice(); } +//---------------------------------------------------------------------------- + + +//---------------------------------------------------------------------------- +int * vvSlicer::GetExtent() { + int *w_ext; + if (mUseReducedExtent) { + w_ext = mReducedExtent; + } + else w_ext = GetInput()->GetWholeExtent(); + return w_ext; +} +//---------------------------------------------------------------------------- + + +//---------------------------------------------------------------------------- +int vvSlicer::GetOrientation() { + return this->SliceOrientation; +} +//---------------------------------------------------------------------------- + //---------------------------------------------------------------------------- void vvSlicer::UpdateDisplayExtent() @@ -1189,6 +1213,8 @@ void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max) //---------------------------------------------------------------------------- void vvSlicer::Render() { + // DD("Render"); + //DD(SliceOrientation); if (this->GetWindowLevel()->GetLookupTable() && !this->mOverlay && !this->mFusion) { legend->SetLookupTable(this->GetWindowLevel()->GetLookupTable()); @@ -1380,3 +1406,5 @@ void vvSlicer::PrintSelf(ostream& os, vtkIndent indent) this->Superclass::PrintSelf(os, indent); } //---------------------------------------------------------------------------- + + diff --git a/vv/vvSlicer.h b/vv/vvSlicer.h index 51e0473..4315dd8 100644 --- a/vv/vvSlicer.h +++ b/vv/vvSlicer.h @@ -160,6 +160,10 @@ public: void EnableReducedExtent(bool b); void SetReducedExtent(int * ext); + void ClipDisplayedExtent(int extent[6], int refExtent[6]); + int GetOrientation(); + int * GetExtent(); + protected: vvSlicer(); ~vvSlicer(); @@ -212,7 +216,6 @@ private: void ComputeVFDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int extent[6]); void ComputeOverlayDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6]); void ComputeFusionDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6]); - void ClipDisplayedExtent(int extent[6], int refExtent[6]); ///Sets the surfaces to be cut on the image slice: update the vtkCutter void SetContourSlice(); -- 2.47.1