]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/VTK/Image3DObserver.hxx
Minor bugs
[FrontAlgorithms.git] / lib / fpa / VTK / Image3DObserver.hxx
index 001924a70c077cd1ecfcf7e4070fac1adb898ec3..e9f9770aa7f588781bc8bbc861f2738ff73a9555 100644 (file)
@@ -28,13 +28,14 @@ template< class F, class R >
 void fpa::VTK::Image3DObserver< F, R >::
 Execute( const itk::Object* c, const itk::EventObject& e )
 {
-  typedef itk::ImageBase< 3 >            _TImage;
-  typedef typename F::TEvent             _TEvent;
-  typedef typename F::TFrontEvent        _TFrontEvent;
-  typedef typename F::TMarkEvent         _TMarkEvent;
-  typedef typename F::TCollisionEvent    _TCollisionEvent;
-  typedef typename F::TEndEvent          _TEndEvent;
-  typedef typename F::TBacktrackingEvent _TBacktrackingEvent;
+  typedef itk::ImageBase< 3 >               _TImage;
+  typedef typename F::TEvent                _TEvent;
+  typedef typename F::TFrontEvent           _TFrontEvent;
+  typedef typename F::TMarkEvent            _TMarkEvent;
+  typedef typename F::TCollisionEvent       _TCollisionEvent;
+  typedef typename F::TEndEvent             _TEndEvent;
+  typedef typename F::TBacktrackingEvent    _TBacktrackingEvent;
+  typedef typename F::TEndBacktrackingEvent _TEndBacktrackingEvent;
 
   // Check inputs
   if( this->m_RenderWindow == NULL )
@@ -158,6 +159,8 @@ Execute( const itk::Object* c, const itk::EventObject& e )
   {
     const _TBacktrackingEvent* bevt =
       dynamic_cast< const _TBacktrackingEvent* >( &e );
+    const _TEndBacktrackingEvent* ebevt =
+      dynamic_cast< const _TEndBacktrackingEvent* >( &e );
     if( bevt != NULL )
     {
       static const unsigned long nColors = 10;
@@ -173,12 +176,18 @@ Execute( const itk::Object* c, const itk::EventObject& e )
       this->m_Data->GetPointData( )->
         GetScalars( )->InsertNextTuple1( back_id );
       this->m_Data->Modified( );
-      this->m_RenderWindow->Render( );
 
       return;
 
     } // fi
 
+    if( ebevt != NULL )
+    {
+      this->m_RenderWindow->Render( );
+      return;
+
+    } // fi
+
   } // fi
 }