]> Creatis software - cpMesh.git/commitdiff
... master
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 23 Sep 2015 07:28:43 +0000 (09:28 +0200)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 23 Sep 2015 07:28:43 +0000 (09:28 +0200)
CMakeLists.txt
appli/InteractiveDeformableMeshSegmentation/MainWnd.cxx
appli/InteractiveDeformableMeshSegmentation/MainWnd.h
appli/InteractiveDeformableMeshSegmentation/MainWnd_ExecutePlugins.cxx
appli/InteractiveDeformableMeshSegmentation/MainWnd_LoadPlugins.cxx
lib/cpm/Plugins/Host.cxx
lib/cpm/Plugins/SimpleFillRegion.h

index 231d94c2dc2ef02625034a8933bcde43fba442d9..f8f39eeb40399f303224a75d49e3c55649e0695f 100644 (file)
@@ -26,7 +26,7 @@ PROJECT(cpMesh)
 ## = Options =
 ## ===========
 
 ## = Options =
 ## ===========
 
-OPTION(BUILD_EXAMPLES "Build demos" OFF)
+## OPTION(BUILD_EXAMPLES "Build demos" OFF)
 OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
 OPTION(BUILD_FINAL_APPLICATION "Build final application" ON)
 
 OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
 OPTION(BUILD_FINAL_APPLICATION "Build final application" ON)
 
index 8e55c5a2815c320e3a6f69ef3f5f107c5e292049..548f87e5a9996f4f73464beb41a2735e1bc0f6a2 100644 (file)
@@ -25,6 +25,8 @@
 
 // -------------------------------------------------------------------------
 MainWnd::MainWnd( QWidget* parent )
 
 // -------------------------------------------------------------------------
 MainWnd::MainWnd( QWidget* parent )
+{}
+  /*
   : QMainWindow( parent ),
     m_UI( new Ui::MainWnd ),
     m_InputImage( NULL ),
   : QMainWindow( parent ),
     m_UI( new Ui::MainWnd ),
     m_InputImage( NULL ),
@@ -53,10 +55,9 @@ MainWnd::MainWnd( QWidget* parent )
   this->m_DoubleClickCommand =
     vtkSmartPointer< DoubleClickCommand >::New( );
   this->m_DoubleClickCommand->SetMainWnd( this );
   this->m_DoubleClickCommand =
     vtkSmartPointer< DoubleClickCommand >::New( );
   this->m_DoubleClickCommand->SetMainWnd( this );
-  this->m_MPR->AddDoubleClickObserver( this->m_DoubleClickCommand );
+  // this->m_MPR->AddDoubleClickObserver( this->m_DoubleClickCommand );
 
   // Orientation marks
 
   // Orientation marks
-  /* TODO
      vtkSmartPointer< vtkAnnotatedCubeActor > oCube =
      vtkSmartPointer< vtkAnnotatedCubeActor >::New( );
      oCube->GetCubeProperty( )->SetColor( 0.9, 0.7, 0.2 );
      vtkSmartPointer< vtkAnnotatedCubeActor > oCube =
      vtkSmartPointer< vtkAnnotatedCubeActor >::New( );
      oCube->GetCubeProperty( )->SetColor( 0.9, 0.7, 0.2 );
@@ -99,7 +100,6 @@ MainWnd::MainWnd( QWidget* parent )
      SetInteractor( this->m_UI->m_3DVTK->GetInteractor( ) );
      this->m_3DOrientationWidget->SetEnabled( 1 );
      this->m_3DOrientationWidget->InteractiveOff( );
      SetInteractor( this->m_UI->m_3DVTK->GetInteractor( ) );
      this->m_3DOrientationWidget->SetEnabled( 1 );
      this->m_3DOrientationWidget->InteractiveOff( );
-  */
 
   // Qt signals <-> slots
   IDMS_QT_ACTION( ReloadPlugins );
 
   // Qt signals <-> slots
   IDMS_QT_ACTION( ReloadPlugins );
@@ -121,63 +121,63 @@ MainWnd::MainWnd( QWidget* parent )
   // Start: load all disponible plugins
   this->_triggered_actionReloadPlugins( );
 }
   // Start: load all disponible plugins
   this->_triggered_actionReloadPlugins( );
 }
-
+*/
 // -------------------------------------------------------------------------
 MainWnd::
 ~MainWnd( )
 {
 // -------------------------------------------------------------------------
 MainWnd::
 ~MainWnd( )
 {
-  // Close all connections
-  this->m_Plugins.UnloadAll( );
-
-  // Delete objects
-  delete this->m_UI;
-  delete this->m_MPR;
-  if( this->m_ActiveParameters != NULL )
-  {
-    this->m_ActiveParameters->close( );
-    delete this->m_ActiveParameters;
-
-  } // fi
-  if( this->m_ActivePlugin != NULL ) delete this->m_ActivePlugin;
-  if( this->m_InputImage != NULL ) delete this->m_InputImage;
-  if( this->m_SegmentedImage != NULL ) delete this->m_SegmentedImage;
+//   // Close all connections
+//   this->m_Plugins.UnloadAll( );
+
+//   // Delete objects
+//   delete this->m_UI;
+//   // delete this->m_MPR;
+//   if( this->m_ActiveParameters != NULL )
+//   {
+//     this->m_ActiveParameters->close( );
+//     delete this->m_ActiveParameters;
+
+//   } // fi
+//   if( this->m_ActivePlugin != NULL ) delete this->m_ActivePlugin;
+//   if( this->m_InputImage != NULL ) delete this->m_InputImage;
+//   if( this->m_SegmentedImage != NULL ) delete this->m_SegmentedImage;
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _LoadApplicationPreferences( )
 {
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _LoadApplicationPreferences( )
 {
-  this->m_ApplicationPreferences.clear( );
-  std::ifstream in( this->m_ApplicationPreferencesFile.c_str( ) );
-  if( in )
-  {
-    std::string line;
-    std::getline( in, line );
-    while( !( in.eof( ) ) )
-    {
-      long pos = line.find_last_of( "=" );
-      std::string key = line.substr( 0, pos );
-      std::string value = line.substr( pos + 1 );
-      key.erase(
-        std::remove_if( key.begin( ), key.end( ), isspace ), key.end( )
-        );
-      value.erase(
-        std::remove_if( value.begin( ), value.end( ), isspace ), value.end( )
-        );
-      this->m_ApplicationPreferences[ key ] = value;
-      std::getline( in, line );
-
-    } // elihw
-  }
-  else
-  {
-    this->m_ApplicationPreferences[ "data_dimensions" ] = "3";
-    this->m_ApplicationPreferences[ "input_image_type" ]  = "short";
-    this->m_ApplicationPreferences[ "segmented_image_type" ]  = "uchar";
-    this->m_ApplicationPreferences[ "mesh_type" ]  = "double";
-
-  } // fi
-  in.close( );
+//   this->m_ApplicationPreferences.clear( );
+//   std::ifstream in( this->m_ApplicationPreferencesFile.c_str( ) );
+//   if( in )
+//   {
+//     std::string line;
+//     std::getline( in, line );
+//     while( !( in.eof( ) ) )
+//     {
+//       long pos = line.find_last_of( "=" );
+//       std::string key = line.substr( 0, pos );
+//       std::string value = line.substr( pos + 1 );
+//       key.erase(
+//         std::remove_if( key.begin( ), key.end( ), isspace ), key.end( )
+//         );
+//       value.erase(
+//         std::remove_if( value.begin( ), value.end( ), isspace ), value.end( )
+//         );
+//       this->m_ApplicationPreferences[ key ] = value;
+//       std::getline( in, line );
+
+//     } // elihw
+//   }
+//   else
+//   {
+//     this->m_ApplicationPreferences[ "data_dimensions" ] = "3";
+//     this->m_ApplicationPreferences[ "input_image_type" ]  = "short";
+//     this->m_ApplicationPreferences[ "segmented_image_type" ]  = "uchar";
+//     this->m_ApplicationPreferences[ "mesh_type" ]  = "double";
+
+//   } // fi
+//   in.close( );
 }
 
 // -------------------------------------------------------------------------
 }
 
 // -------------------------------------------------------------------------
@@ -185,235 +185,239 @@ MainWnd::
 TPluginImage* MainWnd::
 _LoadImage( const std::string& image_type, const std::string& image_dim )
 {
 TPluginImage* MainWnd::
 _LoadImage( const std::string& image_type, const std::string& image_dim )
 {
-  // Show dialog and check if it was accepted
-  QFileDialog dialog( this );
-  dialog.setFileMode( QFileDialog::ExistingFiles );
-  dialog.setDirectory( tr( this->m_LastOpenedFile.c_str( ) ) );
-  dialog.setNameFilter(
-    tr( "Medical image files (*.mhd *.bin *.dcm);;All files (*)" )
-    );
-  dialog.setDefaultSuffix( tr( "mhd" ) );
-  if( !( dialog.exec( ) ) )
-    return( NULL );
-
-  TPluginImage* ret = NULL;
-  unsigned int nFiles = dialog.selectedFiles( ).size( );
-  if( nFiles == 1 )
-  {
-    if( this->m_BaseClasses[ "ImageReader" ] == "" )
-    {
-      QMessageBox::critical(
-        this,
-        tr( "No plugin to read a single image file found!" ),
-        tr( "No plugin to read a single image file found!" )
-        );
-      return( ret );
-
-    } // fi
-
-    std::string fname = dialog.selectedFiles( ).at( 0 ).toStdString( );
-    this->m_LastOpenedFile = fname;
-
-    TPlugin* reader =
-      dynamic_cast< TPlugin* >(
-        this->m_Plugins.CreateObject( this->m_BaseClasses[ "ImageReader" ] )
-        );
-
-    TParameters reader_params = reader->GetDefaultParameters( );
-    reader_params[ "FileName" ].second = fname;
-    reader_params[ "PixelType" ].second = image_type;
-    reader_params[ "ImageDimension" ].second = image_dim;
-    reader_params[ "IsColorImage" ].second = "0";
-    reader->SetParameters( reader_params );
-    std::string err = reader->Update( );
-
-    if( err == "" )
-    {
-      ret = dynamic_cast< TPluginImage* >( reader->GetOutput( 0 ) );
-      reader->DisconnectOutputs( );
-    }
-    else
-      QMessageBox::critical(
-        this,
-        tr( "Error reading single image" ),
-        tr( err.c_str( ) )
-        );
-    delete reader;
-  }
-  else if( nFiles > 1 )
-  {
-    /* TODO
-       if( this->m_ImageSeriesReaderClassName == "" )
-       {
-       QMessageBox::critical(
-       this,
-       tr( "No plugin to read an image series found!" ),
-       tr( "No plugin to read an image series found!" )
-       );
-       return( ret );
-
-       } // fi
-       std::string fname = dialog.selectedFiles( ).at( 0 ).toStdString( );
-       this->m_LastOpenedFile = fname;
-    */
-
-  } // fi
-  return( ret );
+//   // Show dialog and check if it was accepted
+//   QFileDialog dialog( this );
+//   dialog.setFileMode( QFileDialog::ExistingFiles );
+//   dialog.setDirectory( tr( this->m_LastOpenedFile.c_str( ) ) );
+//   dialog.setNameFilter(
+//     tr( "Medical image files (*.mhd *.bin *.dcm);;All files (*)" )
+//     );
+//   dialog.setDefaultSuffix( tr( "mhd" ) );
+//   if( !( dialog.exec( ) ) )
+//     return( NULL );
+
+//   TPluginImage* ret = NULL;
+//   unsigned int nFiles = dialog.selectedFiles( ).size( );
+//   if( nFiles == 1 )
+//   {
+//     if( this->m_BaseClasses[ "ImageReader" ] == "" )
+//     {
+//       QMessageBox::critical(
+//         this,
+//         tr( "No plugin to read a single image file found!" ),
+//         tr( "No plugin to read a single image file found!" )
+//         );
+//       return( ret );
+
+//     } // fi
+
+//     std::string fname = dialog.selectedFiles( ).at( 0 ).toStdString( );
+//     this->m_LastOpenedFile = fname;
+
+//     TPlugin* reader =
+//       dynamic_cast< TPlugin* >(
+//         this->m_Plugins.CreateObject( this->m_BaseClasses[ "ImageReader" ] )
+//         );
+
+//     TParameters reader_params = reader->GetDefaultParameters( );
+//     reader_params[ "FileName" ].second = fname;
+//     reader_params[ "PixelType" ].second = image_type;
+//     reader_params[ "ImageDimension" ].second = image_dim;
+//     reader_params[ "IsColorImage" ].second = "0";
+//     reader->SetParameters( reader_params );
+//     std::string err = reader->Update( );
+
+//     if( err == "" )
+//     {
+//       ret = dynamic_cast< TPluginImage* >( reader->GetOutput( 0 ) );
+//       reader->DisconnectOutputs( );
+//     }
+//     else
+//       QMessageBox::critical(
+//         this,
+//         tr( "Error reading single image" ),
+//         tr( err.c_str( ) )
+//         );
+//     delete reader;
+//   }
+//   else if( nFiles > 1 )
+//   {
+//     /* TODO
+//        if( this->m_ImageSeriesReaderClassName == "" )
+//        {
+//        QMessageBox::critical(
+//        this,
+//        tr( "No plugin to read an image series found!" ),
+//        tr( "No plugin to read an image series found!" )
+//        );
+//        return( ret );
+
+//        } // fi
+//        std::string fname = dialog.selectedFiles( ).at( 0 ).toStdString( );
+//        this->m_LastOpenedFile = fname;
+//     */
+
+//   } // fi
+//   return( ret );
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _UpdateEnabledFlags( )
 {
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _UpdateEnabledFlags( )
 {
-  bool img = ( this->m_InputImage != NULL );
-  this->m_UI->menuSegmentInputImage->setEnabled( img );
-  this->m_UI->actionOpenSegmentedImage->setEnabled( img );
-  this->m_UI->m_3DVTK->setEnabled( img );
-  this->m_UI->m_XPlaneVTK->setEnabled( img );
-  this->m_UI->m_YPlaneVTK->setEnabled( img );
-  this->m_UI->m_ZPlaneVTK->setEnabled( img );
-  this->m_UI->m_AuxVTK->setEnabled( img );
-
-  bool seg = ( this->m_SegmentedImage != NULL );
-  this->m_UI->menuFilterSegmentedImage->setEnabled( seg );
-  this->m_UI->menuExtractMesh->setEnabled( seg );
-  this->m_UI->menuProcessMesh->setEnabled( seg );
-  this->m_UI->actionOpenMesh->setEnabled( seg );
-
-  this->m_UI->actionNavigation->setEnabled( img && seg );
-  this->m_UI->actionSegmentationInteractiveDeformation->
-    setEnabled( img && seg );
+//   bool img = ( this->m_InputImage != NULL );
+//   this->m_UI->menuSegmentInputImage->setEnabled( img );
+//   this->m_UI->actionOpenSegmentedImage->setEnabled( img );
+//   this->m_UI->m_3DVTK->setEnabled( img );
+//   this->m_UI->m_XPlaneVTK->setEnabled( img );
+//   this->m_UI->m_YPlaneVTK->setEnabled( img );
+//   this->m_UI->m_ZPlaneVTK->setEnabled( img );
+//   this->m_UI->m_AuxVTK->setEnabled( img );
+
+//   bool seg = ( this->m_SegmentedImage != NULL );
+//   this->m_UI->menuFilterSegmentedImage->setEnabled( seg );
+//   this->m_UI->menuExtractMesh->setEnabled( seg );
+//   this->m_UI->menuProcessMesh->setEnabled( seg );
+//   this->m_UI->actionOpenMesh->setEnabled( seg );
+
+//   this->m_UI->actionNavigation->setEnabled( img && seg );
+//   this->m_UI->actionSegmentationInteractiveDeformation->
+//     setEnabled( img && seg );
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _triggered_actionReloadPlugins( )
 {
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _triggered_actionReloadPlugins( )
 {
-  if( !( this->_LoadPlugins( ) ) )
-  {
-    QMessageBox::critical(
-      this,
-      tr( "Could not load plugins from given file." ),
-      tr( "Could not load plugins from given file." )
-      );
-
-  } // fi
-  this->_UpdateEnabledFlags( );
+//   if( !( this->_LoadPlugins( ) ) )
+//   {
+//     QMessageBox::critical(
+//       this,
+//       tr( "Could not load plugins from given file." ),
+//       tr( "Could not load plugins from given file." )
+//       );
+
+//   } // fi
+//   this->_UpdateEnabledFlags( );
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _triggered_actionOpenInputImage( )
 {
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _triggered_actionOpenInputImage( )
 {
-  if( this->m_InputImage != NULL )
-    delete this->m_InputImage;
-  this->m_InputImage =
-    this->_LoadImage(
-      this->m_ApplicationPreferences[ "input_image_type" ],
-      this->m_ApplicationPreferences[ "data_dimensions" ]
-      );
-  if( this->m_InputImage != NULL )
-  {
-    this->m_MPR->SetImage( this->m_InputImage->GetVTKImageData( ) );
-
-    // Update activations
-    this->_UpdateEnabledFlags( );
-    this->m_UI->actionNavigation->setChecked( true );
-    this->_triggered_actionSwitchMode( );
-
-  } // fi
+//   if( this->m_InputImage != NULL )
+//     delete this->m_InputImage;
+//   this->m_InputImage =
+//     this->_LoadImage(
+//       this->m_ApplicationPreferences[ "input_image_type" ],
+//       this->m_ApplicationPreferences[ "data_dimensions" ]
+//       );
+//   if( this->m_InputImage != NULL )
+//   {
+//     // this->m_MPR->SetImage( this->m_InputImage->GetVTKImageData( ) );
+
+//     // Update activations
+//     this->_UpdateEnabledFlags( );
+//     this->m_UI->actionNavigation->setChecked( true );
+//     this->_triggered_actionSwitchMode( );
+
+//   } // fi
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _triggered_actionOpenSegmentedImage( )
 {
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _triggered_actionOpenSegmentedImage( )
 {
-  if( this->m_SegmentedImage != NULL )
-    delete this->m_SegmentedImage;
-  this->m_SegmentedImage =
-    this->_LoadImage(
-      this->m_ApplicationPreferences[ "segmented_image_type" ],
-      this->m_ApplicationPreferences[ "data_dimensions" ]
-      );
-  if( this->m_SegmentedImage != NULL )
-  {
-    this->m_MPR->SetSegmentation(
-      this->m_SegmentedImage->GetVTKImageData( )
-      );
-    /* TODO
-       cpPlugins::Interface::Image* img = 
-       dynamic_cast< cpPlugins::Interface::Image* >( this->m_SegmentedImage );
-       this->m_ImageActors->SetSegmentation( img->GetVTKImageData( ) );
-    */
-
-    // Ok, start!
-    this->m_MPR->Render( 0 );
-    this->m_MPR->Render( 1 );
-    this->m_MPR->Render( 2 );
-    this->_UpdateEnabledFlags( );
-
-  } // fi
+//   if( this->m_SegmentedImage != NULL )
+//     delete this->m_SegmentedImage;
+//   this->m_SegmentedImage =
+//     this->_LoadImage(
+//       this->m_ApplicationPreferences[ "segmented_image_type" ],
+//       this->m_ApplicationPreferences[ "data_dimensions" ]
+//       );
+//   if( this->m_SegmentedImage != NULL )
+//   {
+//     /*
+//     this->m_MPR->SetSegmentation(
+//       this->m_SegmentedImage->GetVTKImageData( )
+//       );
+//       */
+//     /* TODO
+//        cpPlugins::Interface::Image* img = 
+//        dynamic_cast< cpPlugins::Interface::Image* >( this->m_SegmentedImage );
+//        this->m_ImageActors->SetSegmentation( img->GetVTKImageData( ) );
+//     */
+
+//     // Ok, start!
+//     /*
+//     this->m_MPR->Render( 0 );
+//     this->m_MPR->Render( 1 );
+//     this->m_MPR->Render( 2 );
+//     */
+//     this->_UpdateEnabledFlags( );
+
+//   } // fi
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _triggered_actionSwitchMode( )
 {
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _triggered_actionSwitchMode( )
 {
-  QAction* snd = dynamic_cast< QAction* >( this->sender( ) );
-  if( snd == this->m_UI->actionNavigation )
-  {
-    this->m_UI->actionSegmentationInteractiveDeformation->setChecked(
-      !( this->m_UI->actionNavigation->isChecked( ) )
-      );
-  }
-  else if( snd == this->m_UI->actionSegmentationInteractiveDeformation )
-  {
-    this->m_UI->actionNavigation->setChecked(
-      !( this->m_UI->actionSegmentationInteractiveDeformation->isChecked( ) )
-      );
-  }
-  else
-  {
-    this->m_UI->actionNavigation->setChecked( true );
-    this->m_UI->actionSegmentationInteractiveDeformation->setChecked( false );
-
-  } // fi
-
-  /* TODO
-     if( this->m_UI->aNavigation->isChecked( ) )
-     {
-     this->m_XStyle->SetModeToNavigation( );
-     this->m_YStyle->SetModeToNavigation( );
-     this->m_ZStyle->SetModeToNavigation( );
-     this->m_ImageActors->HideRegion( 0 );
-     this->m_ImageActors->HideRegion( 1 );
-     this->m_ImageActors->HideRegion( 2 );
-     this->m_3DRenderer->RemoveActor(
-     this->m_ImageActors->GetCursorActor( )
-     );
-     this->m_3DRenderer->RemoveActor(
-     this->m_ImageActors->GetRegionActor( )
-     );
-     this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
-     }
-     else if( this->m_UI->aSegmentationInteractiveDeformation->isChecked( ) )
-     {
-     this->m_XStyle->SetModeToDeformation( );
-     this->m_YStyle->SetModeToDeformation( );
-     this->m_ZStyle->SetModeToDeformation( );
-     this->m_ImageActors->ShowRegion( 0 );
-     this->m_ImageActors->ShowRegion( 1 );
-     this->m_ImageActors->ShowRegion( 2 );
-     this->m_3DRenderer->AddActor(
-     this->m_ImageActors->GetCursorActor( )
-     );
-     this->m_3DRenderer->AddActor(
-     this->m_ImageActors->GetRegionActor( )
-     );
-     this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
-
-     } // fi
-  */
+//   QAction* snd = dynamic_cast< QAction* >( this->sender( ) );
+//   if( snd == this->m_UI->actionNavigation )
+//   {
+//     this->m_UI->actionSegmentationInteractiveDeformation->setChecked(
+//       !( this->m_UI->actionNavigation->isChecked( ) )
+//       );
+//   }
+//   else if( snd == this->m_UI->actionSegmentationInteractiveDeformation )
+//   {
+//     this->m_UI->actionNavigation->setChecked(
+//       !( this->m_UI->actionSegmentationInteractiveDeformation->isChecked( ) )
+//       );
+//   }
+//   else
+//   {
+//     this->m_UI->actionNavigation->setChecked( true );
+//     this->m_UI->actionSegmentationInteractiveDeformation->setChecked( false );
+
+//   } // fi
+
+//   /* TODO
+//      if( this->m_UI->aNavigation->isChecked( ) )
+//      {
+//      this->m_XStyle->SetModeToNavigation( );
+//      this->m_YStyle->SetModeToNavigation( );
+//      this->m_ZStyle->SetModeToNavigation( );
+//      this->m_ImageActors->HideRegion( 0 );
+//      this->m_ImageActors->HideRegion( 1 );
+//      this->m_ImageActors->HideRegion( 2 );
+//      this->m_3DRenderer->RemoveActor(
+//      this->m_ImageActors->GetCursorActor( )
+//      );
+//      this->m_3DRenderer->RemoveActor(
+//      this->m_ImageActors->GetRegionActor( )
+//      );
+//      this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
+//      }
+//      else if( this->m_UI->aSegmentationInteractiveDeformation->isChecked( ) )
+//      {
+//      this->m_XStyle->SetModeToDeformation( );
+//      this->m_YStyle->SetModeToDeformation( );
+//      this->m_ZStyle->SetModeToDeformation( );
+//      this->m_ImageActors->ShowRegion( 0 );
+//      this->m_ImageActors->ShowRegion( 1 );
+//      this->m_ImageActors->ShowRegion( 2 );
+//      this->m_3DRenderer->AddActor(
+//      this->m_ImageActors->GetCursorActor( )
+//      );
+//      this->m_3DRenderer->AddActor(
+//      this->m_ImageActors->GetRegionActor( )
+//      );
+//      this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
+
+//      } // fi
+//   */
 }
 
 // -------------------------------------------------------------------------
 }
 
 // -------------------------------------------------------------------------
index 1fe195996954b07c30002aed7486e824c09b209a..8f2cd1fff7c83e89a1011988d859468cf20d35d8 100644 (file)
@@ -20,7 +20,7 @@
 #include <cpPlugins/Interface/ProcessObject.h>
 #include <cpPlugins/Interface/Image.h>
 #include <cpPlugins/Interface/DataObject.h>
 #include <cpPlugins/Interface/ProcessObject.h>
 #include <cpPlugins/Interface/Image.h>
 #include <cpPlugins/Interface/DataObject.h>
-#include <cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.h>
+// #include <cpPlugins/Extensions/Visualization/MPRWithDifferentWindows.h>
 
 // -------------------------------------------------------------------------
 class MainWnd;
 
 // -------------------------------------------------------------------------
 class MainWnd;
@@ -79,7 +79,7 @@ public:
   typedef cpPlugins::Interface::Image         TPluginImage;
   typedef cpPlugins::Interface::ProcessObject TPlugin;
   typedef cpPlugins::Interface::Parameters    TParameters;
   typedef cpPlugins::Interface::Image         TPluginImage;
   typedef cpPlugins::Interface::ProcessObject TPlugin;
   typedef cpPlugins::Interface::Parameters    TParameters;
-  typedef cpPlugins::Extensions::Visualization::MPRWithDifferentWindows TMPR;
+  // typedef cpPlugins::Extensions::Visualization::MPRWithDifferentWindows TMPR;
 
   typedef std::map< std::string, std::string > TStringMap;
 
 
   typedef std::map< std::string, std::string > TStringMap;
 
@@ -152,6 +152,7 @@ private slots:
   */
 
 private:
   */
 
 private:
+  /*
   Ui::MainWnd* m_UI;
 
   // Application preferences
   Ui::MainWnd* m_UI;
 
   // Application preferences
@@ -176,7 +177,7 @@ private:
   TPluginImage* m_SegmentedImage;
 
   // Visualization stuff
   TPluginImage* m_SegmentedImage;
 
   // Visualization stuff
-  TMPR* m_MPR;
+  // TMPR* m_MPR;
 
   // Active plugin
   TPlugin* m_ActivePlugin;
 
   // Active plugin
   TPlugin* m_ActivePlugin;
@@ -185,6 +186,7 @@ private:
   Self::PluginCategory m_ActivePluginCategory;
 
   vtkSmartPointer< DoubleClickCommand > m_DoubleClickCommand;
   Self::PluginCategory m_ActivePluginCategory;
 
   vtkSmartPointer< DoubleClickCommand > m_DoubleClickCommand;
+  */
 };
 
 #endif // __MAINWND__H__
 };
 
 #endif // __MAINWND__H__
index cbbfac64d213a9884fbe31df39da5466529e14b0..a22dd626232f627f6bf9c2a1015a4bb3e94f3185 100644 (file)
 bool MainWnd::
 _ParametersDialog( const TParameters& parameters )
 {
 bool MainWnd::
 _ParametersDialog( const TParameters& parameters )
 {
-  if( this->m_ActiveParameters != NULL ) 
-    this->m_ActiveParameters->close( );
-  this->m_ActiveParameters = new QWidget( NULL );
-  this->m_ActiveParameters->setWindowFlags( Qt::FramelessWindowHint ); 
-  this->m_ActiveParameters->setWindowFlags( Qt::WindowTitleHint );
-
-  QGridLayout* gridLayout = new QGridLayout( this->m_ActiveParameters );
-  QVBoxLayout* verticalLayout = new QVBoxLayout( );
-
-  // Put values
-  QLabel* title = new QLabel( this->m_ActiveParameters );
-  title->setText( this->m_ActivePlugin->GetClassName( ).c_str( ) );
-  verticalLayout->addWidget( title );
-
-  TParameters::const_iterator pIt = parameters.begin( );
-  for( ; pIt != parameters.end( ); ++pIt )
-  {
-    std::string par_name = pIt->first;
-    std::string par_type = pIt->second.first;
-    std::string par_value = pIt->second.second;
-
-    if( par_type == "double" )
-    {
-      QHBoxLayout* horizontalLayout = new QHBoxLayout( );
-      QLabel* label = new QLabel( this->m_ActiveParameters );
-      label->setText( QString( par_name.c_str( ) ) );
-      horizontalLayout->addWidget( label );
-
-      QDoubleSpinBox* v_double =
-        new QDoubleSpinBox( this->m_ActiveParameters );
-      v_double->setDecimals( 3 );
-      v_double->setMinimum( -( std::numeric_limits< double >::max( ) ) );
-      v_double->setMaximum( std::numeric_limits< double >::max( ) );
-      v_double->setValue( std::atof( par_value.c_str( ) ) );
-      v_double->setObjectName( QString( par_name.c_str( ) ) );
-      horizontalLayout->addWidget( v_double );
-      verticalLayout->addLayout( horizontalLayout );
-
-    } // fi
-
-  } // rof
-  gridLayout->addLayout( verticalLayout, 0, 0, 1, 1 );
-
-  // Infere plugin type
-  TParameters::const_iterator seedIt = parameters.find( "Seed" );
-  TParameters::const_iterator radiusIt = parameters.find( "Radius" );
-  TParameters::const_iterator endIt = parameters.end( );
-  if( seedIt == endIt && radiusIt == endIt )
-    this->m_ActivePluginType = Self::GlobalPluginType;
-  else if( seedIt != endIt && radiusIt == endIt )
-    this->m_ActivePluginType = Self::DoubleClickPluginType;
-  else if( seedIt != endIt && radiusIt != endIt )
-    this->m_ActivePluginType = Self::SpherePluginType;
-  else
-    this->m_ActivePluginType = Self::NonePluginType;
-
-  QMetaObject::connectSlotsByName( this->m_ActiveParameters );
-  this->m_ActiveParameters->show( );
-
-  return( false );
+//   if( this->m_ActiveParameters != NULL ) 
+//     this->m_ActiveParameters->close( );
+//   this->m_ActiveParameters = new QWidget( NULL );
+//   this->m_ActiveParameters->setWindowFlags( Qt::FramelessWindowHint ); 
+//   this->m_ActiveParameters->setWindowFlags( Qt::WindowTitleHint );
+
+//   QGridLayout* gridLayout = new QGridLayout( this->m_ActiveParameters );
+//   QVBoxLayout* verticalLayout = new QVBoxLayout( );
+
+//   // Put values
+//   QLabel* title = new QLabel( this->m_ActiveParameters );
+//   title->setText( this->m_ActivePlugin->GetClassName( ).c_str( ) );
+//   verticalLayout->addWidget( title );
+
+//   TParameters::const_iterator pIt = parameters.begin( );
+//   for( ; pIt != parameters.end( ); ++pIt )
+//   {
+//     std::string par_name = pIt->first;
+//     std::string par_type = pIt->second.first;
+//     std::string par_value = pIt->second.second;
+
+//     if( par_type == "double" )
+//     {
+//       QHBoxLayout* horizontalLayout = new QHBoxLayout( );
+//       QLabel* label = new QLabel( this->m_ActiveParameters );
+//       label->setText( QString( par_name.c_str( ) ) );
+//       horizontalLayout->addWidget( label );
+
+//       QDoubleSpinBox* v_double =
+//         new QDoubleSpinBox( this->m_ActiveParameters );
+//       v_double->setDecimals( 3 );
+//       v_double->setMinimum( -( std::numeric_limits< double >::max( ) ) );
+//       v_double->setMaximum( std::numeric_limits< double >::max( ) );
+//       v_double->setValue( std::atof( par_value.c_str( ) ) );
+//       v_double->setObjectName( QString( par_name.c_str( ) ) );
+//       horizontalLayout->addWidget( v_double );
+//       verticalLayout->addLayout( horizontalLayout );
+
+//     } // fi
+
+//   } // rof
+//   gridLayout->addLayout( verticalLayout, 0, 0, 1, 1 );
+
+//   // Infere plugin type
+//   TParameters::const_iterator seedIt = parameters.find( "Seed" );
+//   TParameters::const_iterator radiusIt = parameters.find( "Radius" );
+//   TParameters::const_iterator endIt = parameters.end( );
+//   if( seedIt == endIt && radiusIt == endIt )
+//     this->m_ActivePluginType = Self::GlobalPluginType;
+//   else if( seedIt != endIt && radiusIt == endIt )
+//     this->m_ActivePluginType = Self::DoubleClickPluginType;
+//   else if( seedIt != endIt && radiusIt != endIt )
+//     this->m_ActivePluginType = Self::SpherePluginType;
+//   else
+//     this->m_ActivePluginType = Self::NonePluginType;
+
+//   QMetaObject::connectSlotsByName( this->m_ActiveParameters );
+//   this->m_ActiveParameters->show( );
+
+//   return( false );
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _ExecuteDoubleClickPlugin( const double* pnt )
 {
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _ExecuteDoubleClickPlugin( const double* pnt )
 {
-  if(
-    this->m_InputImage == NULL ||
-    this->m_SegmentedImage == NULL ||
-    this->m_ActivePlugin == NULL ||
-    this->m_ActiveParameters == NULL ||
-    this->m_ActivePluginType != Self::DoubleClickPluginType
-    )
-    return;
-
-  TParameters parameters = this->m_ActivePlugin->GetDefaultParameters( );
-
-  // Variable parameters
-  for(
-    TParameters::iterator pIt = parameters.begin( );
-    pIt != parameters.end( );
-    ++pIt
-    )
-  {
-    if( pIt->first != "Seed" )
-    {
-      if( pIt->second.first == "double" )
-      {
-        QDoubleSpinBox* v_double = this->m_ActiveParameters->
-          findChild< QDoubleSpinBox* >( pIt->first.c_str( ) );
-        if( v_double != NULL )
-          parameters[ pIt->first ] =
-            TParameter( "double", v_double->text( ).toStdString( ) );
+//   if(
+//     this->m_InputImage == NULL ||
+//     this->m_SegmentedImage == NULL ||
+//     this->m_ActivePlugin == NULL ||
+//     this->m_ActiveParameters == NULL ||
+//     this->m_ActivePluginType != Self::DoubleClickPluginType
+//     )
+//     return;
+
+//   TParameters parameters = this->m_ActivePlugin->GetDefaultParameters( );
+
+//   // Variable parameters
+//   for(
+//     TParameters::iterator pIt = parameters.begin( );
+//     pIt != parameters.end( );
+//     ++pIt
+//     )
+//   {
+//     if( pIt->first != "Seed" )
+//     {
+//       if( pIt->second.first == "double" )
+//       {
+//         QDoubleSpinBox* v_double = this->m_ActiveParameters->
+//           findChild< QDoubleSpinBox* >( pIt->first.c_str( ) );
+//         if( v_double != NULL )
+//           parameters[ pIt->first ] =
+//             TParameter( "double", v_double->text( ).toStdString( ) );
         
         
-      } // fi
-
-    } // fi
-
-  } // rof
-
-  // Seed
-  std::stringstream seed_str;
-  seed_str << pnt[ 0 ] << ":" << pnt[ 1 ] << ":" << pnt[ 2 ];
-  parameters[ "Seed" ] = TParameter( "point", seed_str.str( ) );
-
-  // Execute
-  this->m_ActivePlugin->SetParameters( parameters );
-  this->m_ActivePlugin->SetInput( 0, this->m_InputImage );
-  this->m_ActivePlugin->SetInput( 1, this->m_SegmentedImage );
-  std::string err = this->m_ActivePlugin->Update( );
-  if( err != "" )
-  {
-    QMessageBox::critical( this, tr( "Error caugth!" ), tr( err.c_str( ) ) );
-    return;
-
-  } // fi
-
-  // Join results
-  itk::DataObject* s = this->m_SegmentedImage->GetDataObject( );
-  if( dynamic_cast< itk::Image< char, 3 >* >( s ) != NULL )
-    this->_JoinSegmentations< char >( );
-  else if( dynamic_cast< itk::Image< short, 3 >* >( s ) != NULL )
-    this->_JoinSegmentations< short >( );
-  else if( dynamic_cast< itk::Image< int, 3 >* >( s ) != NULL )
-    this->_JoinSegmentations< int >( );
-  else if( dynamic_cast< itk::Image< long, 3 >* >( s ) != NULL )
-    this->_JoinSegmentations< long >( );
-  else if( dynamic_cast< itk::Image< unsigned char, 3 >* >( s ) != NULL )
-    this->_JoinSegmentations< unsigned char >( );
-  else if( dynamic_cast< itk::Image< unsigned short, 3 >* >( s ) != NULL )
-    this->_JoinSegmentations< unsigned short >( );
-  else if( dynamic_cast< itk::Image< unsigned int, 3 >* >( s ) != NULL )
-    this->_JoinSegmentations< unsigned int >( );
-  else if( dynamic_cast< itk::Image< unsigned long, 3 >* >( s ) != NULL )
-    this->_JoinSegmentations< unsigned long >( );
-
-  // Update visualization
-  this->m_SegmentedImage->UpdateVTKImageData( );
-  this->m_MPR->Render( 0 );
-  this->m_MPR->Render( 1 );
-  this->m_MPR->Render( 2 );
+//       } // fi
+
+//     } // fi
+
+//   } // rof
+
+//   // Seed
+//   std::stringstream seed_str;
+//   seed_str << pnt[ 0 ] << ":" << pnt[ 1 ] << ":" << pnt[ 2 ];
+//   parameters[ "Seed" ] = TParameter( "point", seed_str.str( ) );
+
+//   // Execute
+//   this->m_ActivePlugin->SetParameters( parameters );
+//   this->m_ActivePlugin->SetInput( 0, this->m_InputImage );
+//   this->m_ActivePlugin->SetInput( 1, this->m_SegmentedImage );
+//   std::string err = this->m_ActivePlugin->Update( );
+//   if( err != "" )
+//   {
+//     QMessageBox::critical( this, tr( "Error caugth!" ), tr( err.c_str( ) ) );
+//     return;
+
+//   } // fi
+
+//   // Join results
+//   itk::DataObject* s = this->m_SegmentedImage->GetDataObject( );
+//   if( dynamic_cast< itk::Image< char, 3 >* >( s ) != NULL )
+//     this->_JoinSegmentations< char >( );
+//   else if( dynamic_cast< itk::Image< short, 3 >* >( s ) != NULL )
+//     this->_JoinSegmentations< short >( );
+//   else if( dynamic_cast< itk::Image< int, 3 >* >( s ) != NULL )
+//     this->_JoinSegmentations< int >( );
+//   else if( dynamic_cast< itk::Image< long, 3 >* >( s ) != NULL )
+//     this->_JoinSegmentations< long >( );
+//   else if( dynamic_cast< itk::Image< unsigned char, 3 >* >( s ) != NULL )
+//     this->_JoinSegmentations< unsigned char >( );
+//   else if( dynamic_cast< itk::Image< unsigned short, 3 >* >( s ) != NULL )
+//     this->_JoinSegmentations< unsigned short >( );
+//   else if( dynamic_cast< itk::Image< unsigned int, 3 >* >( s ) != NULL )
+//     this->_JoinSegmentations< unsigned int >( );
+//   else if( dynamic_cast< itk::Image< unsigned long, 3 >* >( s ) != NULL )
+//     this->_JoinSegmentations< unsigned long >( );
+
+//   // Update visualization
+//   this->m_SegmentedImage->UpdateVTKImageData( );
+//   this->m_MPR->Render( 0 );
+//   this->m_MPR->Render( 1 );
+//   this->m_MPR->Render( 2 );
 }
 
 // -------------------------------------------------------------------------
 }
 
 // -------------------------------------------------------------------------
@@ -170,26 +170,26 @@ _triggered_actionSegmentImage( )
 void MainWnd::
 _triggered_actionFilterSegmentation( )
 {
 void MainWnd::
 _triggered_actionFilterSegmentation( )
 {
-  // Get filter name
-  if( this->m_SegmentedImage == NULL )
-    return;
-  QAction* action = dynamic_cast< QAction* >( this->sender( ) );
-  if( action == NULL )
-    return;
-  std::string filter_name = action->text( ).toStdString( );
-
-  // Create plugin
-  if( this->m_ActivePlugin != NULL ) delete this->m_ActivePlugin;
-  this->m_ActivePlugin =
-    dynamic_cast< TPlugin* >(
-      this->m_Plugins.CreateObject(
-        this->m_SegmentationFilterClasses[ filter_name ]
-        )
-      );
-  this->m_ActivePluginCategory = Self::SegmentationFilteringPluginCategory;
-
-  // Show parameters dialog
-  this->_ParametersDialog( this->m_ActivePlugin->GetDefaultParameters( ) );
+//   // Get filter name
+//   if( this->m_SegmentedImage == NULL )
+//     return;
+//   QAction* action = dynamic_cast< QAction* >( this->sender( ) );
+//   if( action == NULL )
+//     return;
+//   std::string filter_name = action->text( ).toStdString( );
+
+//   // Create plugin
+//   if( this->m_ActivePlugin != NULL ) delete this->m_ActivePlugin;
+//   this->m_ActivePlugin =
+//     dynamic_cast< TPlugin* >(
+//       this->m_Plugins.CreateObject(
+//         this->m_SegmentationFilterClasses[ filter_name ]
+//         )
+//       );
+//   this->m_ActivePluginCategory = Self::SegmentationFilteringPluginCategory;
+
+//   // Show parameters dialog
+//   this->_ParametersDialog( this->m_ActivePlugin->GetDefaultParameters( ) );
 }
 
 // -------------------------------------------------------------------------
 }
 
 // -------------------------------------------------------------------------
@@ -203,72 +203,76 @@ template< class P >
 void MainWnd::
 _JoinSegmentations( )
 {
 void MainWnd::
 _JoinSegmentations( )
 {
-  typedef itk::Image< P, 3 > _TImage;
-
-  _TImage* old_segmentation =
-    dynamic_cast< _TImage* >( this->m_SegmentedImage->GetDataObject( ) );
-  _TImage* new_segmentation =
-    dynamic_cast< _TImage* >(
-      dynamic_cast< TPluginImage* >(
-        this->m_ActivePlugin->GetOutput( 0 )
-        )->GetDataObject( )
-      );
-
-  /* TODO: InPlaceOn does not execute correctly on input image
-     typedef itk::AndImageFilter< _TImage, _TImage, _TImage > _TFilter;
-     typename _TFilter::Pointer filter = _TFilter::New( );
-     filter->InPlaceOn( );
-     filter->SetInput( 0, old_segmentation );
-     filter->SetInput( 1, new_segmentation );
-     filter->Update( );
-     //old_segmentation->DisconnectPipeline( );
-
-     std::cout << old_segmentation->GetRequestedRegion( ) << std::endl;
-     std::cout << new_segmentation->GetRequestedRegion( ) << std::endl;
-     std::cout << old_segmentation->GetBufferedRegion( ) << std::endl;
-     std::cout << new_segmentation->GetBufferedRegion( ) << std::endl;
-  */
-  typedef itk::ImageRegionConstIterator< _TImage > _TConstIt;
-  typedef itk::ImageRegionIterator< _TImage > _TIt;
-  _TConstIt nIt( new_segmentation, new_segmentation->GetRequestedRegion( ) );
-  _TIt oIt( old_segmentation, old_segmentation->GetRequestedRegion( ) );
-  nIt.GoToBegin( );
-  oIt.GoToBegin( );
-  for( ; !nIt.IsAtEnd( ); ++nIt, ++oIt )
-    oIt.Set( nIt.Get( ) | oIt.Get( ) );
+//   typedef itk::Image< P, 3 > _TImage;
+
+//   _TImage* old_segmentation =
+//     dynamic_cast< _TImage* >( this->m_SegmentedImage->GetDataObject( ) );
+//   _TImage* new_segmentation =
+//     dynamic_cast< _TImage* >(
+//       dynamic_cast< TPluginImage* >(
+//         this->m_ActivePlugin->GetOutput( 0 )
+//         )->GetDataObject( )
+//       );
+
+//   /* TODO: InPlaceOn does not execute correctly on input image
+//      typedef itk::AndImageFilter< _TImage, _TImage, _TImage > _TFilter;
+//      typename _TFilter::Pointer filter = _TFilter::New( );
+//      filter->InPlaceOn( );
+//      filter->SetInput( 0, old_segmentation );
+//      filter->SetInput( 1, new_segmentation );
+//      filter->Update( );
+//      //old_segmentation->DisconnectPipeline( );
+
+//      std::cout << old_segmentation->GetRequestedRegion( ) << std::endl;
+//      std::cout << new_segmentation->GetRequestedRegion( ) << std::endl;
+//      std::cout << old_segmentation->GetBufferedRegion( ) << std::endl;
+//      std::cout << new_segmentation->GetBufferedRegion( ) << std::endl;
+//   */
+//   typedef itk::ImageRegionConstIterator< _TImage > _TConstIt;
+//   typedef itk::ImageRegionIterator< _TImage > _TIt;
+//   _TConstIt nIt( new_segmentation, new_segmentation->GetRequestedRegion( ) );
+//   _TIt oIt( old_segmentation, old_segmentation->GetRequestedRegion( ) );
+//   nIt.GoToBegin( );
+//   oIt.GoToBegin( );
+//   for( ; !nIt.IsAtEnd( ); ++nIt, ++oIt )
+//     oIt.Set( nIt.Get( ) | oIt.Get( ) );
 }
 
 // -------------------------------------------------------------------------
 DoubleClickCommand* DoubleClickCommand::
 New( )
 {
 }
 
 // -------------------------------------------------------------------------
 DoubleClickCommand* DoubleClickCommand::
 New( )
 {
-  return( new DoubleClickCommand( ) );
+//  return( new DoubleClickCommand( ) );
 }
 
 // -------------------------------------------------------------------------
 void DoubleClickCommand::
 SetMainWnd( MainWnd* wnd )
 {
 }
 
 // -------------------------------------------------------------------------
 void DoubleClickCommand::
 SetMainWnd( MainWnd* wnd )
 {
-  this->m_MainWnd = wnd;
+//  this->m_MainWnd = wnd;
 }
 
 // -------------------------------------------------------------------------
 void DoubleClickCommand::
 Execute( vtkObject* caller, unsigned long eid, void* data )
 {
 }
 
 // -------------------------------------------------------------------------
 void DoubleClickCommand::
 Execute( vtkObject* caller, unsigned long eid, void* data )
 {
-  if( this->m_MainWnd != NULL )
-    this->m_MainWnd->_ExecuteDoubleClickPlugin(
-      reinterpret_cast< const double* >( data )
-      );
+//   If( This->M_Mainwnd != Null )
+//     This->M_Mainwnd->_Executedoubleclickplugin(
+//       Reinterpret_Cast< Const Double* >( Data )
+//       );
 }
 
 // -------------------------------------------------------------------------
 DoubleClickCommand::
 DoubleClickCommand( )
 }
 
 // -------------------------------------------------------------------------
 DoubleClickCommand::
 DoubleClickCommand( )
+{
+}
+/*
   : Superclass( ),
     m_MainWnd( NULL )
 {
 }
   : Superclass( ),
     m_MainWnd( NULL )
 {
 }
+*/
 
 // -------------------------------------------------------------------------
 DoubleClickCommand::
 
 // -------------------------------------------------------------------------
 DoubleClickCommand::
index 27fbfe2fab30bcaad8ded329f0107fb87856e97b..7d8ab32cb5b9e12979a38c1a8ddffebc2f341cf5 100644 (file)
 bool MainWnd::
 _LoadPlugins( )
 {
 bool MainWnd::
 _LoadPlugins( )
 {
-  // Clear states
-  this->m_Plugins.UnloadAll( );
-  this->m_BaseClasses.clear( );
-  this->m_SegmentationClasses.clear( );
-  this->m_SegmentationFilterClasses.clear( );
-  this->m_MeshFilterClasses.clear( );
-
-  // Read file and load plugins
-  std::ifstream in( this->m_PluginsConfigurationFile.c_str( ) );
-  if( !in )
-    return( false );
-  this->m_LastOpenedFile = this->m_PluginsConfigurationFile;
-  std::string line, actual_section = "";
-  std::getline( in, line );
-  while( !( in.eof( ) ) )
-  {
-    std::string clean_line = line;
-    clean_line.erase(
-      std::remove_if( clean_line.begin( ), clean_line.end( ), isspace ),
-      clean_line.end( )
-      );
-    if( clean_line[ 0 ] != '#' )
-    {
-      if(
-        clean_line != "sectionplugins"                     &&
-        clean_line != "sectionbase_classes"                &&
-        clean_line != "sectionsegmentation_classes"        &&
-        clean_line != "sectionsegmentation_filter_classes" &&
-        clean_line != "sectionmesh_filter_classes"
-        )
-      {
-        if( clean_line != "" )
-        {
-          if( actual_section == "sectionplugins" )
-          {
-            if( !( this->m_Plugins.Load( clean_line ) ) )
-            {
-              QMessageBox::warning(
-                this,
-                tr( "Ignoring plugin" ),
-                tr( clean_line.c_str( ) )
-                );
-
-            } // fi
-          }
-          else
-          {
-            std::string name =
-              clean_line.substr( clean_line.find_last_of( ":" ) + 1 );
-            if( actual_section == "sectionbase_classes" )
-              this->m_BaseClasses[ name ] = clean_line;
-            else if( actual_section == "sectionsegmentation_classes" )
-              this->m_SegmentationClasses[ name ] = clean_line;
-            else if( actual_section == "sectionsegmentation_filter_classes" )
-              this->m_SegmentationFilterClasses[ name ] = clean_line;
-            else if( actual_section == "sectionmesh_filter_classes" )
-              this->m_MeshFilterClasses[ name ] = clean_line;
-
-          } // fi
-
-        } // fi
-      }
-      else if( clean_line != "" )
-      {
-        if( clean_line[ 0 ] != '#' )
-          actual_section = clean_line;
-
-      } // fi
-
-    } // fi
-    std::getline( in, line );
-
-  } // elihw
-  in.close( );
-
-  // Check classes existence
-  if( !( this->_CheckClassesInPlugins( this->m_BaseClasses ) ) )
-  {
-    QMessageBox::critical(
-      this,
-      tr( "Could not load all base plugins." ),
-      tr( "Could not load all base plugins... Closing application!" )
-      );
-    std::exit( 1 );
-
-  } // fi
-
-  // Needed object from plugins
-  this->_AddPluginActions(
-    this->m_SegmentationClasses, this->m_UI->menuSegmentInputImage,
-    SLOT( _triggered_actionSegmentImage( ) )
-    );
-  this->_AddPluginActions(
-    this->m_SegmentationFilterClasses, this->m_UI->menuFilterSegmentedImage,
-    SLOT( _triggered_actionFilterSegmentation( ) )
-    );
-  this->_AddPluginActions(
-    this->m_MeshFilterClasses, this->m_UI->menuProcessMesh,
-    SLOT( _triggered_actionProcessMesh( ) )
-    );
-
-  // Historic objects
+//   // Clear states
+//   this->m_Plugins.UnloadAll( );
+//   this->m_BaseClasses.clear( );
+//   this->m_SegmentationClasses.clear( );
+//   this->m_SegmentationFilterClasses.clear( );
+//   this->m_MeshFilterClasses.clear( );
+
+//   // Read file and load plugins
+//   std::ifstream in( this->m_PluginsConfigurationFile.c_str( ) );
+//   if( !in )
+//     return( false );
+//   this->m_LastOpenedFile = this->m_PluginsConfigurationFile;
+//   std::string line, actual_section = "";
+//   std::getline( in, line );
+//   while( !( in.eof( ) ) )
+//   {
+//     std::string clean_line = line;
+//     clean_line.erase(
+//       std::remove_if( clean_line.begin( ), clean_line.end( ), isspace ),
+//       clean_line.end( )
+//       );
+//     if( clean_line[ 0 ] != '#' )
+//     {
+//       if(
+//         clean_line != "sectionplugins"                     &&
+//         clean_line != "sectionbase_classes"                &&
+//         clean_line != "sectionsegmentation_classes"        &&
+//         clean_line != "sectionsegmentation_filter_classes" &&
+//         clean_line != "sectionmesh_filter_classes"
+//         )
+//       {
+//         if( clean_line != "" )
+//         {
+//           if( actual_section == "sectionplugins" )
+//           {
+//             if( !( this->m_Plugins.Load( clean_line ) ) )
+//             {
+//               QMessageBox::warning(
+//                 this,
+//                 tr( "Ignoring plugin" ),
+//                 tr( clean_line.c_str( ) )
+//                 );
+
+//             } // fi
+//           }
+//           else
+//           {
+//             std::string name =
+//               clean_line.substr( clean_line.find_last_of( ":" ) + 1 );
+//             if( actual_section == "sectionbase_classes" )
+//               this->m_BaseClasses[ name ] = clean_line;
+//             else if( actual_section == "sectionsegmentation_classes" )
+//               this->m_SegmentationClasses[ name ] = clean_line;
+//             else if( actual_section == "sectionsegmentation_filter_classes" )
+//               this->m_SegmentationFilterClasses[ name ] = clean_line;
+//             else if( actual_section == "sectionmesh_filter_classes" )
+//               this->m_MeshFilterClasses[ name ] = clean_line;
+
+//           } // fi
+
+//         } // fi
+//       }
+//       else if( clean_line != "" )
+//       {
+//         if( clean_line[ 0 ] != '#' )
+//           actual_section = clean_line;
+
+//       } // fi
+
+//     } // fi
+//     std::getline( in, line );
+
+//   } // elihw
+//   in.close( );
+
+//   // Check classes existence
+//   if( !( this->_CheckClassesInPlugins( this->m_BaseClasses ) ) )
+//   {
+//     QMessageBox::critical(
+//       this,
+//       tr( "Could not load all base plugins." ),
+//       tr( "Could not load all base plugins... Closing application!" )
+//       );
+//     std::exit( 1 );
+
+//   } // fi
+
+//   // Needed object from plugins
+//   this->_AddPluginActions(
+//     this->m_SegmentationClasses, this->m_UI->menuSegmentInputImage,
+//     SLOT( _triggered_actionSegmentImage( ) )
+//     );
+//   this->_AddPluginActions(
+//     this->m_SegmentationFilterClasses, this->m_UI->menuFilterSegmentedImage,
+//     SLOT( _triggered_actionFilterSegmentation( ) )
+//     );
+//   this->_AddPluginActions(
+//     this->m_MeshFilterClasses, this->m_UI->menuProcessMesh,
+//     SLOT( _triggered_actionProcessMesh( ) )
+//     );
+
+//   // Historic objects
 }
 
 // -------------------------------------------------------------------------
 bool MainWnd::
 _CheckClassesInPlugins( const TStringMap& classes )
 {
 }
 
 // -------------------------------------------------------------------------
 bool MainWnd::
 _CheckClassesInPlugins( const TStringMap& classes )
 {
-  bool r = true;
-  TStringMap::const_iterator cIt = classes.begin( );
-  for( ; cIt != classes.end( ); ++cIt )
-  {
-    TPluginObject* o = this->m_Plugins.CreateObject( cIt->second );
-    if( o != NULL )
-      delete o;
-    else
-      r &= false;
+//   bool r = true;
+//   TStringMap::const_iterator cIt = classes.begin( );
+//   for( ; cIt != classes.end( ); ++cIt )
+//   {
+//     TPluginObject* o = this->m_Plugins.CreateObject( cIt->second );
+//     if( o != NULL )
+//       delete o;
+//     else
+//       r &= false;
     
     
-  } // rof
-  return( r );
+//   } // rof
+//   return( r );
 }
 
 // -------------------------------------------------------------------------
 }
 
 // -------------------------------------------------------------------------
@@ -137,13 +137,13 @@ _AddPluginActions(
   const TStringMap& classes, QMenu* menu, const char* method
   )
 {
   const TStringMap& classes, QMenu* menu, const char* method
   )
 {
-  TStringMap::const_iterator clIt = classes.begin( );
-  for( ; clIt != classes.end( ); ++clIt )
-  {
-    QAction* action = menu->addAction( QString( clIt->first.c_str( ) ) );
-    QObject::connect( action, SIGNAL( triggered( ) ), this, method );
+//   TStringMap::const_iterator clIt = classes.begin( );
+//   for( ; clIt != classes.end( ); ++clIt )
+//   {
+//     QAction* action = menu->addAction( QString( clIt->first.c_str( ) ) );
+//     QObject::connect( action, SIGNAL( triggered( ) ), this, method );
 
 
-  } // rof
+//   } // rof
 }
 
 // eof - $RCSfile$
 }
 
 // eof - $RCSfile$
index 1152622259ea63860b58215e429981105f98e7e8..bc5405d003a16e248af2fc5bcdaa5250260ed3d9 100644 (file)
@@ -1,11 +1,11 @@
 #include <Pluma/Connector.hpp>
 #include <Pluma/Connector.hpp>
-#include <cpm/Plugins/SimpleFillRegion.h>
+// TODO #include <cpm/Plugins/SimpleFillRegion.h>
 
 /// TODO: doc
 PLUMA_CONNECTOR
 bool connect( pluma::Host& host )
 {
 
 /// TODO: doc
 PLUMA_CONNECTOR
 bool connect( pluma::Host& host )
 {
-  host.add( new cpm::Plugins::SimpleFillRegionProvider( ) );
+  // TODO: host.add( new cpm::Plugins::SimpleFillRegionProvider( ) );
   return( true );
 }
 
   return( true );
 }
 
index 48a6027ceb9c7a4c3d1723e4d841506a5d93567d..ac2cbab1a5645d0985bf5c1fe05f475953925959 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __CPM__PLUGINS__SIMPLEFILLREGION__H__
 #define __CPM__PLUGINS__SIMPLEFILLREGION__H__
 
 #ifndef __CPM__PLUGINS__SIMPLEFILLREGION__H__
 #define __CPM__PLUGINS__SIMPLEFILLREGION__H__
 
-#include <cpPlugins/Interface/ImageToImageFilter.h>
+#include <cpPlugins/Interface/BaseProcessObjects.h>
 
 namespace cpm
 {
 
 namespace cpm
 {