]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/VisualDebugger2D.hxx
91eff9711618f037096427fcd30a7f1f097ac1c8
[FrontAlgorithms.git] / lib / fpa / Image / VisualDebugger2D.hxx
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Image__VisualDebugger2D__hxx__
7 #define __fpa__Image__VisualDebugger2D__hxx__
8
9 #include <vtkRenderer.h>
10 #include <vtkRenderWindowInteractor.h>
11
12 // -------------------------------------------------------------------------
13 template< class _TFilter >
14 void fpa::Image::VisualDebugger2D< _TFilter >::
15 Render( )
16 {
17 #ifdef USE_ivq
18   if( this->m_Renderer == NULL || this->m_Interactor == NULL )
19     return;
20   this->m_Actor->Modified( );
21   this->m_RenderCount = ( this->m_RenderCount + 1 ) % this->m_NumberOfPixels;
22   if( this->m_RenderCount == 0 )
23     this->m_Interactor->Render( );
24 #endif // USE_ivq
25 }
26
27 // -------------------------------------------------------------------------
28 template< class _TFilter >
29 void fpa::Image::VisualDebugger2D< _TFilter >::
30 StartVisualization( )
31 {
32 #ifdef USE_ivq
33   if( this->m_Renderer == NULL || this->m_Interactor == NULL )
34     return;
35   this->m_Actor = vtkSmartPointer< TImageActor >::New( );
36   this->m_Actor->SetInputData( this->m_VTKLabels->GetOutput( ) );
37   this->m_Actor->Update( );
38   this->m_Renderer->AddViewProp( this->m_Actor );
39
40   this->m_NumberOfPixels =
41     double(
42       this->m_VTKLabels->GetInput( )->
43       GetRequestedRegion( ).GetNumberOfPixels( )
44       ) * 0.005;
45   this->m_RenderCount = 0;
46
47 #endif // USE_ivq
48 }
49
50 // -------------------------------------------------------------------------
51 template< class _TFilter >
52 void fpa::Image::VisualDebugger2D< _TFilter >::
53 EndVisualization( )
54 {
55 }
56
57 // -------------------------------------------------------------------------
58 template< class _TFilter >
59 fpa::Image::VisualDebugger2D< _TFilter >::
60 VisualDebugger2D( )
61   : Superclass( )
62 {
63 }
64
65 // -------------------------------------------------------------------------
66 template< class _TFilter >
67 fpa::Image::VisualDebugger2D< _TFilter >::
68 ~VisualDebugger2D( )
69 {
70 }
71
72 #endif // __fpa__Image__VisualDebugger2D__hxx__
73
74 // eof - $RCSfile$