X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FcpPipelineEditor%2FQNodesEditor.h;h=f338d91a8a08566c437ac41d50584079f946e8d0;hb=f8c546490b7168b5c75d877bf66d27f83aa9412c;hp=87c5a20c5d38b19a0195d4144268ee56c440ff0e;hpb=2c372f652bce67b347cd91737916504a054604a3;p=cpPlugins.git diff --git a/appli/cpPipelineEditor/QNodesEditor.h b/appli/cpPipelineEditor/QNodesEditor.h index 87c5a20..f338d91 100644 --- a/appli/cpPipelineEditor/QNodesEditor.h +++ b/appli/cpPipelineEditor/QNodesEditor.h @@ -21,16 +21,20 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ #ifndef __PIPELINEEDITOR__QNODESEDITOR__H__ #define __PIPELINEEDITOR__QNODESEDITOR__H__ #include +#include +#include +#include class QGraphicsScene; +class QGraphicsSceneMouseEvent; class QGraphicsItem; -class QPointF; namespace PipelineEditor { @@ -48,23 +52,40 @@ namespace PipelineEditor typedef QNodesEditor Self; typedef QObject Superclass; + typedef cpPlugins::Interface::Workspace TWorkspace; + typedef TWorkspace::TFilter TFilter; + typedef + cpExtensions::DataStructures:: + Graph< QNEBlock*, QNEConnection*, std::string > TGraph; + public: explicit QNodesEditor( QObject* parent = 0 ); virtual ~QNodesEditor( ); - void install( QGraphicsScene* s ); + TWorkspace* workspace( ); + const TWorkspace* workspace( ) const; + void setWorkspace( TWorkspace* ws ); - bool eventFilter( QObject* o, QEvent* e ); + std::string createFilter( + const std::string& filter, + const QPointF& pnt = QPointF( qreal( 0 ), qreal( 0 ) ) + ); - void save( QDataStream& ds ); - void load( QDataStream& ds ); + void install( QGraphicsScene* s ); + bool eventFilter( QObject* o, QEvent* e ); private: QGraphicsItem* itemAt( const QPointF& pos ); + inline void _CreateBlock( TFilter* f, const QPointF& pnt ); + inline void _DoubleClick( QGraphicsSceneMouseEvent* evt, QGraphicsItem* item ); + private: QGraphicsScene* m_Scene; QNEConnection* m_Conn; + + TWorkspace* m_Workspace; + TGraph::Pointer m_Graph; }; } // ecapseman