X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FcpPipelineEditor%2FQNEPort.h;h=e10af5ef87c1d0fcc69ac06bd01a69d8d028fe5b;hb=c06908465eb6da50572779f423d1e2c9e03b68dd;hp=383167b9bfcc39d977b4024b612afa43fafaafda;hpb=f4aeff15ebb41183d4b89f41b29ec26043848722;p=cpPlugins.git diff --git a/appli/cpPipelineEditor/QNEPort.h b/appli/cpPipelineEditor/QNEPort.h index 383167b..e10af5e 100644 --- a/appli/cpPipelineEditor/QNEPort.h +++ b/appli/cpPipelineEditor/QNEPort.h @@ -54,28 +54,41 @@ namespace PipelineEditor { return( this->m_Block ); } virtual void setName( const QString& n ); - inline const QString& name( ) const - { return( this->m_Name ); } - - void setPtr( quint64 p ); - inline quint64 ptr( ) - { return( this->m_Ptr ); } + virtual void setExtendedName( const QString& n ); + inline QString name( ) const + { return( this->m_Label->toPlainText( ) ); } + inline QString extendedName( ) const + { return( this->m_ExtendedLabel->toPlainText( ) ); } inline int radius( ) const { return( this->m_Radius ); } + inline bool isExtended( ) const + { return( this->m_IsExtended ); } + virtual void setExtend( bool extend ); + virtual bool isConnected( QNEPort* other ) = 0; inline int type( ) const { return( this->Type ); } + virtual void paint( + QPainter* painter, + const QStyleOptionGraphicsItem* option, + QWidget* widget + ); + + protected: + virtual void _updateLabels( ) { } + protected: QNEBlock* m_Block; - QString m_Name; + int m_Radius; + int m_Margin; + bool m_IsExtended; + QGraphicsTextItem* m_Label; - int m_Radius; - int m_Margin; - quint64 m_Ptr; + QGraphicsTextItem* m_ExtendedLabel; }; /** @@ -93,11 +106,12 @@ namespace PipelineEditor QNENamePort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); virtual ~QNENamePort( ); - virtual void setName( const QString& n ); - virtual bool isConnected( QNEPort* other ); inline int type( ) const { return( this->Type ); } + + protected: + virtual void _updateLabels( ); }; /** @@ -115,11 +129,12 @@ namespace PipelineEditor QNETypePort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); virtual ~QNETypePort( ); - virtual void setName( const QString& n ); - virtual bool isConnected( QNEPort* other ); inline int type( ) const { return( this->Type ); } + + protected: + virtual void _updateLabels( ); }; /** @@ -137,7 +152,7 @@ namespace PipelineEditor QNEInputPort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); virtual ~QNEInputPort( ); - virtual void setName( const QString& n ); + virtual void setExtend( bool extend ); virtual bool isConnected( QNEPort* other ); inline int type( ) const @@ -153,6 +168,7 @@ namespace PipelineEditor protected: QVariant itemChange( GraphicsItemChange change, const QVariant& value ); + virtual void _updateLabels( ); protected: QNEConnection* m_Connection; @@ -173,7 +189,7 @@ namespace PipelineEditor QNEOutputPort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); virtual ~QNEOutputPort( ); - virtual void setName( const QString& n ); + virtual void setExtend( bool extend ); virtual bool isConnected( QNEPort* other ); inline int type( ) const @@ -186,6 +202,7 @@ namespace PipelineEditor protected: QVariant itemChange( GraphicsItemChange change, const QVariant& value ); + virtual void _updateLabels( ); protected: QVector< QNEConnection* > m_Connections;