]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/MPRObjects.cxx
Parameters are now part of the pipeline update process
[cpPlugins.git] / lib / cpExtensions / Visualization / MPRObjects.cxx
index 0e522491b933349501a6286a1fd75682f8799e45..cfee04e58f8f794f1bf45e42306133d2038187c0 100644 (file)
@@ -48,7 +48,7 @@ SetRenderWindows(
 
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::MPRObjects::
-SetImage( vtkImageData* image )
+AddImage( vtkImageData* image )
 {
   this->m_MPRActors->AddInputData( image );
   this->m_MPRActors->PushActorsInto(
@@ -59,93 +59,25 @@ SetImage( vtkImageData* image )
     );
 
   // First rendering
-  this->m_MPRActors->ResetSlices( );
-  this->ResetCameras( );
+  if( this->m_MPRActors->GetNumberOfImages( ) == 1 )
+  {
+    this->m_MPRActors->ResetSlices( );
+    this->ResetCameras( );
+
+  } // fi
   this->RenderAll( );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::MPRObjects::
-AddAuxiliaryImage( vtkImageData* image )
+ClearAll( )
 {
-  // Try to add new image
-  int id = this->m_MPRActors->AddInputData( image );
-  if( id < 0 )
-    return;
-
-  // Push everything on renderers
-  this->m_MPRActors->PushActorsInto(
+  this->m_MPRActors->PopActorsFrom(
     this->m_Windows[ 0 ],
     this->m_Windows[ 1 ],
     this->m_Windows[ 2 ],
     this->m_Windows[ 3 ]
     );
-
-  // Rendering
-  this->RenderAll( );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::Visualization::MPRObjects::
-ActivateInteractors( )
-{
-  // Prepare renderers
-  for( int i = 0; i < 3; ++i )
-  {
-    // Check prerrequisites
-    if( this->m_Windows[ i ] == NULL || this->m_Renderers[ i ] == NULL )
-    {
-      // TODO: this->m_Styles[ i ] = NULL;
-      continue;
-
-    } // fi
-
-    ImageSliceActors* actors = this->m_MPRActors->GetSliceActors( i );
-    if( actors == NULL )
-    {
-      // TODO: this->m_Styles[ i ] = NULL;
-      continue;
-
-    } // fi
-
-    /* TODO
-       this->m_Styles[ i ] = vtkSmartPointer< TStyle >::New( );
-       this->m_Styles[ i ]->Configure( actors, this->m_MPRActors );
-       this->m_Styles[ i ]->
-       SetInteractor( this->m_Windows[ i ]->GetInteractor( ), i );
-       this->m_Styles[ i ]->SetModeToNavigation( );
-    */
-
-  } // rof
-
-  // Synch 2D and 3D renderers
-  for( int i = 0; i < 3; ++i )
-  {
-    for( int j = 0; j < 3; ++j )
-    {
-      /* TODO
-         if(
-         this->m_Windows[ i ] != NULL &&
-         this->m_Windows[ j ] != NULL &&
-         i != j
-         )
-         this->m_Styles[ i ]->
-         AssociateInteractor( this->m_Windows[ j ]->GetInteractor( ) );
-      */
-
-    } // rof
-    /* TODO
-       if( this->m_Windows[ 3 ] != NULL )
-       this->m_Styles[ i ]->
-       AssociateInteractor( this->m_Windows[ 3 ]->GetInteractor( ) );
-    */
-
-  } // rof
-
-  // Finish interactor linking
-  // TODO: this->m_MPRActors->LinkInteractors( );
-
-  // Restart rendering
   this->ResetCameras( );
   this->RenderAll( );
 }