X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpBaseQtApplication%2FPipeline%2FPort.h;fp=lib%2FcpBaseQtApplication%2FPipeline%2FPort.h;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=06229255fba6d9ad57ad81b538996af92dad9a01;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpBaseQtApplication/Pipeline/Port.h b/lib/cpBaseQtApplication/Pipeline/Port.h deleted file mode 100644 index 0622925..0000000 --- a/lib/cpBaseQtApplication/Pipeline/Port.h +++ /dev/null @@ -1,216 +0,0 @@ -#ifndef __cpBaseQtApplication__Pipeline__Port__h__ -#define __cpBaseQtApplication__Pipeline__Port__h__ - -#include -#include - -namespace cpBaseQtApplication -{ - namespace Pipeline - { - class Block; - class Connection; - - /** - */ - class cpBaseQtApplication_EXPORT Port - : public QObject, - public QGraphicsPathItem - { - Q_OBJECT; - public: - typedef Port Self; - typedef QGraphicsPathItem Superclass; - - enum { Type = QGraphicsItem::UserType + 1 }; - - public: - Port( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); - virtual ~Port( ); - - void setBlock( Block* b ); - inline Block* block( ) const - { return( this->m_Block ); } - - virtual void setName( const QString& n ); - 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( Port* other ) = 0; - inline int type( ) const - { return( this->Type ); } - - virtual void paint( - QPainter* painter, - const QStyleOptionGraphicsItem* option, - QWidget* widget - ); - - protected: - virtual void _updateLabels( ) { } - - protected: - Block* m_Block; - - int m_Radius; - int m_Margin; - bool m_IsExtended; - - QGraphicsTextItem* m_Label; - QGraphicsTextItem* m_ExtendedLabel; - }; - - /** - */ - class cpBaseQtApplication_EXPORT NamePort - : public Port - { - Q_OBJECT; - public: - typedef NamePort Self; - typedef Port Superclass; - - enum { Type = Superclass::Type + 1 }; - - public: - NamePort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); - virtual ~NamePort( ); - - virtual bool isConnected( Port* other ); - inline int type( ) const - { return( this->Type ); } - - protected: - virtual void _updateLabels( ); - }; - - /** - */ - class cpBaseQtApplication_EXPORT InfoPort - : public Port - { - Q_OBJECT; - public: - typedef InfoPort Self; - typedef Port Superclass; - - enum { Type = Superclass::Type + 2 }; - - public: - InfoPort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); - virtual ~InfoPort( ); - - virtual bool isConnected( Port* other ); - inline int type( ) const - { return( this->Type ); } - - protected: - virtual void _updateLabels( ); - }; - - /** - */ - class cpBaseQtApplication_EXPORT InputPort - : public Port - { - Q_OBJECT; - public: - typedef InputPort Self; - typedef Port Superclass; - - enum { Type = Superclass::Type + 3 }; - - public: - InputPort( - QGraphicsItem* parent, - bool multiple, - QGraphicsScene* scene = NULL - ); - virtual ~InputPort( ); - - virtual void setExtend( bool extend ); - - virtual bool isConnected( Port* other ); - inline int type( ) const - { return( this->Type ); } - - void setConnection( Connection* c ); - void removeConnection( Connection* c ); - inline unsigned int numberOfConnections( ) const - { return( this->m_Connection.size( ) ); } - inline Connection* connection( unsigned int i ) - { return( this->m_Connection[ i ] ); } - inline const Connection* connection( unsigned int i ) const - { return( this->m_Connection[ i ] ); } - inline bool hasConnection( ) const - { return( this->m_Connection.size( ) > 0 ); } - inline bool isMultiple( ) const - { return( this->m_IsMultiple ); } - - protected: - QVariant itemChange( GraphicsItemChange change, const QVariant& value ); - virtual void _updateLabels( ); - - protected: - std::vector< Connection* > m_Connection; - bool m_IsMultiple; - }; - - /** - */ - class cpBaseQtApplication_EXPORT OutputPort - : public Port - { - Q_OBJECT; - public: - typedef OutputPort Self; - typedef Port Superclass; - - enum { Type = Superclass::Type + 4 }; - - public: - OutputPort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); - virtual ~OutputPort( ); - - void removeConnection( Connection* c ); - virtual void setExtend( bool extend ); - - virtual bool isConnected( Port* other ); - inline int type( ) const - { return( this->Type ); } - - inline std::vector< Connection* >& connections( ) - { return( this->m_Connections ); } - inline const std::vector< Connection* >& connections( ) const - { return( this->m_Connections ); } - - signals: - void viewData( const std::string& name, bool show ); - - protected: - QVariant itemChange( GraphicsItemChange change, const QVariant& value ); - virtual void _updateLabels( ); - - virtual void contextMenuEvent( QGraphicsSceneContextMenuEvent* evt ); - - protected: - std::vector< Connection* > m_Connections; - }; - - } // ecapseman - -} // ecapseman - -#endif // __cpBaseQtApplication__Pipeline__Port__h__ - -// eof - $RCSfile$