]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Image.cxx
MVC integration at 50%
[cpPlugins.git] / lib / cpPlugins / Image.cxx
1 #include <cpPlugins/Image.h>
2
3 #include <vtkImageActor.h>
4 #include <vtkImageSliceMapper.h>
5
6 // -------------------------------------------------------------------------
7 void cpPlugins::Image::
8 SetITK( itk::LightObject* o )
9 {
10   this->Superclass::SetITK( o );
11   bool     s = this->_ITK_2_VTK_0< 2 >( o );
12   if( !s ) s = this->_ITK_2_VTK_0< 3 >( o );
13   if( !s )
14   {
15     this->m_VTKObject = NULL;
16     this->m_ITKvVTK = NULL;
17
18   } // fi
19   this->Modified( );
20 }
21
22 // -------------------------------------------------------------------------
23 void cpPlugins::Image::
24 SetVTK( vtkObjectBase* o )
25 {
26   this->Superclass::SetVTK( o );
27   std::cerr << "Image: TODO this!!!!" << std::endl;
28   std::exit( 1 );
29 }
30
31 // -------------------------------------------------------------------------
32 vtkProp* cpPlugins::Image::
33 CreateVTKActor( )
34 {
35   vtkImageSliceMapper* mapper = vtkImageSliceMapper::New( );
36   vtkImageActor* actor = vtkImageActor::New( );
37   mapper->SetInputData( this->GetVTK< vtkImageData >( ) );
38   actor->SetMapper( mapper );
39   mapper->Delete( );
40   return( actor );
41 }
42
43 // -------------------------------------------------------------------------
44 cpPlugins::Image::
45 Image( )
46   : Superclass( )
47 {
48 }
49
50 // -------------------------------------------------------------------------
51 cpPlugins::Image::
52 ~Image( )
53 {
54 }
55
56 // eof - $RCSfile$