this, SLOT( _Button##BUTTON( ) ) \
)
+// -------------------------------------------------------------------------
+bool PipelineEditor_Blocker::
+eventFilter( QObject* obj, QEvent* event )
+{
+ return( true ); // -> Block all events
+ /* NOTE: correct implementation:
+ switch( event->type( ) )
+ {
+ //list event you want to prevent here ...
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonDblClick:
+ //...
+ return( true );
+ } // hctiws
+ return( this->QObject::eventFilter( obj, event ) );
+ */
+}
+
// -------------------------------------------------------------------------
PipelineEditor::
-PipelineEditor( int argc, char* argv[], QWidget* parent )
+PipelineEditor( int argc, char* argv[], QApplication* app, QWidget* parent )
: QMainWindow( parent ),
m_UI( new Ui::PipelineEditor ),
+ m_Application( app ),
m_Workspace( NULL ),
m_PluginsPath( "." )
{
{
if( this->m_Workspace != NULL )
delete this->m_Workspace;
- delete this->m_UI;
+ // TODO: this causes a segfault (?)
+ // delete this->m_UI;
}
// -------------------------------------------------------------------------
void PipelineEditor::
_UpdateLoadedPlugins( )
{
+ this->_Block( );
auto filters = this->m_Interface.GetFilters( );
if( filters.size( ) == 0 )
{
{
QList< QTreeWidgetItem* > filter_items =
this->m_UI->LoadedPlugins->findItems(
- fIt->first.c_str( ), Qt::MatchExactly | Qt::MatchRecursive
+ fIt->c_str( ), Qt::MatchExactly | Qt::MatchRecursive
);
auto fiIt = filter_items.begin( );
auto found_fiIt = filter_items.end( );
// Add filter
if( found_fiIt == filter_items.end( ) )
QTreeWidgetItem* filter = new QTreeWidgetItem(
- cat, QStringList( fIt->first.c_str( ) )
+ cat, QStringList( fIt->c_str( ) )
);
} // rof
} // rof
+ this->_UnBlock( );
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_Block( )
+{
+ this->m_Application->setOverrideCursor( Qt::WaitCursor );
+ this->m_Application->installEventFilter( &( this->m_Blocker ) );
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_UnBlock( )
+{
+ while( this->m_Application->overrideCursor( ) )
+ this->m_Application->restoreOverrideCursor( );
+ this->m_Application->removeEventFilter( &( this->m_Blocker ) );
}
// -------------------------------------------------------------------------
dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
if( !( dlg.exec( ) ) )
return;
- std::string fname = dlg.selectedFiles( ).at( 0 ).toStdString( );
+ std::string fname = dlg.selectedFiles( ).at( 0 ).toStdString( );
if( this->m_Workspace != NULL )
delete this->m_Workspace;
this->m_Workspace = new cpPlugins::Workspace( );
if( this->m_Workspace != NULL )
{
// Update filter, if needed
+ this->_Block( );
std::string err = this->m_Workspace->Execute( filter_name );
+ this->_UnBlock( );
if( err != "" )
QMessageBox::critical(
this,
this->m_UI->Viewer->SetDataColor( data_name, 1, 0, 0 );
else
this->m_UI->Viewer->SetMainImage( data_name );
+ this->_Block( );
this->m_UI->Viewer->ShowData( data_name );
+ this->_UnBlock( );
} // fi
}
#define __PIPELINEEDITOR__H__
// Qt stuff
+#include <QApplication>
#include <QMainWindow>
#include <cpPlugins/Interface.h>
#include <cpPlugins/Workspace.h>
+/**
+ */
+class PipelineEditor_Blocker
+ : public QObject
+{
+protected:
+ virtual bool eventFilter( QObject* obj, QEvent* event ) override;
+};
+
+/*
+ class PipelineEditor;
+ struct PipelineEditor_Application
+ {
+ QApplication Application;
+ PipelineEditor Window;
+ PipelineEditor_Blocker Blocker;
+ PipelineEditor_Application( int argc, char* argv[] );
+ void Show( );
+ int Exec( );
+ void Block( );
+ void UnBlock( );
+ };
+*/
+
// -------------------------------------------------------------------------
namespace Ui
{
public:
typedef PipelineEditor Self;
- typedef QMainWindow Superclass;
+ typedef QMainWindow Superclass;
public:
explicit PipelineEditor(
int argc, char* argv[],
- QWidget* parent = 0
+ QApplication* app,
+ QWidget* parent = NULL
);
virtual ~PipelineEditor( );
protected:
void _LoadPluginsFromPath( const std::string& path );
void _UpdateLoadedPlugins( );
+ void _Block( );
+ void _UnBlock( );
protected slots:
void _ButtonLoadPluginsFile( );
);
private:
- Ui::PipelineEditor* m_UI;
- cpPlugins::Workspace* m_Workspace;
- cpPlugins::Interface m_Interface;
- std::string m_PluginsPath;
+ Ui::PipelineEditor* m_UI;
+ QApplication* m_Application;
+ PipelineEditor_Blocker m_Blocker;
+ cpPlugins::Workspace* m_Workspace;
+ cpPlugins::Interface m_Interface;
+ std::string m_PluginsPath;
};
#endif // __CPPIPELINEEDITOR__H__
int main( int argc, char* argv[] )
{
QApplication a( argc, argv );
- PipelineEditor w( argc, argv, NULL );
+ PipelineEditor w( argc, argv, &a );
w.show( );
-
return( a.exec( ) );
}
// Write access function
out_stream
<< "extern \"C\" std::map< std::string, std::set< std::string > > "
- << "LoadedFilters( )" << std::endl << "{" << std::endl
+ << "cpPlugins_LoadedFilters( )" << std::endl << "{" << std::endl
<< " std::map< std::string, std::set< std::string > > classes;"
<< std::endl;
- int i = 0;
for( auto iIt = info.begin( ); iIt != info.end( ); ++iIt )
- {
for( auto jIt = iIt->second.begin( ); jIt != iIt->second.end( ); ++jIt )
- {
out_stream
- << " auto f" << i << " = "
- << jIt->second << "::" << jIt->first
- << "::New( );" << std::endl
- << " classes[ f" << i << "->GetClassCategory( ) ].insert( "
- << "f" << i << "->GetClassName( ) );" << std::endl;
- i++;
-
- } // rof
-
- } // rof
+ << " classes[ \"" << iIt->first
+ << "\" ].insert( \"" << jIt->first << "\" );" << std::endl;
out_stream
<< " return( classes );" << std::endl
<< "}" << std::endl << std::endl;
SET(
examples_SOURCES
example_LoadPluginsFile
+ example_LoadPluginsDirectory
example_ReadWriteImage
example_ReadWriteImageWithWorkspace
)
--- /dev/null
+#include <iostream>
+#include <cpPlugins/Interface.h>
+
+int main( int argc, char* argv[] )
+{
+ if( argc < 2 )
+ {
+ std::cerr << "Usage: " << argv[ 0 ] << " plugins_libraries" << std::endl;
+ return( 1 );
+
+ } // fi
+
+ // Load interface
+ cpPlugins::Interface interface;
+ for( int i = 1; i < argc; ++i )
+ {
+ try
+ {
+ interface.LoadPluginFile( argv[ i ] );
+ }
+ catch( ... )
+ {
+ } // yrt
+
+ } // rof
+
+ // Show loaded filters
+ auto filters = interface.GetFilters( );
+ for( auto cIt = filters.begin( ); cIt != filters.end( ); ++cIt )
+ {
+ std::cout << "Category: " << cIt->first << std::endl;
+ for( auto nIt = cIt->second.begin( ); nIt != cIt->second.end( ); ++nIt )
+ std::cout
+ << "\tFilter: " << *nIt
+ << std::endl;
+
+ } // rof
+ return( 0 );
+}
+
+// eof - $RCSfile$
catch( std::exception& err )
{
std::cerr
- << "Interface load failed on \"" << argv[ 1 ] << "\": "
+ << "Error caught:"
<< err.what( )
<< std::endl;
return( 1 );
- } // fi
+ } // yrt
// Show loaded filters
auto filters = interface.GetFilters( );
std::cout << "Category: " << cIt->first << std::endl;
for( auto nIt = cIt->second.begin( ); nIt != cIt->second.end( ); ++nIt )
std::cout
- << "\tFilter: " << nIt->first
- << " (" << nIt->second << ")"
+ << "\tFilter: " << *nIt
<< std::endl;
} // rof
for( int i = 2; i < argc - 1; ++i )
reader_params->AddToOpenFileNameList( "FileNames", argv[ i ] );
auto writer_params = writer->GetParameters( );
- writer_params->SetOpenFileName( "FileName", argv[ argc - 1 ] );
+ writer_params->SetSaveFileName( "FileName", argv[ argc - 1 ] );
// Connect filters
writer->SetInput( "Input", reader->GetOutput( "Output" ) );
for( int i = 2; i < argc - 1; ++i )
reader_params->AddToOpenFileNameList( "FileNames", argv[ i ] );
auto writer_params = writer->GetParameters( );
- writer_params->SetOpenFileName( "FileName", argv[ argc - 1 ] );
+ writer_params->SetSaveFileName( "FileName", argv[ argc - 1 ] );
// Execute
std::string err = workspace.Execute( );
+CONFIGURE_FILE(
+ cpPluginsConfig.cmake.in
+ ${PROJECT_BINARY_DIR}/cpPluginsConfig.cmake
+ @ONLY
+ )
+
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+ FILES
+ ${PROJECT_BINARY_DIR}/cpPluginsConfig.cmake
+ DESTINATION share/cmake
+ )
+
## eof - $RCSfile$
--- /dev/null
+# ===================================
+# -- Some configurations variables --
+# ===================================
+
+SET(USE_QT4 "@QT4_FOUND@")
+
+# =======================
+# -- Find dependencies --
+# =======================
+
+# Find ITK and VTK
+SET(ITK_DIR @ITK_DIR@)
+FIND_PACKAGE(ITK REQUIRED)
+INCLUDE(${ITK_USE_FILE})
+
+SET(VTK_DIR @VTK_DIR@)
+FIND_PACKAGE(VTK REQUIRED)
+INCLUDE(${VTK_USE_FILE})
+
+# Do not use itk-vtk glue --> problems ahead!!!
+IF(ITKVtkGlue_LOADED)
+ MESSAGE(FATAL_ERROR "ITKVtkGlue module is available. Please re-compile your ITK without it. It could lead to nasty compilation problems... Just waiting for Kitware to solve it.")
+ENDIF(ITKVtkGlue_LOADED)
+
+IF(USE_QT4 EQUAL "1")
+ SET(QT_QMAKE_EXECUTABLE @QT_QMAKE_EXECUTABLE@)
+ FIND_PACKAGE(Qt4 REQUIRED)
+ INCLUDE(${QT_USE_FILE})
+
+ ## Check for required vtk-qt4 modules
+ SET(
+ vtk_required_modules
+ vtkGUISupportQt
+ vtkGUISupportQtOpenGL
+ )
+ FOREACH(vtk_module ${vtk_required_modules})
+ IF(NOT ${vtk_module}_LOADED)
+ MESSAGE(
+ FATAL_ERROR
+ "${vtk_module} module is required but not available."
+ )
+ ENDIF(NOT ${vtk_module}_LOADED)
+ ENDFOREACH(vtk_module)
+ENDIF(USE_QT4 EQUAL "1")
+
+
+# =========================
+# -- Include directories --
+# =========================
+
+INCLUDE_DIRECTORIES(
+ @PROJECT_SOURCE_DIR@/lib
+ @PROJECT_SOURCE_DIR@/lib/third_party
+ @PROJECT_SOURCE_DIR@/lib/ItkVtkGlue
+ @PROJECT_BINARY_DIR@/lib
+ @PROJECT_BINARY_DIR@/lib/third_party
+ @PROJECT_BINARY_DIR@/lib/ItkVtkGlue
+ @CMAKE_INSTALL_PREFIX@/include
+ @CMAKE_INSTALL_PREFIX@/include/third_party
+ @CMAKE_INSTALL_PREFIX@/include/ItkVtkGlue
+ )
+
+# =========================
+# -- Library directories --
+# =========================
+
+IF(MSVC)
+ LINK_DIRECTORIES(
+ @PROJECT_BINARY_DIR@/$(ConfigurationName)
+ @CMAKE_INSTALL_PREFIX@/bin
+ @CMAKE_INSTALL_PREFIX@/lib
+ )
+ELSE(MSVC)
+ LINK_DIRECTORIES(
+ @PROJECT_BINARY_DIR@
+ @CMAKE_INSTALL_PREFIX@/bin
+ @CMAKE_INSTALL_PREFIX@/lib
+ )
+ENDIF(MSVC)
+
+# ===================
+# -- Library names --
+# ===================
+
+SET(cpExtensions_LIBRARY cpExtensions)
+SET(cpPlugins_LIBRARY cpPlugins)
+
+# ======================
+# -- Executable names --
+# ======================
+
+IF(MSVC)
+ FIND_PROGRAM(
+ cpPlugins_HostCreator_APP
+ NAMES cpPlugins_HostCreator
+ HINTS /usr /usr/local
+ PATHS @CMAKE_INSTALL_PREFIX@/bin @PROJECT_BINARY_DIR@/Debug @PROJECT_BINARY_DIR@/Release @PROJECT_BINARY_DIR@/MinSizeRel @PROJECT_BINARY_DIR@/RelWithDebInfo
+ PATH_SUFFIXES bin sbin
+ DOC "Where is cpPlugins_HostCreator?"
+ )
+ELSE(MSVC)
+ FIND_PROGRAM(
+ cpPlugins_HostCreator_APP
+ NAMES cpPlugins_HostCreator
+ HINTS /usr /usr/local
+ PATHS @CMAKE_INSTALL_PREFIX@/bin @PROJECT_BINARY_DIR@
+ PATH_SUFFIXES bin sbin
+ DOC "Where is cpPlugins_HostCreator?"
+ )
+ENDIF(MSVC)
+
+## eof - $RCSfile$
virtual ~ImageToVTKImageFilter();
private:
- ImageToVTKImageFilter(const Self&) ITK_DELETE_FUNCTION;
- void operator=(const Self&) ITK_DELETE_FUNCTION;
+ ImageToVTKImageFilter(const Self&) = delete;
+ void operator=(const Self&) = delete;
ExporterFilterPointer m_Exporter;
vtkImageImport * m_Importer;
virtual ~VTKImageToImageFilter();
private:
- VTKImageToImageFilter(const Self&) ITK_DELETE_FUNCTION;
- void operator=(const Self&) ITK_DELETE_FUNCTION;
+ VTKImageToImageFilter(const Self&) = delete;
+ void operator=(const Self&) = delete;
typedef vtkSmartPointer<vtkImageExport> ImageExportPointer;
ImageExportPointer m_Exporter;
cpExtensions::QT::SimpleMPRWidget::
~SimpleMPRWidget( )
{
- delete this->m_UI;
+ // TODO: this causes a segfault (?)
+ // delete this->m_UI;
}
// -------------------------------------------------------------------------
: public DataObject
{
public:
- typedef Image Self;
- typedef DataObject Superclass;
+ typedef Image Self;
+ typedef DataObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
public:
+ itkNewMacro( Self );
+ itkTypeMacro( Image, DataObject );
cpPlugins_Id_Macro( Image, Object );
public:
- Image( );
- virtual ~Image( );
-
virtual void SetITK( itk::LightObject* o ) override;
virtual void SetVTK( vtkObjectBase* o ) override;
protected:
+ Image( );
+ virtual ~Image( );
template< unsigned int D >
inline bool _ITK_2_VTK_0( itk::LightObject* o );
#include <cpPlugins/Interface.h>
-#include <map>
-#include <set>
-#include <string>
-
#ifdef cpPlugins_SYS_WINDOWS
#else // cpPlugins_SYS_WINDOWS
# include <dlfcn.h>
#endif // cpPlugins_SYS_WINDOWS
-
// -------------------------------------------------------------------------
cpPlugins::Interface::
Interface( )
void cpPlugins::Interface::
LoadPluginFile( const std::string& filename )
{
+ // Open library with its canonical path name
auto canonical_fn = cpPlugins::PathHelper::CanonicalPath( filename );
- void* hnd = NULL;
- std::map< std::string, std::set< std::string > > filters;
-#ifdef cpPlugins_SYS_WINDOWS
- // TODO:
-#else // cpPlugins_SYS_WINDOWS
-
- // Try to load canonical filename and clean error messages
- hnd = dlopen( canonical_fn.c_str( ), RTLD_NOW | RTLD_GLOBAL );
+ void* hnd = Self::_DLOpen( canonical_fn );
if( hnd == NULL )
throw std::runtime_error(
std::string( "cpPlugins::Interface: Could not load library \"" ) +
canonical_fn +
std::string( "\"" )
);
- dlerror( );
- // Init plugins
- typedef const std::map< std::string, std::set< std::string > > ( *func_t )( );
- auto func = ( func_t ) dlsym( hnd, "LoadedFilters" );
- const char* func_error = dlerror( );
- if( func_error != NULL )
- {
- dlclose( hnd );
- throw std::runtime_error(
- std::string( "cpPlugins::Interface: Library \"" ) +
- canonical_fn +
- std::string( "\" not recognized as a cpPlugins library." )
- );
+ // Load filters
+ TFilters filters = Self::_DLGetFilters( hnd );
- } // fi
- filters = func( );
-#endif // cpPlugins_SYS_WINDOWS
- if( hnd != NULL )
+ // Save the loaded filters info
+ bool save_handler = false;
+ for( auto catIt = filters.begin( ); catIt != filters.end( ); ++catIt )
{
- // Save the loaded filters names
- for( auto cIt = filters.begin( ); cIt != filters.end( ); ++cIt )
+ // Check if the filter is completely new
+ auto act_catIt = this->m_Filters.find( catIt->first );
+ for(
+ auto clsIt = catIt->second.begin( );
+ clsIt != catIt->second.end( );
+ ++clsIt
+ )
{
- auto colIt = this->m_Filters.find( cIt->first );
- for( auto fIt = cIt->second.begin( ); fIt != cIt->second.end( ); ++fIt )
+ bool new_filter = true;
+ if( act_catIt != this->m_Filters.end( ) )
+ new_filter =
+ ( act_catIt->second.find( *clsIt ) == act_catIt->second.end( ) );
+
+ // Ok, it is new
+ if( new_filter )
{
- bool found = false;
- if( colIt != this->m_Filters.end( ) )
+ // Update filters container
+ TCreator creator = Self::_DLGetCreator( hnd, catIt->first, *clsIt );
+ if( creator != NULL )
{
- auto rowIt = colIt->second.find( *fIt );
- if( rowIt != colIt->second.end( ) )
- found = true;
+ this->m_DynFilters[ catIt->first][ *clsIt ] =
+ TDynFunc( canonical_fn, creator );
+ this->m_Filters[ catIt->first ].insert( *clsIt );
+ save_handler = true;
} // fi
- if( !found )
- this->m_Filters[ cIt->first ][ *fIt ] = canonical_fn;
- } // rof
+ } // fi
} // rof
- // Save the hnd
- this->m_Plugins[ canonical_fn ] = hnd;
- }
+ } // rof
+
+ // Keep dynlib handler, if needed
+ if( save_handler )
+ this->m_DynLibraries[ canonical_fn ] = hnd;
else
- throw std::runtime_error(
- "cpPlugins::Interface: Operative system not yet supported."
- );
+ Self::_DLClose( hnd );
}
// -------------------------------------------------------------------------
void cpPlugins::Interface::
UnloadAll( )
{
- auto pIt = this->m_Plugins.begin( );
- for( ; pIt != this->m_Plugins.end( ); ++pIt )
- {
-#ifdef cpPlugins_SYS_WINDOWS
-#else // cpPlugins_SYS_WINDOWS
- dlclose( pIt->second );
-#endif // cpPlugins_SYS_WINDOWS
- } // rof
- this->m_Plugins.clear( );
+ for(
+ auto d = this->m_DynLibraries.begin( );
+ d != this->m_DynLibraries.end( );
+ ++d
+ )
+ Self::_DLClose( d->second );
+ this->m_DynLibraries.clear( );
+ this->m_DynFilters.clear( );
this->m_Filters.clear( );
}
cpPlugins::ProcessObject::Pointer cpPlugins::Interface::
Create( const std::string& category, const std::string& name )
{
- cpPlugins::ProcessObject::Pointer filter;
- auto cIt = this->m_Filters.find( category );
- if( cIt != this->m_Filters.end( ) )
+ cpPlugins::ProcessObject::Pointer filter = NULL;
+ auto catIt = this->m_DynFilters.find( category );
+ if( catIt != this->m_DynFilters.end( ) )
{
- auto nIt = cIt->second.find( name );
- if( nIt != cIt->second.end( ) )
- {
- auto pIt = this->m_Plugins.find( nIt->second );
- if( pIt != this->m_Plugins.end( ) )
- {
+ auto clsIt = catIt->second.find( name );
+ if( clsIt != catIt->second.end( ) )
+ filter = clsIt->second.second( );
+
+ } // fi
+ return( filter );
+}
+
+// -------------------------------------------------------------------------
+void* cpPlugins::Interface::
+_DLOpen( const std::string& fname )
+{
+ void* hnd = NULL;
#ifdef cpPlugins_SYS_WINDOWS
+ // TODO:
#else // cpPlugins_SYS_WINDOWS
- std::string func_name = category + "_" + name;
- typedef cpPlugins::ProcessObject::Pointer ( *func_t )( );
- auto func = ( func_t ) dlsym( pIt->second, func_name.c_str( ) );
- if( func == NULL )
- {
- throw std::runtime_error(
- std::string( "cpPlugins::Interface: Class \"" ) +
- category + std::string( ":" ) + name +
- std::string( "\" does not have a valid creator function." )
- );
-
- } // fi
- filter = func( );
+ hnd = dlopen( fname.c_str( ), RTLD_NOW | RTLD_GLOBAL );
+ dlerror( );
#endif // cpPlugins_SYS_WINDOWS
- } // fi
+ return( hnd );
+}
- } // fi
+// -------------------------------------------------------------------------
+cpPlugins::Interface::
+TFilters cpPlugins::Interface::
+_DLGetFilters( void* hnd )
+{
+ TFilters filters;
+#ifdef cpPlugins_SYS_WINDOWS
+ // TODO:
+#else // cpPlugins_SYS_WINDOWS
+ typedef const TFilters ( *f_t )( );
+ auto f = ( f_t ) dlsym( hnd, "cpPlugins_LoadedFilters" );
+ const char* err = dlerror( );
+ if( err != NULL )
+ {
+ dlclose( hnd );
+ throw std::runtime_error(
+ std::string(
+ "cpPlugins::Interface: Library not recognized as a cpPlugins library: "
+ ) + std::string( err )
+ );
} // fi
- return( filter );
+ filters = f( );
+#endif // cpPlugins_SYS_WINDOWS
+ return( filters );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::
+TCreator cpPlugins::Interface::
+_DLGetCreator(
+ void* hnd, const std::string& category, const std::string& name
+ )
+{
+ TCreator c = NULL;
+ std::string func_name = category + "_" + name;
+#ifdef cpPlugins_SYS_WINDOWS
+ // TODO:
+#else // cpPlugins_SYS_WINDOWS
+ c = ( TCreator )dlsym( hnd, func_name.c_str( ) );
+ if( c == NULL )
+ throw std::runtime_error(
+ std::string( "cpPlugins::Interface: Class \"" ) +
+ category + std::string( ":" ) + name +
+ std::string( "\" does not have a valid creator function." )
+ );
+#endif // cpPlugins_SYS_WINDOWS
+ return( c );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::
+_DLClose( void* hnd )
+{
+#ifdef cpPlugins_SYS_WINDOWS
+ // TODO:
+#else // cpPlugins_SYS_WINDOWS
+ dlclose( hnd );
+#endif // cpPlugins_SYS_WINDOWS
}
// eof - $RCSfile$
#include <cpPlugins/Config.h>
#include <cpPlugins/ProcessObject.h>
#include <map>
+#include <set>
#include <string>
namespace cpPlugins
class cpPlugins_EXPORT Interface
{
public:
- typedef std::map< std::string, std::string > TStringRow;
- typedef std::map< std::string, TStringRow > TFilters;
+ typedef Interface Self;
+
+ typedef cpPlugins::ProcessObject::Pointer ( *TCreator )( );
+ typedef std::pair< std::string, TCreator > TDynFunc;
+ typedef std::map< std::string, TDynFunc > TDynFilter;
+ typedef std::map< std::string, TDynFilter > TDynFilters;
+ typedef std::map< std::string, void* > TDynLibraries;
+ typedef std::map< std::string, std::set< std::string > > TFilters;
public:
Interface( );
);
protected:
- std::map< std::string, void* > m_Plugins;
- TFilters m_Filters;
+ static void* _DLOpen( const std::string& fname );
+ static TFilters _DLGetFilters( void* hnd );
+ static TCreator _DLGetCreator(
+ void* hnd, const std::string& category, const std::string& name
+ );
+ static void _DLClose( void* hnd );
+
+ protected:
+ TDynLibraries m_DynLibraries;
+ TDynFilters m_DynFilters;
+ TFilters m_Filters;
};
} // ecapseman
if( image == NULL )
return( "IO::ImageWriter: Invalid pixel type." );
auto f = this->_CreateITK< itk::ImageFileWriter< I > >( );
- f->SetFileName( this->m_Parameters.GetOpenFileName( "FileName" ) );
+ f->SetFileName( this->m_Parameters.GetSaveFileName( "FileName" ) );
f->SetInput( image );
f->Update( );
return( "" );