]> Creatis software - cpPlugins.git/commitdiff
Visualization integration in a single interface.
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Fri, 16 Sep 2016 21:00:40 +0000 (16:00 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Fri, 16 Sep 2016 21:00:40 +0000 (16:00 -0500)
18 files changed:
appli/PipelineEditor/PipelineEditorMainWindow.cxx
appli/PipelineEditor/PipelineEditorMainWindow.ui
lib/cpBaseQtApplication/MainWindow.cxx
lib/cpBaseQtApplication/MainWindow.h
lib/cpExtensions/QT/ActorsWidgetInterface.h [new file with mode: 0644]
lib/cpExtensions/QT/ConfigurationChooser.cxx
lib/cpExtensions/QT/ConfigurationChooser.h
lib/cpExtensions/QT/ImageWidget.cxx
lib/cpExtensions/QT/ImageWidget.h
lib/cpExtensions/QT/MPR3DWidget.cxx
lib/cpExtensions/QT/MPR3DWidget.h
lib/cpExtensions/QT/RendererWidget.cxx
lib/cpExtensions/QT/RendererWidget.h
lib/cpExtensions/QT/SimpleMPRWidget.cxx
lib/cpExtensions/QT/SimpleMPRWidget.h
lib/cpExtensions/QT/SimpleMPRWidget.ui
lib/cpExtensions/QT/WindowLevelImageConfiguration.cxx
lib/cpExtensions/QT/WindowLevelImageConfiguration.h

index ddabd0efff94a7d5cc395278082a8f82fe6ab2f1..eb7b985949c535b5112a9e4ff905a70a19243cec 100644 (file)
@@ -24,6 +24,7 @@ PipelineEditorMainWindow(
   cpBaseQtApplication_ConnectAction( ActionAddEnvironmentPath, _addEnvironmentPaths );
   cpBaseQtApplication_ConnectAction( ActionLoadPluginFile, _loadPlugins );
   cpBaseQtApplication_ConnectAction( ActionLoadPluginDirectory, _loadPluginsFromPath );
+  cpBaseQtApplication_ConnectAction( ActionActorsProperties, _actorsProperties );
 }
 
 // -------------------------------------------------------------------------
index 8e257be16d35be0602619b92525b31fbdcf935ba..6a38074f1146eda0dd33e0f1df49ee6e5d5b874e 100644 (file)
           <height>60</height>
          </size>
         </property>
+        <column>
+         <property name="text">
+          <string notr="true">1</string>
+         </property>
+        </column>
        </widget>
        <widget class="cpBaseQtApplication::Canvas" name="Canvas" native="true">
         <property name="minimumSize">
@@ -59,7 +64,7 @@
      <x>0</x>
      <y>0</y>
      <width>640</width>
-     <height>22</height>
+     <height>25</height>
     </rect>
    </property>
    <widget class="QMenu" name="menuFile">
     <addaction name="ActionShowPlugins"/>
     <addaction name="ActionAddEnvironmentPath"/>
    </widget>
+   <widget class="QMenu" name="menuProperties">
+    <property name="title">
+     <string>P&amp;roperties</string>
+    </property>
+    <addaction name="ActionActorsProperties"/>
+   </widget>
    <addaction name="menuFile"/>
+   <addaction name="menuProperties"/>
    <addaction name="menuPlugins"/>
   </widget>
   <widget class="QStatusBar" name="statusbar"/>
     <string>Ctrl+F9</string>
    </property>
   </action>
+  <action name="ActionActorsProperties">
+   <property name="text">
+    <string>&amp;Actors</string>
+   </property>
+   <property name="toolTip">
+    <string>Actors properties</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+V</string>
+   </property>
+  </action>
  </widget>
  <customwidgets>
   <customwidget>
index 81f24c033ec50fc7aebb3b7e94bd65f722734bff..67a3844aaa3641fdf40cbef029ace9cce8fd1a2d 100644 (file)
@@ -7,6 +7,7 @@
 #include <QMessageBox>
 
 #include <cpExtensions/QT/SimpleMPRWidget.h>
+#include <cpExtensions/QT/ConfigurationChooser.h>
 
 #include <vtkDataSet.h>
 
@@ -439,6 +440,19 @@ _loadPluginsFromPath( )
   this->_loadPluginsFromPath( d.selectedFiles( ).begin( )->toStdString( ) );
 }
 
+// -------------------------------------------------------------------------
+void cpBaseQtApplication::MainWindow::
+_actorsProperties( )
+{
+  if( this->m_MPR != NULL )
+  {
+    auto dlg = new cpExtensions::QT::ConfigurationChooser( this );
+    dlg->setData( this->m_MPR );
+    dlg->exec( );
+
+  } // fi
+}
+
 // -------------------------------------------------------------------------
 /* TODO
    void cpBaseQtApplication::MainWindow::
index 1f2f2c285deb00ae2a2c55c4d97a80f2db1bd1e3..9e2b6072f1137ec501cf3c08b555cfc29fbaff02 100644 (file)
@@ -125,6 +125,7 @@ namespace cpBaseQtApplication
     void _loadPlugins( );
     void _loadPluginsFromPath( const std::string& path );
     void _loadPluginsFromPath( );
+    void _actorsProperties( );
 
     /* TODO
        void _ClearWorkspace( );
diff --git a/lib/cpExtensions/QT/ActorsWidgetInterface.h b/lib/cpExtensions/QT/ActorsWidgetInterface.h
new file mode 100644 (file)
index 0000000..ff8dc14
--- /dev/null
@@ -0,0 +1,68 @@
+#ifndef __cpExtensions__QT__ActorsWidgetInterface__h__
+#define __cpExtensions__QT__ActorsWidgetInterface__h__
+
+#include <cpExtensions/Config.h>
+
+#ifdef cpExtensions_QT4
+
+#include <string>
+#include <set>
+
+namespace cpExtensions
+{
+  namespace QT
+  {
+    /**
+     */
+    class cpExtensions_EXPORT ActorsWidgetInterface
+    {
+    public:
+      typedef ActorsWidgetInterface Self;
+
+    public:
+      ActorsWidgetInterface( ) { }
+      virtual ~ActorsWidgetInterface( ) { }
+
+      virtual std::set< std::string > GetActorsNames( ) const = 0;
+      virtual bool IsWindowLevelImageActor( const std::string& name ) const = 0;
+      virtual bool IsLUTImageActor( const std::string& name ) const = 0;
+      virtual bool Is3DActor( const std::string& name ) const = 0;
+
+      virtual void GetScalarRange( const std::string& name, double r[ 2 ] ) const = 0;
+      virtual void GetWindowLevel( const std::string& name, double wl[ 2 ] ) const = 0;
+      virtual double GetWindow( const std::string& name ) const = 0;
+      virtual double GetLevel( const std::string& name ) const = 0;
+      virtual char GetImageInterpolation( const std::string& name ) const = 0;
+
+      virtual void GetColor( const std::string& name, double& r, double& g, double& b ) const = 0;
+      virtual double GetOpacity( const std::string& name ) const = 0;
+      virtual double GetPointSize( const std::string& name ) const = 0;
+      virtual double GetLineWidth( const std::string& name ) const = 0;
+      virtual int GetRepresentation( const std::string& name ) const = 0;
+
+      virtual void SetScalarRange( const std::string& name, double r[ 2 ] ) = 0;
+      virtual void SetScalarRange( const std::string& name, double min, double max ) = 0;
+      virtual void SetWindowLevel( const std::string& name, double wl[ 2 ] ) = 0;
+      virtual void SetWindowLevel( const std::string& name, double w, double l ) = 0;
+      virtual void SetWindow( const std::string& name, double w ) = 0;
+      virtual void SetLevel( const std::string& name, double l ) = 0;
+      virtual void SetImageInterpolation( const std::string& name, char i ) = 0;
+
+      virtual void SetColor( const std::string& name, double r, double g, double b ) = 0;
+      virtual void SetOpacity( const std::string& name, double o ) = 0;
+      virtual void SetPointSize( const std::string& name, double s ) = 0;
+      virtual void SetLineWidth( const std::string& name, double w ) = 0;
+      virtual void SetRepresentationToPoints( const std::string& name ) = 0;
+      virtual void SetRepresentationToSurface( const std::string& name ) = 0;
+      virtual void SetRepresentationToWireframe( const std::string& name ) = 0;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // cpExtensions_QT4
+
+#endif // __cpExtensions__QT__ActorsWidgetInterface__h__
+
+// eof - $RCSfile$
index 13eef422920ad6ddc86c365110b1ca2cef49d78e..aea4abd0ee2988298f2646bf184f0f8869b9466b 100644 (file)
@@ -3,8 +3,8 @@
 #ifdef cpExtensions_QT4
 
 #include <cpExtensions/QT/ui_ConfigurationChooser.h>
+#include <cpExtensions/QT/ActorsWidgetInterface.h>
 #include <cpExtensions/QT/WindowLevelImageConfiguration.h>
-#include <cpExtensions/QT/SimpleMPRWidget.h>
 
 // -------------------------------------------------------------------------
 cpExtensions::QT::ConfigurationChooser::
@@ -25,14 +25,28 @@ cpExtensions::QT::ConfigurationChooser::
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::ConfigurationChooser::
-setData( SimpleMPRWidget* data )
+setData( ActorsWidgetInterface* data )
 {
   this->m_Data = data;
   if( this->m_Data != NULL )
   {
-    auto wl_wdg = new WindowLevelImageConfiguration( this );
-    wl_wdg->setData( data );
-    this->m_UI->Configurations->addTab( wl_wdg, "Image" );
+    auto actors = this->m_Data->GetActorsNames( );
+    for( auto n = actors.begin( ); n != actors.end( ); ++n )
+    {
+      if( this->m_Data->IsWindowLevelImageActor( *n ) )
+      {
+        auto wl_wdg = new WindowLevelImageConfiguration( this );
+        wl_wdg->setData( data, *n );
+        this->m_UI->Configurations->addTab( wl_wdg, n->c_str( ) );
+      }
+      else if( this->m_Data->IsLUTImageActor( *n ) )
+      {
+      }
+      else if( this->m_Data->Is3DActor( *n ) )
+      {
+      } // fi
+
+    } // rof
 
   } // fi
 }
index 7b5e7831ad842ae2f2ca4c583cf0e41bd9c6d9e2..4a9007b6595558340c48b3baa5a98fc916fa2d57 100644 (file)
@@ -15,7 +15,7 @@ namespace cpExtensions
 {
   namespace QT
   {
-    class SimpleMPRWidget;
+    class ActorsWidgetInterface;
 
     /**
      */
@@ -32,11 +32,11 @@ namespace cpExtensions
       explicit ConfigurationChooser( QWidget* parent = NULL, Qt::WindowFlags f = 0 );
       virtual ~ConfigurationChooser( );
 
-      void setData( SimpleMPRWidget* data );
+      void setData( ActorsWidgetInterface* data );
 
     protected:
       Ui::ConfigurationChooser* m_UI;
-      SimpleMPRWidget* m_Data;
+      ActorsWidgetInterface* m_Data;
     };
 
   } // ecapseman
index 35557f5a9ee99330d34ffacfddfa260167d92c4f..8a3d2c30ef3ff499824e4e5993087dde60b4b887 100644 (file)
 #include <vtkProperty.h>
 #include <vtkRenderer.h>
 
-/* TODO
-   #include <cpExtensions/Visualization/ImageViewerActors.h>
-   #include <cpExtensions/Visualization/LUTImageActor.h>
-   #include <vtkImageData.h>
-   #include <vtkImageProperty.h>
-*/
-
 // -------------------------------------------------------------------------
 cpExtensions::QT::ImageWidget::
 ImageWidget( QWidget* parent, Qt::WindowFlags f )
@@ -232,230 +225,6 @@ SetLineWidth( const std::string& name, double w )
   this->Render( );
 }
 
-
-/* TODO
-// -------------------------------------------------------------------------
-vtkInteractorStyle* cpExtensions::QT::ImageWidget::
-GetInteractorStyle( )
-{
-  return( this->m_ImageSliceStyle );
-}
-
-// -------------------------------------------------------------------------
-const vtkInteractorStyle* cpExtensions::QT::ImageWidget::
-GetInteractorStyle( ) const
-{
-  return( this->m_ImageSliceStyle );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::ImageWidget::
-SetImage( vtkImageData* image, int orientation, const std::string& name )
-{
-  if( this->m_ImageName != "" )
-  {
-    // TODO: Clear visualization
-
-  } // fi
-  this->m_ImageName = name;
-
-  this->GetActiveCamera( )->ParallelProjectionOn( );
-
-  this->m_ImageViewerActors =
-    vtkSmartPointer< cpExtensions::Visualization::ImageViewerActors >::New( );
-  this->m_ImageViewerActors->SetImage( image, orientation );
-
-  this->m_ImageSliceStyle->SetActors( this->m_ImageViewerActors );
-
-  this->AddViewProp(
-    this->m_ImageViewerActors->GetWindowLevelImageActor( ),
-    this->m_ImageName
-    );
-  this->AddAuxViewProps( this->m_ImageViewerActors, this->m_ImageName );
-  this->ResetCamera( );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::ImageWidget::
-Add( vtkDataSet* data, const std::string& name )
-{
-  auto image = dynamic_cast< vtkImageData* >( data );
-
-  if( image == NULL )
-  {
-       if( this->m_ImageName == "" )
-       this->SetImage( data, name );
-       {
-       } // fi
-    return;
-
-  } // fi
-
-  if( this->m_ImageName == "" )
-    return;
-
-  if( this->m_ImageViewerActors.GetPointer( ) != NULL )
-  {
-    if( this->m_ImageViewerActors->AddLUTImage( image ) > 0 )
-    {
-      this->AddViewProp(
-        this->m_ImageViewerActors->GetLUTImageActor( ),
-        name
-        );
-      this->Render( );
-
-    } // fi
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-int cpExtensions::QT::ImageWidget::
-GetOrientation( ) const
-{
-  return( this->m_ImageViewerActors->GetOrientation( ) );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::ImageWidget::
-SetSliceNumber( int slice )
-{
-  this->m_ImageViewerActors->SetSliceNumber( slice );
-  this->Render( );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::ImageWidget::
-GetScalarRange( double r[ 2 ] ) const
-{
-  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
-  if( actor != NULL )
-    actor->GetRange( r );
-  else
-    r[ 0 ] = r[ 1 ] = double( 0 );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::ImageWidget::
-GetWindowLevel( double wl[ 2 ] ) const
-{
-  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
-  if( actor != NULL )
-  {
-    wl[ 0 ] = actor->GetWindow( );
-    wl[ 1 ] = actor->GetLevel( );
-  }
-  else
-    wl[ 0 ] = wl[ 1 ] = double( 0 );
-}
-
-// -------------------------------------------------------------------------
-double cpExtensions::QT::ImageWidget::
-GetImageOpacity( ) const
-{
-  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
-  if( actor != NULL )
-    return( actor->GetProperty( )->GetOpacity( ) );
-  else
-    return( double( 0 ) );
-}
-
-// -------------------------------------------------------------------------
-unsigned char cpExtensions::QT::ImageWidget::
-GetImageInterpolation( ) const
-{
-  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
-  if( actor != NULL )
-  {
-    int int_type = actor->GetProperty( )->GetInterpolationType( );
-    char ret = 0;
-    switch( int_type )
-    {
-    case VTK_NEAREST_INTERPOLATION: ret = 'N'; break;
-    case VTK_LINEAR_INTERPOLATION: ret = 'L'; break;
-    case VTK_CUBIC_INTERPOLATION: ret = 'C'; break;
-    default: ret = 0; break;
-    } // hctiws
-    return( ret );
-  }
-  else
-    return( 0 );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::ImageWidget::
-SetScalarRange( double r[ 2 ] )
-{
-  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
-  if( actor != NULL )
-  {
-    actor->ConfigureWindowLevel( r[ 0 ], r[ 1 ] );
-    this->Render( );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::ImageWidget::
-SetWindowLevel( double wl[ 2 ] )
-{
-  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
-  if( actor != NULL )
-  {
-    actor->SetWindowLevel( wl[ 0 ], wl[ 1 ] );
-    this->Render( );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::ImageWidget::
-SetImageOpacity( double o )
-{
-  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
-  if( actor != NULL )
-  {
-    actor->GetProperty( )->SetOpacity( o );
-    this->Render( );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::ImageWidget::
-SetImageInterpolation( unsigned char i )
-{
-  auto actor = this->m_ImageViewerActors->GetWindowLevelImageActor( );
-  if( actor != NULL )
-  {
-    int int_type = 0;
-    switch( i )
-    {
-    case 'L': int_type = VTK_LINEAR_INTERPOLATION; break;
-    case 'C': int_type = VTK_CUBIC_INTERPOLATION; break;
-    default : int_type = VTK_NEAREST_INTERPOLATION; break;
-    } // hctiws
-    actor->GetProperty( )->SetInterpolationType( int_type );
-    this->Render( );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-vtkProp* cpExtensions::QT::ImageWidget::
-GetImageActor( )
-{
-  return( this->m_ImageViewerActors->GetWindowLevelImageActor( ) );
-}
-
-// -------------------------------------------------------------------------
-const vtkProp* cpExtensions::QT::ImageWidget::
-GetImageActor( ) const
-{
-  return( this->m_ImageViewerActors->GetWindowLevelImageActor( ) );
-}
-*/
-
 #endif // cpExtensions_QT4
 
 // eof - $RCSfile$
index 3e3721ec6255988f3eace9aa7c93faba0d2d365e..6627610732488e59d54fde5929b499c7cd6fe3ef 100644 (file)
@@ -56,30 +56,6 @@ namespace cpExtensions
       void SetColor( const std::string& name, double r, double g, double b );
       void SetLineWidth( const std::string& name, double w );
 
-      /* TODO
-         void SetImage(
-         vtkImageData* image, int orientation, const std::string& name
-         );
-
-         // TODO: std::vector< vtkProp* > GetActors( const std::string& name ) const;
-         int GetOrientation( ) const;
-         void SetSliceNumber( int slice );
-
-
-         void GetScalarRange( double r[ 2 ] ) const;
-         void GetWindowLevel( double wl[ 2 ] ) const;
-         double GetImageOpacity( ) const;
-         unsigned char GetImageInterpolation( ) const;
-
-         void SetScalarRange( double r[ 2 ] );
-         void SetWindowLevel( double wl[ 2 ] );
-         void SetImageOpacity( double o );
-         void SetImageInterpolation( unsigned char i );
-
-         vtkProp* GetImageActor( );
-         const vtkProp* GetImageActor( ) const;
-      */
-
     protected:
       std::string m_ImageName;
 
@@ -90,15 +66,6 @@ namespace cpExtensions
       std::vector< TActor* > m_Actors;
 
       vtkSmartPointer< TStyle > m_Style;
-
-      /* TODO
-         protected:
-         vtkSmartPointer< cpExtensions::Visualization::ImageViewerActors >
-         m_ImageViewerActors;
-         vtkSmartPointer< cpExtensions::Interaction::ImageSliceStyle >
-         m_ImageSliceStyle;
-         std::string m_ImageName;
-      */
     };
 
   } // ecapseman
index b4224a7a86bc96b347b5b139061640f8f846d9c0..718078f854f8c751880414887a8b409d7eb3a599 100644 (file)
 #include <vtkPlane.h>
 #include <vtkPolyData.h>
 
-/* TODO
-   #include <cpExtensions/Visualization/MPR3DActors.h>
-   #include <cpExtensions/Visualization/LUTImageActor.h>
-
-   #include <vtkActor.h>
-*/
-
 // -------------------------------------------------------------------------
 cpExtensions::QT::MPR3DWidget::
 MPR3DWidget( QWidget* parent, Qt::WindowFlags f )
   : Superclass( parent, f ),
     m_ImageName( "" )
 {
-  /* TODO
-     this->m_Actors =
-     vtkSmartPointer< cpExtensions::Visualization::MPR3DActors >::New( );
-  */
 }
 
 // -------------------------------------------------------------------------
@@ -151,84 +140,6 @@ SetSlicesNumbers( int x, int y, int z )
   this->Render( );
 }
 
-// -------------------------------------------------------------------------
-/*
-void cpExtensions::QT::MPR3DWidget::
-SetImage( vtkImageData* image, const std::string& name )
-{
-  if( this->m_ImageName != "" )
-  {
-    // TODO: Clear visualization
-
-  } // fi
-
-  this->m_Actors->SetImage( image );
-  this->m_ImageName = name;
-
-  vtkSmartPointer< vtkPropCollection > props =
-    vtkSmartPointer< vtkPropCollection >::New( );
-  props->AddItem( this->m_Actors->GetWindowLevelImageActor( 0 ) );
-  props->AddItem( this->m_Actors->GetWindowLevelImageActor( 1 ) );
-  props->AddItem( this->m_Actors->GetWindowLevelImageActor( 2 ) );
-  this->AddViewProps( props, name );
-  this->AddAuxViewProp( this->m_Actors->GetImageOutlineActor( 0 ), name );
-  this->AddAuxViewProp( this->m_Actors->GetImageOutlineActor( 1 ), name );
-  this->AddAuxViewProp( this->m_Actors->GetImageOutlineActor( 2 ), name );
-  this->ResetCamera( );
-  this->Render( );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::MPR3DWidget::
-SetSliceNumber( int orientation, int slice )
-{
-  this->m_Actors->SetSliceNumber( orientation, slice );
-  this->Render( );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::MPR3DWidget::
-SetSlicesNumbers( int x, int y, int z )
-{
-  this->m_Actors->SetSliceNumber( 0, x );
-  this->m_Actors->SetSliceNumber( 1, y );
-  this->m_Actors->SetSliceNumber( 2, z );
-  this->Render( );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::MPR3DWidget::
-SetScalarRange( double r[ 2 ] )
-{
-  this->m_Actors->SetScalarRange( r );
-  this->Render( );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::MPR3DWidget::
-SetWindowLevel( double wl[ 2 ] )
-{
-  this->m_Actors->SetWindowLevel( wl );
-  this->Render( );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::MPR3DWidget::
-SetImageOpacity( double o )
-{
-  this->m_Actors->SetImageOpacity( o );
-  this->Render( );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::MPR3DWidget::
-SetImageInterpolation( unsigned char i )
-{
-  this->m_Actors->SetImageInterpolation( i );
-  this->Render( );
-}
-  */
-
 #endif // cpExtensions_QT4
 
 // eof - $RCSfile$
index 667e0e2c7b00ef414aa313075b1cda5348faa68d..b2edc14599c7b12ac817582fbf91a8e41d81cb12 100644 (file)
@@ -49,27 +49,12 @@ namespace cpExtensions
       void SetSliceNumber( int orientation, int slice );
       void SetSlicesNumbers( int x, int y, int z );
 
-      /* TODO
-         void SetImage( vtkImageData* image, const std::string& name );
-
-
-         void SetScalarRange( double r[ 2 ] );
-         void SetWindowLevel( double wl[ 2 ] );
-         void SetImageOpacity( double o );
-         void SetImageInterpolation( unsigned char i );
-      */
-
     protected:
       std::string m_ImageName;
 
       vtkSmartPointer< TWLActor > m_WLActors[ 3 ];
       vtkSmartPointer< TOLActor > m_OLActors[ 3 ];
       std::vector< TActor* > m_Actors;
-
-      /* TODO
-         vtkSmartPointer< cpExtensions::Visualization::MPR3DActors > m_Actors;
-         std::string m_ImageName;
-      */
     };
 
   } // ecapseman
index 251ecea5cb82ebe6cc4e84e03e80f4dfe8b019ed..7b04041542b94d69ab6aeaf1a54a5c5e45b5b37e 100644 (file)
@@ -4,15 +4,20 @@
 
 #include <vtkAxesActor.h>
 #include <vtkCamera.h>
+#include <vtkImageProperty.h>
 #include <vtkInteractorStyle.h>
 #include <vtkOrientationMarkerWidget.h>
+#include <vtkProperty.h>
 #include <vtkRenderer.h>
 #include <vtkRenderWindow.h>
+#include <cpExtensions/Visualization/LUTImageActor.h>
+#include <cpExtensions/Visualization/WindowLevelImageActor.h>
 
 // -------------------------------------------------------------------------
 cpExtensions::QT::RendererWidget::
 RendererWidget( QWidget* parent, Qt::WindowFlags f )
-  : Superclass( parent, f )
+  : Superclass( parent, f ),
+    Superclass2( )
 {
   this->m_Renderer = vtkSmartPointer< vtkRenderer >::New( );
   this->GetRenderWindow( )->AddRenderer( this->m_Renderer );
@@ -341,6 +346,640 @@ Render( )
   this->GetRenderWindow( )->Render( );
 }
 
+// -------------------------------------------------------------------------
+std::set< std::string > cpExtensions::QT::RendererWidget::
+GetActorsNames( ) const
+{
+  std::set< std::string > names;
+  for(
+    auto p = this->m_ViewProps.begin( );
+    p != this->m_ViewProps.end( );
+    ++p
+    )
+    names.insert( p->first );
+  return( names );
+}
+
+// -------------------------------------------------------------------------
+bool cpExtensions::QT::RendererWidget::
+IsWindowLevelImageActor( const std::string& name ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto a = it->second.begin( );
+    if( a != it->second.end( ) )
+      return( dynamic_cast< TWLActor* >( a->GetPointer( ) ) != NULL );
+    else
+      return( false );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+bool cpExtensions::QT::RendererWidget::
+IsLUTImageActor( const std::string& name ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto a = it->second.begin( );
+    if( a != it->second.end( ) )
+      return( dynamic_cast< TLUTActor* >( a->GetPointer( ) ) != NULL );
+    else
+      return( false );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+bool cpExtensions::QT::RendererWidget::
+Is3DActor( const std::string& name ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto a = it->second.begin( );
+    if( a != it->second.end( ) )
+      return( dynamic_cast< vtkActor* >( a->GetPointer( ) ) != NULL );
+    else
+      return( false );
+  }
+  else
+    return( false );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+GetScalarRange( const std::string& name, double r[ 2 ] ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto p = it->second.begin( );
+    TWLActor* a = NULL;
+    while( a == NULL && p != it->second.end( ) )
+    {
+      a = dynamic_cast< TWLActor* >( p->GetPointer( ) );
+      p++;
+
+    } // elihw
+    if( a != NULL )
+      a->GetRange( r );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+GetWindowLevel( const std::string& name, double wl[ 2 ] ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto p = it->second.begin( );
+    TWLActor* a = NULL;
+    while( a == NULL && p != it->second.end( ) )
+    {
+      a = dynamic_cast< TWLActor* >( p->GetPointer( ) );
+      p++;
+
+    } // elihw
+    if( a != NULL )
+      a->GetWindowLevel( wl );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::QT::RendererWidget::
+GetWindow( const std::string& name ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto p = it->second.begin( );
+    TWLActor* a = NULL;
+    while( a == NULL && p != it->second.end( ) )
+    {
+      a = dynamic_cast< TWLActor* >( p->GetPointer( ) );
+      p++;
+
+    } // elihw
+    if( a != NULL )
+      return( a->GetWindow( ) );
+    else
+      return( 0 );
+  }
+  else
+    return( 0 );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::QT::RendererWidget::
+GetLevel( const std::string& name ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto p = it->second.begin( );
+    TWLActor* a = NULL;
+    while( a == NULL && p != it->second.end( ) )
+    {
+      a = dynamic_cast< TWLActor* >( p->GetPointer( ) );
+      p++;
+
+    } // elihw
+    if( a != NULL )
+      return( a->GetLevel( ) );
+    else
+      return( 0 );
+  }
+  else
+    return( 0 );
+}
+
+// -------------------------------------------------------------------------
+char cpExtensions::QT::RendererWidget::
+GetImageInterpolation( const std::string& name ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto p = it->second.begin( );
+    TWLActor* a = NULL;
+    while( a == NULL && p != it->second.end( ) )
+    {
+      a = dynamic_cast< TWLActor* >( p->GetPointer( ) );
+      p++;
+
+    } // elihw
+    if( a != NULL )
+    {
+      int int_type = a->GetProperty( )->GetInterpolationType( );
+      char ret = 0;
+      switch( int_type )
+      {
+      case VTK_NEAREST_INTERPOLATION: ret = 'N'; break;
+      case VTK_LINEAR_INTERPOLATION: ret = 'L'; break;
+      case VTK_CUBIC_INTERPOLATION: ret = 'C'; break;
+      default: ret = 0; break;
+      } // hctiws
+      return( ret );
+    }
+    else
+      return( 0 );
+  }
+  else
+    return( 0 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+GetColor( const std::string& name, double& r, double& g, double& b ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto p = it->second.begin( );
+    vtkActor* a = NULL;
+    while( a == NULL && p != it->second.end( ) )
+    {
+      a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      p++;
+
+    } // elihw
+    if( a != NULL )
+      return( a->GetProperty( )->GetColor( r, g, b ) );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::QT::RendererWidget::
+GetOpacity( const std::string& name ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto p = it->second.begin( );
+    vtkActor* a = NULL;
+    vtkImageSlice* s = NULL;
+    while( a == NULL && s == NULL && p != it->second.end( ) )
+    {
+      a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      s = dynamic_cast< vtkImageSlice* >( p->GetPointer( ) );
+      p++;
+
+    } // elihw
+    if( a != NULL )
+      return( a->GetProperty( )->GetOpacity( ) );
+    else if( s != NULL )
+      return( s->GetProperty( )->GetOpacity( ) );
+    else
+      return( 0 );
+  }
+  return( 0 );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::QT::RendererWidget::
+GetPointSize( const std::string& name ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto p = it->second.begin( );
+    vtkActor* a = NULL;
+    while( a == NULL && p != it->second.end( ) )
+    {
+      a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      p++;
+
+    } // elihw
+    if( a != NULL )
+      return( a->GetProperty( )->GetPointSize( ) );
+    else
+      return( 0 );
+  }
+  return( 0 );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::QT::RendererWidget::
+GetLineWidth( const std::string& name ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto p = it->second.begin( );
+    vtkActor* a = NULL;
+    while( a == NULL && p != it->second.end( ) )
+    {
+      a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      p++;
+
+    } // elihw
+    if( a != NULL )
+      return( a->GetProperty( )->GetLineWidth( ) );
+    else
+      return( 0 );
+  }
+  return( 0 );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::QT::RendererWidget::
+GetRepresentation( const std::string& name ) const
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    auto p = it->second.begin( );
+    vtkActor* a = NULL;
+    while( a == NULL && p != it->second.end( ) )
+    {
+      a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      p++;
+
+    } // elihw
+    if( a != NULL )
+      return( a->GetProperty( )->GetRepresentation( ) );
+    else
+      return( -1 );
+  }
+  return( -1 );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetScalarRange( const std::string& name, double r[ 2 ] )
+{
+  this->SetScalarRange( name, r[ 0 ], r[ 1 ] );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetScalarRange( const std::string& name, double min, double max )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      TWLActor* a = dynamic_cast< TWLActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->SetRange( min, max );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetWindowLevel( const std::string& name, double wl[ 2 ] )
+{
+  this->SetWindowLevel( name, wl[ 0 ], wl[ 1 ] );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetWindowLevel( const std::string& name, double w, double l )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      TWLActor* a = dynamic_cast< TWLActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->SetWindowLevel( w, l );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetWindow( const std::string& name, double w )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      TWLActor* a = dynamic_cast< TWLActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->SetWindow( w );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetLevel( const std::string& name, double l )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      TWLActor* a = dynamic_cast< TWLActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->SetLevel( l );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetImageInterpolation( const std::string& name, char i )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      TWLActor* a = dynamic_cast< TWLActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        int int_type = VTK_NEAREST_INTERPOLATION;
+        switch( i )
+        {
+        case 'L': int_type = VTK_LINEAR_INTERPOLATION; break;
+        case 'C': int_type = VTK_CUBIC_INTERPOLATION; break;
+        default:  int_type = VTK_NEAREST_INTERPOLATION; break;
+        } // hctiws
+        a->GetProperty( )->SetInterpolationType( int_type );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetColor( const std::string& name, double r, double g, double b )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      vtkActor* a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->GetProperty( )->SetColor( r, g, b );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetOpacity( const std::string& name, double o )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      vtkActor* a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      vtkImageSlice* s = dynamic_cast< vtkImageSlice* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->GetProperty( )->SetOpacity( o );
+      }
+      else if( s != NULL )
+      {
+        render = true;
+        s->GetProperty( )->SetOpacity( o );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetPointSize( const std::string& name, double s )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      vtkActor* a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->GetProperty( )->SetPointSize( s );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetLineWidth( const std::string& name, double w )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      vtkActor* a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->GetProperty( )->SetLineWidth( w );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetRepresentationToPoints( const std::string& name )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      vtkActor* a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->GetProperty( )->SetRepresentationToPoints( );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetRepresentationToSurface( const std::string& name )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      vtkActor* a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->GetProperty( )->SetRepresentationToSurface( );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::RendererWidget::
+SetRepresentationToWireframe( const std::string& name )
+{
+  auto it = this->m_ViewProps.find( name );
+  if( it != this->m_ViewProps.end( ) )
+  {
+    bool render = false;
+    for( auto p = it->second.begin( ); p != it->second.end( ); ++p )
+    {
+      vtkActor* a = dynamic_cast< vtkActor* >( p->GetPointer( ) );
+      if( a != NULL )
+      {
+        render = true;
+        a->GetProperty( )->SetRepresentationToWireframe( );
+
+      } // fi
+
+    } // rof
+    if( render )
+      this->Render( );
+
+  } // fi
+}
+
 #endif // cpExtensions_QT4
 
 // eof - $RCSfile$
index c90803b26b30aaa1f57c773c43085c6ae66fa9de..256c5b10c9a4a379457d65a81d9690b2d27c1f66 100644 (file)
@@ -5,6 +5,7 @@
 
 #ifdef cpExtensions_QT4
 
+#include <cpExtensions/QT/ActorsWidgetInterface.h>
 #include <vtkSmartPointer.h>
 #include <map>
 #include <set>
@@ -20,22 +21,33 @@ class vtkPropCollection;
 // -------------------------------------------------------------------------
 namespace cpExtensions
 {
+  namespace Visualization
+  {
+    class LUTImageActor;
+    class WindowLevelImageActor;
+  }
+
   namespace QT
   {
     /**
      */
     class cpExtensions_EXPORT RendererWidget
-      : public cpExtensions_QVTKWidget
+      : public cpExtensions_QVTKWidget,
+        public ActorsWidgetInterface
     {
       Q_OBJECT;
 
     public:
       typedef RendererWidget          Self;
       typedef cpExtensions_QVTKWidget Superclass;
+      typedef ActorsWidgetInterface   Superclass2;
 
       typedef std::set< vtkSmartPointer< vtkProp > > TProps;
       typedef std::map< std::string, TProps >        TPropCollection;
 
+      typedef cpExtensions::Visualization::LUTImageActor         TLUTActor;
+      typedef cpExtensions::Visualization::WindowLevelImageActor TWLActor;
+
     public:
       explicit RendererWidget(
         QWidget* parent = NULL, Qt::WindowFlags f = 0
@@ -78,6 +90,39 @@ namespace cpExtensions
       virtual void ResetCamera( );
       virtual void Render( );
 
+      virtual std::set< std::string > GetActorsNames( ) const cpExtensions_OVERRIDE;
+      virtual bool IsWindowLevelImageActor( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual bool IsLUTImageActor( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual bool Is3DActor( const std::string& name ) const cpExtensions_OVERRIDE;
+
+      virtual void GetScalarRange( const std::string& name, double r[ 2 ] ) const cpExtensions_OVERRIDE;
+      virtual void GetWindowLevel( const std::string& name, double wl[ 2 ] ) const cpExtensions_OVERRIDE;
+      virtual double GetWindow( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual double GetLevel( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual char GetImageInterpolation( const std::string& name ) const cpExtensions_OVERRIDE;
+
+      virtual void GetColor( const std::string& name, double& r, double& g, double& b ) const cpExtensions_OVERRIDE;
+      virtual double GetOpacity( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual double GetPointSize( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual double GetLineWidth( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual int GetRepresentation( const std::string& name ) const cpExtensions_OVERRIDE;
+
+      virtual void SetScalarRange( const std::string& name, double r[ 2 ] ) cpExtensions_OVERRIDE;
+      virtual void SetScalarRange( const std::string& name, double min, double max ) cpExtensions_OVERRIDE;
+      virtual void SetWindowLevel( const std::string& name, double wl[ 2 ] ) cpExtensions_OVERRIDE;
+      virtual void SetWindowLevel( const std::string& name, double w, double l ) cpExtensions_OVERRIDE;
+      virtual void SetWindow( const std::string& name, double w ) cpExtensions_OVERRIDE;
+      virtual void SetLevel( const std::string& name, double l ) cpExtensions_OVERRIDE;
+      virtual void SetImageInterpolation( const std::string& name, char i ) cpExtensions_OVERRIDE;
+
+      virtual void SetColor( const std::string& name, double r, double g, double b ) cpExtensions_OVERRIDE;
+      virtual void SetOpacity( const std::string& name, double o ) cpExtensions_OVERRIDE;
+      virtual void SetPointSize( const std::string& name, double s ) cpExtensions_OVERRIDE;
+      virtual void SetLineWidth( const std::string& name, double w ) cpExtensions_OVERRIDE;
+      virtual void SetRepresentationToPoints( const std::string& name ) cpExtensions_OVERRIDE;
+      virtual void SetRepresentationToSurface( const std::string& name ) cpExtensions_OVERRIDE;
+      virtual void SetRepresentationToWireframe( const std::string& name ) cpExtensions_OVERRIDE;
+
     protected:
       vtkSmartPointer< vtkRenderer >                m_Renderer;
       vtkSmartPointer< vtkOrientationMarkerWidget > m_Marker;
index 665b0a187547937421e84281d75d6956d8cf0dec..b700b4e8d5d250ea558258ad20a55d30f9c47e47 100644 (file)
@@ -17,6 +17,7 @@
 cpExtensions::QT::SimpleMPRWidget::
 SimpleMPRWidget( QWidget* parent, Qt::WindowFlags f )
   : Superclass( parent, f ),
+    Superclass2( ),
     m_UI( new Ui::SimpleMPRWidget ),
     m_MainImageName( "" )
 {
@@ -70,10 +71,6 @@ SimpleMPRWidget( QWidget* parent, Qt::WindowFlags f )
     this->m_UI->Bottom, SIGNAL( splitterMoved( int, int ) ),
     this, SLOT( _SyncTop( int, int ) )
     );
-  this->connect(
-    this->m_UI->ConfigurationButton, SIGNAL( clicked( ) ),
-    this, SLOT( _ConfigurationButton( ) )
-    );
 }
 
 // -------------------------------------------------------------------------
@@ -345,125 +342,287 @@ GetWRenderWindow( ) const
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-GetScalarRange( double r[ 2 ] ) const
+ResetCameras( )
+{
+/*
+  this->m_XImage->ResetCamera( );
+  this->m_YImage->ResetCamera( );
+  this->m_ZImage->ResetCamera( );
+  this->m_3DView->ResetCamera( );
+*/
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+Render( )
+{
+/*
+  this->m_XImage->Render( );
+  this->m_YImage->Render( );
+  this->m_ZImage->Render( );
+  this->m_3DView->Render( );
+*/
+}
+
+// -------------------------------------------------------------------------
+std::set< std::string > cpExtensions::QT::SimpleMPRWidget::
+GetActorsNames( ) const
+{
+  std::set< std::string > names = this->m_XImage->GetActorsNames( );
+  std::set< std::string > y = this->m_YImage->GetActorsNames( );
+  std::set< std::string > z = this->m_ZImage->GetActorsNames( );
+  std::set< std::string > w = this->m_3DView->GetActorsNames( );
+  names.insert( y.begin( ), y.end( ) );
+  names.insert( z.begin( ), z.end( ) );
+  names.insert( w.begin( ), w.end( ) );
+  return( names );
+}
+
+// -------------------------------------------------------------------------
+bool cpExtensions::QT::SimpleMPRWidget::
+IsWindowLevelImageActor( const std::string& name ) const
+{
+  return( this->m_XImage->IsWindowLevelImageActor( name ) );
+}
+
+// -------------------------------------------------------------------------
+bool cpExtensions::QT::SimpleMPRWidget::
+IsLUTImageActor( const std::string& name ) const
+{
+  return( this->m_XImage->IsLUTImageActor( name ) );
+}
+
+// -------------------------------------------------------------------------
+bool cpExtensions::QT::SimpleMPRWidget::
+Is3DActor( const std::string& name ) const
+{
+  return(
+    this->m_XImage->Is3DActor( name ) || this->m_3DView->Is3DActor( name )
+    );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+GetScalarRange( const std::string& name, double r[ 2 ] ) const
 {
-//  this->m_XImage->GetScalarRange( r );
+  this->m_XImage->GetScalarRange( name, r );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-GetWindowLevel( double wl[ 2 ] ) const
+GetWindowLevel( const std::string& name, double wl[ 2 ] ) const
 {
-//  this->m_XImage->GetWindowLevel( wl );
+  this->m_XImage->GetWindowLevel( name, wl );
 }
 
 // -------------------------------------------------------------------------
 double cpExtensions::QT::SimpleMPRWidget::
-GetImageOpacity( ) const
+GetWindow( const std::string& name ) const
 {
-//  return( this->m_XImage->GetImageOpacity( ) );
+  return( this->m_XImage->GetWindow( name ) );
 }
 
 // -------------------------------------------------------------------------
-unsigned char cpExtensions::QT::SimpleMPRWidget::
-GetImageInterpolation( ) const
+double cpExtensions::QT::SimpleMPRWidget::
+GetLevel( const std::string& name ) const
 {
-//  return( this->m_XImage->GetImageInterpolation( ) );
+  return( this->m_XImage->GetLevel( name ) );
+}
+
+// -------------------------------------------------------------------------
+char cpExtensions::QT::SimpleMPRWidget::
+GetImageInterpolation( const std::string& name ) const
+{
+  return( this->m_XImage->GetImageInterpolation( name ) );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-SetScalarRange( double r[ 2 ] )
+GetColor( const std::string& name, double& r, double& g, double& b ) const
 {
-/*
-  this->m_XImage->SetScalarRange( r );
-  this->m_YImage->SetScalarRange( r );
-  this->m_ZImage->SetScalarRange( r );
-  this->m_3DView->SetScalarRange( r );
-*/
+  this->m_XImage->GetColor( name, r, g, b );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::QT::SimpleMPRWidget::
+GetOpacity( const std::string& name ) const
+{
+  return( this->m_XImage->GetOpacity( name ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::QT::SimpleMPRWidget::
+GetPointSize( const std::string& name ) const
+{
+  return( this->m_XImage->GetPointSize( name ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::QT::SimpleMPRWidget::
+GetLineWidth( const std::string& name ) const
+{
+  return( this->m_XImage->GetLineWidth( name ) );
+}
+
+// -------------------------------------------------------------------------
+int cpExtensions::QT::SimpleMPRWidget::
+GetRepresentation( const std::string& name ) const
+{
+  return( this->m_XImage->GetRepresentation( name ) );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-SetWindowLevel( double wl[ 2 ] )
+SetScalarRange( const std::string& name, double r[ 2 ] )
 {
-/*
-  this->m_XImage->SetWindowLevel( wl );
-  this->m_YImage->SetWindowLevel( wl );
-  this->m_ZImage->SetWindowLevel( wl );
-  this->m_3DView->SetWindowLevel( wl );
-*/
+  this->m_XImage->SetScalarRange( name, r );
+  this->m_YImage->SetScalarRange( name, r );
+  this->m_ZImage->SetScalarRange( name, r );
+  this->m_3DView->SetScalarRange( name, r );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-SetImageOpacity( double o )
+SetScalarRange( const std::string& name, double min, double max )
 {
-/*
-  this->m_XImage->SetImageOpacity( o );
-  this->m_YImage->SetImageOpacity( o );
-  this->m_ZImage->SetImageOpacity( o );
-  this->m_3DView->SetImageOpacity( o );
-*/
+  this->m_XImage->SetScalarRange( name, min, max );
+  this->m_YImage->SetScalarRange( name, min, max );
+  this->m_ZImage->SetScalarRange( name, min, max );
+  this->m_3DView->SetScalarRange( name, min, max );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-SetImageInterpolation( unsigned char i )
+SetWindowLevel( const std::string& name, double wl[ 2 ] )
 {
-  /*
-  this->m_XImage->SetImageInterpolation( i );
-  this->m_YImage->SetImageInterpolation( i );
-  this->m_ZImage->SetImageInterpolation( i );
-  this->m_3DView->SetImageInterpolation( i );
-*/
+  this->m_XImage->SetWindowLevel( name, wl );
+  this->m_YImage->SetWindowLevel( name, wl );
+  this->m_ZImage->SetWindowLevel( name, wl );
+  this->m_3DView->SetWindowLevel( name, wl );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-ResetCameras( )
+SetWindowLevel( const std::string& name, double w, double l )
 {
-/*
-  this->m_XImage->ResetCamera( );
-  this->m_YImage->ResetCamera( );
-  this->m_ZImage->ResetCamera( );
-  this->m_3DView->ResetCamera( );
-*/
+  this->m_XImage->SetWindowLevel( name, w, l );
+  this->m_YImage->SetWindowLevel( name, w, l );
+  this->m_ZImage->SetWindowLevel( name, w, l );
+  this->m_3DView->SetWindowLevel( name, w, l );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-Render( )
+SetWindow( const std::string& name, double w )
 {
-/*
-  this->m_XImage->Render( );
-  this->m_YImage->Render( );
-  this->m_ZImage->Render( );
-  this->m_3DView->Render( );
-*/
+  this->m_XImage->SetWindow( name, w );
+  this->m_YImage->SetWindow( name, w );
+  this->m_ZImage->SetWindow( name, w );
+  this->m_3DView->SetWindow( name, w );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-_SyncBottom( int a, int b )
+SetLevel( const std::string& name, double l )
 {
-  this->m_UI->Bottom->setSizes( this->m_UI->Top->sizes( ) );
+  this->m_XImage->SetLevel( name, l );
+  this->m_YImage->SetLevel( name, l );
+  this->m_ZImage->SetLevel( name, l );
+  this->m_3DView->SetLevel( name, l );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-_SyncTop( int a, int b )
+SetImageInterpolation( const std::string& name, char i )
 {
-  this->m_UI->Top->setSizes( this->m_UI->Bottom->sizes( ) );
+  this->m_XImage->SetImageInterpolation( name, i );
+  this->m_YImage->SetImageInterpolation( name, i );
+  this->m_ZImage->SetImageInterpolation( name, i );
+  this->m_3DView->SetImageInterpolation( name, i );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+SetColor( const std::string& name, double r, double g, double b )
+{
+  this->m_XImage->SetColor( name, r, g, b );
+  this->m_YImage->SetColor( name, r, g, b );
+  this->m_ZImage->SetColor( name, r, g, b );
+  this->m_3DView->SetColor( name, r, g, b );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+SetOpacity( const std::string& name, double o )
+{
+  this->m_XImage->SetOpacity( name, o );
+  this->m_YImage->SetOpacity( name, o );
+  this->m_ZImage->SetOpacity( name, o );
+  this->m_3DView->SetOpacity( name, o );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-_ConfigurationButton( )
+SetPointSize( const std::string& name, double s )
 {
-  auto dlg = new cpExtensions::QT::ConfigurationChooser( NULL );
-  dlg->setData( this );
-  dlg->exec( );
+  this->m_XImage->SetPointSize( name, s );
+  this->m_YImage->SetPointSize( name, s );
+  this->m_ZImage->SetPointSize( name, s );
+  this->m_3DView->SetPointSize( name, s );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+SetLineWidth( const std::string& name, double w )
+{
+  this->m_XImage->SetLineWidth( name, w );
+  this->m_YImage->SetLineWidth( name, w );
+  this->m_ZImage->SetLineWidth( name, w );
+  this->m_3DView->SetLineWidth( name, w );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+SetRepresentationToPoints( const std::string& name )
+{
+  this->m_XImage->SetRepresentationToPoints( name );
+  this->m_YImage->SetRepresentationToPoints( name );
+  this->m_ZImage->SetRepresentationToPoints( name );
+  this->m_3DView->SetRepresentationToPoints( name );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+SetRepresentationToSurface( const std::string& name )
+{
+  this->m_XImage->SetRepresentationToSurface( name );
+  this->m_YImage->SetRepresentationToSurface( name );
+  this->m_ZImage->SetRepresentationToSurface( name );
+  this->m_3DView->SetRepresentationToSurface( name );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+SetRepresentationToWireframe( const std::string& name )
+{
+  this->m_XImage->SetRepresentationToWireframe( name );
+  this->m_YImage->SetRepresentationToWireframe( name );
+  this->m_ZImage->SetRepresentationToWireframe( name );
+  this->m_3DView->SetRepresentationToWireframe( name );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+_SyncBottom( int a, int b )
+{
+  this->m_UI->Bottom->setSizes( this->m_UI->Top->sizes( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+_SyncTop( int a, int b )
+{
+  this->m_UI->Top->setSizes( this->m_UI->Bottom->sizes( ) );
 }
 
 #endif // cpExtensions_QT4
index 6403e45c50a728ee743de42c4114b736e55ac2f0..6d32fc9dc3a41360e9fb0dfdab4ad3a561942744 100644 (file)
@@ -5,7 +5,7 @@
 
 #ifdef cpExtensions_QT4
 
-// TODO: #include <cpExtensions/Visualization/MeshActor.h>
+#include <cpExtensions/QT/ActorsWidgetInterface.h>
 #include <QWidget>
 #include <vtkSmartPointer.h>
 #include <map>
@@ -29,13 +29,15 @@ namespace cpExtensions
     /**
      */
     class cpExtensions_EXPORT SimpleMPRWidget
-      : public QWidget
+      : public QWidget,
+        public ActorsWidgetInterface
     {
       Q_OBJECT;
 
     public:
-      typedef SimpleMPRWidget Self;
-      typedef QWidget         Superclass;
+      typedef SimpleMPRWidget       Self;
+      typedef QWidget               Superclass;
+      typedef ActorsWidgetInterface Superclass2;
 
       typedef vtkSmartPointer< vtkPropCollection > TProp;
       typedef std::set< TProp >                    TProps;
@@ -74,27 +76,45 @@ namespace cpExtensions
       vtkRenderWindow* GetWRenderWindow( );
       const vtkRenderWindow* GetWRenderWindow( ) const;
 
-      void GetScalarRange( double r[ 2 ] ) const;
-      void GetWindowLevel( double wl[ 2 ] ) const;
-      double GetImageOpacity( ) const;
-      unsigned char GetImageInterpolation( ) const;
-
-      void SetScalarRange( double r[ 2 ] );
-      void SetWindowLevel( double wl[ 2 ] );
-      void SetImageOpacity( double o );
-      void SetImageInterpolation( unsigned char i );
-
-      /* TODO
-         std::vector< vtkProp* > GetActors( const std::string& name ) const;
-      */
-
       void ResetCameras( );
       void Render( );
 
+      virtual std::set< std::string > GetActorsNames( ) const cpExtensions_OVERRIDE;
+      virtual bool IsWindowLevelImageActor( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual bool IsLUTImageActor( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual bool Is3DActor( const std::string& name ) const cpExtensions_OVERRIDE;
+
+      virtual void GetScalarRange( const std::string& name, double r[ 2 ] ) const cpExtensions_OVERRIDE;
+      virtual void GetWindowLevel( const std::string& name, double wl[ 2 ] ) const cpExtensions_OVERRIDE;
+      virtual double GetWindow( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual double GetLevel( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual char GetImageInterpolation( const std::string& name ) const cpExtensions_OVERRIDE;
+
+      virtual void GetColor( const std::string& name, double& r, double& g, double& b ) const cpExtensions_OVERRIDE;
+      virtual double GetOpacity( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual double GetPointSize( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual double GetLineWidth( const std::string& name ) const cpExtensions_OVERRIDE;
+      virtual int GetRepresentation( const std::string& name ) const cpExtensions_OVERRIDE;
+
+      virtual void SetScalarRange( const std::string& name, double r[ 2 ] ) cpExtensions_OVERRIDE;
+      virtual void SetScalarRange( const std::string& name, double min, double max ) cpExtensions_OVERRIDE;
+      virtual void SetWindowLevel( const std::string& name, double wl[ 2 ] ) cpExtensions_OVERRIDE;
+      virtual void SetWindowLevel( const std::string& name, double w, double l ) cpExtensions_OVERRIDE;
+      virtual void SetWindow( const std::string& name, double w ) cpExtensions_OVERRIDE;
+      virtual void SetLevel( const std::string& name, double l ) cpExtensions_OVERRIDE;
+      virtual void SetImageInterpolation( const std::string& name, char i ) cpExtensions_OVERRIDE;
+
+      virtual void SetColor( const std::string& name, double r, double g, double b ) cpExtensions_OVERRIDE;
+      virtual void SetOpacity( const std::string& name, double o ) cpExtensions_OVERRIDE;
+      virtual void SetPointSize( const std::string& name, double s ) cpExtensions_OVERRIDE;
+      virtual void SetLineWidth( const std::string& name, double w ) cpExtensions_OVERRIDE;
+      virtual void SetRepresentationToPoints( const std::string& name ) cpExtensions_OVERRIDE;
+      virtual void SetRepresentationToSurface( const std::string& name ) cpExtensions_OVERRIDE;
+      virtual void SetRepresentationToWireframe( const std::string& name ) cpExtensions_OVERRIDE;
+
     private slots:
       void _SyncBottom( int a, int b );
       void _SyncTop( int a, int b );
-      void _ConfigurationButton( );
 
     protected:
       Ui::SimpleMPRWidget* m_UI;
index fec88554e2643d079dab472a80ab2ae6e8fe8e4a..3f0750e33fe54b29b828d6cafd29db026681e9fb 100644 (file)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>94</width>
-    <height>40</height>
+    <width>495</width>
+    <height>394</height>
    </rect>
   </property>
   <property name="windowTitle">
      </widget>
     </widget>
    </item>
-   <item>
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <spacer name="horizontalSpacer">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QToolButton" name="ConfigurationButton">
-       <property name="minimumSize">
-        <size>
-         <width>20</width>
-         <height>20</height>
-        </size>
-       </property>
-       <property name="maximumSize">
-        <size>
-         <width>20</width>
-         <height>20</height>
-        </size>
-       </property>
-       <property name="text">
-        <string>...</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
   </layout>
  </widget>
  <resources/>
index c865f55d0a3d249646a7f7ac5211f9bc973d18b3..2c53bfefc0b289093548a753871be3b94ab0b9cf 100644 (file)
@@ -9,7 +9,9 @@
 cpExtensions::QT::WindowLevelImageConfiguration::
 WindowLevelImageConfiguration( QWidget* parent, Qt::WindowFlags f )
   : Superclass( parent, f ),
-    m_UI( new Ui::WindowLevelImageConfiguration )
+    m_UI( new Ui::WindowLevelImageConfiguration ),
+    m_Data( NULL ),
+    m_Name( "" )
 {
   this->m_UI->setupUi( this );
 }
@@ -23,16 +25,17 @@ cpExtensions::QT::WindowLevelImageConfiguration::
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::WindowLevelImageConfiguration::
-setData( SimpleMPRWidget* data )
+setData( ActorsWidgetInterface* data, const std::string& name )
 {
   if( this->m_Data != data )
   {
     this->m_Data = data;
+    this->m_Name = name;
 
     // Get data
     double range[ 2 ], win_lev[ 2 ];
-    this->m_Data->GetScalarRange( range );
-    this->m_Data->GetWindowLevel( win_lev );
+    this->m_Data->GetScalarRange( this->m_Name, range );
+    this->m_Data->GetWindowLevel( this->m_Name, win_lev );
 
     // Intensity range
     this->m_UI->MinimumBox->setMinimum( -1000000 );
@@ -66,7 +69,7 @@ setData( SimpleMPRWidget* data )
     this->m_UI->LevelSlider->setValue( l );
 
     // Opacity
-    double o = this->m_Data->GetImageOpacity( );
+    double o = this->m_Data->GetOpacity( this->m_Name );
     o *=
       double( this->m_UI->OpacitySlider->maximum( ) ) -
       double( this->m_UI->OpacitySlider->minimum( ) );
@@ -74,7 +77,7 @@ setData( SimpleMPRWidget* data )
     this->m_UI->OpacitySlider->setValue( o );
 
     // Interpolation mode
-    switch( this->m_Data->GetImageInterpolation( ) )
+    switch( this->m_Data->GetImageInterpolation( this->m_Name ) )
     {
     case 'L': this->m_UI->InterpolatorBox->setCurrentIndex( 1 ); break;
     case 'C': this->m_UI->InterpolatorBox->setCurrentIndex( 2 ); break;
@@ -125,7 +128,7 @@ _maximumValue( int v )
   double range[ 2 ];
   range[ 0 ] = double( this->m_UI->MinimumBox->value( ) );
   range[ 1 ] = double( v );
-  this->m_Data->SetScalarRange( range );
+  this->m_Data->SetScalarRange( this->m_Name, range );
 }
 
 // -------------------------------------------------------------------------
@@ -135,7 +138,7 @@ _minimumValue( int v )
   double range[ 2 ];
   range[ 0 ] = double( v );
   range[ 1 ] = double( this->m_UI->MaximumBox->value( ) );
-  this->m_Data->SetScalarRange( range );
+  this->m_Data->SetScalarRange( this->m_Name, range );
 }
 
 // -------------------------------------------------------------------------
@@ -145,7 +148,7 @@ _levelValue( int v )
   double r[ 2 ];
   double l, s;
 
-  this->m_Data->GetScalarRange( r );
+  this->m_Data->GetScalarRange( this->m_Name, r );
   if( this->sender( ) == this->m_UI->LevelSlider )
   {
     s = double( v ) / double( this->m_UI->LevelSlider->maximum( ) );
@@ -166,10 +169,7 @@ _levelValue( int v )
   this->m_UI->LevelBox->setValue( l );
   this->m_UI->LevelBox->blockSignals( b );
 
-  double wl[ 2 ];
-  this->m_Data->GetWindowLevel( wl );
-  wl[ 1 ] = l;
-  this->m_Data->SetWindowLevel( wl );
+  this->m_Data->SetLevel( this->m_Name, l );
 }
 
 // -------------------------------------------------------------------------
@@ -179,7 +179,7 @@ _windowValue( int v )
   double r[ 2 ];
   double w, s;
 
-  this->m_Data->GetScalarRange( r );
+  this->m_Data->GetScalarRange( this->m_Name, r );
   if( this->sender( ) == this->m_UI->WindowSlider )
   {
     s = double( v ) / double( this->m_UI->WindowSlider->maximum( ) );
@@ -200,10 +200,7 @@ _windowValue( int v )
   this->m_UI->WindowBox->setValue( w );
   this->m_UI->WindowBox->blockSignals( b );
 
-  double wl[ 2 ];
-  this->m_Data->GetWindowLevel( wl );
-  wl[ 0 ] = w;
-  this->m_Data->SetWindowLevel( wl );
+  this->m_Data->SetWindow( this->m_Name, w );
 }
 
 // -------------------------------------------------------------------------
@@ -217,7 +214,7 @@ _opacityValue( int v )
     o /=
       double( this->m_UI->OpacitySlider->maximum( ) ) -
       double( this->m_UI->OpacitySlider->minimum( ) );
-    this->m_Data->SetImageOpacity( o );
+    this->m_Data->SetOpacity( this->m_Name, o );
 
   } // fi
 }
@@ -228,9 +225,9 @@ _interpolatorValue( int v )
 {
   switch( v )
   {
-  case 1  : this->m_Data->SetImageInterpolation( 'L' ); break;
-  case 2  : this->m_Data->SetImageInterpolation( 'C' ); break;
-  default : this->m_Data->SetImageInterpolation( 'N' ); break;
+  case 1  : this->m_Data->SetImageInterpolation( this->m_Name, 'L' ); break;
+  case 2  : this->m_Data->SetImageInterpolation( this->m_Name, 'C' ); break;
+  default : this->m_Data->SetImageInterpolation( this->m_Name, 'N' ); break;
   } // hctiws
 }
 
index 665e741e8c87c9616e2b2dc617f30bfbb15c5eaa..c3984cafc9d63cc578d966ccc01a0cc4d39834be 100644 (file)
@@ -15,7 +15,7 @@ namespace cpExtensions
 {
   namespace QT
   {
-    class SimpleMPRWidget;
+    class ActorsWidgetInterface;
 
     /**
      */
@@ -34,7 +34,7 @@ namespace cpExtensions
         );
       virtual ~WindowLevelImageConfiguration( );
 
-      void setData( SimpleMPRWidget* data );
+      void setData( ActorsWidgetInterface* data, const std::string& name );
 
     protected slots:
       void _maximumValue( int v );
@@ -46,7 +46,8 @@ namespace cpExtensions
 
     protected:
       Ui::WindowLevelImageConfiguration* m_UI;
-      SimpleMPRWidget* m_Data;
+      ActorsWidgetInterface* m_Data;
+      std::string m_Name;
     };
 
   } // ecapseman