]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/Widgets/SeedWidget.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / Widgets / SeedWidget.cxx
index 147527eddf6264c1263e01d9d11b24f215d3736a..8dbaf9fe96ddcd372fb098cd5e409b8c41ab989e 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <cpPlugins/Interface/Image.h>
 #include <cpPlugins/Interface/PointList.h>
+#include <cpPlugins/Interface/SimpleMPRWidget.h>
 #include <cpExtensions/Interaction/ImageInteractorStyle.h>
 
 #include <vtkRenderWindowInteractor.h>
@@ -65,6 +66,61 @@ _GD0( itk::DataObject* image )
   unsigned int dim = ( I::ImageDimension < 3 )? I::ImageDimension: 3;
 
   out->Clear( );
+
+  // MPR
+  if( this->m_MPRViewer != NULL )
+  {
+    for( unsigned int i = 0; i < 4; ++i )
+    {
+      _S* s =
+        dynamic_cast< _S* >(
+          this->m_MPRViewer->GetInteractor( i )->GetInteractorStyle( )
+          );
+      if( s != NULL )
+      {
+        if( this->m_Configured )
+        {
+          for( unsigned int i = 0; i < s->GetNumberOfSeeds( ); ++i )
+          {
+            s->GetSeedAsPoint( i, aux_pnt );
+            typename I::PointType seed;
+            for( unsigned int d = 0; d < dim; ++d )
+              seed[ d ] = aux_pnt[ d ];
+            out->AddPoint( seed );
+
+          } // rof
+        }
+        else
+          s->SeedWidgetOn( );
+
+      } // fi
+
+    } // rof
+
+  } // fi
+
+  // Single interactor
+  _S* s = dynamic_cast< _S* >( this->m_SingleInteractor.GetPointer( ) );
+  if( s != NULL )
+  {
+    if( this->m_Configured )
+    {
+      for( unsigned int i = 0; i < s->GetNumberOfSeeds( ); ++i )
+      {
+        s->GetSeedAsPoint( i, aux_pnt );
+        typename I::PointType seed;
+        for( unsigned int d = 0; d < dim; ++d )
+          seed[ d ] = aux_pnt[ d ];
+        out->AddPoint( seed );
+
+      } // rof
+    }
+    else
+      s->SeedWidgetOn( );
+
+  } // fi
+
+  /* TODO
   auto iIt = this->m_Interactors.begin( );
   for( ; iIt != this->m_Interactors.end( ); ++iIt )
   {
@@ -89,6 +145,7 @@ _GD0( itk::DataObject* image )
     } // fi
 
   } // rof
+  */
   this->m_Configured = true;
   return( "" );
 }