]> Creatis software - cpPlugins.git/blobdiff - plugins/Widgets/SeedWidget.cxx
PolyLine updated.
[cpPlugins.git] / plugins / Widgets / SeedWidget.cxx
index 440005622c82bdb01b7be79868c6f31442320e75..fe19381e96eec259beaf299f35bdb9e56cede84c 100644 (file)
 #include <vtkRenderWindow.h>
 #include <vtkSeedRepresentation.h>
 
+// -------------------------------------------------------------------------
+void cpPluginsWidgets::SeedWidget::
+Clear( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsWidgets::SeedWidget::
+SetEnabled( bool v )
+{
+  for( auto w = this->m_Widgets.begin( ); w != this->m_Widgets.end( ); ++w )
+  {
+    if( v ) w->second->RestartInteraction( );
+    else    w->second->CompleteInteraction( );
+    w->second->SetEnabled( v );
+    w->second->Render( );
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+bool cpPluginsWidgets::SeedWidget::
+GetEnabled( ) const
+{
+  if( this->m_Widgets.size( ) > 0 )
+  {
+    auto i = this->m_Widgets.begin( );
+    TWidget* w = const_cast< TWidget* >( i->second.GetPointer( ) );
+    return( w->GetEnabled( ) != 0 );
+  }
+  else
+    return( false );
+}
+
 // -------------------------------------------------------------------------
 cpPluginsWidgets::SeedWidget::
 SeedWidget( )
@@ -118,7 +152,6 @@ _GD0_Image( vtkImageData* image )
           act->AddObserver( vtkCommand::InteractionEvent, this->m_Command );
           wdg->AddObserver( vtkCommand::PlacePointEvent, this->m_Command );
           wdg->AddObserver( vtkCommand::CursorChangedEvent, this->m_Command );
-          wdg->EnabledOn( );
           this->m_Widgets[ *inIt ] = wdg;
 
         } // fi