]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/include/vtkImageViewer2_XYZ.cxx_
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / include / vtkImageViewer2_XYZ.cxx_
1
2 #include "vtkImageViewer2_XYZ.h"
3
4
5 //-------------------------------------------------------------------
6 //-------------------------------------------------------------------
7 //-------------------------------------------------------------------
8 vtkImageViewer2_XYZ::vtkImageViewer2_XYZ()
9 {
10         _vtkimageviewer2=  vtkImageViewer2::New();
11 }
12 //-------------------------------------------------------------------
13 vtkImageViewer2_XYZ::~vtkImageViewer2_XYZ()
14 {
15         _vtkimageviewer2->Delete();
16 }
17 //-------------------------------------------------------------------
18 void vtkImageViewer2_XYZ::SetExtentDimension(int x1,int x2,
19                                                                                          int y1,int y2,
20                                                                                          int z1,int z2)
21 {
22         _x1=x1;
23         _x2=x2;
24         _y1=y1;
25         _y2=y2;
26         _z1=z1;
27         _z2=z2;
28 }
29 //-------------------------------------------------------------------
30 void vtkImageViewer2_XYZ::SetXSlice(int slice)
31 {
32         vtkImageActor *imageActor = _vtkimageviewer2->GetImageActor();
33         imageActor->SetDisplayExtent(slice, slice, _y1, _y2, _z1, _z2 );  
34 }
35 //-------------------------------------------------------------------
36 void vtkImageViewer2_XYZ::SetYSlice(int slice)
37 {
38         vtkImageActor *imageActor = _vtkimageviewer2->GetImageActor();
39         imageActor->SetDisplayExtent(_x1, _x2, slice, slice, _z1, _z2 );  
40 }
41 //-------------------------------------------------------------------
42 void vtkImageViewer2_XYZ::SetZSlice(int slice)
43 {
44 #if (VTK_MAJOR_VERSION >= 5)
45 //              _vtkimageviewer2->SetSlice( slice );
46         vtkImageActor *imageActor = _vtkimageviewer2->GetImageActor();
47         imageActor->SetDisplayExtent(_x1, _x2, _y1, _y2, slice, slice );  
48 #else
49                 _vtkimageviewer2->SetZSlice( slice );
50 #endif
51
52
53 }
54 //-------------------------------------------------------------------
55 int vtkImageViewer2_XYZ::GetXSlice()
56 {
57         vtkImageActor *imageActor = _vtkimageviewer2->GetImageActor();
58         return imageActor->GetDisplayExtent()[0];
59 }
60 //-------------------------------------------------------------------
61 int vtkImageViewer2_XYZ::GetYSlice()
62 {
63         vtkImageActor *imageActor = _vtkimageviewer2->GetImageActor();
64         return imageActor->GetDisplayExtent()[2];
65 }
66 //-------------------------------------------------------------------
67 int vtkImageViewer2_XYZ::GetZSlice()
68 {
69
70          int result;
71 #if (VTK_MAJOR_VERSION >= 5)
72                 result= _vtkimageviewer2->GetSlice( );
73 #else
74                 result= _vtkimageviewer2->GetZSlice( );
75 #endif
76
77         
78         return result;
79 }
80 //-------------------------------------------------------------------
81 vtkImageViewer2 *vtkImageViewer2_XYZ::GetVtkImageViewer2()
82 {
83         return _vtkimageviewer2;
84 }
85
86
87 //-------------------------------------------------------------------
88 //-------------------------------------------------------------------
89 //-------------------------------------------------------------------
90