From 55743f4ff8867c0075518dcc6b76745722ce60ed Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Thu, 5 Nov 2015 18:08:54 -0500 Subject: [PATCH] UML-code sync --- doc/uml/cpPlugins_classes.dia | Bin 5632 -> 5924 bytes lib/cpPlugins/Interface/BaseApplication.h | 27 + .../Interface/BasePluginsApplication.h | 27 - lib/cpPlugins/Interface/DataObject.cxx | 9 +- lib/cpPlugins/Interface/DataObject.h | 17 +- lib/cpPlugins/Interface/Image.h | 7 +- lib/cpPlugins/Interface/Image.hxx | 2 - lib/cpPlugins/Interface/Macros.h | 52 +- lib/cpPlugins/Interface/Mesh.h | 5 +- lib/cpPlugins/Interface/Mesh.hxx | 2 - lib/cpPlugins/Interface/Object.cxx | 3 - lib/cpPlugins/Interface/Object.h | 61 +-- lib/cpPlugins/Interface/Plugins.cxx | 474 ++++++++++++++++-- lib/cpPlugins/Interface/Plugins.h | 122 ++--- lib/cpPlugins/Interface/Plugins.hxx | 30 ++ lib/cpPlugins/Interface/ProcessObject.cxx | 76 +-- lib/cpPlugins/Interface/ProcessObject.h | 58 ++- 17 files changed, 657 insertions(+), 315 deletions(-) create mode 100644 lib/cpPlugins/Interface/BaseApplication.h delete mode 100644 lib/cpPlugins/Interface/BasePluginsApplication.h create mode 100644 lib/cpPlugins/Interface/Plugins.hxx diff --git a/doc/uml/cpPlugins_classes.dia b/doc/uml/cpPlugins_classes.dia index d5c06312e9c36e1ace50bf3e6689c114247c72c0..7e24d9a6680c0f444615ae14eef9a3c06d035abf 100644 GIT binary patch literal 5924 zcmZve2T)Vp)`k%fR8){A9i&M|dMBbl6bulgS837(q<4|t6$v0MG%3bzIvj>H(U3QMS1HK-tCfGi94Sh~xUSOnCci#3hO`YE z(j_~SBwzUAkc1pElMYYGtKzw1eW$p^+&mRP zCnziWVi8Sbd2Y&LEe>0EW7H|eVW*c)4&1Xv9ObaW6$p&{d)|$iOwV5zggM>Qucv)y z_ijh8Y%3fqe@?EM5Fl8D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|D`&V>E?V*wZZbZD2uLgM7>_NJd#PAEe* zQ)^|u{+dj1z?S=|yL>jxt`sV(I03sAQ?ealaq#`{ z1ynsDT;*02+}@<#XMu`-W~Ch%2^R$TYq_!vjtn4kQa8Vkt}xpqJMj`hz| So=8Pvz=ZHKb%jI%y#E7>A71AG diff --git a/lib/cpPlugins/Interface/BaseApplication.h b/lib/cpPlugins/Interface/BaseApplication.h new file mode 100644 index 0000000..549296b --- /dev/null +++ b/lib/cpPlugins/Interface/BaseApplication.h @@ -0,0 +1,27 @@ +#ifndef __CPPLUGINS__INTERFACE__BASEAPPLICATION__H__ +#define __CPPLUGINS__INTERFACE__BASEAPPLICATION__H__ + +#include + +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/BasePluginsApplication.h b/lib/cpPlugins/Interface/BasePluginsApplication.h deleted file mode 100644 index 26ba271..0000000 --- a/lib/cpPlugins/Interface/BasePluginsApplication.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__BASEPLUGINSAPPLICATION__H__ -#define __CPPLUGINS__INTERFACE__BASEPLUGINSAPPLICATION__H__ - -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_Interface_EXPORT BasePluginsApplication - { - public: - BasePluginsApplication( ) { } - virtual ~BasePluginsApplication( ) { } - - virtual void UpdateActualFilter( ) = 0; - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__BASEPLUGINSAPPLICATION__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/DataObject.cxx b/lib/cpPlugins/Interface/DataObject.cxx index 5804345..c937e4d 100644 --- a/lib/cpPlugins/Interface/DataObject.cxx +++ b/lib/cpPlugins/Interface/DataObject.cxx @@ -1,18 +1,19 @@ #include +#include #include #include #include // ------------------------------------------------------------------------- -cpPlugins::Interface::Object* cpPlugins::Interface::DataObject:: +cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject:: GetSource( ) { return( this->m_Source ); } // ------------------------------------------------------------------------- -const cpPlugins::Interface::Object* cpPlugins::Interface::DataObject:: +const cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject:: GetSource( ) const { return( this->m_Source ); @@ -20,9 +21,9 @@ GetSource( ) const // ------------------------------------------------------------------------- void cpPlugins::Interface::DataObject:: -SetSource( cpPlugins::Interface::Object* src ) +SetSource( cpPlugins::Interface::ProcessObject* src ) { - if( this->m_Source.GetPointer( ) != src ) + if( this->m_Source != src ) { this->m_Source = src; this->Modified( ); diff --git a/lib/cpPlugins/Interface/DataObject.h b/lib/cpPlugins/Interface/DataObject.h index 841f3a2..4668219 100644 --- a/lib/cpPlugins/Interface/DataObject.h +++ b/lib/cpPlugins/Interface/DataObject.h @@ -1,11 +1,9 @@ #ifndef __CPPLUGINS__INTERFACE__DATAOBJECT__H__ #define __CPPLUGINS__INTERFACE__DATAOBJECT__H__ -#include #include #include - #include #include @@ -13,6 +11,9 @@ namespace cpPlugins { namespace Interface { + // Some forward declarations + class ProcessObject; + /** */ class cpPlugins_Interface_EXPORT DataObject @@ -26,14 +27,12 @@ namespace cpPlugins public: itkTypeMacro( DataObject, Object ); - cpPlugins_Id_Macro( - cpPlugins::Interface::DataObject, "BasicObject" - ); + cpPlugins_Id_Macro( DataObject, "BasicObject" ); public: - Object* GetSource( ); - const Object* GetSource( ) const; - void SetSource( Object* src ); + ProcessObject* GetSource( ); + const ProcessObject* GetSource( ) const; + void SetSource( ProcessObject* src ); void DisconnectPipeline( ); @@ -61,7 +60,7 @@ namespace cpPlugins protected: itk::Object::Pointer m_ITKObject; vtkSmartPointer< vtkObject > m_VTKObject; - Object::Pointer m_Source; + ProcessObject* m_Source; }; } // ecapseman diff --git a/lib/cpPlugins/Interface/Image.h b/lib/cpPlugins/Interface/Image.h index 1aeee5c..30bfbf5 100644 --- a/lib/cpPlugins/Interface/Image.h +++ b/lib/cpPlugins/Interface/Image.h @@ -1,13 +1,10 @@ #ifndef __CPPLUGINS__INTERFACE__IMAGE__H__ #define __CPPLUGINS__INTERFACE__IMAGE__H__ -#include #include #include -class vtkImageData; - // ------------------------------------------------------------------------- namespace cpPlugins { @@ -27,9 +24,7 @@ namespace cpPlugins public: itkNewMacro( Self ); itkTypeMacro( Image, DataObject ); - cpPlugins_Id_Macro( - cpPlugins::Interface::Image, "DataObject" - ); + cpPlugins_Id_Macro( Image, "DataObject" ); public: template< class I > diff --git a/lib/cpPlugins/Interface/Image.hxx b/lib/cpPlugins/Interface/Image.hxx index dfabc0a..8c31dca 100644 --- a/lib/cpPlugins/Interface/Image.hxx +++ b/lib/cpPlugins/Interface/Image.hxx @@ -1,8 +1,6 @@ #ifndef __CPPLUGINS__INTERFACE__IMAGE__HXX__ #define __CPPLUGINS__INTERFACE__IMAGE__HXX__ -#include - #include #include diff --git a/lib/cpPlugins/Interface/Macros.h b/lib/cpPlugins/Interface/Macros.h index c85cd0c..85a9d08 100644 --- a/lib/cpPlugins/Interface/Macros.h +++ b/lib/cpPlugins/Interface/Macros.h @@ -1,12 +1,62 @@ #ifndef __CPPLUGINS__INTERFACE__MACROS__H__ #define __CPPLUGINS__INTERFACE__MACROS__H__ +#include #include +#include + +// ------------------------------------------------------------------------- +#define cpPlugins_Id_Macro( name, category ) \ + public: \ + virtual std::string GetClassName( ) { return( #name ); } \ + virtual std::string GetClassCategory( ) { return( category ); } + +// ------------------------------------------------------------------------- +#define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \ + class cpPlugins_Interface_EXPORT TYPE##Provider \ + : public pluma::Provider \ + { \ +private: \ + friend class pluma::Pluma; \ + static const unsigned int PLUMA_INTERFACE_VERSION; \ + static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION; \ + static const std::string PLUMA_PROVIDER_TYPE; \ + std::string plumaGetType( ) const \ + { return( PLUMA_PROVIDER_TYPE ); } \ +public: \ + unsigned int getVersion( ) const \ + { return( PLUMA_INTERFACE_VERSION ); } + +// ------------------------------------------------------------------------- +#define CPPLUGINS_PROVIDER_HEADER_END }; + +// ------------------------------------------------------------------------- +#define CPPLUGINS_PROVIDER_HEADER( TYPE ) \ + CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \ + virtual TYPE::Pointer create( ) const = 0; \ + CPPLUGINS_PROVIDER_HEADER_END + +// ------------------------------------------------------------------------- +#define CPPLUGINS_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) \ + PLUMA_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) + +// ------------------------------------------------------------------------- +#define CPPLUGINS_INHERIT_PROVIDER( TYPE ) \ + class TYPE##Provider \ + : public cpPlugins::Interface::ProcessObjectProvider \ + { \ + public: \ + cpPlugins::Interface::Object::Pointer create( ) const \ + { \ + TYPE::Pointer a = TYPE::New( ); \ + cpPlugins::Interface::Object::Pointer b = a.GetPointer( ); \ + return( b ); \ + } \ + }; /** * Based upon: http://www.itk.org/Wiki/Proposals:Explicit_Instantiation */ - // ------------------------------------------------------------------------- #define cpPlugins_TEMPLATE_1( X1 ) \ X1 diff --git a/lib/cpPlugins/Interface/Mesh.h b/lib/cpPlugins/Interface/Mesh.h index 92c3c45..097ed30 100644 --- a/lib/cpPlugins/Interface/Mesh.h +++ b/lib/cpPlugins/Interface/Mesh.h @@ -1,7 +1,6 @@ #ifndef __CPPLUGINS__INTERFACE__MESH__H__ #define __CPPLUGINS__INTERFACE__MESH__H__ -#include #include namespace cpPlugins @@ -22,9 +21,7 @@ namespace cpPlugins public: itkNewMacro( Self ); itkTypeMacro( Mesh, DataObject ); - cpPlugins_Id_Macro( - cpPlugins::Interface::Mesh, "DataObject" - ); + cpPlugins_Id_Macro( Mesh, "DataObject" ); public: template< class M > diff --git a/lib/cpPlugins/Interface/Mesh.hxx b/lib/cpPlugins/Interface/Mesh.hxx index da89167..6de611e 100644 --- a/lib/cpPlugins/Interface/Mesh.hxx +++ b/lib/cpPlugins/Interface/Mesh.hxx @@ -1,8 +1,6 @@ #ifndef __CPPLUGINS__INTERFACE__MESH__HXX__ #define __CPPLUGINS__INTERFACE__MESH__HXX__ -#include - #include #include diff --git a/lib/cpPlugins/Interface/Object.cxx b/lib/cpPlugins/Interface/Object.cxx index 4ca6286..474e031 100644 --- a/lib/cpPlugins/Interface/Object.cxx +++ b/lib/cpPlugins/Interface/Object.cxx @@ -13,7 +13,4 @@ cpPlugins::Interface::Object:: { } -// ------------------------------------------------------------------------- -CPPLUGINS_PROVIDER_SOURCE( cpPlugins::Interface::Object, 1, 1 ); - // eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Object.h b/lib/cpPlugins/Interface/Object.h index c4a0bfb..03eb2ae 100644 --- a/lib/cpPlugins/Interface/Object.h +++ b/lib/cpPlugins/Interface/Object.h @@ -1,62 +1,12 @@ #ifndef __CPPLUGINS__INTERFACE__OBJECT__H__ #define __CPPLUGINS__INTERFACE__OBJECT__H__ -#include -#include -#include +#include +#include #include #include -// ------------------------------------------------------------------------- -#define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \ - class cpPlugins_Interface_EXPORT TYPE##Provider \ - : public pluma::Provider \ - { \ -private: \ - friend class pluma::Pluma; \ - static const unsigned int PLUMA_INTERFACE_VERSION; \ - static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION; \ - static const std::string PLUMA_PROVIDER_TYPE; \ - std::string plumaGetType( ) const \ - { return( PLUMA_PROVIDER_TYPE ); } \ -public: \ - unsigned int getVersion( ) const \ - { return( PLUMA_INTERFACE_VERSION ); } - -// ------------------------------------------------------------------------- -#define CPPLUGINS_PROVIDER_HEADER_END }; - -// ------------------------------------------------------------------------- -#define CPPLUGINS_PROVIDER_HEADER( TYPE ) \ - CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \ - virtual TYPE::Pointer create( ) const = 0; \ - CPPLUGINS_PROVIDER_HEADER_END - -// ------------------------------------------------------------------------- -#define CPPLUGINS_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) \ - PLUMA_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) - -// ------------------------------------------------------------------------- -#define CPPLUGINS_INHERIT_PROVIDER( TYPE ) \ - class TYPE##Provider \ - : public cpPlugins::Interface::ObjectProvider \ - { \ - public: \ - cpPlugins::Interface::Object::Pointer create( ) const \ - { \ - TYPE::Pointer a = TYPE::New( ); \ - cpPlugins::Interface::Object::Pointer b = a.GetPointer( ); \ - return( b ); \ - } \ - }; - -// ------------------------------------------------------------------------- -#define cpPlugins_Id_Macro( name, category ) \ - public: \ - virtual std::string GetClassName( ) { return( #name ); } \ - virtual std::string GetClassCategory( ) { return( category ); } - namespace cpPlugins { namespace Interface @@ -75,7 +25,7 @@ namespace cpPlugins public: itkNewMacro( Self ); itkTypeMacro( Object, itkObject ); - cpPlugins_Id_Macro( cpPlugins::Interface::Object, "BaseObject" ); + cpPlugins_Id_Macro( Object, "BaseObject" ); itkGetStringMacro( Name ); itkSetStringMacro( Name ); @@ -93,11 +43,6 @@ namespace cpPlugins std::string m_Name; }; - /** - * Plugin provider - */ - CPPLUGINS_PROVIDER_HEADER( Object ); - } // ecapseman } // ecapseman diff --git a/lib/cpPlugins/Interface/Plugins.cxx b/lib/cpPlugins/Interface/Plugins.cxx index 99aaebb..4647fde 100644 --- a/lib/cpPlugins/Interface/Plugins.cxx +++ b/lib/cpPlugins/Interface/Plugins.cxx @@ -1,16 +1,14 @@ #include -#include - -#include -#include #ifdef cpPlugins_Interface_QT4 -#include -#include -#include -#include -#include +/* + #include + #include + #include + #include + #include +*/ #ifdef _WIN32 # define PLUGIN_PREFIX "" @@ -26,18 +24,22 @@ // ------------------------------------------------------------------------- cpPlugins::Interface::Plugins:: -Plugins( QWidget* widget ) - : m_Widget( widget ), +Plugins( ) + : m_Widget( NULL ), m_Application( NULL ), - m_LastLoadedPlugin( "." ) + m_Interface( NULL ), + m_LastLoadedPlugin( "" ), + m_ActiveFilter( NULL ) { + this->m_Interface = new TInterface( ); } // ------------------------------------------------------------------------- cpPlugins::Interface::Plugins:: ~Plugins( ) { - // TODO: this causes a segfault? this->m_Interface.UnloadAll( ); + if( this->m_Interface != NULL ) + delete this->m_Interface; } // ------------------------------------------------------------------------- @@ -117,39 +119,14 @@ DialogLoadPlugins( ) } // ------------------------------------------------------------------------- -void cpPlugins::Interface::Plugins:: -AssociatePluginsToMenu( QMenu* menu, QObject* obj, const char* slot ) -{ -#ifdef cpPlugins_Interface_QT4 - std::map< std::string, std::set< std::string > >::const_iterator i; - std::set< std::string >::const_iterator j; - - menu->clear( ); - for( i = this->m_Filters.begin( ); i != this->m_Filters.end( ); i++ ) - { - QMenu* newMenu = menu->addMenu( i->first.c_str( ) ); - for( j = i->second.begin( ); j != i->second.end( ); ++j ) - { - QAction* a = newMenu->addAction( j->c_str( ) ); - QObject::connect( a, SIGNAL( triggered( ) ), obj, slot ); - - } // rof - - } // rof -#endif // cpPlugins_Interface_QT4 -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface:: -BasePluginsApplication* cpPlugins::Interface::Plugins:: +BaseApplication* cpPlugins::Interface::Plugins:: GetApplication( ) { return( this->m_Application ); } // ------------------------------------------------------------------------- -const cpPlugins::Interface:: -BasePluginsApplication* cpPlugins::Interface::Plugins:: +const BaseApplication* cpPlugins::Interface::Plugins:: GetApplication( ) const { return( this->m_Application ); @@ -157,11 +134,18 @@ GetApplication( ) const // ------------------------------------------------------------------------- void cpPlugins::Interface::Plugins:: -SetApplication( cpPlugins::Interface::BasePluginsApplication* a ) +SetApplication( BaseApplication* a ) { this->m_Application = a; } +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Plugins:: +LoadPlugins( ) +{ + // TODO: what to do here? +} + // ------------------------------------------------------------------------- bool cpPlugins::Interface::Plugins:: LoadPlugins( const std::string& fname ) @@ -173,7 +157,7 @@ LoadPlugins( const std::string& fname ) if( this->m_LoadedPlugins.find( fname ) == this->m_LoadedPlugins.end( ) ) { // Was it succesfully loaded? - ret = this->m_Interface.Load( fname ); + ret = this->m_Interface->Load( fname ); // Update a simple track if( ret ) @@ -221,6 +205,412 @@ LoadPluginsConfigurationFile( const std::string& fname ) return( true ); } +// ------------------------------------------------------------------------- +const cpPlugins::Interface::Plugins:: +TStringContainer& cpPlugins::Interface::Plugins:: +GetLoadedPlugins( ) const +{ + return( this->m_LoadedPlugins ); +} + +// ------------------------------------------------------------------------- +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& plugin ) const +{ + static const TStringContainer EMPTY; + auto pIt = this->m_LoadedFilters.find( plugin ); + 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 + ) +{ + // Activate reader + auto fIt = this->m_IOFilters.find( "ImageReader" ); + if( fIt == this->m_IOFilters.end( ) ) + return( "" ); + this->m_ActiveFilter = fIt->second; + + // Configure reader + TParameters* params = this->GetActiveFilterParameters( ); + params->ClearStringList( "FileNames" ); + for( auto nIt = fnames.begin( ); nIt != fnames.end( ); ++nIt ) + params->AddToStringList( "FileNames", *nIt ); + + // Execute filter + std::string err = this->UpdateActiveFilter( ); + if( err == "" ) + { +#error GET OBJECT NAME + } + else + { +#error THROW ERROR + } // fi +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::Plugins:: +ReadImage( const std::string& parent ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::Plugins:: +ReadDicomSeries( const std::string& parent ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::Plugins:: +ReadMesh( + const std::string& fname, const std::string& parent + ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::Plugins:: +ReadMesh( const std::string& parent ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::Plugins:: +WriteDataObject( + const std::string& fname, const std::string& name + ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::Plugins:: +WriteDataObject( const std::string& name ) +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Plugins:: +ClearDataObjects( ) +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Plugins:: +DeleteDataObject( const std::string& name ) +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Plugins:: +GetDataObjects( TStringContainer& names ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::Plugins:: +GetParent( const std::string& name ) const +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Plugins:: +GetChildren( + TStringContainer& names, const std::string& name + ) const +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Plugins:: +GetRoots( TStringContainer& names ) const +{ +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Plugins:: +ActivateFilter( const std::string& name ) +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Plugins:: +DeactivateFilter( ) +{ +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Plugins:: +HasActiveFilter( ) const +{ +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Plugins:: +IsActiveFilterInteractive( ) const +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Plugins:: +GetActiveFilterInputsNames( TStringContainer& names ) const +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Plugins:: +GetActiveFilterOutputsNames( TStringContainer& names ) const +{ +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Plugins:: +ConnectInputInActiveFilter( + const std::string& object_name, const std::string& input_name + ) +{ +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Plugins:: +SetOutputNameInActiveFilter( + const std::string& new_object_name, const std::string& output_name + ) +{ +} + +// ------------------------------------------------------------------------- +TParameters* cpPlugins::Interface::Plugins:: +GetActiveFilterParameters( ) +{ +} + +// ------------------------------------------------------------------------- +const TParameters* cpPlugins::Interface::Plugins:: +GetActiveFilterParameters( ) const +{ +} + +// ------------------------------------------------------------------------- +TProcessObject::DialogResult cpPlugins::Interface::Plugins:: +ConfigureActiveFilter( ) +{ +} + +// ------------------------------------------------------------------------- +std::string cpPlugins::Interface::Plugins:: +UpdateActiveFilter( ) +{ +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Plugins:: +_UpdateLoadedPluginsInformation( ) +{ +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::Plugins:: +_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; + + // Loaded filters + std::map< std::string, TProcessObject::Pointer > m_IOFilters; + TProcessObject::Pointer m_ActiveFilter; + std::map< std::string, std::string > m_ActiveFilterOutputs; + std::map< std::string, TStringContainer > m_LoadedFilters; + + // 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 + +#include +#include + +#ifdef cpPlugins_Interface_QT4 + +#include +#include +#include +#include +#include + +#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 + + + + // ------------------------------------------------------------------------- void cpPlugins::Interface::Plugins:: AddInteractor( vtkRenderWindowInteractor* interactor ) diff --git a/lib/cpPlugins/Interface/Plugins.h b/lib/cpPlugins/Interface/Plugins.h index 8eb4d3c..57ffe3f 100644 --- a/lib/cpPlugins/Interface/Plugins.h +++ b/lib/cpPlugins/Interface/Plugins.h @@ -1,27 +1,29 @@ #ifndef __CPPLUGINS__INTERFACE__PLUGINS__H__ #define __CPPLUGINS__INTERFACE__PLUGINS__H__ -#include +#include +#include +#include #include #include #include +#include -#include -#include -#include -#include - -class QObject; -class QMenu; -class QWidget; +// Some forward declarations class vtkRenderWindowInteractor; +#ifdef cpPlugins_Interface_QT4 +class QWidget; +#else +typedef char QWidget; +#endif // cpPlugins_Interface_QT4 namespace cpPlugins { namespace Interface { - class BasePluginsApplication; + // Some forward declarations + class BaseApplication; /** */ @@ -31,36 +33,36 @@ namespace cpPlugins typedef cpPlugins::Interface::Interface TInterface; typedef cpPlugins::Interface::ProcessObject TProcessObject; typedef cpPlugins::Interface::DataObject TDataObject; - typedef cpPlugins::Interface::Image TImage; - typedef cpPlugins::Interface::Mesh TMesh; typedef TProcessObject::TParameters TParameters; - typedef std::set< std::string > TOrderedStringContainer; - typedef std::map< std::string, std::set< std::string > > TFilters; - typedef std::pair< std::string, TDataObject::Pointer > TTreeNode; - typedef std::map< std::string, TTreeNode > TTree; + typedef std::set< std::string > TStringContainer; public: - Plugins( QWidget* widget = NULL ); + Plugins( ); virtual ~Plugins( ); + // Qt oriented methods QWidget* GetWidget( ); const QWidget* GetWidget( ) const; void SetWidget( QWidget* widget ); void BlockWidget( ); void UnblockWidget( ); void DialogLoadPlugins( ); - void AssociatePluginsToMenu( - QMenu* menu, QObject* obj, const char* slot - ); - BasePluginsApplication* GetApplication( ); - const BasePluginsApplication* GetApplication( ) const; - void SetApplication( BasePluginsApplication* a ); + // Connection to main application + BaseApplication* GetApplication( ); + const BaseApplication* GetApplication( ) const; + void SetApplication( BaseApplication* a ); + // Plugins management bool LoadPlugins( ); bool LoadPlugins( const std::string& fname ); bool LoadPluginsConfigurationFile( const std::string& fname ); + const TStringContainer& GetLoadedPlugins( ) const; + void GetLoadedFilters( TStringContainer& filters ) const; + const TStringContainer& GetLoadedFilters( + const std::string& plugin + ) const; // Interactors void AddInteractor( vtkRenderWindowInteractor* interactor ); @@ -87,66 +89,68 @@ namespace cpPlugins ); std::string ReadMesh( const std::string& parent ); - bool WriteImage( const std::string& fname, const std::string& name ); - bool WriteImage( const std::string& name ); - bool WriteMesh( const std::string& fname, const std::string& name ); - bool WriteMesh( const std::string& name ); + std::string WriteDataObject( + const std::string& fname, const std::string& name + ); + std::string 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; - const TTree& GetDataObjects( ) const; - TDataObject* GetDataObject( const std::string& name ); - const TDataObject* GetDataObject( const std::string& name ) const; - TImage* GetImage( const std::string& name ); - const TImage* GetImage( const std::string& name ) const; - TMesh* GetMesh( const std::string& name ); - const TMesh* GetMesh( 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; - unsigned int GetNumberOfInputsInActiveFilter( ) const; - unsigned int GetNumberOfOutputsInActiveFilter( ) const; - std::vector< std::string > GetActiveFilterInputsNames( ) const; - std::vector< std::string > GetActiveFilterOutputsNames( ) const; - void ConnectInputInActiveFilter( - const std::string& object_name, const std::string& input + void GetActiveFilterInputsNames( TStringContainer& names ) const; + void GetActiveFilterOutputsNames( TStringContainer& names ) const; + bool ConnectInputInActiveFilter( + const std::string& object_name, const std::string& input_name ); - void SetOutputNameInActiveFilter( - const std::string& new_name, const std::string& output + bool SetOutputNameInActiveFilter( + const std::string& new_object_name, const std::string& output_name ); TParameters* GetActiveFilterParameters( ); const TParameters* GetActiveFilterParameters( ) const; TProcessObject::DialogResult ConfigureActiveFilter( ); - std::string UpdateActiveFilter( std::vector< std::string >& outputs ); + std::string UpdateActiveFilter( ); protected: void _UpdateLoadedPluginsInformation( ); bool _InsertNewData( TDataObject* dobj, const std::string& parent ); protected: - QWidget* m_Widget; - BasePluginsApplication* m_Application; + // MVC objects + QWidget* m_Widget; + BaseApplication* m_Application; - TInterface m_Interface; - TOrderedStringContainer m_LoadedPlugins; - std::string m_LastLoadedPlugin; + // Plugins interface + TInterface* m_Interface; + TStringContainer m_LoadedPlugins; + std::string m_LastLoadedPlugin; + std::map< std::string, TStringContainer > m_LoadedFilters; - TProcessObject::Pointer m_ImageReader; - TProcessObject::Pointer m_ImageWriter; - TProcessObject::Pointer m_MeshReader; - TProcessObject::Pointer m_MeshWriter; - TProcessObject::Pointer m_DicomSeriesReader; - TProcessObject::Pointer m_ActiveFilter; - std::map< std::string, std::string > m_ActiveFilterOutputs; - TFilters m_Filters; + // Loaded filters + std::map< std::string, TProcessObject::Pointer > m_IOFilters; + TProcessObject::Pointer m_ActiveFilter; + std::map< std::string, std::string > m_ActiveFilterOutputs; - // Loaded objects - TTree m_Objects; + // 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; @@ -156,6 +160,8 @@ namespace cpPlugins } // ecapseman +#include + #endif // __CPPLUGINS__INTERFACE__PLUGINS__H__ // eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Plugins.hxx b/lib/cpPlugins/Interface/Plugins.hxx new file mode 100644 index 0000000..b2bcd8a --- /dev/null +++ b/lib/cpPlugins/Interface/Plugins.hxx @@ -0,0 +1,30 @@ +#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$ diff --git a/lib/cpPlugins/Interface/ProcessObject.cxx b/lib/cpPlugins/Interface/ProcessObject.cxx index 6f3bd34..93d36d5 100644 --- a/lib/cpPlugins/Interface/ProcessObject.cxx +++ b/lib/cpPlugins/Interface/ProcessObject.cxx @@ -17,79 +17,6 @@ Modified( ) const this->Superclass::Modified( ); } -// ------------------------------------------------------------------------- -bool cpPlugins::Interface::ProcessObject:: -IsInteractive( ) const -{ - std::vector< std::string > names; - this->m_Parameters->GetNames( names ); - bool res = false; - auto i = names.begin( ); - for( ; i != names.end( ); ++i ) - { - TParameters::Type t = this->m_Parameters->GetType( *i ); - res |= ( t == TParameters::Point ); - res |= ( t == TParameters::Index ); - res |= ( t == TParameters::PointList ); - res |= ( t == TParameters::IndexList ); - - } // rof - return( res ); -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::ProcessObject:: -TParameters* cpPlugins::Interface::ProcessObject:: -GetParameters( ) -{ - return( this->m_Parameters.GetPointer( ) ); -} - -// ------------------------------------------------------------------------- -const cpPlugins::Interface::ProcessObject:: -TParameters* cpPlugins::Interface::ProcessObject:: -GetParameters( ) const -{ - return( this->m_Parameters.GetPointer( ) ); -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface:: -Plugins* cpPlugins::Interface::ProcessObject:: -GetPlugins( ) -{ - return( this->m_Plugins ); -} - -// ------------------------------------------------------------------------- -const cpPlugins::Interface:: -Plugins* cpPlugins::Interface::ProcessObject:: -GetPlugins( ) const -{ - return( this->m_Plugins ); -} - -// ------------------------------------------------------------------------- -void cpPlugins::Interface::ProcessObject:: -SetPlugins( Plugins* p ) -{ - this->m_Plugins = p; -} - -// ------------------------------------------------------------------------- -unsigned int cpPlugins::Interface::ProcessObject:: -GetNumberOfInputs( ) const -{ - return( this->m_Inputs.size( ) ); -} - -// ------------------------------------------------------------------------- -unsigned int cpPlugins::Interface::ProcessObject:: -GetNumberOfOutputs( ) const -{ - return( this->m_Outputs.size( ) ); -} - // ------------------------------------------------------------------------- std::vector< std::string > cpPlugins::Interface::ProcessObject:: GetInputsNames( ) const @@ -231,4 +158,7 @@ _AddInput( const std::string& name ) this->Modified( ); } +// ------------------------------------------------------------------------- +CPPLUGINS_PROVIDER_SOURCE( cpPlugins::Interface::ProcessObject, 1, 1 ); + // eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ProcessObject.h b/lib/cpPlugins/Interface/ProcessObject.h index 49f0907..43533f5 100644 --- a/lib/cpPlugins/Interface/ProcessObject.h +++ b/lib/cpPlugins/Interface/ProcessObject.h @@ -1,33 +1,35 @@ #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ -#include +/* + #include -#include -#include + #include + #include -#include -#include + #include + #include +*/ #include #include -#ifdef cpPlugins_Interface_QT4 -class QWidget; -#else -typedef char QWidget; -#endif // cpPlugins_Interface_QT4 - #include - #include #include +// 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 Plugins; #ifdef cpPlugins_Interface_QT4 class ParametersQtDialog; @@ -57,24 +59,22 @@ namespace cpPlugins public: itkTypeMacro( ProcessObject, Object ); - cpPlugins_Id_Macro( - cpPlugins::Interface::ProcessObject, "BaseObject" - ); + cpPlugins_Id_Macro( ProcessObject, "BaseObject" ); - public: - // To impact pipeline - virtual void Modified( ) const; + itkBooleanMacro( Interactive ); - virtual bool IsInteractive( ) const; - virtual TParameters* GetParameters( ); - virtual const TParameters* GetParameters( ) const; + itkGetConstObjectMacro( Parameters, TParameters ); + itkGetObjectMacro( Parameters, TParameters ); + itkGetConstMacro( Plugins, const Plugins* ); + itkGetMacro( Plugins, Plugins* ); + itkGetConstMacro( Interactive, bool ); - Plugins* GetPlugins( ); - const Plugins* GetPlugins( ) const; - void SetPlugins( Plugins* p ); + itkSetObjectMacro( Plugins, Plugins ); + itkSetMacro( Interactive, bool ); - virtual unsigned int GetNumberOfInputs( ) const; - virtual unsigned int GetNumberOfOutputs( ) const; + public: + // To impact pipeline + virtual void Modified( ) const; virtual std::vector< std::string > GetInputsNames( ) const; virtual std::vector< std::string > GetOutputsNames( ) const; @@ -140,12 +140,18 @@ namespace cpPlugins Parameters::Pointer m_Parameters; ParametersQtDialog* m_ParametersDialog; Plugins* m_Plugins; + bool m_Interactive; typedef std::map< std::string, DataObject::Pointer > _TDataContainer; _TDataContainer m_Inputs; _TDataContainer m_Outputs; }; + /** + * Plugin provider + */ + CPPLUGINS_PROVIDER_HEADER( ProcessObject ); + } // ecapseman } // ecapseman -- 2.47.1