Program: bbtk
Module: $RCSfile: bbwxvtkViewer2D.cxx,v $
Language: C++
- Date: $Date: 2008/07/03 13:59:37 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2008/10/10 13:57:42 $
+ Version: $Revision: 1.16 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// std::cout << "CW = "<< mBox->bbGetContainingWindow() << std::endl;
// std::cout << "Sh = "<< mBox->bbIsShown() << std::endl;
-
+ int orientation = mBox->bbGetInputOrientation();
+ if (orientation<0 || orientation>2)
+ orientation=2; // Why not?
// mBox->bbIsShown() is necessary to be sure that the wxWindow is already
// created and displayed.
// std::cout << "ext = "<<ext[4]<<" - "<<ext[5]<<std::endl;
+ switch(orientation){
+ case 0:
+ if (z<ext[0]) { z=ext[0]; }
+ if (z>ext[1]) { z=ext[1]; }
+
+ break;
+
+ case 1:
+ if (z<ext[2]) { z=ext[2]; }
+ if (z>ext[3]) { z=ext[3]; }
+ break;
+
+ case 2:
if (z<ext[4]) { z=ext[4]; }
if (z>ext[5]) { z=ext[5]; }
-
- wxvtkrenderwindowinteractor->Update();
- wxvtkrenderwindowinteractor->Render();
- imageViewer->GetRenderer()->ResetCameraClippingRange();
-
-
+ break;
+
+ default:
+ z = ext[5]; // Why not?
+ }
+
+ wxvtkrenderwindowinteractor->Update();
+ wxvtkrenderwindowinteractor->Render();
+ imageViewer->GetRenderer()->ResetCameraClippingRange();
+
+/*
#if (VTK_MAJOR_VERSION >= 5)
imageViewer->SetSlice( z );
#else
imageViewer->SetZSlice( z );
#endif
-
+*/
+ imageViewer->SetSliceOrientation (orientation);
+ imageViewer->SetSlice( z );
+
//imageViewer->UpdateDisplayExtent();
}