#ifndef __CPPIPELINEEDITOR__EDITOR__H__ #define __CPPIPELINEEDITOR__EDITOR__H__ #include #include #include #include #include class QGraphicsScene; class QGraphicsSceneMouseEvent; class QGraphicsItem; class QGraphicsSceneContextMenuEvent; class QGraphicsSceneDragDropEvent; class QGraphicsSceneHelpEvent; class QGraphicsSceneHoverEvent; class QGraphicsSceneMouseEvent; class QGraphicsSceneMoveEvent; class QGraphicsSceneResizeEvent; class QGraphicsSceneWheelEvent; // ------------------------------------------------------------------------- #define cpPipelineEditor_Editor_Callback_DCL( E ) \ void _##E##_cbk( QGraphicsScene##E##Event* e ); namespace cpPipelineEditor { class Connection; class Block; /** */ class cpPipelineEditor_EXPORT Editor : public QObject { Q_OBJECT; public: typedef Editor Self; typedef QObject Superclass; typedef cpPlugins::Interface::Workspace TWorkspace; typedef TWorkspace::TFilter TFilter; typedef cpExtensions::DataStructures:: Graph< Block*, Connection*, std::string > TGraph; public: explicit Editor( QObject* parent = 0 ); virtual ~Editor( ); TWorkspace* workspace( ); const TWorkspace* workspace( ) const; void setWorkspace( TWorkspace* ws ); std::string createFilter( const std::string& filter, const QPointF& pnt = QPointF( qreal( 0 ), qreal( 0 ) ) ); void install( QGraphicsScene* s ); bool eventFilter( QObject* o, QEvent* e ); void updateFilter( const std::string& filter_name ); void showOutputData( const std::string& filter_name, const std::string& output_name ); signals: void execFilter( const std::string& filter_name ); void showFilterOutput( const std::string& filter_name, const std::string& output_name ); private: QGraphicsItem* itemAt( const QPointF& pos ); inline Block* _createBlock( TFilter* f, const QPointF& pnt ); protected: typedef QGraphicsSceneDragDropEvent QGraphicsSceneDragEnterEvent; typedef QGraphicsSceneDragDropEvent QGraphicsSceneDragLeaveEvent; typedef QGraphicsSceneDragDropEvent QGraphicsSceneDragMoveEvent; typedef QGraphicsSceneDragDropEvent QGraphicsSceneDropEvent; typedef QGraphicsSceneHoverEvent QGraphicsSceneHoverEnterEvent; typedef QGraphicsSceneHoverEvent QGraphicsSceneHoverMoveEvent; typedef QGraphicsSceneHoverEvent QGraphicsSceneHoverLeaveEvent; typedef QGraphicsSceneMouseEvent QGraphicsSceneMouseDoubleClickEvent; typedef QGraphicsSceneMouseEvent QGraphicsSceneMouseMoveEvent; typedef QGraphicsSceneMouseEvent QGraphicsSceneMousePressEvent; typedef QGraphicsSceneMouseEvent QGraphicsSceneMouseReleaseEvent; cpPipelineEditor_Editor_Callback_DCL( ContextMenu ); cpPipelineEditor_Editor_Callback_DCL( DragEnter ); cpPipelineEditor_Editor_Callback_DCL( DragLeave ); cpPipelineEditor_Editor_Callback_DCL( DragMove ); cpPipelineEditor_Editor_Callback_DCL( Drop ); cpPipelineEditor_Editor_Callback_DCL( Help ); cpPipelineEditor_Editor_Callback_DCL( HoverEnter ); cpPipelineEditor_Editor_Callback_DCL( HoverLeave ); cpPipelineEditor_Editor_Callback_DCL( HoverMove ); cpPipelineEditor_Editor_Callback_DCL( MouseDoubleClick ); cpPipelineEditor_Editor_Callback_DCL( MouseMove ); cpPipelineEditor_Editor_Callback_DCL( MousePress ); cpPipelineEditor_Editor_Callback_DCL( MouseRelease ); cpPipelineEditor_Editor_Callback_DCL( Move ); cpPipelineEditor_Editor_Callback_DCL( Resize ); cpPipelineEditor_Editor_Callback_DCL( Wheel ); private: QGraphicsScene* m_Scene; Connection* m_ActualConnection; TWorkspace* m_Workspace; TGraph::Pointer m_Graph; }; } // ecapseman #endif // __CPPIPELINEEDITOR__EDITOR__H__ // eof - $RCSfile$