]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/VTK/Image2DObserver.hxx
CMake updated. Some other filters added.
[FrontAlgorithms.git] / lib / fpa / VTK / Image2DObserver.hxx
index fd6247ffb6be1d7d881b1fc5b5da048ed67eb2ae..49d5577b98fedf0baf3744c55a75849f73cdc18c 100644 (file)
@@ -62,6 +62,10 @@ Execute( const itk::Object* c, const itk::EventObject& e )
   typedef typename F::TFrontEvent     _TFrontEvent;
   typedef typename F::TFreezeEvent    _TFreezeEvent;
 
+  typedef typename F::TStartBacktrackingEvent _TStartBacktrackingEvent;
+  typedef typename F::TEndBacktrackingEvent _TEndBacktrackingEvent;
+  typedef typename F::TBacktrackingEvent _TBacktrackingEvent;
+
   static unsigned char Colors[][4] =
     {
       {   0,   0, 127, 127 },
@@ -87,7 +91,9 @@ Execute( const itk::Object* c, const itk::EventObject& e )
     return;
 
   const _TStartEvent* startEvt = dynamic_cast< const _TStartEvent* >( &e );
-  if( startEvt != NULL )
+  const _TStartBacktrackingEvent* startBackEvt =
+    dynamic_cast< const _TStartBacktrackingEvent* >( &e );
+  if( startEvt != NULL || startBackEvt != NULL )
   {
     const typename F::TInputImage* img = filter->GetInput( );
     unsigned int minD = F::TInputImage::ImageDimension;
@@ -171,6 +177,29 @@ Execute( const itk::Object* c, const itk::EventObject& e )
     return;
 
   } // fi
+
+  const _TBacktrackingEvent* backEvt =
+    dynamic_cast< const _TBacktrackingEvent* >( &e );
+  const _TEndBacktrackingEvent* endBackEvt =
+    dynamic_cast< const _TEndBacktrackingEvent* >( &e );
+  if( backEvt != NULL )
+  {
+    this->SetPixel( backEvt->Vertex, 0, 0, 255, 255 );
+    return;
+
+  } // fi
+
+  if( endBackEvt != NULL )
+  {
+    this->m_RenderWindow->Render( );
+    /* TODO: DEBUG
+       std::cout << "Press enter: " << std::ends;
+       int aux;
+       std::cin >> aux;
+    */
+    return;
+
+  } // fi
 }
 
 // -------------------------------------------------------------------------