X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPipelineEditor%2FPort.cxx;h=b447b0ac41a64e4b34f0aa5d3ba862b8d4af37d8;hb=ddc5b66441101ed6584f4972ca0c4d13c588dacf;hp=ab478c298343960aa6bd064649c0fef71a5d4869;hpb=46f2cf7aa39bda8301b22fcfddd43daf0dc13770;p=cpPlugins.git diff --git a/lib/cpPipelineEditor/Port.cxx b/lib/cpPipelineEditor/Port.cxx index ab478c2..b447b0a 100644 --- a/lib/cpPipelineEditor/Port.cxx +++ b/lib/cpPipelineEditor/Port.cxx @@ -1,8 +1,12 @@ #include "Port.h" #include "Connection.h" +#include "Block.h" +#include "Editor.h" #include +#include #include +#include #include #include @@ -120,37 +124,6 @@ isConnected( Port* other ) return( false ); } -// ------------------------------------------------------------------------- -cpPipelineEditor::TypePort:: -TypePort( QGraphicsItem* parent, QGraphicsScene* scene ) - : Superclass( parent, scene ) -{ -} - -// ------------------------------------------------------------------------- -cpPipelineEditor::TypePort:: -~TypePort( ) -{ -} - -// ------------------------------------------------------------------------- -void cpPipelineEditor::TypePort:: -_updateLabels( ) -{ - QFont font( this->scene( )->font( ) ); - font.setItalic( true ); - this->m_Label->setFont( font ); - this->m_ExtendedLabel->setFont( font ); - this->setPath( QPainterPath( ) ); -} - -// ------------------------------------------------------------------------- -bool cpPipelineEditor::TypePort:: -isConnected( Port* other ) -{ - return( false ); -} - // ------------------------------------------------------------------------- cpPipelineEditor::InputPort:: InputPort( QGraphicsItem* parent, QGraphicsScene* scene ) @@ -292,4 +265,28 @@ itemChange( GraphicsItemChange change, const QVariant& value ) return( value ); } +// ------------------------------------------------------------------------- +void cpPipelineEditor::OutputPort:: +contextMenuEvent( QGraphicsSceneContextMenuEvent* evt ) +{ + if( this->m_Block == NULL ) + return; + + QMenu menu; + QAction* showAction = menu.addAction( "Show" ); + QAction* hideAction = menu.addAction( "Hide" ); + QAction* selectedAction = menu.exec( evt->screenPos( ) ); + + if( selectedAction == showAction ) + { + this->m_Block->editor( )->showOutputData( + this->m_Block->namePort( ).toStdString( ), + this->name( ).toStdString( ) + ); + } + else if( selectedAction == hideAction ) + { + } // fi +} + // eof - $RCSfile$