#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; typedef std::pair< std::string, std::string > TGlobalPort; typedef std::map< std::string, TGlobalPort > TGlobalPorts; // 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 TInterface* GetInterface( ); void SetInterface( TInterface* i ); // 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 ); bool Connect( const std::string& i, const std::string& o ); 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; bool HasFilter( const std::string& name ) const; // Graph reduction bool Reduce( const std::string& name ); void AddInputPort( const std::string& name, const std::string& filter, const std::string& filter_input ); void AddOutputPort( const std::string& name, const std::string& filter, const std::string& filter_output ); void ClearInputPorts( ); void ClearOutputPorts( ); // Pipeline execution std::string Execute( ); std::string Execute( const std::string& name, QWidget* p = NULL ); protected: void _UpdateLoadedPluginsInformation( ); protected: // Plugins interface TInterface* m_Interface; // Processing graph typename TGraph::Pointer m_Graph; TGlobalPorts m_InputPorts; TGlobalPorts m_OutputPorts; }; } // ecapseman } // ecapseman #endif // __CPPLUGINS__INTERFACE__WORKSPACE__H__ // eof - $RCSfile$