From: malaterre Date: Thu, 11 May 2006 20:01:28 +0000 (+0000) Subject: ENH: vtkgdcmSerieViewer2 looks like it's completely duplicated code. oh god we love... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=5f30f5b0aa4f5499957765a78ba63a94c7c8e277;p=gdcm.git ENH: vtkgdcmSerieViewer2 looks like it's completely duplicated code. oh god we love duplicated code in gdcm, do we. Fix a minor warning (perf reason cast to bool thing) --- diff --git a/vtk/vtkWriteDicomExtended.cxx b/vtk/vtkWriteDicomExtended.cxx index a22667d0..a7312cba 100755 --- a/vtk/vtkWriteDicomExtended.cxx +++ b/vtk/vtkWriteDicomExtended.cxx @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) if (am->ArgMgrDefined("debug")) gdcm::Debug::DebugOn(); - bool deuxD = am->ArgMgrDefined("2D"); + int deuxD = am->ArgMgrDefined("2D"); /* if unused Param we give up */ if ( am->ArgMgrPrintUnusedLabels() ) diff --git a/vtk/vtkgdcmSerieViewer2.cxx b/vtk/vtkgdcmSerieViewer2.cxx index 466fcd06..d8af5dcc 100755 --- a/vtk/vtkgdcmSerieViewer2.cxx +++ b/vtk/vtkgdcmSerieViewer2.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkgdcmSerieViewer2.cxx,v $ Language: C++ - Date: $Date: 2006/03/30 17:11:11 $ - Version: $Revision: 1.4 $ + Date: $Date: 2006/05/11 20:01:28 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -85,10 +85,19 @@ public: { if ( event == vtkCommand::CharEvent ) { +#if (VTK_MAJOR_VERSION >= 5) + int max = ImageViewer->GetWholeMax(); + int slice = (ImageViewer->GetSlice() + 1 ) % ++max; + ImageViewer->SetSlice( slice ); +#else int max = ImageViewer->GetWholeZMax(); int slice = (ImageViewer->GetZSlice() + 1 ) % ++max; ImageViewer->SetZSlice( slice ); +#endif +#if !( (VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION >= 5 ) ) + // This used to be a bug in version VTK 4.4 and earlier ImageViewer->GetRenderer()->ResetCameraClippingRange(); +#endif ImageViewer->Render(); } } diff --git a/vtk/vtkgdcmViewer2.cxx b/vtk/vtkgdcmViewer2.cxx index 98989111..99b64110 100644 --- a/vtk/vtkgdcmViewer2.cxx +++ b/vtk/vtkgdcmViewer2.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkgdcmViewer2.cxx,v $ Language: C++ - Date: $Date: 2006/05/02 10:09:43 $ - Version: $Revision: 1.7 $ + Date: $Date: 2006/05/11 20:01:28 $ + Version: $Revision: 1.8 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -68,7 +68,7 @@ public: { if ( event == vtkCommand::CharEvent ) { - #if (VTK_MAJOR_VERSION >= 5) +#if (VTK_MAJOR_VERSION >= 5) int max = ImageViewer->GetSliceMax(); int slice = (ImageViewer->GetSlice() + 1 ) % ++max; ImageViewer->SetSlice( slice ); @@ -78,7 +78,7 @@ public: ImageViewer->SetZSlice( slice ); #endif #if !( (VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION >= 5 ) ) - // This used to be a bug in version VTK 4.4 and earlier + // This used to be a bug in version VTK 4.4 and earlier ImageViewer->GetRenderer()->ResetCameraClippingRange(); #endif ImageViewer->Render();