1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Image__VisualDebugger2D__hxx__
7 #define __fpa__Image__VisualDebugger2D__hxx__
9 #include <vtkRenderer.h>
10 #include <vtkRenderWindowInteractor.h>
12 // -------------------------------------------------------------------------
13 template< class _TFilter >
14 void fpa::Image::VisualDebugger2D< _TFilter >::
18 if( this->m_Renderer == NULL || this->m_Interactor == NULL )
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( );
27 // -------------------------------------------------------------------------
28 template< class _TFilter >
29 void fpa::Image::VisualDebugger2D< _TFilter >::
33 if( this->m_Renderer == NULL || this->m_Interactor == NULL )
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 );
40 this->m_NumberOfPixels =
42 this->m_VTKLabels->GetInput( )->
43 GetRequestedRegion( ).GetNumberOfPixels( )
45 this->m_RenderCount = 0;
50 // -------------------------------------------------------------------------
51 template< class _TFilter >
52 void fpa::Image::VisualDebugger2D< _TFilter >::
57 // -------------------------------------------------------------------------
58 template< class _TFilter >
59 fpa::Image::VisualDebugger2D< _TFilter >::
65 // -------------------------------------------------------------------------
66 template< class _TFilter >
67 fpa::Image::VisualDebugger2D< _TFilter >::
72 #endif // __fpa__Image__VisualDebugger2D__hxx__