#ifndef __CPPLUGINS__INTERFACE__WORKSPACE__H__ #define __CPPLUGINS__INTERFACE__WORKSPACE__H__ #include #include #include #include #include #include // Some forward declarations class QWidget; namespace cpPlugins { namespace Interface { /** */ class cpPlugins_Interface_EXPORT Workspace { public: typedef cpPlugins::Interface::Interface TInterface; typedef cpPlugins::Interface::Object TObject; typedef cpPlugins::Interface::ProcessObject TFilter; typedef cpPlugins::Interface::DataObject TData; typedef TFilter::TParameters TParameters; // Various types typedef std::set< std::string > TStringContainer; // Graph type typedef std::pair< std::string, std::string > TConnection; typedef cpExtensions::DataStructures:: Graph< TObject::Pointer, TConnection, std::string > TGraph; public: Workspace( ); virtual ~Workspace( ); // Plugins management bool LoadPluginsPath( const std::string& path, bool r = false ); bool LoadPlugins( const std::string& fname ); const TStringContainer& GetLoadedPlugins( ) const; void GetLoadedPluginCategories( TStringContainer& categories ) const; void GetLoadedPluginFilters( TStringContainer& filters ) const; const TStringContainer& GetLoadedPluginFilters( const std::string& category ) const; // Workspace IO std::string LoadWorkspace( const std::string& fname ); std::string SaveWorkspace( const std::string& fname ) const; // Graph management void Clear( ); TGraph* GetGraph( ); const TGraph* GetGraph( ) const; bool CreateFilter( const std::string& filter, const std::string& name ); bool Connect( const std::string& orig_filter, const std::string& dest_filter, const std::string& output_name, const std::string& input_name ); TParameters* GetParameters( const std::string& name ); const TParameters* GetParameters( const std::string& name ) const; TFilter* GetFilter( const std::string& name ); const TFilter* GetFilter( const std::string& name ) const; // Graph reduction bool Reduce( const std::string& name ); // Pipeline execution std::string Execute( ); std::string Execute( const std::string& name, QWidget* p = NULL ); protected: void _UpdateLoadedPluginsInformation( ); protected: // Plugins interface TInterface m_Interface; std::string m_LastLoadedPlugin; TStringContainer m_LoadedPlugins; std::map< std::string, TStringContainer > m_LoadedFilters; // Processing graph typename TGraph::Pointer m_Graph; }; } // ecapseman } // ecapseman #endif // __CPPLUGINS__INTERFACE__WORKSPACE__H__ // eof - $RCSfile$