+#include <vtkPickingManager.h>
+
+class vtkUpdateCallback
+ : public vtkCommand
+{
+public:
+ static vtkUpdateCallback *New()
+ {
+ return new vtkUpdateCallback;
+ }
+ virtual void Execute(vtkObject *caller, unsigned long eventId, void*
+ arguments)
+ {
+ vtkRenderWindowInteractor* iren =
+ static_cast< vtkRenderWindowInteractor* >( caller );
+ if( caller == NULL )
+ return;
+
+ switch( iren->GetKeyCode( ) )
+ {
+ case 'x':
+ case 'X':
+ {
+ bool eSeed = ( this->SeedWidget->GetProcessEvents( ) == 1 );
+ if( eSeed )
+ {
+ this->SeedWidget->ProcessEventsOff( );
+ this->WidgetX->InteractionOn( );
+ this->WidgetY->InteractionOn( );
+ this->WidgetZ->InteractionOn( );
+ }
+ else
+ {
+ this->SeedWidget->ProcessEventsOn( );
+ this->WidgetX->InteractionOff( );
+ this->WidgetY->InteractionOff( );
+ this->WidgetZ->InteractionOff( );
+
+ } // fi
+ }
+ break;
+ default:
+ break;
+
+ } // hctiws
+ }
+
+public:
+ vtkImagePlaneWidget* WidgetX;
+ vtkImagePlaneWidget* WidgetY;
+ vtkImagePlaneWidget* WidgetZ;
+ vtkSeedWidget2* SeedWidget;
+};