]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/MPRObjects.cxx
Merge ssh://git.creatis.insa-lyon.fr/cpPlugins
[cpPlugins.git] / lib / cpExtensions / Visualization / MPRObjects.cxx
index aaadf31b1b61ede9daff48099bb27613b232f87f..914c46de29d47490ec867cd2a4e527f65c4ef483 100644 (file)
@@ -1,5 +1,9 @@
 #include <cpExtensions/Visualization/MPRObjects.h>
 
+#include <cmath>
+#include <vtkImageData.h>
+#include <vtkLookupTable.h>
+
 // -------------------------------------------------------------------------
 cpExtensions::Visualization::MPRObjects*
 cpExtensions::Visualization::MPRObjects::
@@ -54,20 +58,33 @@ SetImage( vtkImageData* image )
     this->m_Renderers[ 3 ]
     );
 
-  // Correct cameras positions
-  /* TODO
-     vtkCamera* zCam = this->m_Renderers[ 2 ]->GetActiveCamera( );
-     zCam->SetViewUp( 0, -1, 0 );
-     zCam->SetPosition( 0, 0, -1 );
-     zCam->SetFocalPoint( 0, 0, 0 );
-  */
-
   // First rendering
   this->m_MPRActors->ResetSlices( );
   this->ResetCameras( );
   this->RenderAll( );
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+AddAuxiliaryImage( vtkImageData* image )
+{
+  // Try to add new image
+  int id = this->m_MPRActors->AddInputData( image );
+  if( id < 0 )
+    return;
+
+  // Push everything on renderers
+  this->m_MPRActors->PushDataInto(
+    this->m_Renderers[ 0 ],
+    this->m_Renderers[ 1 ],
+    this->m_Renderers[ 2 ],
+    this->m_Renderers[ 3 ]
+    );
+
+  // Rendering
+  this->RenderAll( );
+}
+
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::MPRObjects::
 ActivateInteractors( )