]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 20 Jan 2016 22:14:55 +0000 (17:14 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 20 Jan 2016 22:14:55 +0000 (17:14 -0500)
55 files changed:
appli/CMakeLists.txt
appli/cpPipelineEditor/App_cpPipelineEditor.cxx
appli/cpPipelineEditor/App_cpPipelineEditor.h
appli/examples/CMakeLists.txt
appli/examples/example_LoadPlugins.cxx
appli/examples/example_LoadPluginsFromPath.cxx
appli/examples/example_TestParameters.cxx
lib/cpPipelineEditor/Block.cxx
lib/cpPipelineEditor/Editor.cxx
lib/cpPlugins/Interface/BaseApplication.h [deleted file]
lib/cpPlugins/Interface/BaseMPRWidget.cxx [deleted file]
lib/cpPlugins/Interface/BaseMPRWidget.h [deleted file]
lib/cpPlugins/Interface/BaseMPRWidget.ui [deleted file]
lib/cpPlugins/Interface/CMakeLists.txt
lib/cpPlugins/Interface/DataObject.cxx
lib/cpPlugins/Interface/DataObject.h
lib/cpPlugins/Interface/Image.h
lib/cpPlugins/Interface/Image.hxx
lib/cpPlugins/Interface/ImplicitFunction.cxx
lib/cpPlugins/Interface/ImplicitFunction.h
lib/cpPlugins/Interface/Interface.cxx
lib/cpPlugins/Interface/Macros.h
lib/cpPlugins/Interface/Mesh.h
lib/cpPlugins/Interface/Object.cxx
lib/cpPlugins/Interface/Object.h
lib/cpPlugins/Interface/Object.hxx [moved from lib/cpPlugins/Interface/DataObject.hxx with 70% similarity]
lib/cpPlugins/Interface/Parameters.cxx
lib/cpPlugins/Interface/Parameters.h
lib/cpPlugins/Interface/Parameters.hxx [deleted file]
lib/cpPlugins/Interface/ParametersQtDialog.cxx
lib/cpPlugins/Interface/Plugins.cxx [deleted file]
lib/cpPlugins/Interface/Plugins.h [deleted file]
lib/cpPlugins/Interface/Plugins.hxx [deleted file]
lib/cpPlugins/Interface/ProcessObject.cxx
lib/cpPlugins/Interface/ProcessObject.h
lib/cpPlugins/Interface/ProcessObject.hxx
lib/cpPlugins/Plugins/BasicFilters/BinaryErodeImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/Cutter.cxx
lib/cpPlugins/Plugins/BasicFilters/DoubleFloodImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/DoubleFloodImageFilter.h
lib/cpPlugins/Plugins/BasicFilters/ExtractSliceImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/FloodFillImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/MacheteFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/MacheteImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/MacheteImageFilter.h
lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx
lib/cpPlugins/Plugins/BasicFilters/MedianImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/RGBImageToOtherChannelsFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/SignedMaurerDistanceMapImageFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/SphereMeshSource.cxx
lib/cpPlugins/Plugins/IO/ImageReader.cxx
lib/cpPlugins/Plugins/IO/MeshReader.cxx
lib/cpPlugins/Plugins/Widgets/SeedWidget.cxx

index 1f50ec7bb34715ceb88097e460e20e303b2504e2..785c97e5573d4e8bb9df69ba2b998f1e1bb8be67 100644 (file)
@@ -5,7 +5,7 @@ SUBDIRS(
 IF(BUILD_EXAMPLES)
   SUBDIRS(
     examples
-    ImageMPR
+    #ImageMPR
     )
   IF(USE_QT4)
     SUBDIRS(
index 864d96fb99f7ebaabd075c3baf164caae633f6d3..78318a9a674241aad4cd1172a9aebde2196d04da 100644 (file)
@@ -31,7 +31,8 @@ App_cpPipelineEditor::
 App_cpPipelineEditor( int argc, char* argv[], QWidget* parent )
   : QMainWindow( parent ),
     m_UI( new Ui::App_cpPipelineEditor ),
-    m_Workspace( NULL )
+    m_Workspace( NULL ),
+    m_PluginsPath( "." )
 {
   this->m_UI->setupUi( this );
 
@@ -40,10 +41,10 @@ App_cpPipelineEditor( int argc, char* argv[], QWidget* parent )
   QFileInfo info( argv[ 0 ] );
   if( info.exists( ) )
   {
-    std::string path = info.canonicalPath( ).toStdString( );
-    if( !( this->m_Plugins->LoadDefaultConfiguration( path ) ) )
-      if( this->m_Plugins->LoadFromFolder( path, false ) )
-        if( !( this->m_Plugins->SaveDefaultConfiguration( path ) ) )
+    this->m_PluginsPath = info.canonicalPath( ).toStdString( );
+    if( !( this->m_Plugins->LoadDefaultConfiguration( this->m_PluginsPath ) ) )
+      if( this->m_Plugins->LoadFromFolder( this->m_PluginsPath, false ) )
+        if( !( this->m_Plugins->SaveDefaultConfiguration( this->m_PluginsPath ) ) )
           QMessageBox::critical(
             this,
             "Error creating default plugins configuration",
@@ -185,6 +186,7 @@ _ButtonLoadPluginsFile( )
       );
 
   // Update view
+  this->m_Plugins->SaveDefaultConfiguration( this->m_PluginsPath );
   this->_UpdateLoadedPlugins( );
 }
 
@@ -208,6 +210,7 @@ _ButtonLoadPluginsPath( )
       );
 
   // Update view
+  this->m_Plugins->SaveDefaultConfiguration( this->m_PluginsPath );
   this->_UpdateLoadedPlugins( );
 }
 
@@ -230,6 +233,10 @@ _ActionOpenWorkspace( )
     delete this->m_Workspace;
   this->m_Workspace = new cpPlugins::Interface::Workspace( );
   this->m_Workspace->SetPlugins( this->m_Plugins );
+  this->m_Workspace->AddInteractor( this->m_UI->Viewer->GetInteractor( 0 ) );
+  this->m_Workspace->AddInteractor( this->m_UI->Viewer->GetInteractor( 1 ) );
+  this->m_Workspace->AddInteractor( this->m_UI->Viewer->GetInteractor( 2 ) );
+  this->m_Workspace->AddInteractor( this->m_UI->Viewer->GetInteractor( 3 ) );
   std::string err = this->m_Workspace->LoadWorkspace( fname );
   if( err != "" )
   {
index 831ef36155b4e9e955abf1211157285e104ef898..41b31b0adef7f6577663fa8d6058c58615849032 100644 (file)
@@ -54,6 +54,7 @@ private:
   Ui::App_cpPipelineEditor* m_UI;
   cpPlugins::Interface::Workspace* m_Workspace;
   cpPlugins::Interface::Interface* m_Plugins;
+  std::string m_PluginsPath;
 };
 
 #endif // __CPPIPELINEEDITOR__H__
index 9938095c1f875fb542428356ca3240383905e8fc..b6161de48119ba393d50c6b0a61db251418f0563 100644 (file)
@@ -17,7 +17,7 @@ SET(
   example_TestParameters
   example_LoadPlugins
   example_LoadPluginsFromPath
-  example_WorkspaceSandBox
+  #example_WorkspaceSandBox
   )
 
 FOREACH(prog ${EXAMPLES_PROGRAMS_ONLY_INTERFACE}) 
@@ -27,15 +27,15 @@ ENDFOREACH(prog)
 
 SET(
   EXAMPLES_PROGRAMS_WITH_PLUGINS
-  example_ReadWriteImage
-  example_MarchingCubes
+  #example_ReadWriteImage
+  #example_MarchingCubes
   #example_MPR
-  example_View2DImage
-  example_ViewImageThreshold
-  example_HandleWidget
-  example_SeedWidget
-  example_SphereWidget
-  example_Test_Memento
+  #example_View2DImage
+  #example_ViewImageThreshold
+  #example_HandleWidget
+  #example_SeedWidget
+  #example_SphereWidget
+  #example_Test_Memento
   ##example_OtsuFilter
   ##example_RGBImageToHSVChannels
   ##example_RGBImageToYPbPrChannels
@@ -59,9 +59,9 @@ ENDFOREACH(prog)
 
 SET(
   NOPLUGINS_EXAMPLES_PROGRAMS
-  example_BaseInteractorStyle
+  #example_BaseInteractorStyle
   
-  example_ContourWidget
+  #example_ContourWidget
   ##example_Test_async
   ## example_MacheteFilter
   ## example_Test_DoubleClick
index 76c5febe6eb4b3e08dbb57fac3a80b9669dbeba0..9b4018312cf8c08d977359bde3ceb346360ba005 100644 (file)
@@ -38,9 +38,15 @@ int main( int argc, char* argv[] )
   } // rof
 
   // Show loaded classes
-  auto c = interface.GetClasses( ).begin( );
-  for( ; c != interface.GetClasses( ).end( ); ++c )
-    std::cout << "Class -> " << c->first << std::endl;
+  auto cat = interface.GetClasses( ).begin( );
+  for( ; cat != interface.GetClasses( ).end( ); ++cat )
+  {
+    std::cout << "Catergory -> " << cat->first << std::endl;
+    auto cla = cat->second.begin( );
+    for( ; cla != cat->second.end( ); ++cla )
+      std::cout << "\tClass -> " << cla->first << std::endl;
+
+  } // rof
 
   return( 0 );
 }
index ba684ce52e9eeb39d704cfa9678fa72468747aa0..451d3330c94abac36473595128d0c5f8ea6383f7 100644 (file)
@@ -31,10 +31,16 @@ int main( int argc, char* argv[] )
 
   } // rof
 
-    // Show loaded classes
-  auto c = interface.GetClasses( ).begin( );
-  for( ; c != interface.GetClasses( ).end( ); ++c )
-    std::cout << "Class -> " << c->first << std::endl;
+  // Show loaded classes
+  auto cat = interface.GetClasses( ).begin( );
+  for( ; cat != interface.GetClasses( ).end( ); ++cat )
+  {
+    std::cout << "Catergory -> " << cat->first << std::endl;
+    auto cla = cat->second.begin( );
+    for( ; cla != cat->second.end( ); ++cla )
+      std::cout << "\tClass -> " << cla->first << std::endl;
+    
+  } // rof
 
   return( 0 );
 }
index 807b4d9af8f505ee546f2a5f63dc40844115ae11..2e6e9e0375e0906dd1973262213f90264857ccb4 100644 (file)
@@ -1,9 +1,6 @@
 #include <iostream>
 #include <vector>
 
-#include <itkIndex.h>
-#include <itkPoint.h>
-
 #include <cpPlugins/Interface/Parameters.h>
 
 // -------------------------------------------------------------------------
@@ -21,28 +18,19 @@ void PrintList( const L& lst, const std::string& desc )
 int main( int argc, char* argv[] )
 {
   typedef cpPlugins::Interface::Parameters TParameters;
-  typedef itk::Index< 3 > TIndex;
-  typedef itk::Point< float, 3 > TPoint;
 
   TParameters::Pointer parameters = TParameters::New( );
 
-  TIndex idx; idx[ 0 ] = 1; idx[ 1 ] = 2; idx[ 2 ] = 3;
-  TPoint pnt; pnt[ 0 ] = 3.1; pnt[ 1 ] = 2.2; pnt[ 2 ] = 1.3;
-
   parameters->ConfigureAsString( "StringParam" );
   parameters->ConfigureAsBool( "BoolParam" );
   parameters->ConfigureAsInt( "IntParam" );
   parameters->ConfigureAsUint( "UintParam" );
   parameters->ConfigureAsReal( "RealParam" );
-  parameters->ConfigureAsIndex( "IndexParam" );
-  parameters->ConfigureAsPoint( "PointParam" );
   parameters->ConfigureAsStringList( "StringListParam" );
   parameters->ConfigureAsBoolList( "BoolListParam" );
   parameters->ConfigureAsIntList( "IntListParam" );
   parameters->ConfigureAsUintList( "UintListParam" );
   parameters->ConfigureAsRealList( "RealListParam" );
-  parameters->ConfigureAsIndexList( "IndexListParam" );
-  parameters->ConfigureAsPointList( "PointListParam" );
 
   std::vector< std::string > choices;
   choices.push_back( "bat" );
@@ -62,11 +50,6 @@ int main( int argc, char* argv[] )
   parameters->SetUint( "UintParam", 1234567 );
   parameters->SetReal( "RealParam", 3.14159244444 );
 
-  idx[ 0 ] = 10; idx[ 1 ] = 20; idx[ 2 ] = 30;
-  pnt[ 0 ] = 30.1; pnt[ 1 ] = 21.2; pnt[ 2 ] = 12.3;
-  parameters->SetIndex( "IndexParam", 3, idx );
-  parameters->SetPoint( "PointParam", 3, pnt );
-
   std::cout << "---------------------------------------------" << std::endl;
   parameters->Print( std::cout );
   std::cout << "---------------------------------------------" << std::endl;
@@ -76,8 +59,6 @@ int main( int argc, char* argv[] )
   parameters->ClearIntList( "IntListParam" );
   parameters->ClearUintList( "UintListParam" );
   parameters->ClearRealList( "RealListParam" );
-  parameters->ClearIndexList( "IndexListParam" );
-  parameters->ClearPointList( "PointListParam" );
 
   parameters->AddToStringList( "StringListParam", "one" );
   parameters->AddToStringList( "StringListParam", "two" );
@@ -126,22 +107,6 @@ int main( int argc, char* argv[] )
   parameters->AddToRealList( "RealListParam", 1.0012 );
   parameters->AddToRealList( "RealListParam", 1.131245 );
 
-  idx.Fill( 1 );
-  parameters->AddToIndexList( "IndexListParam", 3, idx );
-  idx.Fill( 2 );
-  parameters->AddToIndexList( "IndexListParam", 3, idx );
-  idx.Fill( 3 );
-  parameters->AddToIndexList( "IndexListParam", 3, idx );
-
-  pnt.Fill( 1.2 );
-  parameters->AddToPointList( "PointListParam", 3, pnt );
-  pnt.Fill( 3.14 );
-  parameters->AddToPointList( "PointListParam", 3, pnt );
-  pnt.Fill( 6.28 );
-  parameters->AddToPointList( "PointListParam", 3, pnt );
-  pnt.Fill( 1.63 );
-  parameters->AddToPointList( "PointListParam", 3, pnt );
-
   std::cout << "---------------------------------------------" << std::endl;
   parameters->Print( std::cout );
   std::cout << "---------------------------------------------" << std::endl;
index f27a7c8878a2ed74200e64abfa3c29a027f2678a..bce1197d8f6bb2ae2b34fb8f0447892abf89cb04 100644 (file)
@@ -41,14 +41,12 @@ Block( TFilter* filter, QGraphicsItem* parent, QGraphicsScene* scene )
   this->_setTypePort( this->m_Filter->GetClassName( ) );\r
 \r
   // Add input ports\r
-  std::set< std::string > inputs;\r
-  this->m_Filter->GetInputsNames( inputs );\r
+  auto inputs = this->m_Filter->GetInputsNames( );\r
   for( auto iIt = inputs.begin( ); iIt != inputs.end( ); ++iIt )\r
     this->addInputPort( iIt->c_str( ) );\r
 \r
   // Add output ports\r
-  std::set< std::string > outputs;\r
-  this->m_Filter->GetOutputsNames( outputs );\r
+  auto outputs = this->m_Filter->GetOutputsNames( );\r
   for( auto oIt = outputs.begin( ); oIt != outputs.end( ); ++oIt )\r
     this->addOutputPort( oIt->c_str( ) );\r
 }\r
@@ -211,10 +209,13 @@ itemChange( GraphicsItemChange change, const QVariant& value )
 void cpPipelineEditor::Block::\r
 _setTypePort( const QString& txt )\r
 {\r
-  if( this->m_TypePort == NULL )\r
-    this->m_TypePort = new TypePort( this );\r
-  this->m_TypePort->setName( txt );\r
-  this->_configPort( this->m_TypePort );\r
+  /* TODO\r
+     if( this->m_TypePort == NULL )\r
+     this->m_TypePort = new TypePort( this );\r
+     this->m_TypePort->setName( txt );\r
+     this->_configPort( this->m_TypePort );\r
+  */\r
+  this->setToolTip( txt );\r
 }\r
 \r
 // -------------------------------------------------------------------------\r
index 2a0fca6a04a4bb222ea61ca8d4e2dbf70e7d42dc..f74ce6eba238c5005f458a31eb9ca8dd79057ac8 100644 (file)
@@ -162,8 +162,7 @@ _createBlock( TFilter* f, const QPointF& pnt )
 \r
   // Mark exposed inputs\r
   auto& e_in = this->m_Workspace->GetExposedInputPorts( );\r
-  std::set< std::string > f_in;\r
-  f->GetInputsNames( f_in );\r
+  auto f_in = f->GetInputsNames( );\r
   for( auto iIt = f_in.begin( ); iIt != f_in.end( ); ++iIt )\r
   {\r
     auto eIt = e_in.begin( );\r
@@ -182,8 +181,7 @@ _createBlock( TFilter* f, const QPointF& pnt )
 \r
   // Mark exposed outputs\r
   auto& e_out = this->m_Workspace->GetExposedOutputPorts( );\r
-  std::set< std::string > f_out;\r
-  f->GetOutputsNames( f_out );\r
+  auto f_out = f->GetOutputsNames( );\r
   for( auto iIt = f_out.begin( ); iIt != f_out.end( ); ++iIt )\r
   {\r
     auto eIt = e_out.begin( );\r
diff --git a/lib/cpPlugins/Interface/BaseApplication.h b/lib/cpPlugins/Interface/BaseApplication.h
deleted file mode 100644 (file)
index 549296b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __CPPLUGINS__INTERFACE__BASEAPPLICATION__H__
-#define __CPPLUGINS__INTERFACE__BASEAPPLICATION__H__
-
-#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
-
-namespace cpPlugins
-{
-  namespace Interface
-  {
-    /**
-     */
-    class cpPlugins_Interface_EXPORT BaseApplication
-    {
-    public:
-      BaseApplication( ) { }
-      virtual ~BaseApplication( ) { }
-
-      virtual void UpdateActualFilter( ) = 0;
-    };
-
-  } // ecapseman
-
-} // ecapseman
-
-#endif // __CPPLUGINS__INTERFACE__BASEAPPLICATION__H__
-
-// eof - $RCSfile$
diff --git a/lib/cpPlugins/Interface/BaseMPRWidget.cxx b/lib/cpPlugins/Interface/BaseMPRWidget.cxx
deleted file mode 100644 (file)
index 052e374..0000000
+++ /dev/null
@@ -1,580 +0,0 @@
-#include <cpPlugins/Interface/BaseMPRWidget.h>
-
-#ifdef cpPlugins_Interface_QT4
-
-#include <cpPlugins/Interface/ui_BaseMPRWidget.h>
-#include <cpPlugins/Interface/DataObject.h>
-#include <cpPlugins/Interface/Image.h>
-#include <cpPlugins/Interface/Mesh.h>
-#include <QTreeWidgetItem>
-#include <vtkRendererCollection.h>
-
-double cpPlugins::Interface::BaseMPRWidget::
-cm_Colors[ 8 ][ 3 ] =
-{
-  { 1.0, 0.0, 0.0 },
-  { 0.0, 1.0, 0.0 },
-  { 0.0, 0.0, 1.0 },
-  { 0.0, 1.0, 1.0 },
-  { 1.0, 0.0, 1.0 },
-  { 1.0, 1.0, 0.0 },
-  { 1.0, 0.5, 0.0 },
-  { 1.0, 0.0, 0.5 }
-};
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::BaseMPRWidget::
-BaseMPRWidget( QWidget* parent )
-  : QWidget( parent ),
-    m_UI( new Ui::BaseMPRWidget ),
-    m_MainImage( "" )
-{
-  this->m_UI->setupUi( this );
-
-  // Configure VTK widgets
-  this->m_VTK[ 0 ] = this->m_UI->VTK01;
-  this->m_VTK[ 1 ] = this->m_UI->VTK00;
-  this->m_VTK[ 2 ] = this->m_UI->VTK10;
-  this->m_VTK[ 3 ] = this->m_UI->VTK11;
-
-  this->m_MPRObjects = vtkSmartPointer< TMPRObjects >::New( );
-  this->m_MPRObjects->SetRenderWindows(
-    this->m_VTK[ 0 ]->GetRenderWindow( ),
-    this->m_VTK[ 1 ]->GetRenderWindow( ),
-    this->m_VTK[ 2 ]->GetRenderWindow( ),
-    this->m_VTK[ 3 ]->GetRenderWindow( )
-    );
-
-  // Connect slots
-  QObject::connect(
-    this->m_UI->TopSplitter, SIGNAL( splitterMoved( int, int ) ),
-    this, SLOT( _SyncBottom( int, int ) )
-    );
-  QObject::connect(
-    this->m_UI->BottomSplitter, SIGNAL( splitterMoved( int, int ) ),
-    this, SLOT( _SyncTop( int, int ) )
-    );
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::BaseMPRWidget::
-~BaseMPRWidget( )
-{
-  delete this->m_UI;
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::BaseMPRWidget::
-AddData(
-  cpPlugins::Interface::DataObject* data, const std::string& name,
-  const std::string& parent
-  )
-{
-  if( name == "" )
-    return( false );
-
-  auto iIt = this->m_Data.find( name );
-  if( iIt == this->m_Data.end( ) )
-  {
-    if( parent != "" )
-    {
-      auto pIt = this->m_Data.find( parent );
-      if( pIt == this->m_Data.end( ) )
-        return( false );
-
-    } // fi
-
-    // Add new data
-    this->m_Data[ name ].SetSourceDataObject( data );
-
-    // Add to tree view
-    this->_UpdateTreeItem( name, parent );
-    return( true );
-  }
-  else
-    return( false );
-}
-
-// -------------------------------------------------------------------------
-const std::string& cpPlugins::Interface::BaseMPRWidget::
-GetMainImage( ) const
-{
-  return( this->m_MainImage );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::BaseMPRWidget::
-SetMainImage( const std::string& name )
-{
-  auto iIt = this->m_Data.find( name );
-  if( iIt != this->m_Data.end( ) )
-  {
-    if( iIt->second.Tag == Data::IMAGE )
-    {
-      this->m_MainImage = name;
-      return( true );
-    }
-    else
-      return( false );
-  }
-  else
-    return( false );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::BaseMPRWidget::
-DeleteData( const std::string& name )
-{
-  auto iIt = this->m_Data.find( name );
-  if( iIt != this->m_Data.end( ) )
-  {
-    this->m_Data.erase( iIt );
-
-    // Get children
-    std::vector< std::string > to_erase;
-    auto tIt = this->m_Tree.begin( );
-    for( ; tIt != this->m_Tree.end( ); ++tIt )
-      if( tIt->second == name )
-        to_erase.push_back( tIt->first );
-
-    // Delete from tree
-    tIt = this->m_Tree.find( name );
-    if( tIt != this->m_Tree.end( ) )
-      this->m_Tree.erase( tIt );
-
-    // Recursive erase
-    auto dIt = to_erase.begin( );
-    for( ; dIt != to_erase.end( ); ++dIt )
-      this->DeleteData( *dIt );
-
-    // Delete from tree widget
-    QTreeWidgetItem* item = this->_FindItemInTree( name );
-    if( item != NULL )
-      this->m_UI->LoadedData->removeItemWidget( item, 0 );
-
-    // Reset main image, just in case
-    if( this->m_Data.size( ) == 0 )
-      this->m_MainImage = "";
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::BaseMPRWidget::
-DeleteAllData( )
-{
-  this->m_MPRObjects->Clear( );
-  this->m_Data.clear( );
-  this->m_Tree.clear( );
-  this->m_UI->LoadedData->clear( );
-  this->m_MainImage = "";
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::BaseMPRWidget::
-SetDataColor(
-  const std::string& name, const double& r, const double& g, const double& b
-  )
-{
-  /*
-    auto iIt = this->m_Data.find( name );
-    if( iIt == this->m_Data.end( ) )
-    return;
-
-    if( iIt->second.Tag == Data::IMAGE )
-    {
-    }
-    else if( iIt->second.Tag == Data::MESH )
-    {
-    } // fi
-  */
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::BaseMPRWidget::
-ShowData( const std::string& name )
-{
-  auto iIt = this->m_Data.find( name );
-  if( iIt == this->m_Data.end( ) )
-    return;
-
-  if( iIt->second.Tag == Data::IMAGE )
-  {
-    if( name == this->m_MainImage )
-      this->m_MPRObjects->SetInputImage( iIt->second.Image );
-    else
-    {
-      unsigned int i = ( this->m_MPRObjects->GetNumberOfImages( ) - 1 ) % 8;
-      this->m_MPRObjects->AddBinaryImage(
-        iIt->second.Image,
-        Self::cm_Colors[ i ][ 0 ],
-        Self::cm_Colors[ i ][ 1 ],
-        Self::cm_Colors[ i ][ 2 ]
-        );
-    }
-    this->m_MPRObjects->Show( );
-  }
-  else if( iIt->second.Tag == Data::MESH )
-  {
-    /* TODO
-       vtkRenderer* ren =
-       this->m_VTK[ 3 ]->GetRenderWindow( )->GetRenderers( )->GetFirstRenderer( );
-       if( ren == NULL )
-       return;
-       ren->AddActor( iIt->second.GetMeshActor( ) );
-       this->m_VTK[ 3 ]->GetRenderWindow( )->Render( );
-    */
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::BaseMPRWidget::
-HideData( const std::string& name )
-{
-}
-
-// -------------------------------------------------------------------------
-vtkRenderWindowInteractor* cpPlugins::Interface::BaseMPRWidget::
-GetInteractor( unsigned int i )
-{
-  if( i < 4 )
-  {
-    if( this->m_VTK[ i ] != NULL )
-      return( this->m_VTK[ i ]->GetInteractor( ) );
-    else
-      return( NULL );
-  }
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-/*
-  bool cpPlugins::Interface::BaseMPRWidget::
-  ShowImage(
-  vtkImageData* image,
-  const std::string& name,
-  const std::string& parent
-  )
-  {
-  // Update tree view
-  QTreeWidgetItem* new_item = this->_UpdateTreeItem( name, parent );
-  if( new_item == NULL )
-  return( false );
-
-  // Associate new data
-  this->m_Images[ name ] = image;
-  this->m_Tree[ name ] = parent;
-
-  // Show image and return
-  this->m_MPRObjects->AddImage( image );
-  return( true );
-  }
-
-  // -------------------------------------------------------------------------
-  bool cpPlugins::Interface::BaseMPRWidget::
-  ShowImage(
-  vtkImageData* image,
-  const std::string& name,
-  const std::string& parent,
-  const double& r, const double& g, const double& b
-  )
-  {
-  // Update tree view
-  QTreeWidgetItem* new_item = this->_UpdateTreeItem( name, parent );
-  if( new_item == NULL )
-  return( false );
-
-  // Associate new data
-  this->m_Images[ name ] = image;
-  this->m_Tree[ name ] = parent;
-
-  // Show image and return
-  this->m_MPRObjects->AddImage( image );
-  return( true );
-  }
-
-  // -------------------------------------------------------------------------
-  bool cpPlugins::Interface::BaseMPRWidget::
-  ShowMesh(
-  vtkPolyData* mesh,
-  const std::string& name,
-  const std::string& parent
-  )
-  {
-  // Update tree view
-  QTreeWidgetItem* new_item = this->_UpdateTreeItem( name, parent );
-  if( new_item == NULL )
-  return( false );
-
-  // Associate new data
-  PolyDataActor* actor = new PolyDataActor( mesh );
-  this->m_Meshes[ name ] = actor;
-  this->m_Tree[ name ] = parent;
-
-  // Show mesh
-  this->_Add3DActor( actor->Actor );
-  return( true );
-  }
-
-  // -------------------------------------------------------------------------
-  bool cpPlugins::Interface::BaseMPRWidget::
-  ShowMesh(
-  vtkPolyData* mesh,
-  const std::string& name,
-  const std::string& parent,
-  const double& r, const double& g, const double& b
-  )
-  {
-  return false;
-  }
-
-  // -------------------------------------------------------------------------
-  void cpPlugins::Interface::BaseMPRWidget::
-  ClearAll( )
-  {
-  this->m_MPRObjects->ClearAll( );
-  this->m_Images.clear( );
-  this->m_Meshes.clear( );
-  }
-*/
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::BaseMPRWidget::
-GetSelectedData( ) const
-{
-  QTreeWidgetItem* item = this->m_UI->LoadedData->currentItem( );
-  if( item != NULL )
-    return( item->text( 0 ).toStdString( ) );
-  else
-    return( "" );
-}
-
-// -------------------------------------------------------------------------
-QTreeWidgetItem* cpPlugins::Interface::BaseMPRWidget::
-_FindItemInTree( const std::string& name ) const
-{
-  QList< QTreeWidgetItem* > items =
-    this->m_UI->LoadedData->findItems(
-      name.c_str( ), Qt::MatchExactly | Qt::MatchRecursive
-      );
-  if( items.size( ) > 0 )
-    return( items[ 0 ] );
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-QTreeWidgetItem* cpPlugins::Interface::BaseMPRWidget::
-_UpdateTreeItem( const std::string& name, const std::string& parent )
-{
-  // Update tree view
-  QTreeWidgetItem* new_item = NULL;
-  if( parent != "" )
-  {
-    QTreeWidgetItem* parent_item = this->_FindItemInTree( parent );
-    if( parent_item != NULL )
-    {
-      QTreeWidgetItem* old_item = this->_FindItemInTree( name );
-      if( old_item == NULL )
-      {
-        new_item =
-          new QTreeWidgetItem( parent_item, QStringList( name.c_str( ) ) );
-        parent_item->setExpanded( true );
-
-      } // fi
-
-    } // fi
-  }
-  else
-  {
-    new_item = new QTreeWidgetItem(
-      ( QTreeWidgetItem* )( NULL ), QStringList( name.c_str( ) )
-      );
-    this->m_UI->LoadedData->addTopLevelItem( new_item );
-
-  } // fi
-  return( new_item );
-}
-
-// -------------------------------------------------------------------------
-/*
-  void cpPlugins::Interface::BaseMPRWidget::
-  _Add3DActor( vtkProp3D* prop )
-  {
-  vtkRenderer* ren =
-  this->m_VTK[ 3 ]->GetRenderWindow( )->GetRenderers( )->GetFirstRenderer( );
-  if( ren == NULL )
-  return;
-  ren->AddActor( prop );
-  this->m_VTK[ 3 ]->GetRenderWindow( )->Render( );
-  }
-*/
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::BaseMPRWidget::
-_SyncBottom( int a, int b )
-{
-  this->m_UI->BottomSplitter->setSizes( this->m_UI->TopSplitter->sizes( ) );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::BaseMPRWidget::
-_SyncTop( int a, int b )
-{
-  this->m_UI->TopSplitter->setSizes( this->m_UI->BottomSplitter->sizes( ) );
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::BaseMPRWidget::PolyDataActor::
-PolyDataActor( )
-  : Mesh( NULL ),
-    Normals( NULL ),
-    Stripper( NULL ),
-    Mapper( NULL ),
-    Actor( NULL )
-{
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::BaseMPRWidget::PolyDataActor::
-~PolyDataActor( )
-{
-  if( this->Actor != NULL )    this->Actor->Delete( );
-  if( this->Mapper != NULL )   this->Mapper->Delete( );
-  if( this->Stripper != NULL ) this->Stripper->Delete( );
-  if( this->Normals != NULL )  this->Normals->Delete( );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::BaseMPRWidget::PolyDataActor::
-Configure( vtkPolyData* pd )
-{
-  if( pd ==  NULL )
-    return;
-
-  double range[ 2 ];
-  pd->GetScalarRange( range );
-
-  this->Normals = vtkPolyDataNormals::New( );
-  this->Stripper = vtkStripper::New( );
-  this->Mapper = vtkPolyDataMapper::New( );
-  this->Actor = vtkQuadricLODActor::New( );
-
-  this->Mesh = pd;
-  this->Normals->SetInputData( pd );
-  this->Normals->SetFeatureAngle( 60.0 );
-  this->Stripper->SetInputConnection( this->Normals->GetOutputPort( ) );
-  this->Mapper->SetInputConnection( this->Stripper->GetOutputPort( ) );
-  this->Mapper->UseLookupTableScalarRangeOff( );
-  this->Mapper->SetScalarRange(
-    range[ 0 ], ( ( range[ 1 ] - range[ 0 ] ) * 0.75 ) + range[ 0 ]
-    );
-  this->Actor->SetMapper( this->Mapper );
-  this->Actor->DeferLODConstructionOff( );
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::BaseMPRWidget::Data::
-Data( )
-{
-  this->Tag = Data::IMAGE;
-  this->Source = NULL;
-  this->Image = NULL;
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::BaseMPRWidget::Data::
-~Data( )
-{
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::BaseMPRWidget::
-Data& cpPlugins::Interface::BaseMPRWidget::Data::
-operator=( const Data& data )
-{
-  this->Tag = data.Tag;
-  this->Source = data.Source;
-  if( this->Tag == Data::IMAGE )
-    this->Image = data.Image;
-  else if( this->Tag == Data::MESH )
-    this->Mesh = data.Mesh;
-  return( *this );
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::
-DataObject* cpPlugins::Interface::BaseMPRWidget::Data::
-GetSourceDataObject( )
-{
-  return( this->Source );
-}
-
-// -------------------------------------------------------------------------
-const cpPlugins::Interface::
-DataObject* cpPlugins::Interface::BaseMPRWidget::Data::
-GetSourceDataObject( ) const
-{
-  return( this->Source );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::BaseMPRWidget::Data::
-SetSourceDataObject( cpPlugins::Interface::DataObject* dobj )
-{
-  typedef cpPlugins::Interface::Image _TImage;
-  typedef cpPlugins::Interface::Mesh  _TMesh;
-
-  this->Source = dobj;
-  _TImage* image = dynamic_cast< _TImage* >( dobj );
-  if( image != NULL )
-  {
-    this->Tag = Data::IMAGE;
-    this->Image = image->GetVTK< vtkImageData >( );
-  }
-  else
-  {
-    _TMesh* mesh = dynamic_cast< _TMesh* >( dobj );
-    if( mesh == NULL )
-      return;
-
-    this->Tag = Data::MESH;
-    this->Mesh.Configure( mesh->GetVTK< vtkPolyData >( ) );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-vtkImageData* cpPlugins::Interface::BaseMPRWidget::Data::
-GetImage( )
-{
-  if( this->Tag == Data::IMAGE )
-    return( this->Image );
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-vtkPolyData* cpPlugins::Interface::BaseMPRWidget::Data::
-GetMesh( )
-{
-  if( this->Tag == Data::MESH )
-    return( this->Mesh.Mesh );
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-vtkProp* cpPlugins::Interface::BaseMPRWidget::Data::
-GetMeshActor( )
-{
-  if( this->Tag == Data::MESH )
-    return( this->Mesh.Actor );
-  else
-    return( NULL );
-}
-
-#endif // cpPlugins_Interface_QT4
-
-// eof - $RCSfile$
diff --git a/lib/cpPlugins/Interface/BaseMPRWidget.h b/lib/cpPlugins/Interface/BaseMPRWidget.h
deleted file mode 100644 (file)
index d3b89dd..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-#ifndef __CPPLUGINS__INTERFACE__BASEMPRWIDGET__H__
-#define __CPPLUGINS__INTERFACE__BASEMPRWIDGET__H__
-
-#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
-#include <cpPlugins/Interface/Config.h>
-
-#ifdef cpPlugins_Interface_QT4
-
-#include <map>
-#include <string>
-
-#include <QWidget>
-
-#include <vtkSmartPointer.h>
-#include <vtkImageData.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkPolyDataNormals.h>
-#include <vtkQuadricLODActor.h>
-#include <vtkStripper.h>
-
-#include <cpExtensions/Visualization/MPRObjects.h>
-
-// -------------------------------------------------------------------------
-class QTreeWidgetItem;
-class QVTKWidget;
-
-namespace Ui
-{
-  class BaseMPRWidget;
-}
-
-// -------------------------------------------------------------------------
-namespace cpPlugins
-{
-  namespace Interface
-  {
-    // Some forward declarations
-    class DataObject;
-
-    /**
-     */
-    class cpPlugins_Interface_EXPORT BaseMPRWidget
-      : public QWidget
-    {
-      Q_OBJECT;
-
-    public:
-      typedef BaseMPRWidget Self;
-      typedef cpExtensions::Visualization::MPRObjects TMPRObjects;
-
-      typedef TMPRObjects::TStyle                   TStyle;
-      typedef TMPRObjects::TMouseCommand            TMouseCommand;
-      typedef TMPRObjects::TMouseWheelCommand       TMouseWheelCommand;
-      typedef TMPRObjects::TKeyCommand              TKeyCommand;
-      typedef TMPRObjects::TVoidCommand             TVoidCommand;
-      typedef TMPRObjects::TMouseMoveCommand        TMouseMoveCommand;
-      typedef TMPRObjects::TMouseClickCommand       TMouseClickCommand;
-      typedef TMPRObjects::TMouseDoubleClickCommand TMouseDoubleClickCommand;
-      typedef TMPRObjects::TExposeCommand           TExposeCommand;
-      typedef TMPRObjects::TConfigureCommand        TConfigureCommand;
-      typedef TMPRObjects::TEnterCommand            TEnterCommand;
-      typedef TMPRObjects::TLeaveCommand            TLeaveCommand;
-
-    public:
-      explicit BaseMPRWidget( QWidget* parent = 0 );
-      virtual ~BaseMPRWidget( );
-
-      // Data management
-      bool AddData(
-        DataObject* data, const std::string& name,
-        const std::string& parent
-        );
-      const std::string& GetMainImage( ) const;
-      bool SetMainImage( const std::string& name );
-      void DeleteData( const std::string& name );
-      void DeleteAllData( );
-
-      // Some visualization accessors
-      void SetDataColor(
-        const std::string& name,
-        const double& r, const double& g, const double& b
-        );
-      void ShowData( const std::string& name );
-      void HideData( const std::string& name );
-
-      vtkRenderWindowInteractor* GetInteractor( unsigned int i );
-
-      // Visual objects accessors
-      std::string GetSelectedData( ) const;
-
-    protected:
-      QTreeWidgetItem* _FindItemInTree( const std::string& name ) const;
-      QTreeWidgetItem* _UpdateTreeItem(
-        const std::string& name,
-        const std::string& parent
-        );
-
-    private slots:
-      void _SyncBottom( int a, int b );
-      void _SyncTop( int a, int b );
-
-    protected:
-      static double cm_Colors[ 8 ][ 3 ];
-
-      Ui::BaseMPRWidget*             m_UI;
-      vtkSmartPointer< TMPRObjects > m_MPRObjects;
-      QVTKWidget*                    m_VTK[ 4 ];
-
-      struct PolyDataActor
-      {
-        vtkPolyData*        Mesh;
-        vtkPolyDataNormals* Normals;
-        vtkStripper*        Stripper;
-        vtkPolyDataMapper*  Mapper;
-        vtkQuadricLODActor* Actor;
-
-        PolyDataActor( );
-        virtual ~PolyDataActor( );
-        void Configure( vtkPolyData* pd );
-      };
-
-      struct Data
-      {
-        enum { IMAGE, MESH } Tag;
-        DataObject*          Source;
-        vtkImageData*        Image;
-        PolyDataActor        Mesh;
-
-        Data( );
-        virtual ~Data( );
-
-        Data& operator=( const Data& data );
-
-        DataObject* GetSourceDataObject( );
-        const DataObject* GetSourceDataObject( ) const;
-        void SetSourceDataObject( DataObject* dobj );
-
-        vtkImageData* GetImage( );
-        vtkPolyData* GetMesh( );
-        vtkProp* GetMeshActor( );
-      };
-
-      std::string m_MainImage;
-      std::map< std::string, Data >        m_Data;
-      std::map< std::string, std::string > m_Tree;
-    };
-
-  } // ecapseman
-
-} // ecapseman
-
-#endif // cpPlugins_Interface_QT4
-
-#endif // __CPPLUGINS__INTERFACE__BASEMPRWIDGET__H__
-
-// eof - $RCSfile$
diff --git a/lib/cpPlugins/Interface/BaseMPRWidget.ui b/lib/cpPlugins/Interface/BaseMPRWidget.ui
deleted file mode 100644 (file)
index 8eafb59..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>BaseMPRWidget</class>
- <widget class="QWidget" name="BaseMPRWidget">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>580</width>
-    <height>424</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <widget class="QSplitter" name="MainSplitter">
-     <property name="minimumSize">
-      <size>
-       <width>562</width>
-       <height>406</height>
-      </size>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <widget class="QTreeWidget" name="LoadedData">
-      <property name="minimumSize">
-       <size>
-        <width>150</width>
-        <height>406</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>500</width>
-        <height>16777215</height>
-       </size>
-      </property>
-      <column>
-       <property name="text">
-        <string>Data</string>
-       </property>
-      </column>
-     </widget>
-     <widget class="QSplitter" name="QuadSplitter">
-      <property name="minimumSize">
-       <size>
-        <width>406</width>
-        <height>406</height>
-       </size>
-      </property>
-      <property name="orientation">
-       <enum>Qt::Vertical</enum>
-      </property>
-      <widget class="QSplitter" name="TopSplitter">
-       <property name="minimumSize">
-        <size>
-         <width>406</width>
-         <height>200</height>
-        </size>
-       </property>
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <widget class="QVTKWidget" name="VTK00" native="true">
-        <property name="minimumSize">
-         <size>
-          <width>200</width>
-          <height>200</height>
-         </size>
-        </property>
-       </widget>
-       <widget class="QVTKWidget" name="VTK01" native="true">
-        <property name="minimumSize">
-         <size>
-          <width>200</width>
-          <height>200</height>
-         </size>
-        </property>
-       </widget>
-      </widget>
-      <widget class="QSplitter" name="BottomSplitter">
-       <property name="minimumSize">
-        <size>
-         <width>406</width>
-         <height>200</height>
-        </size>
-       </property>
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <widget class="QVTKWidget" name="VTK10" native="true">
-        <property name="minimumSize">
-         <size>
-          <width>200</width>
-          <height>200</height>
-         </size>
-        </property>
-       </widget>
-       <widget class="QVTKWidget" name="VTK11" native="true">
-        <property name="minimumSize">
-         <size>
-          <width>200</width>
-          <height>200</height>
-         </size>
-        </property>
-       </widget>
-      </widget>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>QVTKWidget</class>
-   <extends>QWidget</extends>
-   <header location="global">QVTKWidget.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
index 44eb019063bf6612b2796e32ccb57fb854e9e976..3de13f139a21d757acc1f904c7168a498c8a2bac 100644 (file)
@@ -20,7 +20,6 @@ FILE(GLOB LIB_SOURCES_CXX "*.cxx")
 IF(USE_QT4)
   SET(
     LIB_QT_UI
-    BaseMPRWidget.ui
     SimpleMPRWidget.ui
     ParametersListWidget.ui
     )
@@ -28,14 +27,12 @@ IF(USE_QT4)
     LIB_QT_Headers
     ParametersListWidget.h
     ParametersQtDialog.h
-    BaseMPRWidget.h
     SimpleMPRWidget.h
     )
   SET(
     LIB_QT_Sources
     ParametersListWidget.cxx
     ParametersQtDialog.cxx
-    BaseMPRWidget.cxx
     SimpleMPRWidget.cxx
     )
   SET(
index c937e4d32d868d8359018e8183136168f7ea4283..deac58c581b7421cd3f27ec2cc7dbfeb201cae03 100644 (file)
@@ -67,8 +67,6 @@ DisconnectPipeline( )
 cpPlugins::Interface::DataObject::
 DataObject( )
   : Superclass( ),
-    m_ITKObject( NULL ),
-    m_VTKObject( NULL ),
     m_Source( NULL )
 {
 }
index 05b70239dc06bda7ff7ac5e7451bbca89f050b95..e2d79ffcc16ba3313d4b50b2b1e4e7f26759a60e 100644 (file)
@@ -3,10 +3,6 @@
 
 #include <cpPlugins/Interface/Object.h>
 
-#include <itkObject.h>
-#include <vtkSmartPointer.h>
-#include <vtkObject.h>
-
 namespace cpPlugins
 {
   namespace Interface
@@ -37,18 +33,6 @@ namespace cpPlugins
 
       void DisconnectPipeline( );
 
-      template< class T >
-        inline T* GetITK( );
-
-      template< class T >
-        inline const T* GetITK( ) const;
-
-      template< class T >
-        inline T* GetVTK( );
-
-      template< class T >
-        inline const T* GetVTK( ) const;
-
     protected:
       DataObject( );
       virtual ~DataObject( );
@@ -59,17 +43,13 @@ namespace cpPlugins
       Self& operator=( const Self& );
 
     protected:
-      itk::Object::Pointer         m_ITKObject;
-      vtkSmartPointer< vtkObject > m_VTKObject;
-      ProcessObject*               m_Source;
+      ProcessObject* m_Source;
     };
 
   } // ecapseman
 
 } // ecapseman
 
-#include <cpPlugins/Interface/DataObject.hxx>
-
 #endif // __CPPLUGINS__INTERFACE__DATAOBJECT__H__
 
 // eof - $RCSfile$
index 23e1c233c3d2d80748c4bc90b5ad807703a40dc0..729acdf682aaaa382d4e50db41ab40dadda85666 100644 (file)
@@ -5,7 +5,9 @@
 
 #include <itkProcessObject.h>
 
-// -------------------------------------------------------------------------
+// Some forward declarations
+class vtkObject;
+
 namespace cpPlugins
 {
   namespace Interface
index 5b675b2bcada1e7a2a436d6c50594f30efd9cb30..ab2c5ea00c9b6399ce0afa635dd1bba997b50805 100644 (file)
@@ -48,6 +48,7 @@ SetITK( itk::Object* object )
     this->m_VTKObject = NULL;
     this->m_ITKvVTKConnection = NULL;
     this->Modified( );
+    return;
 
   } // fi
 
@@ -118,7 +119,7 @@ _ITK_2_VTK( itk::Object* object )
   typedef itk::Image< P, D > _I;
   typedef itk::ImageToVTKImageFilter< _I > _I2Vtk;
 
-  // Check if input object has the desired type
+  // Check (yes, again!!!) if input object has the desired type
   _I* image = dynamic_cast< _I* >( object );
   if( image == NULL )
     return;
index 5802ac86c831d451a473034d33c57a2ced024497..cae117db7938bd1ca795752b70d3f2791a08ea9a 100644 (file)
@@ -1,5 +1,8 @@
 #include <cpPlugins/Interface/ImplicitFunction.h>
 
+#include <itkSpatialObject.h>
+
+#include <vtkSmartPointer.h>
 #include <vtkBox.h>
 #include <vtkCone.h>
 #include <vtkCylinder.h>
index 18ff63d3d5767afe1707be4c24099c5cb9cb99ec..a8c8a7841de14bc876e5ef254820efd6a610a86c 100644 (file)
@@ -4,10 +4,8 @@
 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 #include <cpPlugins/Interface/DataObject.h>
 
-#include <itkSpatialObject.h>
-
-#include <vtkSmartPointer.h>
-#include <vtkImplicitFunction.h>
+// Sompe forward declarations
+class vtkImplicitFunction;
 
 namespace cpPlugins
 {
index 34dbf2e6fc186218481d1ebbfabd448bb64d4681..9d7b2fe77752598673fab232c9f582437054fe29 100644 (file)
@@ -1,4 +1,5 @@
 #include <cpPlugins/Interface/Interface.h>
+#include <algorithm>
 #include <cstdlib>
 #include <fstream>
 #include <sstream>
index 90cea8c5fae400215e057e7e467c2fefa5908b4f..790a99765c64d508ebfe0d0c32b97a0965e5d7c7 100644 (file)
@@ -6,10 +6,10 @@
 #include <cpPlugins/Interface/Config.h>
 
 // -------------------------------------------------------------------------
-#define cpPlugins_Id_Macro( name, category )                            \
+#define cpPlugins_Id_Macro( N, C )                                      \
   public:                                                               \
-  virtual const char* GetClassName( ) const     { return( #name ); }    \
-  virtual const char* GetClassCategory( ) const { return( #category ); }
+  virtual const char* GetClassName( ) const     { return( #N ); }       \
+  virtual const char* GetClassCategory( ) const { return( #C ); }
 
 // -------------------------------------------------------------------------
 #define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE )                 \
index e7692390bc46e12a2d2f663159d9c5ac5d56462d..10752baeb0be3d171b5495957173da3715d644b8 100644 (file)
@@ -3,6 +3,9 @@
 
 #include <cpPlugins/Interface/DataObject.h>
 
+// Some forward declarations
+class vtkObject;
+
 namespace cpPlugins
 {
   namespace Interface
index 369b20f7cf79a04bc754d37556334b2b6dce1062..583f59adba97c10cbbca3dc51c43c02561daebfa 100644 (file)
@@ -1,9 +1,33 @@
 #include <cpPlugins/Interface/Object.h>
 
+#include <itkObject.h>
+#include <vtkObject.h>
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::Object::
+Modified( ) const
+{
+  const itk::Object* i = this->GetITK< itk::Object >( );
+  vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
+  if( i != NULL ) i->Modified( );
+  if( v != NULL ) v->Modified( );
+  this->Superclass::Modified( );
+}
+
+// -------------------------------------------------------------------------
+float cpPlugins::Interface::Object::
+SetViewCoords( float x, float y )
+{
+  this->SetViewX( x );
+  this->SetViewY( y );
+}
+
 // -------------------------------------------------------------------------
 cpPlugins::Interface::Object::
 Object( )
   : Superclass( ),
+    m_ITKObject( NULL ),
+    m_VTKObject( NULL ),
     m_Name( "" ),
     m_ViewX( float( 0 ) ),
     m_ViewY( float( 0 ) )
index 345be7f9cb8a9733bb2eb40636e9643e16c1b99c..0adfa8e9ab62a323ffd148eac2ef1e52f9c6060e 100644 (file)
@@ -4,9 +4,13 @@
 #include <cpPlugins/Interface/Macros.h>
 
 #include <string>
+
 #include <itkObject.h>
 #include <itkObjectFactory.h>
 
+#include <vtkSmartPointer.h>
+#include <vtkObjectBase.h>
+
 namespace cpPlugins
 {
   namespace Interface
@@ -36,11 +40,20 @@ namespace cpPlugins
       itkSetMacro( ViewY, float );
 
     public:
-      inline float SetViewCoords( float x, float y )
-        {
-          this->SetViewX( x );
-          this->SetViewY( y );
-        }
+      virtual void Modified( ) const;
+      float SetViewCoords( float x, float y );
+
+      template< class T >
+        inline T* GetITK( );
+
+      template< class T >
+        inline const T* GetITK( ) const;
+
+      template< class T >
+        inline T* GetVTK( );
+
+      template< class T >
+        inline const T* GetVTK( ) const;
 
     protected:
       Object( );
@@ -52,14 +65,20 @@ namespace cpPlugins
       Self& operator=( const Self& );
 
     protected:
-      std::string m_Name;
-      float m_ViewX, m_ViewY;
+      itk::LightObject::Pointer        m_ITKObject;
+      vtkSmartPointer< vtkObjectBase > m_VTKObject;
+      std::string                      m_Name;
+
+      float m_ViewX;
+      float m_ViewY;
     };
 
   } // ecapseman
 
 } // ecapseman
 
+#include <cpPlugins/Interface/Object.hxx>
+
 #endif // __CPPLUGINS__INTERFACE__OBJECT__H__
 
 // eof - $RCSfile$
similarity index 70%
rename from lib/cpPlugins/Interface/DataObject.hxx
rename to lib/cpPlugins/Interface/Object.hxx
index a7e6c63762da3bcf333cc535496ca4490e9977c0..914d5caf81f846a890c1c8c281d41b1e7aea13c7 100644 (file)
@@ -1,9 +1,9 @@
-#ifndef __CPPLUGINS__INTERFACE__DATAOBJECT__HXX__
-#define __CPPLUGINS__INTERFACE__DATAOBJECT__HXX__
+#ifndef __CPPLUGINS__INTERFACE__OBJECT__HXX__
+#define __CPPLUGINS__INTERFACE__OBJECT__HXX__
 
 // -------------------------------------------------------------------------
 template< class T >
-T* cpPlugins::Interface::DataObject::
+T* cpPlugins::Interface::Object::
 GetITK( )
 {
   return( dynamic_cast< T* >( this->m_ITKObject.GetPointer( ) ) );
@@ -11,7 +11,7 @@ GetITK( )
 
 // -------------------------------------------------------------------------
 template< class T >
-const T* cpPlugins::Interface::DataObject::
+const T* cpPlugins::Interface::Object::
 GetITK( ) const
 {
   return( dynamic_cast< const T* >( this->m_ITKObject.GetPointer( ) ) );
@@ -19,7 +19,7 @@ GetITK( ) const
 
 // -------------------------------------------------------------------------
 template< class T >
-T* cpPlugins::Interface::DataObject::
+T* cpPlugins::Interface::Object::
 GetVTK( )
 {
   return( dynamic_cast< T* >( this->m_VTKObject.GetPointer( ) ) );
@@ -27,12 +27,12 @@ GetVTK( )
 
 // -------------------------------------------------------------------------
 template< class T >
-const T* cpPlugins::Interface::DataObject::
+const T* cpPlugins::Interface::Object::
 GetVTK( ) const
 {
   return( dynamic_cast< const T* >( this->m_VTKObject.GetPointer( ) ) );
 }
 
-#endif // __CPPLUGINS__INTERFACE__DATAOBJECT__HXX__
+#endif // __CPPLUGINS__INTERFACE__OBJECT__HXX__
 
 // eof - $RCSfile$
index 7e2459cafbc686459ba8f56859fb6e14197fde10..e6db0e3541a6246665dbb91915e69371f723da5a 100644 (file)
@@ -44,7 +44,7 @@ Clear( )
 
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::Parameters::
-GetNames( std::vector< TString >& container ) const
+GetNames( std::vector< std::string >& container ) const
 {
   container.clear( );
   TParameters::const_iterator i = this->m_Parameters.begin( );
@@ -55,7 +55,7 @@ GetNames( std::vector< TString >& container ) const
 // -------------------------------------------------------------------------
 cpPlugins::Interface::Parameters::
 Type cpPlugins::Interface::Parameters::
-GetType( const TString& name ) const
+GetType( const std::string& name ) const
 {
   auto i = this->m_Parameters.find( name );
   if( i != this->m_Parameters.end( ) )
@@ -70,7 +70,7 @@ GetType( const TString& name ) const
     return( #Y )
 
 std::string cpPlugins::Interface::Parameters::
-GetTypeAsString( const TString& name ) const
+GetTypeAsString( const std::string& name ) const
 {
   auto i = this->m_Parameters.find( name );
   cpPlugins_Parameters_TypeAsString( String );
@@ -78,9 +78,6 @@ GetTypeAsString( const TString& name ) const
   else cpPlugins_Parameters_TypeAsString( Int );
   else cpPlugins_Parameters_TypeAsString( Uint );
   else cpPlugins_Parameters_TypeAsString( Real );
-  else cpPlugins_Parameters_TypeAsString( Index );
-  else cpPlugins_Parameters_TypeAsString( Point );
-  else cpPlugins_Parameters_TypeAsString( Vector );
   else cpPlugins_Parameters_TypeAsString( OpenFileName );
   else cpPlugins_Parameters_TypeAsString( SaveFileName );
   else cpPlugins_Parameters_TypeAsString( PathName );
@@ -89,9 +86,6 @@ GetTypeAsString( const TString& name ) const
   else cpPlugins_Parameters_TypeAsString( IntList );
   else cpPlugins_Parameters_TypeAsString( UintList );
   else cpPlugins_Parameters_TypeAsString( RealList );
-  else cpPlugins_Parameters_TypeAsString( IndexList );
-  else cpPlugins_Parameters_TypeAsString( PointList );
-  else cpPlugins_Parameters_TypeAsString( VectorList );
   else cpPlugins_Parameters_TypeAsString( OpenFileNameList );
   else cpPlugins_Parameters_TypeAsString( SaveFileNameList );
   else cpPlugins_Parameters_TypeAsString( PathNameList );
@@ -113,9 +107,6 @@ GetTypeFromString( const std::string& t )
   else cpPlugins_Parameters_TypeFromString( Int, t );
   else cpPlugins_Parameters_TypeFromString( Uint, t );
   else cpPlugins_Parameters_TypeFromString( Real, t );
-  else cpPlugins_Parameters_TypeFromString( Index, t );
-  else cpPlugins_Parameters_TypeFromString( Point, t );
-  else cpPlugins_Parameters_TypeFromString( Vector, t );
   else cpPlugins_Parameters_TypeFromString( OpenFileName, t );
   else cpPlugins_Parameters_TypeFromString( SaveFileName, t );
   else cpPlugins_Parameters_TypeFromString( PathName, t );
@@ -124,9 +115,6 @@ GetTypeFromString( const std::string& t )
   else cpPlugins_Parameters_TypeFromString( IntList, t );
   else cpPlugins_Parameters_TypeFromString( UintList, t );
   else cpPlugins_Parameters_TypeFromString( RealList, t );
-  else cpPlugins_Parameters_TypeFromString( IndexList, t );
-  else cpPlugins_Parameters_TypeFromString( PointList, t );
-  else cpPlugins_Parameters_TypeFromString( VectorList, t );
   else cpPlugins_Parameters_TypeFromString( OpenFileNameList, t );
   else cpPlugins_Parameters_TypeFromString( SaveFileNameList, t );
   else cpPlugins_Parameters_TypeFromString( PathNameList, t );
@@ -189,7 +177,7 @@ ConfigureAsChoices(
 
 // -------------------------------------------------------------------------
 std::vector< std::string > cpPlugins::Interface::Parameters::
-GetChoices( const TString& name ) const
+GetChoices( const std::string& name ) const
 {
   std::vector< std::string > choices;
 
@@ -236,19 +224,18 @@ GetSelectedChoice( const std::string& name ) const
 
 // -------------------------------------------------------------------------
 bool cpPlugins::Interface::Parameters::
-SetSelectedChoice( const TString& name, const TString& choice )
+SetSelectedChoice( const std::string& name, const std::string& choice )
 {
   auto i = this->m_Parameters.find( name );
   if( i != this->m_Parameters.end( ) )
   {
     if( i->second.first == Self::Choices )
     {
-      std::vector< std::string > c = this->GetChoices( name );
-      if( std::find( c.begin( ), c.end( ), choice ) != c.end( ) )
+      std::istringstream str_choices( i->second.second );
+      std::string choices;
+      std::getline( str_choices, choices, '@' );
+      if( choices.find( choice ) != std::string::npos )
       {
-        std::istringstream str_choices( i->second.second );
-        std::string choices;
-        std::getline( str_choices, choices, '@' );
         std::stringstream new_choices;
         new_choices << choices << "@" << choice;
         i->second.second = new_choices.str( );
@@ -264,24 +251,6 @@ SetSelectedChoice( const TString& name, const TString& choice )
     return( false );
 }
 
-// -------------------------------------------------------------------------
-#define cpPlugins_Parameters_ClearList( Y )                     \
-  void cpPlugins::Interface::Parameters::                       \
-  Clear##Y##List( const TString& name )                         \
-  {                                                             \
-    auto i = this->m_Parameters.find( name );                   \
-    if( i == this->m_Parameters.end( ) )                        \
-      return;                                                   \
-    if( i->second.first != Self::Y##List )                      \
-      return;                                                   \
-    i->second.second = "";                                      \
-    this->Modified( );                                          \
-  }
-
-cpPlugins_Parameters_ClearList( Index );
-cpPlugins_Parameters_ClearList( Point );
-cpPlugins_Parameters_ClearList( Vector );
-
 // -------------------------------------------------------------------------
 bool cpPlugins::Interface::Parameters::
 ToXML( TiXmlElement* parent_elem ) const
index c93e160877d51275504aef98621a2f6a8433e5e4..f751e984d9a9821a551b27991539d09e794b7a88 100644 (file)
@@ -159,12 +159,10 @@ namespace cpPlugins
       enum Type
       {
         String       , Bool             , Int              ,
-        Uint         , Real             , Index            ,
-        Point        , Vector           , OpenFileName     ,
+        Uint         , Real             , OpenFileName     ,
         SaveFileName , PathName         , StringList       ,
         BoolList     , IntList          , UintList         ,
-        RealList     , IndexList        , PointList        ,
-        VectorList   , OpenFileNameList , SaveFileNameList ,
+        RealList     , OpenFileNameList , SaveFileNameList ,
         PathNameList , Choices          , NoType
       };
 
@@ -189,9 +187,6 @@ namespace cpPlugins
       cpPlugins_Parameters_Configure( Int );
       cpPlugins_Parameters_Configure( Uint );
       cpPlugins_Parameters_Configure( Real );
-      cpPlugins_Parameters_Configure( Index );
-      cpPlugins_Parameters_Configure( Point );
-      cpPlugins_Parameters_Configure( Vector );
       cpPlugins_Parameters_Configure( OpenFileName );
       cpPlugins_Parameters_Configure( SaveFileName );
       cpPlugins_Parameters_Configure( PathName );
@@ -200,9 +195,6 @@ namespace cpPlugins
       cpPlugins_Parameters_Configure( IntList );
       cpPlugins_Parameters_Configure( UintList );
       cpPlugins_Parameters_Configure( RealList );
-      cpPlugins_Parameters_Configure( IndexList );
-      cpPlugins_Parameters_Configure( PointList );
-      cpPlugins_Parameters_Configure( VectorList );
       cpPlugins_Parameters_Configure( OpenFileNameList );
       cpPlugins_Parameters_Configure( SaveFileNameList );
       cpPlugins_Parameters_Configure( PathNameList );
@@ -258,63 +250,6 @@ namespace cpPlugins
         const std::string& name, const std::string& choice
         );
 
-      // Some templated methods
-      template< class I >
-        I GetIndex(
-          const std::string& name, const unsigned int& dim
-          ) const;
-      template< class P >
-        P GetPoint(
-          const std::string& name, const unsigned int& dim
-          ) const;
-      template< class V >
-        V GetVector(
-          const std::string& name, const unsigned int& dim
-          ) const;
-
-      template< class I >
-        void SetIndex(
-          const std::string& name, const unsigned int& dim, const I& v
-          );
-      template< class P >
-        void SetPoint(
-          const std::string& name, const unsigned int& dim, const P& v
-          );
-      template< class V >
-        void SetVector(
-          const std::string& name, const unsigned int& dim, const V& v
-          );
-
-      template< class I >
-        std::vector< I > GetIndexList(
-          const std::string& name, const unsigned int& dim
-          ) const;
-      template< class P >
-        std::vector< P > GetPointList(
-          const std::string& name, const unsigned int& dim
-          ) const;
-      template< class V >
-        std::vector< V > GetVectorList(
-          const std::string& name, const unsigned int& dim
-          ) const;
-
-      template< class I >
-        void AddToIndexList(
-          const std::string& name, const unsigned int& dim, const I& v
-          );
-      template< class P >
-        void AddToPointList(
-          const std::string& name, const unsigned int& dim, const P& v
-          );
-      template< class P >
-        void AddToVectorList(
-          const std::string& name, const unsigned int& dim, const P& v
-          );
-
-      void ClearIndexList( const std::string& name );
-      void ClearPointList( const std::string& name );
-      void ClearVectorList( const std::string& name );
-
       // XML "streaming"
       bool ToXML( TiXmlElement* parent_elem ) const;
       bool FromXML( const TiXmlElement* filter_elem );
@@ -341,8 +276,6 @@ namespace cpPlugins
 
 } // ecapseman
 
-#include <cpPlugins/Interface/Parameters.hxx>
-
 #endif // __CPPLUGINS__INTERFACE__PARAMETERS__H__
 
 // eof - $RCSfile$
diff --git a/lib/cpPlugins/Interface/Parameters.hxx b/lib/cpPlugins/Interface/Parameters.hxx
deleted file mode 100644 (file)
index eecb2b6..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-#ifndef __CPPLUGINS__INTERFACE__PARAMETERS__HXX__
-#define __CPPLUGINS__INTERFACE__PARAMETERS__HXX__
-
-// -------------------------------------------------------------------------
-template< class I >
-I cpPlugins::Interface::Parameters::
-GetIndex( const std::string& name, const unsigned int& dim ) const
-{
-  I v;
-  auto i = this->m_Parameters.find( name );
-  if( i != this->m_Parameters.end( ) )
-  {
-    if( i->second.first == Self::Index )
-    {
-      std::istringstream str( i->second.second );
-      std::string token;
-      unsigned int d = 0;
-      while( std::getline( str, token, ';' ) && d < dim )
-      {
-        v[ d ] = std::atoi( token.c_str( ) );
-        d++;
-
-      } // elihw
-      return( v );
-
-    } // fi
-
-  } // fi
-
-  // If parameter not found
-  for( unsigned int d = 0; d < dim; ++d )
-    v[ d ] = 0;
-  return( v );
-}
-
-// -------------------------------------------------------------------------
-template< class P >
-P cpPlugins::Interface::Parameters::
-GetPoint( const std::string& name, const unsigned int& dim ) const
-{
-  P v;
-  auto i = this->m_Parameters.find( name );
-  if( i != this->m_Parameters.end( ) )
-  {
-    if( i->second.first == Self::Point )
-    {
-      std::istringstream str( i->second.second );
-      std::string token;
-      unsigned int d = 0;
-      while( std::getline( str, token, ';' ) && d < dim )
-      {
-        std::istringstream tok_str( token );
-        tok_str >> v[ d ];
-        d++;
-
-      } // elihw
-      return( v );
-
-    } // fi
-
-  } // fi
-
-  // If parameter not found
-  for( unsigned int d = 0; d < dim; ++d )
-    v[ d ] = float( 0 );
-  return( v );
-}
-
-// -------------------------------------------------------------------------
-template< class V >
-V cpPlugins::Interface::Parameters::
-GetVector( const std::string& name, const unsigned int& dim ) const
-{
-  V v;
-  auto i = this->m_Parameters.find( name );
-  if( i != this->m_Parameters.end( ) )
-  {
-    if( i->second.first == Self::Vector )
-    {
-      std::istringstream str( i->second.second );
-      std::string token;
-      unsigned int d = 0;
-      while( std::getline( str, token, ';' ) && d < dim )
-      {
-        std::istringstream tok_str( token );
-        tok_str >> v[ d ];
-        d++;
-
-      } // elihw
-      return( v );
-
-    } // fi
-
-  } // fi
-
-  // If parameter not found
-  for( unsigned int d = 0; d < dim; ++d )
-    v[ d ] = float( 0 );
-  return( v );
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-void cpPlugins::Interface::Parameters::
-SetIndex( const std::string& name, const unsigned int& dim, const I& v )
-{
-  TParameters::iterator i = this->m_Parameters.find( name );
-  if( i == this->m_Parameters.end( ) )
-    return;
-  if( i->second.first != Self::Index )
-    return;
-
-  std::stringstream str;
-  str << v[ 0 ];
-  for( unsigned int d = 1; d < dim; ++d )
-    str << ";" << v[ d ];
-  i->second.second = str.str( );
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-template< class P >
-void cpPlugins::Interface::Parameters::
-SetPoint( const std::string& name, const unsigned int& dim, const P& v )
-{
-  TParameters::iterator i = this->m_Parameters.find( name );
-  if( i == this->m_Parameters.end( ) )
-    return;
-  if( i->second.first != Self::Point )
-    return;
-
-  std::stringstream str;
-  str << v[ 0 ];
-  for( unsigned int d = 1; d < dim; ++d )
-    str << ";" << v[ d ];
-  i->second.second = str.str( );
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-template< class V >
-void cpPlugins::Interface::Parameters::
-SetVector( const std::string& name, const unsigned int& dim, const V& v )
-{
-  TParameters::iterator i = this->m_Parameters.find( name );
-  if( i == this->m_Parameters.end( ) )
-    return;
-  if( i->second.first != Self::Vector )
-    return;
-
-  std::stringstream str;
-  str << v[ 0 ];
-  for( unsigned int d = 1; d < dim; ++d )
-    str << ";" << v[ d ];
-  i->second.second = str.str( );
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-std::vector< I > cpPlugins::Interface::Parameters::
-GetIndexList( const std::string& name, const unsigned int& dim ) const
-{
-  std::vector< I > lst;
-  auto i = this->m_Parameters.find( name );
-  if( i != this->m_Parameters.end( ) )
-  {
-    if( i->second.first == Self::IndexList )
-    {
-      std::istringstream str( i->second.second );
-      std::string token;
-      unsigned int d = 0;
-      while( std::getline( str, token, '#' ) )
-      {
-        std::istringstream str2( token );
-        std::string token2;
-        unsigned int d = 0;
-        I v;
-        while( std::getline( str2, token2, ';' ) && d < dim )
-        {
-          v[ d ] = std::atoi( token.c_str( ) );
-          d++;
-
-        } // elihw
-        lst.push_back( v );
-
-      } // elihw
-
-    } // fi
-
-  } // fi
-  return( lst );
-}
-
-// -------------------------------------------------------------------------
-template< class P >
-std::vector< P > cpPlugins::Interface::Parameters::
-GetPointList( const std::string& name, const unsigned int& dim ) const
-{
-  std::vector< P > lst;
-
-  auto i = this->m_Parameters.find( name );
-  if( i != this->m_Parameters.end( ) )
-  {
-    if( i->second.first == Self::PointList )
-    {
-      std::istringstream str( i->second.second );
-      std::string token;
-      unsigned int d = 0;
-      while( std::getline( str, token, '#' ) )
-      {
-        std::istringstream str2( token );
-        std::string token2;
-        unsigned int d = 0;
-        P v;
-        while( std::getline( str2, token2, ';' ) && d < dim )
-        {
-          std::istringstream tok_str( token );
-          tok_str >> v[ d ];
-          d++;
-
-        } // elihw
-        lst.push_back( v );
-
-      } // elihw
-
-    } // fi
-
-  } // fi
-  return( lst );
-}
-
-// -------------------------------------------------------------------------
-template< class V >
-std::vector< V > cpPlugins::Interface::Parameters::
-GetVectorList( const std::string& name, const unsigned int& dim ) const
-{
-  std::vector< V > lst;
-
-  auto i = this->m_Parameters.find( name );
-  if( i != this->m_Parameters.end( ) )
-  {
-    if( i->second.first == Self::VectorList )
-    {
-      std::istringstream str( i->second.second );
-      std::string token;
-      unsigned int d = 0;
-      while( std::getline( str, token, '#' ) )
-      {
-        std::istringstream str2( token );
-        std::string token2;
-        unsigned int d = 0;
-        V v;
-        while( std::getline( str2, token2, ';' ) && d < dim )
-        {
-          std::istringstream tok_str( token );
-          tok_str >> v[ d ];
-          d++;
-
-        } // elihw
-        lst.push_back( v );
-
-      } // elihw
-
-    } // fi
-
-  } // fi
-  return( lst );
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-void cpPlugins::Interface::Parameters::
-AddToIndexList( const std::string& name, const unsigned int& dim, const I& v )
-{
-  TParameters::iterator i = this->m_Parameters.find( name );
-  if( i == this->m_Parameters.end( ) )
-    return;
-  if( i->second.first != Self::IndexList )
-    return;
-
-  std::stringstream str;
-  if( i->second.second == "" )
-    str << v[ 0 ];
-  else
-    str << "#" << v[ 0 ];
-  for( unsigned int d = 1; d < dim; ++d )
-    str << ";" << v[ d ];
-  i->second.second += str.str( );
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-template< class P >
-void cpPlugins::Interface::Parameters::
-AddToPointList( const std::string& name, const unsigned int& dim, const P& v )
-{
-  TParameters::iterator i = this->m_Parameters.find( name );
-  if( i == this->m_Parameters.end( ) )
-    return;
-  if( i->second.first != Self::PointList )
-    return;
-
-  std::stringstream str;
-  if( i->second.second == "" )
-    str << v[ 0 ];
-  else
-    str << "#" << v[ 0 ];
-  for( unsigned int d = 1; d < dim; ++d )
-    str << ";" << v[ d ];
-  i->second.second += str.str( );
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-template< class V >
-void cpPlugins::Interface::Parameters::
-AddToVectorList( const std::string& name, const unsigned int& dim, const V& v )
-{
-  TParameters::iterator i = this->m_Parameters.find( name );
-  if( i == this->m_Parameters.end( ) )
-    return;
-  if( i->second.first != Self::VectorList )
-    return;
-
-  std::stringstream str;
-  if( i->second.second == "" )
-    str << v[ 0 ];
-  else
-    str << "#" << v[ 0 ];
-  for( unsigned int d = 1; d < dim; ++d )
-    str << ";" << v[ d ];
-  i->second.second += str.str( );
-  this->Modified( );
-}
-
-#endif // __CPPLUGINS__INTERFACE__PARAMETERS__HXX__
-
-// eof - $RCSfile$
index e502c6eb28a8332692a9a3c2f14141ca3124bb2e..0c3d4377151a8e1c97012442ac66fb5ef0b8521e 100644 (file)
@@ -5,6 +5,7 @@
 #include <limits>
 
 #include <cpPlugins/Interface/ParametersListWidget.h>
+#include <cpPlugins/Interface/ProcessObject.h>
 
 #include <vtkCommand.h>
 #include <vtkRenderWindowInteractor.h>
 #include <QPushButton>
 #include <QWidget>
 
-// -------------------------------------------------------------------------
-#include <cpPlugins/Interface/ProcessObject.h>
-#include <cpPlugins/Interface/Plugins.h>
-#include <cpPlugins/Interface/BaseApplication.h>
-
 /* TODO
 class SingleSeedCommand
   : public vtkCommand
@@ -244,12 +240,6 @@ setParameters( Parameters* parameters )
       w_input = v_double;
     }
     break;
-    case Parameters::Index:
-      break;
-    case Parameters::Point:
-      break;
-    case Parameters::Vector:
-      break;
     case Parameters::OpenFileName:
     {
       QFrame* frame = new QFrame( this );
@@ -367,12 +357,6 @@ setParameters( Parameters* parameters )
       w_input = frame;
     }
     break;
-    case Parameters::IndexList:
-      break;
-    case Parameters::PointList:
-      break;
-    case Parameters::VectorList:
-      break;
     case Parameters::OpenFileNameList:
     {
       QFrame* frame = new QFrame( this );
@@ -528,22 +512,10 @@ updateParameters( )
       } // fi
     }
     break;
-    case Parameters::Index:
-      break;
-    case Parameters::Point:
-      break;
-    case Parameters::Vector:
-      break;
     case Parameters::StringList:
       break;
     case Parameters::BoolList:
       break;
-    case Parameters::IndexList:
-      break;
-    case Parameters::PointList:
-      break;
-    case Parameters::VectorList:
-      break;
     case Parameters::SaveFileNameList:
       break;
     case Parameters::PathNameList:
@@ -632,22 +604,10 @@ updateView( )
       } // fi
     }
     break;
-    case Parameters::Index:
-      break;
-    case Parameters::Point:
-      break;
-    case Parameters::Vector:
-      break;
     case Parameters::StringList:
       break;
     case Parameters::BoolList:
       break;
-    case Parameters::IndexList:
-      break;
-    case Parameters::PointList:
-      break;
-    case Parameters::VectorList:
-      break;
     case Parameters::SaveFileNameList:
       break;
     case Parameters::PathNameList:
diff --git a/lib/cpPlugins/Interface/Plugins.cxx b/lib/cpPlugins/Interface/Plugins.cxx
deleted file mode 100644 (file)
index c5727c2..0000000
+++ /dev/null
@@ -1,811 +0,0 @@
-#include <cpPlugins/Interface/Plugins.h>
-
-#include <stdexcept>
-
-#include <cpPlugins/Interface/Image.h>
-#include <cpPlugins/Interface/Mesh.h>
-
-#ifdef cpPlugins_Interface_QT4
-
-#include <QApplication>
-#include <QFileDialog>
-#include <QMessageBox>
-#include <QWidget>
-
-#ifdef _WIN32
-#  define PLUGIN_PREFIX ""
-#  define PLUGIN_EXT "dll"
-#  define PLUGIN_REGEX "Plugins file (*.dll);;All files (*)"
-#else // Linux
-#  define PLUGIN_PREFIX "lib"
-#  define PLUGIN_EXT "so"
-#  define PLUGIN_REGEX "Plugins file (*.so);;All files (*)"
-#endif // _WIN32
-
-#endif // cpPlugins_Interface_QT4
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Plugins::
-Plugins( )
-  : m_Widget( NULL ),
-    m_Application( NULL ),
-    m_LastLoadedPlugin( "" ),
-    m_ActiveFilter( NULL )
-{
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Plugins::
-~Plugins( )
-{
-}
-
-// -------------------------------------------------------------------------
-QWidget* cpPlugins::Interface::Plugins::
-GetWidget( )
-{
-  return( this->m_Widget );
-}
-
-// -------------------------------------------------------------------------
-const QWidget* cpPlugins::Interface::Plugins::
-GetWidget( ) const
-{
-  return( this->m_Widget );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-SetWidget( QWidget* widget )
-{
-  this->m_Widget = widget;
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-BlockWidget( )
-{
-#ifdef cpPlugins_Interface_QT4
-  if( this->m_Widget != NULL )
-  {
-    QApplication::setOverrideCursor( Qt::WaitCursor );
-    this->m_Widget->setEnabled( false );
-
-  } // fi
-#endif // cpPlugins_Interface_QT4
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-UnblockWidget( )
-{
-#ifdef cpPlugins_Interface_QT4
-  if( this->m_Widget != NULL )
-  {
-    QApplication::restoreOverrideCursor( );
-    this->m_Widget->setEnabled( true );
-
-  } // fi
-#endif // cpPlugins_Interface_QT4
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-DialogLoadPlugins( )
-{
-#ifdef cpPlugins_Interface_QT4
-  if( this->m_Widget != NULL )
-  {
-    QFileDialog dialog( this->m_Widget );
-    dialog.setFileMode( QFileDialog::ExistingFile );
-    dialog.setDirectory( this->m_LastLoadedPlugin.c_str( ) );
-    dialog.setNameFilter( QFileDialog::tr( PLUGIN_REGEX ) );
-    dialog.setDefaultSuffix( QFileDialog::tr( PLUGIN_EXT ) );
-    if( !( dialog.exec( ) ) )
-      return;
-
-    std::string fname = dialog.selectedFiles( ).at( 0 ).toStdString( );
-    if( !( this->LoadPlugins( fname ) ) )
-      QMessageBox::critical(
-        this->m_Widget,
-        QMessageBox::tr( "Ignoring plugin" ),
-        QMessageBox::tr( fname.c_str( ) )
-        );
-
-  } // fi
-#endif // cpPlugins_Interface_QT4
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::
-BaseApplication* cpPlugins::Interface::Plugins::
-GetApplication( )
-{
-  return( this->m_Application );
-}
-
-// -------------------------------------------------------------------------
-const cpPlugins::Interface::
-BaseApplication* cpPlugins::Interface::Plugins::
-GetApplication( ) const
-{
-  return( this->m_Application );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-SetApplication( BaseApplication* a )
-{
-  this->m_Application = a;
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-LoadPluginsPath( const std::string& path, bool r )
-{
-  /* TODO
-  this->BlockWidget( );
-
-  // Load all plugins from given folder
-  std::list< std::string > files =
-    this->m_Interface.LoadFromFolder( path, r );
-
-  // Update a simple track
-  bool ret = false;
-  if( files.size( ) > 0 )
-  {
-    for( auto fIt = files.begin( ); fIt != files.end( ); ++fIt )
-    {
-      this->m_LoadedPlugins.insert( *fIt );
-      this->m_LastLoadedPlugin = *fIt;
-      ret = true;
-
-    } // rof
-    this->_UpdateLoadedPluginsInformation( );
-
-  } // fi
-
-  this->UnblockWidget( );
-  return( ret );
-  */
-  return( false );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-LoadPlugins( const std::string& fname )
-{
-  this->BlockWidget( );
-
-  // Is it already loaded?
-  bool ret = true;
-  if( this->m_LoadedPlugins.find( fname ) == this->m_LoadedPlugins.end( ) )
-  {
-    // Was it succesfully loaded?
-    ret = this->m_Interface.Load( fname );
-
-    // Update a simple track
-    if( ret )
-    {
-      this->m_LoadedPlugins.insert( fname );
-      this->m_LastLoadedPlugin = fname;
-      this->_UpdateLoadedPluginsInformation( );
-
-    } // fi
-
-  } // fi
-
-  this->UnblockWidget( );
-  return( ret );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-LoadPluginsConfigurationFile( const std::string& fname )
-{
-  // Load file into a char buffer
-  std::ifstream in(
-    fname.c_str( ), std::ios::in | std::ios::binary | std::ios::ate
-    );
-  if( !in.is_open( ) )
-    return( false );
-
-  std::streampos size = in.tellg( );
-  char* buffer = new char[ size ];
-  in.seekg( 0, std::ios::beg );
-  in.read( buffer, size );
-  in.close( );
-
-  // Read stream
-  std::stringstream in_stream( buffer );
-  char line[ 4096 ];
-  while( in_stream )
-  {
-    in_stream.getline( line, 4096 );
-    this->LoadPlugins( line );
-
-  } // elihw
-  delete buffer;
-
-  return( true );
-}
-
-// -------------------------------------------------------------------------
-const cpPlugins::Interface::Plugins::
-TStringContainer& cpPlugins::Interface::Plugins::
-GetLoadedPlugins( ) const
-{
-  return( this->m_LoadedPlugins );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-GetLoadedCategories( TStringContainer& categories ) const
-{
-  categories.clear( );
-  auto fIt = this->m_LoadedFilters.begin( );
-  for( ; fIt != this->m_LoadedFilters.end( ); ++fIt )
-    categories.insert( fIt->first );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-GetLoadedFilters( TStringContainer& filters ) const
-{
-  filters.clear( );
-  auto pIt = this->m_LoadedFilters.begin( );
-  for( ; pIt != this->m_LoadedFilters.end( ); ++pIt )
-    for( auto fIt = pIt->second.begin( ); fIt != pIt->second.end( ); ++fIt )
-      filters.insert( *fIt );
-}
-
-// -------------------------------------------------------------------------
-const cpPlugins::Interface::Plugins::
-TStringContainer& cpPlugins::Interface::Plugins::
-GetLoadedFilters( const std::string& category ) const
-{
-  static const TStringContainer EMPTY;
-  auto pIt = this->m_LoadedFilters.find( category );
-  if( pIt != this->m_LoadedFilters.end( ) )
-    return( pIt->second );
-  else
-    return( EMPTY );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-AddInteractor( vtkRenderWindowInteractor* interactor )
-{
-  this->m_Interactors.insert( interactor );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-RemoveInteractor( vtkRenderWindowInteractor* interactor )
-{
-  this->m_Interactors.erase( interactor );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-ClearInteractors( )
-{
-  this->m_Interactors.clear( );
-}
-
-// -------------------------------------------------------------------------
-#define cpPlugins_Plugins_HasMacro( F )                                 \
-  bool cpPlugins::Interface::Plugins::                                  \
-  Has##F( ) const                                                       \
-  {                                                                     \
-    return( this->m_IOFilters.find( #F ) != this->m_IOFilters.end( ) ); \
-  }
-
-cpPlugins_Plugins_HasMacro( ImageReader );
-cpPlugins_Plugins_HasMacro( DicomSeriesReader );
-cpPlugins_Plugins_HasMacro( MeshReader );
-cpPlugins_Plugins_HasMacro( ImageWriter );
-cpPlugins_Plugins_HasMacro( MeshWriter );
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::Plugins::
-ReadImage( const std::string& fname, const std::string& parent )
-{
-  std::vector< std::string > fnames( 1, fname );
-  return( this->ReadImage( fnames, parent ) );
-}
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::Plugins::
-ReadImage(
-  const std::vector< std::string >& fnames, const std::string& parent
-  )
-{
-  // Load source
-  this->_ActivateIOFilter( "ImageReader" );
-
-  // Configure reader
-  TParameters* params = this->GetActiveFilterParameters( );
-  params->ClearStringList( "FileNames" );
-  for( auto nIt = fnames.begin( ); nIt != fnames.end( ); ++nIt )
-    params->AddToStringList( "FileNames", *nIt );
-
-  // Execute filter
-  return( this->_ReadData( parent ) );
-}
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::Plugins::
-ReadImage( const std::string& parent )
-{
-  // Load source
-  this->_ActivateIOFilter( "ImageReader" );
-
-  // Try to configure source
-  if( !( this->ConfigureActiveFilter( ) ) )
-  {
-    this->DeactivateFilter( );
-    return( "" );
-
-  } // fi
-
-  // Execute filter
-  return( this->_ReadData( parent ) );
-}
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::Plugins::
-ReadDicomSeries( const std::string& parent )
-{
-  // Load source
-  this->_ActivateIOFilter( "DicomSeriesReader" );
-
-  // Try to configure source
-  if( !( this->ConfigureActiveFilter( ) ) )
-  {
-    this->DeactivateFilter( );
-    return( "" );
-
-  } // fi
-
-  // Execute filter
-  return( this->_ReadData( parent ) );
-}
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::Plugins::
-ReadMesh( const std::string& fname, const std::string& parent )
-{
-  // Load source
-  this->_ActivateIOFilter( "MeshReader" );
-
-  // Configure reader
-  TParameters* params = this->GetActiveFilterParameters( );
-  params->SetString( "FileName", fname );
-
-  // Execute filter
-  return( this->_ReadData( parent ) );
-}
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::Plugins::
-ReadMesh( const std::string& parent )
-{
-  // Load source
-  this->_ActivateIOFilter( "MeshReader" );
-
-  // Try to configure source
-  if( !( this->ConfigureActiveFilter( ) ) )
-  {
-    this->DeactivateFilter( );
-    return( "" );
-
-  } // fi
-
-  // Execute filter
-  return( this->_ReadData( parent ) );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-WriteDataObject( const std::string& fname, const std::string& name )
-{
-  typedef cpPlugins::Interface::Image _TImage;
-  typedef cpPlugins::Interface::Mesh  _TMesh;
-
-  // Activate sink
-  TDataObject* obj = this->GetData< TDataObject >( name );
-  if( dynamic_cast< cpPlugins::Interface::Image* >( obj ) != NULL )
-    this->_ActivateIOFilter( "ImageWriter" );
-  else if( dynamic_cast< cpPlugins::Interface::Mesh* >( obj ) != NULL )
-    this->_ActivateIOFilter( "MeshWriter" );
-  else
-  {
-    this->DeactivateFilter( );
-    return( false );
-
-  } // fi
-
-  // Configure writer
-  TParameters* params = this->GetActiveFilterParameters( );
-  params->SetString( "FileName", fname );
-
-  // Execute filter
-  return( this->_WriteData( name ) );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-WriteDataObject( const std::string& name )
-{
-  typedef cpPlugins::Interface::Image _TImage;
-  typedef cpPlugins::Interface::Mesh  _TMesh;
-
-  // Activate sink
-  TDataObject* obj = this->GetData< TDataObject >( name );
-  if( dynamic_cast< cpPlugins::Interface::Image* >( obj ) != NULL )
-    this->_ActivateIOFilter( "ImageWriter" );
-  else if( dynamic_cast< cpPlugins::Interface::Mesh* >( obj ) != NULL )
-    this->_ActivateIOFilter( "MeshWriter" );
-  else
-  {
-    this->DeactivateFilter( );
-    return( false );
-
-  } // fi
-
-  // Try to configure source
-  if( !( this->ConfigureActiveFilter( ) ) )
-  {
-    this->DeactivateFilter( );
-    return( false );
-
-  } // fi
-
-  // Execute filter
-  return( this->_WriteData( name ) );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-ClearDataObjects( )
-{
-  this->m_DataObjects.clear( );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-DeleteDataObject( const std::string& name )
-{
-  // Find and delete object
-  auto oIt = this->m_DataObjects.find( name );
-  if( oIt == this->m_DataObjects.end( ) )
-    return;
-  this->m_DataObjects.erase( oIt );
-
-  // Delete children
-  TStringContainer children;
-  this->GetChildren( children, name );
-  auto cIt = children.begin( );
-  for( ; cIt != children.end( ); ++cIt )
-    this->DeleteDataObject( *cIt );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-GetDataObjects( TStringContainer& names )
-{
-  names.clear( );
-  auto oIt = this->m_DataObjects.begin( );
-  for( ; oIt != this->m_DataObjects.end( ); ++oIt )
-    names.insert( oIt->first );
-}
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::Plugins::
-GetParent( const std::string& name ) const
-{
-  // Find and delete object
-  auto oIt = this->m_DataObjects.find( name );
-  if( oIt != this->m_DataObjects.end( ) )
-    return( oIt->second.first );
-  else
-    return( "" );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-GetChildren( TStringContainer& names, const std::string& name ) const
-{
-  names.clear( );
-  auto oIt = this->m_DataObjects.begin( );
-  for( ; oIt != this->m_DataObjects.end( ); ++oIt )
-    if( oIt->second.first == name )
-      names.insert( oIt->first );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-GetRoots( TStringContainer& names ) const
-{
-  this->GetChildren( names, "" );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-ActivateFilter( const std::string& name )
-{
-  this->m_ActiveFilter = this->m_Interface.CreateObject( name );
-  if( this->m_ActiveFilter.IsNotNull( ) )
-  {
-    this->m_ActiveFilter->SetPlugins( this );
-    auto iIt = this->m_Interactors.begin( );
-    for( ; iIt != this->m_Interactors.end( ); ++iIt )
-      this->m_ActiveFilter->AddInteractor( *iIt );
-    return( true );
-  }
-  else
-    return( false );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-DeactivateFilter( )
-{
-  if( this->m_ActiveFilter.IsNotNull( ) )
-    this->m_ActiveFilter->DisconnectOutputs( );
-  this->m_ActiveFilter = NULL;
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-HasActiveFilter( ) const
-{
-  return( this->m_ActiveFilter.IsNotNull( ) );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-IsActiveFilterInteractive( ) const
-{
-  if( this->m_ActiveFilter.IsNotNull( ) )
-    return( this->m_ActiveFilter->GetInteractive( ) );
-  else
-    return( false );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-GetActiveFilterInputsNames( TStringContainer& names ) const
-{
-  if( this->m_ActiveFilter.IsNotNull( ) )
-    this->m_ActiveFilter->GetInputsNames( names );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-GetActiveFilterOutputsNames( TStringContainer& names ) const
-{
-  if( this->m_ActiveFilter.IsNotNull( ) )
-    this->m_ActiveFilter->GetOutputsNames( names );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-ConnectInputInActiveFilter(
-  const std::string& object_name, const std::string& input_name
-  )
-{
-  if( this->m_ActiveFilter.IsNotNull( ) )
-  {
-    TDataObject* dobj = this->GetData< TDataObject >( object_name );
-    if( dobj != NULL )
-    {
-      this->m_ActiveFilter->SetInput( input_name, dobj );
-      return( true );
-
-    } // fi
-
-  } // fi
-  return( false );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-SetOutputNameInActiveFilter(
-  const std::string& new_object_name, const std::string& output_name
-  )
-{
-  if( this->m_ActiveFilter.IsNotNull( ) )
-    return(
-      this->m_ActiveFilter->SetOutputObjectName(
-        new_object_name, output_name
-        )
-      );
-  else
-    return( false );
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Plugins::
-TParameters* cpPlugins::Interface::Plugins::
-GetActiveFilterParameters( )
-{
-  if( this->m_ActiveFilter.IsNotNull( ) )
-    return( this->m_ActiveFilter->GetParameters( ) );
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-const cpPlugins::Interface::Plugins::
-TParameters* cpPlugins::Interface::Plugins::
-GetActiveFilterParameters( ) const
-{
-  if( this->m_ActiveFilter.IsNotNull( ) )
-    return( this->m_ActiveFilter->GetParameters( ) );
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Plugins::
-TProcessObject::DialogResult cpPlugins::Interface::Plugins::
-ConfigureActiveFilter( )
-{
-  if( this->m_ActiveFilter.IsNotNull( ) )
-    return( this->m_ActiveFilter->ExecConfigurationDialog( this->m_Widget ) );
-  else
-    return( false );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-UpdateActiveFilter( TStringContainer& outputs, const std::string& parent )
-{
-  if( this->m_ActiveFilter.IsNull( ) )
-    return( false );
-  
-  // Execute filter
-  this->BlockWidget( );
-  std::string err = this->m_ActiveFilter->Update( );
-  this->UnblockWidget( );
-
-  // Associate outputs
-  outputs.clear( );
-  if( err == "" )
-  {
-    std::set< std::string > names;
-    this->m_ActiveFilter->GetOutputsNames( names );
-    for( auto oIt = names.begin( ); oIt != names.end( ); ++oIt )
-    {
-      TDataObject* dobj =
-        this->m_ActiveFilter->GetOutput< TDataObject >( *oIt );
-
-      if( std::string( dobj->GetName( ) ) == std::string( "" ) )
-        dobj->SetName(
-          this->m_ActiveFilter->GetName( ) + std::string( "_" ) + *oIt
-          );
-      this->_InsertNewData( dobj, parent );
-      outputs.insert( dobj->GetName( ) );
-
-    } // rof
-    // this->m_ActiveFilter->DisconnectOutputs( );
-    return( true );
-  }
-  else
-  {
-#ifdef cpPlugins_Interface_QT4
-    if( this->m_Widget != NULL )
-      QMessageBox::critical(
-        this->m_Widget,
-        QMessageBox::tr( "Error reading image." ),
-        QMessageBox::tr( err.c_str( ) )
-        );
-    else
-      throw std::runtime_error(
-        std::string( "Error reading image: " ) + err
-        );
-#else // cpPlugins_Interface_QT4
-    throw std::runtime_error(
-      std::string( "Error reading image: " ) + err
-      );
-#endif // cpPlugins_Interface_QT4
-    return( false );
-
-  } // fi
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::Plugins::
-_UpdateLoadedPluginsInformation( )
-{
-  this->m_LoadedFilters.clear( );
-  const TInterface::TClasses& cls = this->m_Interface.GetClasses( );
-  for( auto i = cls.begin( ); i != cls.end( ); ++i )
-  {
-    TProcessObject::Pointer o = this->m_Interface.CreateObject( i->first );
-    std::string name = o->GetClassName( );
-    std::string category = o->GetClassCategory( );
-
-    if(
-      category == "ImageReader" ||
-      category == "ImageWriter" ||
-      category == "MeshReader" ||
-      category == "MeshWriter" ||
-      category == "DicomSeriesReader"
-      )
-      this->m_IOFilters[ category ] = o;
-    else
-      this->m_LoadedFilters[ category ].insert( name );
-
-  } // rof
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-_ActivateIOFilter( const std::string& filter )
-{
-  // Activate reader
-  auto fIt = this->m_IOFilters.find( filter );
-  if( fIt != this->m_IOFilters.end( ) )
-  {
-    this->m_ActiveFilter = fIt->second;
-    return( true );
-  }
-  else
-    return( false );
-}
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::Plugins::
-_ReadData( const std::string& parent )
-{
-  if( !( this->HasActiveFilter( ) ) )
-    return( "" );
-
-  TStringContainer outputs;
-  if( this->UpdateActiveFilter( outputs, parent ) )
-    return( *( outputs.begin( ) ) );
-  else
-    return( "" );
-}
-
-// ------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-_WriteData( const std::string& name )
-{
-  if( !( this->HasActiveFilter( ) ) )
-    return( false );
-
-  TStringContainer inputs;
-  this->GetActiveFilterInputsNames( inputs );
-  bool r = true;
-  for( auto iIt = inputs.begin( ); iIt != inputs.end( ); ++iIt )
-    r &= this->ConnectInputInActiveFilter( name, *iIt );
-
-  if( r )
-  {
-    TStringContainer outputs;
-    return( this->UpdateActiveFilter( outputs, "" ) );
-  }
-  else
-    return( false );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-_InsertNewData( TDataObject* dobj, const std::string& parent )
-{
-  if( parent != "" )
-  {
-    auto oIt = this->m_DataObjects.find( parent );
-    if( oIt == this->m_DataObjects.end( ) )
-      return( false );
-
-  } // fi
-  this->m_DataObjects[ dobj->GetName( ) ] = _TTreeNode( parent, dobj );
-  return( true );
-}
-
-// eof - $RCSfile$
diff --git a/lib/cpPlugins/Interface/Plugins.h b/lib/cpPlugins/Interface/Plugins.h
deleted file mode 100644 (file)
index f93f377..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#ifndef __CPPLUGINS__INTERFACE__PLUGINS__H__
-#define __CPPLUGINS__INTERFACE__PLUGINS__H__
-
-#include <cpPlugins/Interface/Interface.h>
-#include <cpPlugins/Interface/DataObject.h>
-#include <cpPlugins/Interface/ProcessObject.h>
-
-#include <map>
-#include <set>
-#include <string>
-#include <vector>
-
-// Some forward declarations
-class vtkRenderWindowInteractor;
-#ifdef cpPlugins_Interface_QT4
-class QWidget;
-#else
-typedef char QWidget;
-#endif // cpPlugins_Interface_QT4
-
-namespace cpPlugins
-{
-  namespace Interface
-  {
-    // Some forward declarations
-    class BaseApplication;
-
-    /**
-     */
-    class cpPlugins_Interface_EXPORT Plugins
-    {
-    public:
-      typedef cpPlugins::Interface::Interface     TInterface;
-      typedef cpPlugins::Interface::ProcessObject TProcessObject;
-      typedef cpPlugins::Interface::DataObject    TDataObject;
-      typedef TProcessObject::TParameters         TParameters;
-
-      typedef std::set< std::string > TStringContainer;
-
-    public:
-      Plugins( );
-      virtual ~Plugins( );
-
-      // Qt oriented methods
-      QWidget* GetWidget( );
-      const QWidget* GetWidget( ) const;
-      void SetWidget( QWidget* widget );
-      void BlockWidget( );
-      void UnblockWidget( );
-      void DialogLoadPlugins( );
-
-      // Connection to main application
-      BaseApplication* GetApplication( );
-      const BaseApplication* GetApplication( ) const;
-      void SetApplication( BaseApplication* a );
-
-      // Plugins management
-      bool LoadPluginsPath( const std::string& path, bool r = false );
-      bool LoadPlugins( const std::string& fname );
-      bool LoadPluginsConfigurationFile( const std::string& fname );
-      const TStringContainer& GetLoadedPlugins( ) const;
-      void GetLoadedCategories( TStringContainer& categories ) const;
-      void GetLoadedFilters( TStringContainer& filters ) const;
-      const TStringContainer& GetLoadedFilters(
-        const std::string& category
-        ) const;
-
-      // Interactors
-      void AddInteractor( vtkRenderWindowInteractor* interactor );
-      void RemoveInteractor( vtkRenderWindowInteractor* interactor );
-      void ClearInteractors( );
-
-      // Data IO
-      bool HasImageReader( ) const;
-      bool HasDicomSeriesReader( ) const;
-      bool HasMeshReader( ) const;
-      bool HasImageWriter( ) const;
-      bool HasMeshWriter( ) const;
-
-      std::string ReadImage(
-        const std::string& fname, const std::string& parent
-        );
-      std::string ReadImage(
-        const std::vector< std::string >& fnames, const std::string& parent
-        );
-      std::string ReadImage( const std::string& parent );
-      std::string ReadDicomSeries( const std::string& parent );
-      std::string ReadMesh(
-        const std::string& fname, const std::string& parent
-        );
-      std::string ReadMesh( const std::string& parent );
-
-      bool WriteDataObject(
-        const std::string& fname, const std::string& name
-        );
-      bool WriteDataObject( const std::string& name );
-
-      // Data objects
-      void ClearDataObjects( );
-      void DeleteDataObject( const std::string& name );
-      void GetDataObjects( TStringContainer& names );
-      std::string GetParent( const std::string& name ) const;
-      void GetChildren(
-        TStringContainer& names, const std::string& name
-        ) const;
-      void GetRoots( TStringContainer& names ) const;
-
-      template< class T >
-        inline T* GetData( const std::string& name );
-
-      template< class T >
-        inline const T* GetData( const std::string& name ) const;
-
-      // Filter acces
-      bool ActivateFilter( const std::string& name );
-      void DeactivateFilter( );
-      bool HasActiveFilter( ) const;
-      bool IsActiveFilterInteractive( ) const;
-      void GetActiveFilterInputsNames( TStringContainer& names ) const;
-      void GetActiveFilterOutputsNames( TStringContainer& names ) const;
-      bool ConnectInputInActiveFilter(
-        const std::string& object_name, const std::string& input_name
-        );
-      bool SetOutputNameInActiveFilter(
-        const std::string& new_object_name, const std::string& output_name
-        );
-      TParameters* GetActiveFilterParameters( );
-      const TParameters* GetActiveFilterParameters( ) const;
-      TProcessObject::DialogResult ConfigureActiveFilter( );
-      bool UpdateActiveFilter(
-        TStringContainer& outputs,
-        const std::string& parent
-        );
-
-    protected:
-      void _UpdateLoadedPluginsInformation( );
-      bool _ActivateIOFilter( const std::string& filter );
-      std::string _ReadData( const std::string& parent );
-      bool _WriteData( const std::string& name );
-      bool _InsertNewData( TDataObject* dobj, const std::string& parent );
-
-    protected:
-      // MVC objects
-      QWidget*         m_Widget;
-      BaseApplication* m_Application;
-
-      // Plugins interface
-      TInterface                                m_Interface;
-      TStringContainer                          m_LoadedPlugins;
-      std::string                               m_LastLoadedPlugin;
-      std::map< std::string, TStringContainer > m_LoadedFilters;
-
-      // Loaded filters
-      std::map< std::string, TProcessObject::Pointer > m_IOFilters;
-      TProcessObject::Pointer                       m_ActiveFilter;
-
-      // Loaded data objects
-      typedef std::pair< std::string, TDataObject::Pointer >  _TTreeNode;
-      std::map< std::string, _TTreeNode > m_DataObjects;
-
-      // Associated interactors
-      std::set< vtkRenderWindowInteractor* > m_Interactors;
-    };
-
-  } // ecapseman
-
-} // ecapseman
-
-#include <cpPlugins/Interface/Plugins.hxx>
-
-#endif // __CPPLUGINS__INTERFACE__PLUGINS__H__
-
-// eof - $RCSfile$
diff --git a/lib/cpPlugins/Interface/Plugins.hxx b/lib/cpPlugins/Interface/Plugins.hxx
deleted file mode 100644 (file)
index b2bcd8a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __CPPLUGINS__INTERFACE__PLUGINS__HXX__
-#define __CPPLUGINS__INTERFACE__PLUGINS__HXX__
-
-// -------------------------------------------------------------------------
-template< class T >
-T* cpPlugins::Interface::Plugins::
-GetData( const std::string& name )
-{
-  auto dIt = this->m_DataObjects.find( name );
-  if( dIt != this->m_DataObjects.end( ) )
-    return( dynamic_cast< T* >( dIt->second.second.GetPointer( ) ) );
-  else
-    return( NULL );
-}
-
-// -------------------------------------------------------------------------
-template< class T >
-const T* cpPlugins::Interface::Plugins::
-GetData( const std::string& name ) const
-{
-  auto dIt = this->m_DataObjects.find( name );
-  if( dIt != this->m_DataObjects.end( ) )
-    return( dynamic_cast< const T* >( dIt->second.second.GetPointer( ) ) );
-  else
-    return( NULL );
-}
-
-#endif // __CPPLUGINS__INTERFACE__PLUGINS__HXX__
-
-// eof - $RCSfile$
index 1db1a61cb44db76ac27f40400912feab3523d21a..7ed9dfc01732f45c1b51c985a416e27334f683ed 100644 (file)
@@ -8,34 +8,25 @@
 #include <vtkRenderWindowInteractor.h>
 
 // -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
-Modified( ) const
-{
-  if( this->m_ITKObject.IsNotNull( ) )
-    this->m_ITKObject->Modified( );
-  if( this->m_VTKObject.GetPointer( ) != NULL )
-    this->m_VTKObject->Modified( );
-  this->Superclass::Modified( );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
-GetInputsNames( std::set< std::string >& names ) const
+std::set< std::string > cpPlugins::Interface::ProcessObject::
+GetInputsNames( ) const
 {
-  names.clear( );
+  std::set< std::string > names;
   auto dIt = this->m_Inputs.begin( );
   for( ; dIt != this->m_Inputs.end( ); ++dIt )
     names.insert( dIt->first );
+  return( names );
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
-GetOutputsNames( std::set< std::string >& names ) const
+std::set< std::string > cpPlugins::Interface::ProcessObject::
+GetOutputsNames( ) const
 {
-  names.clear( );
+  std::set< std::string > names;
   auto dIt = this->m_Outputs.begin( );
   for( ; dIt != this->m_Outputs.end( ); ++dIt )
     names.insert( dIt->first );
+  return( names );
 }
 
 // -------------------------------------------------------------------------
@@ -54,23 +45,6 @@ GetNumberOfOutputs( ) const
 
 // -------------------------------------------------------------------------
 bool cpPlugins::Interface::ProcessObject::
-SetOutputObjectName(
-  const std::string& new_object_name, const std::string& output_name
-  )
-{
-  auto oIt = this->m_Outputs.find( output_name );
-  if( oIt != this->m_Outputs.end( ) )
-  {
-    this->m_OutputObjectsNames[ output_name ] = new_object_name;
-    this->Modified( );
-    return( true );
-  }
-  else
-    return( false );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
 SetInput( const std::string& id, cpPlugins::Interface::DataObject* dobj )
 {
   _TDataContainer::iterator i = this->m_Inputs.find( id );
@@ -78,8 +52,10 @@ SetInput( const std::string& id, cpPlugins::Interface::DataObject* dobj )
   {
     i->second = dobj;
     this->Modified( );
-
-  } // fi
+    return( true );
+  }
+  else
+    return( false );
 }
 
 // -------------------------------------------------------------------------
@@ -107,16 +83,6 @@ Update( )
   if( r == "" )
     r = this->_GenerateData( );
 
-  // Configure output names
-  auto oIt = this->m_Outputs.begin( );
-  for( ; oIt != this->m_Outputs.end( ); ++oIt )
-  {
-    auto nIt = this->m_OutputObjectsNames.find( oIt->first );
-    if( nIt != this->m_OutputObjectsNames.end( ) )
-      oIt->second->SetName( nIt->second );
-
-  } // rof
-
   // Return error description, if any
   return( r );
 }
@@ -143,12 +109,10 @@ GetInteractors( ) const
 void cpPlugins::Interface::ProcessObject::
 AddInteractor( vtkRenderWindowInteractor* interactor )
 {
+  this->m_Interactors.insert( interactor );
 #ifdef cpPlugins_Interface_QT4
-  if( this->m_ParametersDialog == NULL )
-    this->m_ParametersDialog = new ParametersQtDialog( );
   this->m_ParametersDialog->addInteractor( interactor );
 #endif // cpPlugins_Interface_QT4
-  this->m_Interactors.insert( interactor );
 }
 
 // -------------------------------------------------------------------------
@@ -156,29 +120,16 @@ bool cpPlugins::Interface::ProcessObject::
 ExecConfigurationDialog( QWidget* parent )
 {
   bool r = false;
-
 #ifdef cpPlugins_Interface_QT4
-
-  if( QApplication::instance( ) != NULL )
+  if( this->m_ParametersDialog != NULL )
   {
-    if( this->m_ParametersDialog == NULL )
-      this->m_ParametersDialog = new ParametersQtDialog( );
-    /* TODO
-       this->m_ParametersDialog->setTitle(
-       this->GetClassName( ) + std::string( " basic configuration" )
-       );
-    */
-
     this->m_ParametersDialog->setParent( NULL );
     this->m_ParametersDialog->setParameters( this->m_Parameters );
-
     r = ( this->m_ParametersDialog->exec( ) == 1 );
   }
   else
     r = false;
-  
 #endif // cpPlugins_Interface_QT4
-
   return( r );
 }
 
@@ -186,21 +137,25 @@ ExecConfigurationDialog( QWidget* parent )
 cpPlugins::Interface::ProcessObject::
 ProcessObject( )
   : Superclass( ),
-    m_ITKObject( NULL ),
-    m_VTKObject( NULL ),
-    m_ParametersDialog( NULL ),
-    m_Plugins( NULL )
+    m_ParametersDialog( NULL )
 {
   this->m_Parameters = TParameters::New( );
   this->m_Parameters->SetProcessObject( this );
+
+#ifdef cpPlugins_Interface_QT4
+  if( QApplication::instance( ) != NULL )
+    this->m_ParametersDialog = new ParametersQtDialog( );
+#endif // cpPlugins_Interface_QT4
 }
 
 // -------------------------------------------------------------------------
 cpPlugins::Interface::ProcessObject::
 ~ProcessObject( )
 {
+#ifdef cpPlugins_Interface_QT4
   if( this->m_ParametersDialog != NULL )
     delete this->m_ParametersDialog;
+#endif // cpPlugins_Interface_QT4
 }
 
 // -------------------------------------------------------------------------
index 52b56546abe3521d83e50b959caa80cc8d4e7729..c48d61f3e36ab0f201c30aeac8a8f71b89640473 100644 (file)
@@ -3,13 +3,11 @@
 
 #include <set>
 
+#include <itkDataObject.h>
+
 #include <cpPlugins/Interface/DataObject.h>
 #include <cpPlugins/Interface/Parameters.h>
 
-#include <itkProcessObject.h>
-#include <vtkSmartPointer.h>
-#include <vtkAlgorithm.h>
-
 // Some forward declarations
 class vtkRenderWindowInteractor;
 #ifdef cpPlugins_Interface_QT4
@@ -23,7 +21,6 @@ namespace cpPlugins
   namespace Interface
   {
     // Some forward declarations
-    class Plugins;
 #ifdef cpPlugins_Interface_QT4
     class ParametersQtDialog;
 #else
@@ -50,31 +47,19 @@ namespace cpPlugins
       cpPlugins_Id_Macro( ProcessObject, BaseObject );
 
       itkBooleanMacro( Interactive );
+      itkGetConstMacro( Interactive, bool );
+      itkSetMacro( Interactive, bool );
 
       itkGetConstObjectMacro( Parameters, TParameters );
       itkGetObjectMacro( Parameters, TParameters );
-      itkGetConstMacro( Plugins, const Plugins* );
-      itkGetMacro( Plugins, Plugins* );
-      itkGetConstMacro( Interactive, bool );
-
-      itkSetObjectMacro( Plugins, Plugins );
-      itkSetMacro( Interactive, bool );
 
     public:
-      // To impact pipeline
-      virtual void Modified( ) const;
-
-      virtual void GetInputsNames( std::set< std::string >& names ) const;
-      virtual void GetOutputsNames( std::set< std::string >& names ) const;
+      virtual std::set< std::string > GetInputsNames( ) const;
+      virtual std::set< std::string > GetOutputsNames( ) const;
       unsigned int GetNumberOfInputs( ) const;
       unsigned int GetNumberOfOutputs( ) const;
 
-      virtual bool SetOutputObjectName(
-        const std::string& new_object_name,
-        const std::string& output_name
-        );
-
-      virtual void SetInput( const std::string& id, DataObject* dobj );
+      virtual bool SetInput( const std::string& id, DataObject* dobj );
 
       virtual std::string Update( );
       virtual void DisconnectOutputs( );
@@ -83,18 +68,6 @@ namespace cpPlugins
       virtual void AddInteractor( vtkRenderWindowInteractor* interactor );
       virtual bool ExecConfigurationDialog( QWidget* parent );
 
-      template< class T >
-        inline T* GetITK( );
-
-      template< class T >
-        inline const T* GetITK( ) const;
-
-      template< class T >
-        inline T* GetVTK( );
-
-      template< class T >
-        inline const T* GetVTK( ) const;
-
       template< class T >
         inline T* GetInput( const std::string& id );
 
@@ -113,15 +86,15 @@ namespace cpPlugins
 
       virtual void _AddInput( const std::string& name );
 
+      template< class O >
+        inline void _AddOutput( const std::string& id );
+
       template< class F >
         inline F* _CreateITK( );
 
       template< class F >
         inline F* _CreateVTK( );
 
-      template< class O >
-        inline void _MakeOutput( const std::string& id );
-
       virtual std::string _GenerateData( ) = 0;
 
     private:
@@ -130,19 +103,15 @@ namespace cpPlugins
       Self& operator=( const Self& );
 
     protected:
-      itk::ProcessObject::Pointer     m_ITKObject;
-      vtkSmartPointer< vtkAlgorithm > m_VTKObject;
-
       Parameters::Pointer m_Parameters;
       ParametersQtDialog* m_ParametersDialog;
-      TInteractors        m_Interactors;
-      Plugins* m_Plugins;
-      bool m_Interactive;
+
+      TInteractors m_Interactors;
+      bool         m_Interactive;
 
       typedef std::map< std::string, DataObject::Pointer > _TDataContainer;
       _TDataContainer m_Inputs;
       _TDataContainer m_Outputs;
-      std::map< std::string, std::string > m_OutputObjectsNames;
     };
 
     /**
index 10b4dbe99fcc7a66fb02a42d978523e57b3e5c61..33b4a2022cb558bc9a943c4be8a8c4240038116d 100644 (file)
@@ -1,38 +1,6 @@
 #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
 #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
 
-// -------------------------------------------------------------------------
-template< class T >
-T* cpPlugins::Interface::ProcessObject::
-GetITK( )
-{
-  return( dynamic_cast< T* >( this->m_ITKObject.GetPointer( ) ) );
-}
-
-// -------------------------------------------------------------------------
-template< class T >
-const T* cpPlugins::Interface::ProcessObject::
-GetITK( ) const
-{
-  return( dynamic_cast< const T* >( this->m_ITKObject.GetPointer( ) ) );
-}
-
-// -------------------------------------------------------------------------
-template< class T >
-T* cpPlugins::Interface::ProcessObject::
-GetVTK( )
-{
-  return( dynamic_cast< T* >( this->m_VTKObject.GetPointer( ) ) );
-}
-
-// -------------------------------------------------------------------------
-template< class T >
-const T* cpPlugins::Interface::ProcessObject::
-GetVTK( ) const
-{
-  return( dynamic_cast< const T* >( this->m_VTKObject.GetPointer( ) ) );
-}
-
 // -------------------------------------------------------------------------
 template< class T >
 T* cpPlugins::Interface::ProcessObject::
@@ -81,6 +49,16 @@ GetOutput( const std::string& id ) const
     return( NULL );
 }
 
+// -------------------------------------------------------------------------
+template< class O >
+void cpPlugins::Interface::ProcessObject::
+_AddOutput( const std::string& id )
+{
+  this->m_Outputs[ id ] = O::New( );
+  this->m_Outputs[ id ]->SetSource( this );
+  this->Modified( );
+}
+
 // -------------------------------------------------------------------------
 template< class F >
 F* cpPlugins::Interface::ProcessObject::
@@ -114,16 +92,6 @@ _CreateVTK( )
   return( filter );
 }
 
-// -------------------------------------------------------------------------
-template< class O >
-void cpPlugins::Interface::ProcessObject::
-_MakeOutput( const std::string& id )
-{
-  this->m_Outputs[ id ] = O::New( );
-  this->m_Outputs[ id ]->SetSource( this );
-  this->Modified( );
-}
-
 #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
 
 // eof - $RCSfile$
index 55b2eedfab3b9b209c6ac088e098337e4b4d5306..fb9d6ea704476436de736fccc1d4deaff65f334e 100644 (file)
@@ -11,7 +11,7 @@ BinaryErodeImageFilter( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
   this->m_Parameters->ConfigureAsUint( "Radius" );
   this->m_Parameters->SetUint( "Radius", 2 );
index 09ba2c3f1ba5513ab4be6bfdc4da1d6351487f4e..19561125bf368da562dc40a7d5cc74b28de590d7 100644 (file)
@@ -9,7 +9,7 @@ BinaryThresholdImageFilter( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
   this->m_Parameters->ConfigureAsReal( "LowerThresholdValue" );
   this->m_Parameters->ConfigureAsReal( "UpperThresholdValue" );
index d0907b41e6429badcc34a3c3cffeb474bc9afb46..3d3104f90b562239ce544450a398d31ffbb94b30 100644 (file)
@@ -15,7 +15,7 @@ Cutter( )
 {
   this->_AddInput( "InputMesh" );
   this->_AddInput( "InputFunction" );
-  this->_MakeOutput< cpPlugins::Interface::Mesh >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" );
 }
 
 // -------------------------------------------------------------------------
index 61ff7d2e291b46a22e67b9fed0406d48735b64dc..aeaa590d0a85ce9a2b0cd34c53a934a7be389bd5 100644 (file)
@@ -1,7 +1,5 @@
 #include "DoubleFloodImageFilter.h"
 #include <cpPlugins/Interface/Image.h>
-#include <cpPlugins/Interface/BaseApplication.h>
-#include <cpPlugins/Interface/Plugins.h>
 #include <cpExtensions/Interaction/ImageInteractorStyle.h>
 #include <cpExtensions/Visualization/ImageSliceActors.h>
 
@@ -21,6 +19,7 @@ DoubleFloodImageFilter_Dialog(
   : QDialog( parent, f | Qt::WindowStaysOnTopHint ),
     m_Filter( filter )
 {
+/* TODO
   this->m_Title = new QLabel( this );
   this->m_Title->setText( "Execute simple vessel segmentation filter" );
 
@@ -36,21 +35,25 @@ DoubleFloodImageFilter_Dialog(
   QObject::connect( bb, SIGNAL( accepted( ) ), this, SLOT( accept( ) ) );
   QObject::connect( bb, SIGNAL( rejected( ) ), this, SLOT( reject( ) ) );
   this->m_ToolsLayout->addWidget( bb );
+*/
 }
 
 // -------------------------------------------------------------------------
 cpPlugins::BasicFilters::DoubleFloodImageFilter_Dialog::
 ~DoubleFloodImageFilter_Dialog( )
 {
+/*
   delete this->m_Title;
   delete this->m_ToolsLayout;
   delete this->m_MainLayout;
+*/
 }
 
 // -------------------------------------------------------------------------
 void cpPlugins::BasicFilters::DoubleFloodImageFilter_Dialog::
 accept( )
 {
+/*
   // Get interactive widget
   if( this->m_Filter == NULL )
     return;
@@ -108,18 +111,20 @@ accept( )
       app->UpdateActualFilter( );
 
   } // fi
+*/
 }
 
 // -------------------------------------------------------------------------
 void cpPlugins::BasicFilters::DoubleFloodImageFilter_Dialog::
 reject( )
 {
+/*
   auto plugins = this->m_Filter->GetPlugins( );
   if( plugins != NULL )
     plugins->DeactivateFilter( );
   this->Superclass::reject( );
+*/
 }
-
 #endif // cpPlugins_Interface_QT4
 
 // -------------------------------------------------------------------------
@@ -127,6 +132,7 @@ cpPlugins::BasicFilters::DoubleFloodImageFilter::
 DialogResult cpPlugins::BasicFilters::DoubleFloodImageFilter::
 ExecConfigurationDialog( QWidget* parent )
 {
+/* TODO
 #ifdef cpPlugins_Interface_QT4
 
   typedef cpExtensions::Interaction::ImageInteractorStyle _TImageStyle;
@@ -159,6 +165,8 @@ ExecConfigurationDialog( QWidget* parent )
 #else // cpPlugins_Interface_QT4
   return( false );
 #endif // cpPlugins_Interface_QT4
+*/
+  return( false );
 }
 
 // -------------------------------------------------------------------------
@@ -166,6 +174,7 @@ cpPlugins::BasicFilters::DoubleFloodImageFilter::
 DoubleFloodImageFilter( )
   : Superclass( )
 {
+  /* TODO
   this->_AddInput( "Input" );
   this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
 
@@ -180,6 +189,7 @@ DoubleFloodImageFilter( )
   this->m_Parameters->SetReal( "Level", 0 );
   this->m_Parameters->SetUint( "InsideValue", 255 );
   this->m_Parameters->SetUint( "OutsideValue", 0 );
+  */
 }
 
 // -------------------------------------------------------------------------
@@ -192,6 +202,7 @@ cpPlugins::BasicFilters::DoubleFloodImageFilter::
 std::string cpPlugins::BasicFilters::DoubleFloodImageFilter::
 _GenerateData( )
 {
+  /* TODO
   cpPlugins::Interface::Image* image =
     this->GetInput< cpPlugins::Interface::Image >( "Input" );
   if( image == NULL )
@@ -203,6 +214,8 @@ _GenerateData( )
   else cpPlugins_Image_Demangle_AllScalarTypes( 3, image, itk_image, r, _GD0 );
   else r = "DoubleFloodImageFilter: Input image type not supported.";
   return( r );
+  */
+  return( "" );
 }
 
 // -------------------------------------------------------------------------
@@ -210,14 +223,19 @@ template< class I >
 std::string cpPlugins::BasicFilters::DoubleFloodImageFilter::
 _GD0( itk::DataObject* image )
 {
+  /* TODO
   return(
     this->_RealGD< I, itk::Image< unsigned char, I::ImageDimension > >(
       image
       )
     );
+  */
+  return( "" );
+
 }
 
 // -------------------------------------------------------------------------
+/* TODO
 template< class I, class R = float >
 class cpPlugins_BasicFilters_DoubleFloodImageFilter_Function
   : public itk::ImageFunction< I, bool, R >
@@ -301,12 +319,14 @@ protected:
   mutable unsigned char m_StartValue;
   mutable bool m_Start;
 };
+*/
 
 // -------------------------------------------------------------------------
 template< class I, class O >
 inline std::string cpPlugins::BasicFilters::DoubleFloodImageFilter::
 _RealGD( itk::DataObject* image )
 {
+  /* TODO
   typedef typename O::PixelType _OP;
   typedef cpPlugins_BasicFilters_DoubleFloodImageFilter_Function< I > _F;
   typedef itk::FloodFilledImageFunctionConditionalConstIterator< I, _F > _It;
@@ -359,6 +379,8 @@ _RealGD( itk::DataObject* image )
   }
   else
     return( "DoubleFloodImageFilter: output not correctly created." );
+  */
+  return( "" );
 }
 
 // eof - $RCSfile$
index 3a887d06dc4964de69067c037a04166c78313a0c..0383c0f86c692bf4c419fac172cd9608e351175b 100644 (file)
@@ -18,8 +18,6 @@ namespace cpPlugins
 #ifdef cpPlugins_Interface_QT4
     class DoubleFloodImageFilter;
 
-    /**
-     */
     class DoubleFloodImageFilter_Dialog
       : public QDialog
     {
index 5a65ca67da587acbbb6536b53a544ffb61c56cb3..3f566e5834cbdc2df323037c65ba27f02d408d41 100644 (file)
@@ -9,7 +9,7 @@ ExtractSliceImageFilter( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
   this->m_Parameters->ConfigureAsUint( "Axis" );
   this->m_Parameters->ConfigureAsInt( "Slice" );
index 376602bfe6d9f4708f70a0fd5115b6beeb3de488..98b9e5864c92eb4540ddd70be56023ea3cf46b68 100644 (file)
@@ -1,5 +1,6 @@
 #include "FloodFillImageFilter.h"
 #include <cpPlugins/Interface/Image.h>
+#include <cpPlugins/Interface/PointList.h>
 
 #include <itkFloodFilledImageFunctionConditionalConstIterator.h>
 #include <itkImageFunction.h>
@@ -9,10 +10,11 @@ cpPlugins::BasicFilters::FloodFillImageFilter::
 FloodFillImageFilter( )
   : Superclass( )
 {
+  /* TODO
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddInput( "Seed" );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
-  this->m_Parameters->ConfigureAsPoint( "Seed" );
   this->m_Parameters->ConfigureAsReal( "Window" );
   this->m_Parameters->ConfigureAsReal( "Level" );
   this->m_Parameters->ConfigureAsUint( "InsideValue" );
@@ -22,6 +24,7 @@ FloodFillImageFilter( )
   this->m_Parameters->SetReal( "Level", 0 );
   this->m_Parameters->SetUint( "InsideValue", 0 );
   this->m_Parameters->SetUint( "OutsideValue", 255 );
+  */
 }
 
 // -------------------------------------------------------------------------
@@ -34,6 +37,7 @@ cpPlugins::BasicFilters::FloodFillImageFilter::
 std::string cpPlugins::BasicFilters::FloodFillImageFilter::
 _GenerateData( )
 {
+  /* TODO
   cpPlugins::Interface::Image* image =
     this->GetInput< cpPlugins::Interface::Image >( "Input" );
   if( image == NULL )
@@ -45,6 +49,8 @@ _GenerateData( )
   else cpPlugins_Image_Demangle_AllScalarTypes( 3, image, itk_image, r, _GD0 );
   else r = "FloodFillImageFilter: Input image type not supported.";
   return( r );
+  */
+  return( "" );
 }
 
 // -------------------------------------------------------------------------
@@ -52,14 +58,18 @@ template< class I >
 std::string cpPlugins::BasicFilters::FloodFillImageFilter::
 _GD0( itk::DataObject* image )
 {
+  /* TODO
   return(
     this->_RealGD< I, itk::Image< unsigned char, I::ImageDimension > >(
       image
       )
     );
+  */
+  return( "" );
 }
 
 // -------------------------------------------------------------------------
+/* TODO
 template< class I, class R = float >
 class cpPlugins_BasicFilters_FloodFillImageFilter_Function
   : public itk::ImageFunction< I, bool, R >
@@ -143,12 +153,14 @@ protected:
   mutable unsigned char m_StartValue;
   mutable bool m_Start;
 };
+*/
 
 // -------------------------------------------------------------------------
 template< class I, class O >
 inline std::string cpPlugins::BasicFilters::FloodFillImageFilter::
 _RealGD( itk::DataObject* image )
 {
+  /* TODO
   typedef typename O::PixelType _OP;
   typedef cpPlugins_BasicFilters_FloodFillImageFilter_Function< I > _F;
   typedef itk::FloodFilledImageFunctionConditionalConstIterator< I, _F > _It;
@@ -196,6 +208,8 @@ _RealGD( itk::DataObject* image )
   }
   else
     return( "FloodFillImageFilter: output not correctly created." );
+  */
+  return( "" );
 }
 
 // eof - $RCSfile$
index 1f4709cd689801a00b4279377dacee0baa7ac08f..82449b388a4d45f7f8a69c8c65bbacef684af206 100644 (file)
@@ -1,8 +1,5 @@
 #include "MacheteFilter.h"
 
-#include <cpPlugins/Interface/BaseApplication.h>
-#include <cpPlugins/Interface/Plugins.h>
-
 #include <cpPlugins/Interface/DataObject.h>
 #include <cpPlugins/Interface/Image.h>
 #include <cpPlugins/Interface/Mesh.h>
@@ -72,27 +69,33 @@ accept( )
   wdg->GetCenter( center );
   wdg->GetNormal( normal );
 
-  this->m_Filter->GetParameters( )->SetPoint( "PlaneCenter", 3, center );
-  this->m_Filter->GetParameters( )->SetVector( "PlaneNormal", 3, normal );
+  /* TODO
+     this->m_Filter->GetParameters( )->SetPoint( "PlaneCenter", 3, center );
+     this->m_Filter->GetParameters( )->SetVector( "PlaneNormal", 3, normal );
+  */
 
   // Update filter
-  auto plugins = this->m_Filter->GetPlugins( );
-  if( plugins != NULL )
-  {
-    auto app = plugins->GetApplication( );
-    if( app != NULL )
-      app->UpdateActualFilter( );
-
-  } // fi
+  /* TODO
+     auto plugins = this->m_Filter->GetPlugins( );
+     if( plugins != NULL )
+     {
+     auto app = plugins->GetApplication( );
+     if( app != NULL )
+     app->UpdateActualFilter( );
+
+     } // fi
+  */
 }
 
 // -------------------------------------------------------------------------
 void cpPlugins::BasicFilters::MacheteFilter_Dialog::
 reject( )
 {
+  /*
   auto plugins = this->m_Filter->GetPlugins( );
   if( plugins != NULL )
     plugins->DeactivateFilter( );
+  */
   this->Superclass::reject( );
 }
 
@@ -192,11 +195,13 @@ MacheteFilter( )
     m_PlaneWidget( NULL )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::DataObject >( "PositiveOutput" );
-  this->_MakeOutput< cpPlugins::Interface::DataObject >( "NegativeOutput" );
+  this->_AddOutput< cpPlugins::Interface::DataObject >( "PositiveOutput" );
+  this->_AddOutput< cpPlugins::Interface::DataObject >( "NegativeOutput" );
 
+  /*
   this->m_Parameters->ConfigureAsPoint( "PlaneCenter" );
   this->m_Parameters->ConfigureAsVector( "PlaneNormal" );
+  */
 }
 
 // -------------------------------------------------------------------------
@@ -260,12 +265,16 @@ _RealImage( itk::DataObject* dobj )
 
   I* image = dynamic_cast< I* >( dobj );
 
+  /*
   _TPoint c = this->m_Parameters->GetPoint< _TPoint >(
     "PlaneCenter", I::ImageDimension
     );
   _TVector n = this->m_Parameters->GetVector< _TVector >(
     "PlaneNormal", I::ImageDimension
     );
+  */
+  _TPoint c;
+  _TVector n;
 
   typename _TPlane::Pointer plane = _TPlane::New( );
   plane->SetCenter( c );
@@ -286,7 +295,7 @@ _RealImage( itk::DataObject* dobj )
   _TImage* pos_out = this->GetOutput< _TImage >( "PositiveOutput" );
   if( pos_out == NULL )
   {
-    this->_MakeOutput< _TImage >( "PositiveOutput" );
+    this->_AddOutput< _TImage >( "PositiveOutput" );
     pos_out = this->GetOutput< _TImage >( "PositiveOutput" );
     pos_out->SetName( pos_name );
 
@@ -294,7 +303,7 @@ _RealImage( itk::DataObject* dobj )
   _TImage* neg_out = this->GetOutput< _TImage >( "NegativeOutput" );
   if( neg_out == NULL )
   {
-    this->_MakeOutput< _TImage >( "NegativeOutput" );
+    this->_AddOutput< _TImage >( "NegativeOutput" );
     neg_out = this->GetOutput< _TImage >( "NegativeOutput" );
     neg_out->SetName( neg_name );
 
index e40ecb192c76217e4b05f44677cac80f1e655ee9..980ba8d01602b3d05ee55218b1b84d9ae0005fc3 100644 (file)
@@ -12,8 +12,8 @@ cpPlugins::BasicFilters::MacheteImageFilter::
 MacheteImageFilter()
 : Superclass()
 {
-  this->_AddInput("Input");
-  this->_MakeOutput< cpPlugins::Interface::Image >("Output");
+  this->_AddInput( "Input" );
+  this->_AddOutput< cpPlugins::Interface::Image >("Output");
 
   this->m_Parameters->ConfigureAsReal("Radius");
   //this->m_Parameters->ConfigureAsPoint("Point", 3, 3);
index e0208de07ca4b4a56d5d46a77dba0c4c7151ce96..1ac3df9d62557fedf474e0980c4d8345b9d97f5c 100644 (file)
@@ -14,7 +14,7 @@ namespace cpPlugins
       : public cpPlugins::Interface::ImageToImageFilter
     {
     public:
-      typedef MacheteImageFilter                        Self;
+      typedef MacheteImageFilter                       Self;
       typedef cpPlugins::Interface::ImageToImageFilter Superclass;
       typedef itk::SmartPointer< Self >                Pointer;
       typedef itk::SmartPointer< const Self >          ConstPointer;
index 51bc93708e844324918be8f7e5906b8696224e1d..ce6aa32fba7b3ab1372ffde0e1a19320482de8c4 100644 (file)
@@ -12,7 +12,7 @@ MarchingCubes( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Mesh >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" );
 
   this->m_Parameters->ConfigureAsRealList( "Thresholds" );
 }
index da2f7f39e59b99b0fa0eff8e3308b86ca776e39f..a74714c6bb3a125ba7eb1a38218f2d0eabe3e180 100644 (file)
@@ -9,7 +9,7 @@ MedianImageFilter( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
   this->m_Parameters->ConfigureAsUint( "Radius" );
   this->m_Parameters->SetUint( "Radius", 3 );
index ed8b95a3baf5d016650e439131ab439ebf363282..dd2bd1ca346960af8ded4c3af10a0d8a02705d5f 100644 (file)
@@ -9,7 +9,7 @@ OtsuThresholdImageFilter( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
   this->m_Parameters->ConfigureAsUint( "NumberOfHistogramBins" );
   this->m_Parameters->ConfigureAsUint( "InsideValue" );
index 13e6732abc1bd7410ffd31e00ccbc321b3294613..433c0fae8bafc32d367c537553f89bb31d4a23df 100644 (file)
@@ -14,7 +14,7 @@ RGBImageToOtherChannelsFilter( )
   typedef cpPlugins::Interface::Parameters TParameters;
 
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
   std::vector< std::string > choices;
   choices.push_back( "HSV" );
index c8740cd843326fba896ee2e42e84b689f30245c9..147855535c944a96c4957950860e7465d49539fb 100644 (file)
@@ -9,7 +9,7 @@ SignedMaurerDistanceMapImageFilter( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
   this->m_Parameters->ConfigureAsReal( "BackgroundValue" );
   this->m_Parameters->ConfigureAsBool( "InsideIsPositive" );
index 2ed0b7d79abc994afe3a2fbcfe8e93af206516ca..cad8eb80535cca632641a426017003274788195f 100644 (file)
@@ -10,9 +10,9 @@ cpPlugins::BasicFilters::SphereMeshSource::
 SphereMeshSource( )
   : Superclass( )
 {
-  this->_MakeOutput< cpPlugins::Interface::Mesh >( "Output" );
+  this->_AddInput( "Center" );
+  this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" );
 
-  this->m_Parameters->ConfigureAsPoint( "Center" );
   this->m_Parameters->ConfigureAsReal( "Radius" );
   this->m_Parameters->ConfigureAsUint( "PhiResolution" );
   this->m_Parameters->ConfigureAsUint( "ThetaResolution" );
@@ -32,9 +32,12 @@ cpPlugins::BasicFilters::SphereMeshSource::
 std::string cpPlugins::BasicFilters::SphereMeshSource::
 _GenerateData( )
 {
-  itk::Point< double, 3 > center =
-    this->m_Parameters->GetPoint< itk::Point< double, 3 > >( "Center", 3 );
-  // TODO: center.Fill( double( 0 ) ); // TODO
+  itk::Point< double, 3 > center;
+  center.Fill( double( 0 ) );
+  /* TODO
+     itk::Point< double, 3 > center =
+     this->m_Parameters->GetPoint< itk::Point< double, 3 > >( "Center", 3 );
+  */
   double radius = this->m_Parameters->GetReal( "Radius" );
   unsigned int phi = this->m_Parameters->GetUint( "PhiResolution" );
   unsigned int theta = this->m_Parameters->GetUint( "ThetaResolution" );
index e1f3c665a96a14eb933d6dfbf0148e024765a041..d2d619c9920eb98e041bca08f4239c537c56e468 100644 (file)
@@ -56,7 +56,7 @@ cpPlugins::IO::ImageReader::
 ImageReader( )
   : Superclass( )
 {
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
   this->m_Parameters->ConfigureAsOpenFileNameList( "FileNames" );
   this->m_Parameters->ConfigureAsBool( "VectorType" );
index 473686dc0b0a3da14862eec846f157b7a92f0fdc..27d8f559e7601e352be172245a76fe2f768c46ca 100644 (file)
@@ -45,7 +45,7 @@ cpPlugins::IO::MeshReader::
 MeshReader( )
   : Superclass( )
 {
-  this->_MakeOutput< cpPlugins::Interface::Mesh >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" );
 
   std::vector< TParameters::TString > valid_types;
   valid_types.push_back( "float" );
index 129a8a676136ef2458cc0d81cbdc7a76ac499668..147527eddf6264c1263e01d9d11b24f215d3736a 100644 (file)
@@ -13,7 +13,7 @@ SeedWidget( )
     m_Configured( false )
 {
   this->_AddInput( "ReferenceImage" );
-  this->_MakeOutput< cpPlugins::Interface::PointList >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::PointList >( "Output" );
 
   this->m_Parameters->ConfigureAsBool( "SeedsAreInRealSpace" );
   this->m_Parameters->SetBool( "SeedsAreInRealSpace", true );