]> Creatis software - cpPlugins.git/commitdiff
Visual properties dialog finished.
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 30 May 2016 01:01:01 +0000 (20:01 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 30 May 2016 01:01:01 +0000 (20:01 -0500)
14 files changed:
appli/PipelineEditor/PipelineEditor.cxx
appli/PipelineEditor/PipelineEditor.h
appli/examples/plugins/QT/example_MPRViewer/example_MPRViewer.cxx
lib/cpExtensions/QT/SimpleMPRWidget.cxx
lib/cpExtensions/QT/SimpleMPRWidget.h
lib/cpPipelineEditor/BaseQtMainWindow.cxx
lib/cpPipelineEditor/BaseQtMainWindow.h
lib/cpPipelineEditor/Port.cxx
lib/cpPlugins/ActorPropertiesQtDialog.cxx [moved from lib/cpPlugins/DataObjectVisualizationQtDialog.cxx with 73% similarity]
lib/cpPlugins/ActorPropertiesQtDialog.h [moved from lib/cpPlugins/DataObjectVisualizationQtDialog.h with 55% similarity]
lib/cpPlugins/CMakeLists.txt
lib/cpPlugins/DataObject.cxx
lib/cpPlugins/DataObject.h
plugins/cpPluginsWidgets/SeedWidget.cxx

index 65fb82b7f816cd9c8403844a6c5e05b4bae47b7d..cd3876f7949dbc3de41414cd36f402f0da54c9fd 100644 (file)
@@ -25,6 +25,14 @@ PipelineEditor( int argc, char* argv[], QApplication* app, QWidget* parent )
     );
 
   // Connect actions to slots
+  this->connect(
+    this->m_UI->ActionBackgroundMPR, SIGNAL( triggered( ) ),
+    this, SLOT( _ActionBackgroundMPR( ) )
+    );
+  this->connect(
+    this->m_UI->ActionBackground3D, SIGNAL( triggered( ) ),
+    this, SLOT( _ActionBackground3D( ) )
+    );
   this->connect(
     this->m_UI->ButtonLoadPluginsFile, SIGNAL( clicked( ) ),
     this, SLOT( _InteractiveLoadPlugins( ) )
@@ -74,32 +82,28 @@ PipelineEditor::
   delete this->m_UI;
 }
 
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_ActionBackgroundMPR( )
+{
+  this->_BackgroundProperties( 4 );
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_ActionBackground3D( )
+{
+  this->_BackgroundProperties( 3 );
+}
+
 // -------------------------------------------------------------------------
 void PipelineEditor::
 _ShowFilterOutput(
   const std::string& filter_name, const std::string& output_name
   )
 {
-  // Update filter, if needed
   this->_ExecFilter( filter_name );
-
-  // Get output
-  auto output = this->m_Workspace.GetOutput( filter_name, output_name );
-  if( output == NULL )
-  {
-    QMessageBox::critical(
-      this,
-      QMessageBox::tr( "Error showing data" ),
-      QMessageBox::tr( "Unknown port name." )
-      );
-    return;
-
-  } // fi
-
-  // Create and associate actor
-  this->_Block( );
-  this->m_UI->Viewer->AddActor( output->GetVTKActor( ) );
-  this->_UnBlock( );
+  this->_ShowData( filter_name, output_name );
 }
 
 // -------------------------------------------------------------------------
@@ -108,21 +112,7 @@ _HideFilterOutput(
   const std::string& filter_name, const std::string& output_name
   )
 {
-  // Get output
-  /* TODO
-     auto filter = this->m_Workspace.GetFilter( filter_name );
-     if( filter != NULL )
-     {
-     auto output = filter->GetOutputData( output_name );
-     if( output != NULL )
-     {
-     std::string data_name = output_name + "@" + filter_name;
-     this->m_UI->Viewer->HideData( data_name );
-
-     } // fi
-
-     } // fi
-  */
+  this->_HideData( filter_name, output_name );
 }
 
 // -------------------------------------------------------------------------
@@ -131,35 +121,7 @@ _PropertiesFilterOutput(
   const std::string& filter_name, const std::string& output_name
   )
 {
-  /* TODO
-     auto filter = this->m_Workspace.GetFilter( filter_name );
-     if( filter != NULL )
-     {
-     auto output = filter->GetOutputData< vtkPolyData >( output_name );
-     if( output != NULL )
-     {
-     auto actor = this->m_UI->Viewer->GetActor( output );
-     if( actor != NULL )
-     {
-     cpExtensions::QT::PropertyWidget* wdg =
-     new cpExtensions::QT::PropertyWidget( NULL );
-     wdg->SetProp( actor );
-     wdg->SetRenderWindow(
-     this->m_UI->Viewer->GetInteractor( 3 )->GetRenderWindow( )
-     );
-     wdg->show( );
-
-     } // fi
-     }
-     else
-     QMessageBox::critical(
-     this,
-     QMessageBox::tr( "Error showing data" ),
-     QMessageBox::tr( "No known VTK conversion!" )
-     );
-
-     } // fi
-  */
+  this->_DataProperties( filter_name, output_name );
 }
 
 // eof - $RCSfile$
index 123f5e1776a8357ecd635225fd2a9e8e5dcbe5ca..770c89660a98245aa7742de46b26820300e8b229 100644 (file)
@@ -29,6 +29,8 @@ public:
   virtual ~PipelineEditor( );
 
 protected slots:
+  void _ActionBackgroundMPR( );
+  void _ActionBackground3D( );
   void _ShowFilterOutput(
     const std::string& filter_name, const std::string& output_name
     );
index eb6daff534ca78898aede3ee93e12029a4e2449f..cfb33b474c5e1f6bfc4ae009f7bf933f6f412ab2 100644 (file)
@@ -66,7 +66,8 @@ example_MPRViewer( int argc, char* argv[], QWidget* parent )
   } // yrt
 
   this->m_UI->Viewer->SetMainImage(
-    this->m_Reader->GetOutputData< vtkImageData >( "Output" )
+    this->m_Reader->GetOutputData< vtkImageData >( "Output" ),
+    "MainImage"
     );
 }
 
index 836bd7bdd7c9cb6765b856169925e43031d5c656..a020fb9e3d7e0c80207922e3827ae2016e131279 100644 (file)
@@ -3,6 +3,7 @@
 #ifdef cpExtensions_QT4
 
 #include <cpExtensions/ui_SimpleMPRWidget.h>
+#include <vtkRenderer.h>
 #include <vtkRenderWindow.h>
 
 // -------------------------------------------------------------------------
@@ -42,6 +43,7 @@ SimpleMPRWidget( QWidget* parent )
 cpExtensions::QT::SimpleMPRWidget::
 ~SimpleMPRWidget( )
 {
+  this->Clear( );
   delete this->m_UI;
 }
 
@@ -59,12 +61,12 @@ Clear( )
       this->m_3DSlices[ i ]->Clear( );
 
   } // rof
-  this->m_PolyDatas.clear( );
+  this->m_NamedActors.clear( );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-SetMainImage( vtkImageData* image )
+SetMainImage( vtkImageData* image, const std::string& name )
 {
   this->Clear( );
   for( unsigned int i = 0; i < 3; ++i )
@@ -85,13 +87,20 @@ SetMainImage( vtkImageData* image )
         )
       );
 
+    this->m_NamedActors[ name ].insert(
+      this->m_2DSlices[ i ]->GetImageActor( )
+      );
+    this->m_NamedActors[ name ].insert(
+      this->m_3DSlices[ i ]->GetImageActor( )
+      );
+
   } // rof
   this->_AssociateSlices( );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-SetMainActor( vtkImageActor* actor )
+SetMainActor( vtkImageActor* actor, const std::string& name )
 {
   this->Clear( );
   vtkImageData* image = NULL;
@@ -119,13 +128,20 @@ SetMainActor( vtkImageActor* actor )
         )
       );
 
+    this->m_NamedActors[ name ].insert(
+      this->m_2DSlices[ i ]->GetImageActor( )
+      );
+    this->m_NamedActors[ name ].insert(
+      this->m_3DSlices[ i ]->GetImageActor( )
+      );
+
   } // rof
   this->_AssociateSlices( );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-AddImage( vtkImageData* image )
+AddImage( vtkImageData* image, const std::string& name )
 {
   std::cerr << "SimpleMPR: adding image" << std::endl;
   std::exit( 1 );
@@ -133,7 +149,7 @@ AddImage( vtkImageData* image )
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-AddImageActor( vtkImageActor* actor )
+AddImageActor( vtkImageActor* actor, const std::string& name )
 {
   unsigned int i = 0;
   bool cont = true;
@@ -155,12 +171,12 @@ AddImageActor( vtkImageActor* actor )
 
   // Add if no actors were found
   if( cont )
-    this->SetMainActor( actor );
+    this->SetMainActor( actor, name );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-AddMesh( vtkPolyData* mesh )
+AddMesh( vtkPolyData* mesh, const std::string& name )
 {
   std::cerr << "SimpleMPR: adding mesh" << std::endl;
   std::exit( 1 );
@@ -194,29 +210,43 @@ AddMesh( vtkPolyData* mesh )
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-AddMeshActor( vtkProp3D* actor )
+AddMeshActor( vtkProp3D* actor, const std::string& name )
 {
   if( actor != NULL )
   {
     this->m_Renderers[ 3 ]->AddViewProp( actor );
     this->m_VTK[ 3 ]->GetRenderWindow( )->Render( );
+    this->m_NamedActors[ name ].insert( actor );
 
   } // fi
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::QT::SimpleMPRWidget::
-AddActor( vtkProp* actor )
+AddActor( vtkProp* actor, const std::string& name )
 {
   auto ia = dynamic_cast< vtkImageActor* >( actor );
   if( ia == NULL )
   {
     auto ma = dynamic_cast< vtkActor* >( actor );
     if( ma != NULL )
-      this->AddMeshActor( ma );
+      this->AddMeshActor( ma, name );
   }
   else
-    this->AddImageActor( ia );
+    this->AddImageActor( ia, name );
+}
+
+// -------------------------------------------------------------------------
+const cpExtensions::QT::SimpleMPRWidget::
+TActors& cpExtensions::QT::SimpleMPRWidget::
+GetActors( const std::string& name ) const
+{
+  static const TActors empty;
+  auto i = this->m_NamedActors.find( name );
+  if( i != this->m_NamedActors.end( ) )
+    return( i->second );
+  else
+    return( empty );
 }
 
 // -------------------------------------------------------------------------
index fefe1446e70fb86ac51fd417607e54dbaa0ed456..35307a4e69de730cbaac427b30cba4db524ac655 100644 (file)
@@ -6,11 +6,9 @@
 #ifdef cpExtensions_QT4
 
 #include <map>
+#include <set>
 #include <QWidget>
-#include <vtkPolyDataNormals.h>
-#include <vtkQuadricLODActor.h>
-#include <vtkRenderer.h>
-#include <vtkStripper.h>
+#include <vtkProp.h>
 #include <vtkSmartPointer.h>
 #include <cpExtensions/Visualization/ImageSliceActors.h>
 
@@ -39,55 +37,17 @@ namespace cpExtensions
     public:
       typedef SimpleMPRWidget Self;
 
-      typedef cpExtensions::Visualization::ImageSliceActors TSliceActors;
-
-      /**
-       */
-      struct PolyDataActor
+      struct TActorCmp
       {
-        vtkSmartPointer< vtkPolyData >        Data;
-        vtkSmartPointer< vtkPolyDataNormals > Normals;
-        vtkSmartPointer< vtkStripper >        Stripper;
-        vtkSmartPointer< vtkPolyDataMapper >  Mapper;
-        vtkSmartPointer< vtkActor >           Actor;
-
-        void Configure( vtkPolyData* data )
-          {
-            this->Data = data;
-            double r[ 2 ];
-            this->Data->GetScalarRange( r );
-
-            this->Normals  = vtkSmartPointer< vtkPolyDataNormals >::New( );
-            this->Stripper = vtkSmartPointer< vtkStripper >::New( );
-            this->Mapper   = vtkSmartPointer< vtkPolyDataMapper >::New( );
-            this->Normals->SetInputData( this->Data );
-            this->Normals->SetFeatureAngle( 60.0 );
-            this->Stripper->SetInputConnection(
-              this->Normals->GetOutputPort( )
-              );
-            this->Mapper->SetInputConnection(
-              this->Stripper->GetOutputPort( )
-              );
-            this->Mapper->UseLookupTableScalarRangeOff( );
-            this->Mapper->SetScalarRange( r[ 0 ], r[ 1 ] );
-
-            unsigned long nPolys = this->Data->GetNumberOfPolys( );
-            if( nPolys < cpExtensions_MAX_POLYS )
-            {
-              this->Actor = vtkSmartPointer< vtkActor >::New( );
-              this->Actor->SetMapper( this->Mapper );
-            }
-            else
-            {
-              vtkSmartPointer< vtkQuadricLODActor > actor =
-                vtkSmartPointer< vtkQuadricLODActor >::New( );
-              actor->SetMapper( this->Mapper );
-              actor->DeferLODConstructionOff( );
-              this->Actor = actor.GetPointer( );
-
-            } // fi
-          }
+        bool operator()(
+          const vtkSmartPointer< vtkProp >& a,
+          const vtkSmartPointer< vtkProp >& b
+          ) const
+          { return( a.GetPointer( ) < b.GetPointer( ) ); }
       };
+      typedef std::set< vtkSmartPointer< vtkProp >, TActorCmp >  TActors;
+      typedef std::map< std::string, TActors >              TNamedActors;
+      typedef cpExtensions::Visualization::ImageSliceActors TSliceActors;
 
     public:
       explicit SimpleMPRWidget( QWidget* parent = 0 );
@@ -95,23 +55,19 @@ namespace cpExtensions
 
       // Data management
       void Clear( );
-      void SetMainImage( vtkImageData* image );
-      void SetMainActor( vtkImageActor* actor );
-      void AddImage( vtkImageData* image );
-      void AddImageActor( vtkImageActor* actor );
-      void AddMesh( vtkPolyData* mesh );
-      void AddMeshActor( vtkProp3D* actor );
-      void AddActor( vtkProp* actor );
+      void SetMainImage( vtkImageData* image, const std::string& name );
+      void SetMainActor( vtkImageActor* actor, const std::string& name );
+      void AddImage( vtkImageData* image, const std::string& name );
+      void AddImageActor( vtkImageActor* actor, const std::string& name );
+      void AddMesh( vtkPolyData* mesh, const std::string& name );
+      void AddMeshActor( vtkProp3D* actor, const std::string& name );
+      void AddActor( vtkProp* actor, const std::string& name );
+      const TActors& GetActors( const std::string& name ) const;
 
       // Visual objects
       vtkRenderWindowInteractor* GetInteractor( unsigned int i );
       vtkRenderer* GetRenderer( unsigned int i );
       vtkRenderWindow* GetRenderWindow( unsigned int i );
-      /* TODO
-         std::vector< std::pair< vtkImageActor*, vtkRenderer* > >
-         GetMainImageActors( );
-         vtkActor* GetActor( vtkPolyData* mesh );
-      */
 
     protected:
       void _AssociateSlices( );
@@ -128,7 +84,7 @@ namespace cpExtensions
       vtkSmartPointer< TSliceActors > m_2DSlices[ 3 ];
       vtkSmartPointer< TSliceActors > m_3DSlices[ 3 ];
 
-      std::map< vtkPolyData*, PolyDataActor > m_PolyDatas;
+      TNamedActors m_NamedActors;
     };
 
   } // ecapseman
index b423294ff53e05073948b0c1c9d76b02dc981f33..8d4a98bf715526b61d57255df23ea8fb5ba2198f 100644 (file)
@@ -1,8 +1,11 @@
 #include <cpPipelineEditor/BaseQtMainWindow.h>
 
 #include <cpExtensions/QT/SimpleMPRWidget.h>
+#include <cpPlugins/ActorPropertiesQtDialog.h>
 #include <cpPipelineEditor/Editor.h>
+#include <vtkRenderer.h>
 #include <QApplication>
+#include <QColorDialog>
 #include <QDir>
 #include <QFileDialog>
 #include <QFileInfo>
@@ -41,7 +44,8 @@ BaseQtMainWindow(
     m_Application( app ),
     m_PluginsPath( "." ),
     m_TreeWidget( NULL ),
-    m_Editor( NULL )
+    m_Editor( NULL ),
+    m_MPR( NULL )
 {
   this->m_Interface.GuessAccesiblePlugins( );
 
@@ -77,6 +81,7 @@ _Configure(
     this->m_Editor->setWorkspace( &( this->m_Workspace ) );
   if( mpr != NULL )
     this->m_Workspace.SetMPRViewer( mpr );
+  this->m_MPR = mpr;
 }
 
 // -------------------------------------------------------------------------
@@ -236,6 +241,128 @@ _SaveWorkspace( const std::string& filename )
       );
 }
 
+// -------------------------------------------------------------------------
+void cpPipelineEditor::BaseQtMainWindow::
+_ShowData( const std::string& filter_name, const std::string& output_name )
+{
+  if( this->m_MPR == NULL )
+    return;
+  auto output = this->m_Workspace.GetOutput( filter_name, output_name );
+  if( output != NULL )
+  {
+    this->_Block( );
+    auto actor = output->GetVTKActor( );
+    if( actor != NULL )
+    {
+      this->m_MPR->AddActor(
+        actor, output_name + std::string( "@" ) + filter_name
+        );
+      this->_UnBlock( );
+    }
+    else
+    {
+      this->_UnBlock( );
+      QMessageBox::critical(
+        this,
+        QMessageBox::tr( "Error showing data" ),
+        QMessageBox::tr( "Unknown VTK conversion." )
+        );
+
+    } // fi
+  }
+  else
+    QMessageBox::critical(
+      this,
+      QMessageBox::tr( "Error showing data" ),
+      QMessageBox::tr( "Unknown port name." )
+      );
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::BaseQtMainWindow::
+_HideData( const std::string& filter, const std::string& output )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::BaseQtMainWindow::
+_DataProperties(
+  const std::string& filter_name, const std::string& output_name
+  )
+{
+  if( this->m_MPR == NULL )
+    return;
+  auto output = this->m_Workspace.GetOutput( filter_name, output_name );
+  if( output != NULL )
+  {
+    this->_Block( );
+    auto actors = this->m_MPR->GetActors(
+      output_name + std::string( "@" ) + filter_name
+      );
+    auto dlg = new cpPlugins::ActorPropertiesQtDialog( NULL );
+    for( auto i = actors.begin( ); i != actors.end( ); ++i )
+      dlg->addActor( *i );
+    dlg->addRenderWindow( this->m_MPR->GetRenderWindow( 0 ) );
+    dlg->addRenderWindow( this->m_MPR->GetRenderWindow( 1 ) );
+    dlg->addRenderWindow( this->m_MPR->GetRenderWindow( 2 ) );
+    dlg->addRenderWindow( this->m_MPR->GetRenderWindow( 3 ) );
+    this->_UnBlock( );
+    dlg->exec( );
+  }
+  else
+    QMessageBox::critical(
+      this,
+      QMessageBox::tr( "Error showing data" ),
+      QMessageBox::tr( "Unknown port name." )
+      );
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::BaseQtMainWindow::
+_BackgroundProperties( unsigned int i )
+{
+  QColor color =
+    QColorDialog::getColor(
+      QColor( 0, 0, 0 ),
+      this,
+      "Select Color",
+      QColorDialog::DontUseNativeDialog
+      );
+  if( color.isValid( ) )
+  {
+    double r = double( color.red( ) ) / double( 255 );
+    double g = double( color.green( ) ) / double( 255 );
+    double b = double( color.blue( ) ) / double( 255 );
+    if( i >= 4 )
+    {
+      unsigned int maxId = ( i == 4 )? 3: 4;
+      for( unsigned int j = 0; j < maxId; ++j )
+      {
+        auto ren = this->m_MPR->GetRenderer( j );
+        if( ren != NULL )
+        {
+          ren->SetBackground( r, g, b );
+          ren->Render( );
+
+        } // fi
+
+      } // rof
+    }
+    else
+    {
+      auto ren = this->m_MPR->GetRenderer( i );
+      if( ren != NULL )
+      {
+        ren->SetBackground( r, g, b );
+        ren->Render( );
+
+      } // fi
+
+    } // fi
+
+  } // fi
+}
+
 // -------------------------------------------------------------------------
 void cpPipelineEditor::BaseQtMainWindow::
 _InteractiveLoadPlugins( )
index fbcde2873e80ca3ac673c0ecbaa845dc4a54745a..7b4837d6f49aa2abe5cd97b81bf625ff69f5fc6e 100644 (file)
@@ -63,6 +63,17 @@ namespace cpPipelineEditor
     void _LoadWorkspace( const std::string& filename );
     void _SaveWorkspace( const std::string& filename );
 
+    void _ShowData(
+      const std::string& filter_name, const std::string& output_name
+      );
+    void _HideData(
+      const std::string& filter_name, const std::string& output_name
+      );
+    void _DataProperties(
+      const std::string& filter_name, const std::string& output_name
+      );
+    void _BackgroundProperties( unsigned int i );
+
   protected slots:
     void _InteractiveLoadPlugins( );
     void _InteractiveLoadPluginsFromPath( );
@@ -79,6 +90,7 @@ namespace cpPipelineEditor
 
     QTreeWidget* m_TreeWidget;
     Editor*      m_Editor;
+    cpExtensions::QT::SimpleMPRWidget* m_MPR;
   };
 
 } // ecapseman
index b0278eaecf1524078fc92462ed445170953c42e7..1eb2c78c637ee0b99dbdb220caa1ed23dfe485d1 100644 (file)
@@ -3,8 +3,6 @@
 #include "Block.h"\r
 #include "Editor.h"\r
 \r
-#include <cpPlugins/DataObjectVisualizationQtDialog.h>\r
-\r
 #include <QGraphicsScene>\r
 #include <QGraphicsSceneContextMenuEvent>\r
 #include <QFontMetrics>\r
@@ -296,19 +294,10 @@ contextMenuEvent( QGraphicsSceneContextMenuEvent* evt )
   }\r
   else if( selectedAction == propertiesAction )\r
   {\r
-    auto filter = this->m_Block->filter( );\r
-    auto name = this->name( ).toStdString( );\r
-    if( filter != NULL )\r
-    {\r
-      auto output = filter->GetOutput( name );\r
-      if( output != NULL )\r
-      {\r
-        auto dlg = output->CreateQtDialog( );\r
-        dlg->exec( );\r
-\r
-      } // fi\r
-\r
-    } // fi\r
+    this->m_Block->editor( )->visualPropertiesOutputData(\r
+      this->m_Block->namePort( ).toStdString( ),\r
+      this->name( ).toStdString( )\r
+      );\r
 \r
   } // fi\r
 }\r
similarity index 73%
rename from lib/cpPlugins/DataObjectVisualizationQtDialog.cxx
rename to lib/cpPlugins/ActorPropertiesQtDialog.cxx
index 7494eed3116ce07575d14644c2dde45b1f3d980a..eaed06a66ec736a44aea536a8bf09f9f208200dd 100644 (file)
@@ -1,14 +1,15 @@
-#include <cpPlugins/DataObjectVisualizationQtDialog.h>
+#include <cpPlugins/ActorPropertiesQtDialog.h>
 
+#ifdef cpPlugins_QT4
+
+#include <vtkActor.h>
+#include <vtkAxesActor.h>
 #include <vtkImageActor.h>
 #include <vtkImageData.h>
 #include <vtkImageProperty.h>
 #include <vtkMapper.h>
-#include <vtkPolyData.h>
 #include <vtkProperty.h>
 
-#ifdef cpPlugins_QT4
-
 #include <QCheckBox>
 #include <QColorDialog>
 #include <QDoubleSpinBox>
 #include <QSlider>
 
 // -------------------------------------------------------------------------
-cpPlugins::DataObjectVisualizationQtDialog::
-DataObjectVisualizationQtDialog( QWidget* parent, Qt::WindowFlags f )
+cpPlugins::ActorPropertiesQtDialog::
+ActorPropertiesQtDialog( QWidget* parent, Qt::WindowFlags f )
   : QDialog( parent, f ),
-    m_DataObject( NULL ),
     m_WidgetsUpdated( false )
 {
   this->m_Title = new QLabel( this );
@@ -31,34 +31,52 @@ DataObjectVisualizationQtDialog( QWidget* parent, Qt::WindowFlags f )
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::DataObjectVisualizationQtDialog::
-~DataObjectVisualizationQtDialog( )
+cpPlugins::ActorPropertiesQtDialog::
+~ActorPropertiesQtDialog( )
 {
+  this->m_Actors.clear( );
+  this->m_Windows.clear( );
   delete this->m_Title;
   delete this->m_ToolsLayout;
   delete this->m_MainLayout;
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::DataObject* cpPlugins::DataObjectVisualizationQtDialog::
-getDataObject( ) const
+bool cpPlugins::ActorPropertiesQtDialog::
+addActor( vtkProp* obj )
 {
-  return( this->m_DataObject );
+  if( obj == NULL )
+    return( false );
+
+  if( this->m_Actors.size( ) > 0 )
+  {
+    bool     s = this->_addActor< vtkAxesActor >( obj );
+    if( !s ) s = this->_addActor< vtkImageActor >( obj );
+    if( !s ) s = this->_addActor< vtkActor >( obj );
+    return( s );
+  }
+  else
+  {
+    this->m_Actors.insert( obj );
+    this->m_WidgetsUpdated = false;
+    return( true );
+
+  } // fi
 }
 
 // -------------------------------------------------------------------------
-bool cpPlugins::DataObjectVisualizationQtDialog::
-setDataObject( DataObject* obj )
+bool cpPlugins::ActorPropertiesQtDialog::
+addRenderWindow( vtkRenderWindow* win )
 {
-  if( this->m_DataObject != NULL || obj == NULL )
+  if( win == NULL )
     return( false );
-  this->m_DataObject = obj;
+  this->m_Windows.insert( win );
   this->m_WidgetsUpdated = false;
   return( true );
 }
 
 // -------------------------------------------------------------------------
-int cpPlugins::DataObjectVisualizationQtDialog::
+int cpPlugins::ActorPropertiesQtDialog::
 exec( )
 {
   this->_updateWidgets( );
@@ -73,7 +91,7 @@ exec( )
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _addButtons( )
 {
   // Add buttons
@@ -85,54 +103,70 @@ _addButtons( )
     this->m_Buttons, SIGNAL( rejected( ) ), this, SLOT( reject( ) )
     );
   this->m_ToolsLayout->addWidget( this->m_Buttons );
-  // TODO: this->updateView( );
   this->m_WidgetsUpdated = true;
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _updateWidgets( )
 {
-  if( this->m_WidgetsUpdated || this->m_DataObject == NULL )
+  if( this->m_WidgetsUpdated || this->m_Actors.size( ) == 0 )
     return;
+  bool     s = this->_configureForAxes( );
+  if( !s ) s = this->_configureForImage( );
+  if( !s ) s = this->_configureForMesh( );
+  this->_addButtons( );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::ActorPropertiesQtDialog::
+_configureForAxes( )
+{
+  if( this->m_Actors.size( ) == 0 )
+    return( false );
+  auto actor =
+    dynamic_cast< vtkAxesActor* >( this->m_Actors.begin( )->GetPointer( ) );
+  if( actor == NULL )
+    return( false );
 
   // Set dialog title
   std::stringstream title;
-  title
-    << "Parameters for an object of class \""
-    << this->m_DataObject->GetClassName( )
-    << "\"";
+  title << "Parameters for an object of class \"Axes\"";
   this->m_Title->setText( title.str( ).c_str( ) );
 
-  // Configure particular objects
-  this->_configureForImage( );
-  this->_configureForMesh( );
-
-  // Update values
-  this->_addButtons( );
+  return( true );
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+bool cpPlugins::ActorPropertiesQtDialog::
 _configureForImage( )
 {
-  /* TODO
-  auto image = this->m_DataObject->GetVTK< vtkImageData >( );
-  auto aIt = this->m_DataObject->BeginVTKActors( );
-  if( image == NULL || aIt == this->m_DataObject->EndVTKActors( ) )
-    return;
-  auto actor = dynamic_cast< vtkImageActor* >( aIt->Actor.GetPointer( ) );
+  if( this->m_Actors.size( ) == 0 )
+    return( false );
+  auto actor =
+    dynamic_cast< vtkImageActor* >( this->m_Actors.begin( )->GetPointer( ) );
   if( actor == NULL )
-    return;
-  
+    return( false );
+  auto image = actor->GetInput( );
+  if( image == NULL )
+    return( false );
+
+  // Get properties
+  auto prop = actor->GetProperty( );
   double r[ 2 ];
   image->GetScalarRange( r );
   double w = actor->GetProperty( )->GetColorWindow( );
   double l = actor->GetProperty( )->GetColorLevel( );
   double sw = double( 1000 ) * w / ( r[ 1 ] - r[ 0 ] );
   double sl = double( 1000 ) * ( l - r[ 0 ] ) / ( r[ 1 ] - r[ 0 ] );
-  double op = double( 10 ) * actor->GetProperty( )->GetOpacity( );
+  double op = double( 10 ) * prop->GetOpacity( );
+
+  // Set dialog title
+  std::stringstream title;
+  title << "Parameters for an object of class \"Image\"";
+  this->m_Title->setText( title.str( ).c_str( ) );
 
+  // Create widgets
   QDoubleSpinBox* win_box = new QDoubleSpinBox( this );
   win_box->setObjectName( "win_box" );
   win_box->setDecimals( 3 );
@@ -205,27 +239,33 @@ _configureForImage( )
   op_layout->addWidget( op_label );
   op_layout->addWidget( op_sld );
   this->m_ToolsLayout->addLayout( op_layout );
-*/
+
+  return( true );
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+bool cpPlugins::ActorPropertiesQtDialog::
 _configureForMesh( )
 {
-  /* TODO
-  auto mesh = this->m_DataObject->GetVTK< vtkPolyData >( );
-  auto aIt = this->m_DataObject->BeginVTKActors( );
-  if( mesh == NULL || aIt == this->m_DataObject->EndVTKActors( ) )
-    return;
-  auto actor = dynamic_cast< vtkActor* >( aIt->Actor.GetPointer( ) );
+  if( this->m_Actors.size( ) == 0 )
+    return( false );
+  auto actor =
+    dynamic_cast< vtkActor* >( this->m_Actors.begin( )->GetPointer( ) );
   if( actor == NULL )
-    return;
+    return( false );
+  auto prop = actor->GetProperty( );
 
+  // Set dialog title
+  std::stringstream title;
+  title << "Parameters for an object of class \"Mesh\"";
+  this->m_Title->setText( title.str( ).c_str( ) );
+
+  // Input boxes
   QSpinBox* ps_box = new QSpinBox( this );
   ps_box->setObjectName( "ps_box" );
   ps_box->setMinimum( 1 );
   ps_box->setMaximum( 100 );
-  ps_box->setValue( actor->GetProperty( )->GetPointSize( ) );
+  ps_box->setValue( prop->GetPointSize( ) );
   ps_box->connect(
     ps_box, SIGNAL( valueChanged( int ) ),
     this, SLOT( _boxPointSize( int ) )
@@ -242,7 +282,7 @@ _configureForMesh( )
   lw_box->setObjectName( "lw_box" );
   lw_box->setMinimum( 1 );
   lw_box->setMaximum( 100 );
-  lw_box->setValue( actor->GetProperty( )->GetLineWidth( ) );
+  lw_box->setValue( prop->GetLineWidth( ) );
   lw_box->connect(
     lw_box, SIGNAL( valueChanged( int ) ),
     this, SLOT( _boxLineWidth( int ) )
@@ -269,7 +309,7 @@ _configureForMesh( )
   this->m_ToolsLayout->addLayout( sv_layout );
 
   double cr, cg, cb;
-  actor->GetProperty( )->GetColor( cr, cg, cb );
+  prop->GetColor( cr, cg, cb );
   cr *= double( 255 );
   cg *= double( 255 );
   cb *= double( 255 );
@@ -295,7 +335,7 @@ _configureForMesh( )
   op_sld->setObjectName( "op_sld" );
   op_sld->setRange( 0, 10 );
   op_sld->setValue(
-    ( unsigned int )( actor->GetProperty( )->GetOpacity( ) * double( 10 ) )
+    ( unsigned int )( prop->GetOpacity( ) * double( 10 ) )
     );
   op_sld->connect(
     op_sld, SIGNAL( valueChanged( int ) ),
@@ -308,20 +348,20 @@ _configureForMesh( )
   op_layout->addWidget( op_label );
   op_layout->addWidget( op_sld );
   this->m_ToolsLayout->addLayout( op_layout );
-*/
+
+  return( true );
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _setWindow( double w )
 {
-  /* TODO
-  if( this->m_DataObject == NULL )
+  if( this->m_Actors.size( ) == 0 )
     return;
-  auto aIt = this->m_DataObject->BeginVTKActors( );
-  for( ; aIt != this->m_DataObject->EndVTKActors( ); ++aIt )
+  auto aIt = this->m_Actors.begin( );
+  for( ; aIt != this->m_Actors.end( ); ++aIt )
   {
-    auto actor = dynamic_cast< vtkImageActor* >( aIt->Actor.GetPointer( ) );
+    auto actor = dynamic_cast< vtkImageActor* >( aIt->GetPointer( ) );
     if( actor != NULL )
     {
       actor->GetProperty( )->SetColorWindow( w );
@@ -331,20 +371,18 @@ _setWindow( double w )
 
   } // rof
   this->_render( );
-*/
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _setLevel( double l )
 {
-  /* TODO
-  if( this->m_DataObject == NULL )
+  if( this->m_Actors.size( ) == 0 )
     return;
-  auto aIt = this->m_DataObject->BeginVTKActors( );
-  for( ; aIt != this->m_DataObject->EndVTKActors( ); ++aIt )
+  auto aIt = this->m_Actors.begin( );
+  for( ; aIt != this->m_Actors.end( ); ++aIt )
   {
-    auto actor = dynamic_cast< vtkImageActor* >( aIt->Actor.GetPointer( ) );
+    auto actor = dynamic_cast< vtkImageActor* >( aIt->GetPointer( ) );
     if( actor != NULL )
     {
       actor->GetProperty( )->SetColorLevel( l );
@@ -354,22 +392,36 @@ _setLevel( double l )
 
   } // rof
   this->_render( );
-*/
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _render( )
 {
-  /* TODO
-  if( this->m_DataObject == NULL )
-    return;
-  this->m_DataObject->RenderVTKActors( );
-*/
+  for( auto i = this->m_Windows.begin( ); i != this->m_Windows.end( ); ++i )
+    ( *i )->Render( );
+}
+
+// -------------------------------------------------------------------------
+template< class _TActor >
+bool cpPlugins::ActorPropertiesQtDialog::
+_addActor( vtkProp* obj )
+{
+  auto new_obj = dynamic_cast< _TActor* >( obj );
+  auto pre_obj =
+    dynamic_cast< _TActor* >( this->m_Actors.begin( )->GetPointer( ) );
+  if( new_obj != NULL && pre_obj != NULL )
+  {
+    this->m_Actors.insert( obj );
+    this->m_WidgetsUpdated = false;
+    return( true );
+  }
+  else
+    return( false );
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _boxWindow( double v )
 {
   auto* box = this->findChild< QDoubleSpinBox* >( "win_box" );
@@ -391,7 +443,7 @@ _boxWindow( double v )
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _sldWindow( int v )
 {
   auto* box = this->findChild< QDoubleSpinBox* >( "win_box" );
@@ -413,7 +465,7 @@ _sldWindow( int v )
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _boxLevel( double v )
 {
   auto* box = this->findChild< QDoubleSpinBox* >( "lev_box" );
@@ -435,7 +487,7 @@ _boxLevel( double v )
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _sldLevel( int v )
 {
   auto* box = this->findChild< QDoubleSpinBox* >( "lev_box" );
@@ -457,11 +509,10 @@ _sldLevel( int v )
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _sldOpacity( int v )
 {
-  /* TODO
-  if( this->m_DataObject == NULL )
+  if( this->m_Actors.size( ) == 0 )
     return;
   auto* sld = this->findChild< QSlider* >( "op_sld" );
   if( sld == NULL )
@@ -471,11 +522,11 @@ _sldOpacity( int v )
   double max = double( sld->maximum( ) );
   double s = ( double( v ) - min ) / ( max - min );
 
-  auto aIt = this->m_DataObject->BeginVTKActors( );
-  for( ; aIt != this->m_DataObject->EndVTKActors( ); ++aIt )
+  auto aIt = this->m_Actors.begin( );
+  for( ; aIt != this->m_Actors.end( ); ++aIt )
   {
-    auto ia = dynamic_cast< vtkImageActor* >( aIt->Actor.GetPointer( ) );
-    auto ma = dynamic_cast< vtkActor* >( aIt->Actor.GetPointer( ) );
+    auto ia = dynamic_cast< vtkImageActor* >( aIt->GetPointer( ) );
+    auto ma = dynamic_cast< vtkActor* >( aIt->GetPointer( ) );
     if( ia != NULL )
     {
       ia->GetProperty( )->SetOpacity( s );
@@ -490,27 +541,25 @@ _sldOpacity( int v )
 
   } // rof
   this->_render( );
-*/
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _boxPointSize( int v )
 {
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _boxLineWidth( int v )
 {
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _scalarVisibility( int v )
 {
-  /* TODO
-  if( this->m_DataObject == NULL )
+  if( this->m_Actors.size( ) == 0 )
     return;
   auto* btn = this->findChild< QPushButton* >( "color_button" );
   auto* chk = this->findChild< QCheckBox* >( "sv_box" );
@@ -523,10 +572,10 @@ _scalarVisibility( int v )
   rgb[ 1 ] = double( color.green( ) ) / double( 255 );
   rgb[ 2 ] = double( color.blue( ) ) / double( 255 );
 
-  auto aIt = this->m_DataObject->BeginVTKActors( );
-  for( ; aIt != this->m_DataObject->EndVTKActors( ); ++aIt )
+  auto aIt = this->m_Actors.begin( );
+  for( ; aIt != this->m_Actors.end( ); ++aIt )
   {
-    auto ma = dynamic_cast< vtkActor* >( aIt->Actor.GetPointer( ) );
+    auto ma = dynamic_cast< vtkActor* >( aIt->GetPointer( ) );
     if( ma != NULL )
     {
       if( !( chk->isChecked( ) ) )
@@ -542,15 +591,13 @@ _scalarVisibility( int v )
 
   } // rof
   this->_render( );
-*/
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::DataObjectVisualizationQtDialog::
+void cpPlugins::ActorPropertiesQtDialog::
 _color( )
 {
-  /* TODO
-  if( this->m_DataObject == NULL )
+  if( this->m_Actors.size( ) == 0 )
     return;
   auto* btn = this->findChild< QPushButton* >( "color_button" );
   auto* chk = this->findChild< QCheckBox* >( "sv_box" );
@@ -574,7 +621,6 @@ _color( )
     this->_scalarVisibility( 0 );
 
   } // fi
-*/
 }
 
 #endif // cpPlugins_QT4
similarity index 55%
rename from lib/cpPlugins/DataObjectVisualizationQtDialog.h
rename to lib/cpPlugins/ActorPropertiesQtDialog.h
index a26b7badfd191e7edb868e55e02e3dc517df6e0f..ca45b57f396941775404cd995b42c128db84ab57 100644 (file)
@@ -1,13 +1,14 @@
-#ifndef __CPPLUGINS__DATAOBJECTVISUALIZATIONQTDIALOG__H__
-#define __CPPLUGINS__DATAOBJECTVISUALIZATIONQTDIALOG__H__
+#ifndef __CPPLUGINS__ACTORPROPERTIESQTDIALOG__H__
+#define __CPPLUGINS__ACTORPROPERTIESQTDIALOG__H__
 
 #include <cpPlugins/Config.h>
 
 #ifdef cpPlugins_QT4
 
-#include <cpPlugins/DataObject.h>
-
 #include <set>
+#include <vtkProp.h>
+#include <vtkRenderWindow.h>
+#include <vtkSmartPointer.h>
 
 #include <QApplication>
 #include <QDialog>
 #include <QLabel>
 #include <QVBoxLayout>
 
+class vtkProp;
+
 namespace cpPlugins
 {
   /**
    */
-  class cpPlugins_EXPORT DataObjectVisualizationQtDialog
+  class cpPlugins_EXPORT ActorPropertiesQtDialog
     : public QDialog
   {
     Q_OBJECT;
 
   public:
-    DataObjectVisualizationQtDialog(
+    template< class _TObj >
+    struct TCmp
+    {
+      bool operator()(
+        const vtkSmartPointer< _TObj >& a,
+        const vtkSmartPointer< _TObj >& b ) const
+        { return( a.GetPointer( ) < b.GetPointer( ) ); }
+    };
+    typedef vtkSmartPointer< vtkProp >                         TActor;
+    typedef vtkSmartPointer< vtkRenderWindow >                 TRenderWindow;
+    typedef std::set< TActor, TCmp< vtkProp > >                TActors;
+    typedef std::set< TRenderWindow, TCmp< vtkRenderWindow > > TWindows;
+
+  public:
+    ActorPropertiesQtDialog(
       QWidget* parent = 0, Qt::WindowFlags f = 0
       );
-    virtual ~DataObjectVisualizationQtDialog( );
-
-    DataObject* getDataObject( ) const;
-    virtual bool setDataObject( DataObject* obj );
+    virtual ~ActorPropertiesQtDialog( );
 
+    virtual bool addActor( vtkProp* obj );
+    virtual bool addRenderWindow( vtkRenderWindow* win );
     virtual int exec( );
 
   protected:
     virtual void _addButtons( );
     virtual void _updateWidgets( );
 
-    virtual void _configureForImage( );
-    virtual void _configureForMesh( );
+    virtual bool _configureForAxes( );
+    virtual bool _configureForImage( );
+    virtual bool _configureForMesh( );
 
     void _setWindow( double w );
     void _setLevel( double l );
     void _render( );
 
+    template< class _TActor >
+      inline bool _addActor( vtkProp* obj );
+
   protected slots:
     void _boxWindow( double v );
     void _sldWindow( int v );
@@ -77,7 +97,8 @@ namespace cpPlugins
     */
 
   protected:
-    DataObject* m_DataObject;
+    TActors  m_Actors;
+    TWindows m_Windows;
     bool m_WidgetsUpdated;
     QLabel* m_Title;
     QGridLayout* m_MainLayout;
@@ -89,6 +110,6 @@ namespace cpPlugins
 
 #endif // cpPlugins_QT4
 
-#endif // __CPPLUGINS__DATAOBJECTVISUALIZATIONQTDIALOG__H__
+#endif // __CPPLUGINS__ACTORPROPERTIESQTDIALOG__H__
 
 // eof - $RCSfile$
index 55ffd24eec6e93e399f05d186889f52e1a0255db..7817df1e7a9fcf49673be79da35b725cb51de73b 100644 (file)
@@ -32,12 +32,12 @@ IF(USE_QT4)
     )
   SET(
     lib_QT_Headers
-    DataObjectVisualizationQtDialog.h
+    ActorPropertiesQtDialog.h
     ParametersQtDialog.h
     )
   SET(
     lib_QT_Sources
-    DataObjectVisualizationQtDialog.cxx
+    ActorPropertiesQtDialog.cxx
     ParametersQtDialog.cxx
     )
   SET(
index e51ddaf5fd6d354605076015edc080f7a54a4cc2..06806b56fd483ec689154d733c05fd710802bd6d 100644 (file)
@@ -1,7 +1,6 @@
 #include <cpPlugins/DataObject.h>
 
 #include <cpPlugins/ProcessObject.h>
-#include <cpPlugins/DataObjectVisualizationQtDialog.h>
 #include <itkDataObject.h>
 #include <vtkImageData.h>
 #include <vtkPolyData.h>
@@ -66,24 +65,6 @@ DisconnectFromPipeline( )
   this->Modified( );
 }
 
-// -------------------------------------------------------------------------
-cpPlugins::DataObjectVisualizationQtDialog* cpPlugins::DataObject::
-CreateQtDialog( )
-{
-#ifdef cpPlugins_QT4
-  DataObjectVisualizationQtDialog* dlg = NULL;
-  if( QApplication::instance( ) != NULL )
-  {
-    dlg = new DataObjectVisualizationQtDialog( );
-    dlg->setDataObject( this );
-
-  } // fi
-  return( dlg );
-#else // cpPlugins_QT4  
-  return( NULL );
-#endif // cpPlugins_QT4
-}
-
 // -------------------------------------------------------------------------
 vtkProp* cpPlugins::DataObject::
 GetVTKActor( )
index ae98879f94e2eb1ded5ff9e284c6928419fd2938..998a91487697e7cfd65faa8f98400753cfa9c059 100644 (file)
@@ -10,7 +10,6 @@ namespace cpPlugins
 {
   // Some forward declarations
   class ProcessObject;
-  class DataObjectVisualizationQtDialog;
 
   /**
    */
@@ -35,9 +34,6 @@ namespace cpPlugins
 
     void DisconnectFromPipeline( );
 
-    // Qt dialog creation
-    virtual DataObjectVisualizationQtDialog* CreateQtDialog( );
-
     // VTK actors
     vtkProp* GetVTKActor( );
     const vtkProp* GetVTKActor( ) const;
index 18bcdeb4b4fac7f2983268dd0bd47f20203ad48f..40b251b8178a995eb741a364488e09ab387513b3 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <vtkCommand.h>
 #include <vtkProperty.h>
+#include <vtkRenderer.h>
 #include <vtkRenderWindowInteractor.h>
 #include <cpExtensions/QT/SimpleMPRWidget.h>