]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/BaseMPRWindow.cxx
90100a110419e5b6b5b9c09695f4fd2f77411fe7
[cpPlugins.git] / lib / cpPlugins / Interface / BaseMPRWindow.cxx
1 #include <cpPlugins/Interface/BaseMPRWindow.h>
2
3 #ifdef cpPlugins_Interface_QT4
4
5 // -------------------------------------------------------------------------
6 cpPlugins::Interface::BaseMPRWindow::
7 BaseMPRWindow( QWidget* parent )
8   : cpExtensions::QT::QuadSplitter( parent )
9 {
10   // Configure splitter
11   this->m_XVTK = new QVTKWidget( this );
12   this->m_YVTK = new QVTKWidget( this );
13   this->m_ZVTK = new QVTKWidget( this );
14   this->m_WVTK = new QVTKWidget( this );
15   this->addWidgets( this->m_YVTK, this->m_XVTK, this->m_ZVTK, this->m_WVTK );
16
17   // Create and associate vtk renderers
18   this->m_MPRObjects = vtkSmartPointer< TMPRObjects >::New( );
19   this->m_MPRObjects->SetRenderWindows(
20     this->m_XVTK->GetRenderWindow( ),
21     this->m_YVTK->GetRenderWindow( ),
22     this->m_ZVTK->GetRenderWindow( ),
23     this->m_WVTK->GetRenderWindow( )
24     );
25 }
26
27 // -------------------------------------------------------------------------
28 cpPlugins::Interface::BaseMPRWindow::
29 ~BaseMPRWindow( )
30 {
31   if( this->m_WVTK != NULL ) delete this->m_WVTK;
32   if( this->m_ZVTK != NULL ) delete this->m_ZVTK;
33   if( this->m_YVTK != NULL ) delete this->m_YVTK;
34   if( this->m_XVTK != NULL ) delete this->m_XVTK;
35 }
36
37 // -------------------------------------------------------------------------
38 bool cpPlugins::Interface::BaseMPRWindow::
39 ShowImage( vtkImageData* image )
40 {
41   bool r = ( image != NULL );
42   if( r )
43     this->m_MPRObjects->AddImage( image );
44   return( r );
45 }
46
47 // -------------------------------------------------------------------------
48 bool cpPlugins::Interface::BaseMPRWindow::
49 ShowImage( vtkImageData* image, double r, double g, double b )
50 {
51   return( false );
52 }
53
54 // -------------------------------------------------------------------------
55 bool cpPlugins::Interface::BaseMPRWindow::
56 ShowMesh( vtkPolyData* mesh )
57 {
58   return( false );
59 }
60
61 // -------------------------------------------------------------------------
62 /*
63   void cpPlugins::Interface::BaseMPRWindow::
64   AddImage( const std::string& name, TImage* image )
65   {
66   this->m_Images[ name ] = image;
67   vtkImageData* vtk_id =
68   this->m_Images[ name ]->GetVTK< vtkImageData >( );
69   if( vtk_id != NULL )
70   this->m_MPRObjects->AddImage( vtk_id );
71   }
72 */
73
74 // -------------------------------------------------------------------------
75 double cpPlugins::Interface::BaseMPRWindow::
76 GetWindow( ) const
77 {
78   return( this->m_MPRObjects->GetWindow( ) );
79 }
80
81 // -------------------------------------------------------------------------
82 double cpPlugins::Interface::BaseMPRWindow::
83 GetLevel( ) const
84 {
85   return( this->m_MPRObjects->GetLevel( ) );
86 }
87
88 // -------------------------------------------------------------------------
89 void cpPlugins::Interface::BaseMPRWindow::
90 ClearAll( )
91 {
92   /*
93     this->m_MPRObjects->ClearAll( );
94     this->m_Images.clear( );
95     this->m_Meshes.clear( );
96   */
97 }
98
99 #endif // cpPlugins_Interface_QT4
100
101 // eof - $RCSfile$