X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPipelineEditor%2FPort.h;fp=lib%2FcpPipelineEditor%2FPort.h;h=0000000000000000000000000000000000000000;hb=98390bcac544f7f3a6762ce812dda491213d6f13;hp=4daafd0b7a32e57f54b6fdacc485233dc0e2d595;hpb=b6c7e73ebcce23619daced67f85d9e1364b33f30;p=cpPlugins.git diff --git a/lib/cpPipelineEditor/Port.h b/lib/cpPipelineEditor/Port.h deleted file mode 100644 index 4daafd0..0000000 --- a/lib/cpPipelineEditor/Port.h +++ /dev/null @@ -1,169 +0,0 @@ -#ifndef __CPPIPELINEEDITOR__PORT__H__ -#define __CPPIPELINEEDITOR__PORT__H__ - -#include -#include - -namespace cpPipelineEditor -{ - class Block; - class Connection; - - /** - */ - class cpPipelineEditor_EXPORT Port - : public QGraphicsPathItem - { - 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 NamePort - : public Port - { - 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 InputPort - : public Port - { - public: - typedef InputPort Self; - typedef Port Superclass; - - enum { Type = Superclass::Type + 3 }; - - public: - InputPort( QGraphicsItem* parent = NULL, 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 ); - inline Connection* connection( ) - { return( this->m_Connection ); } - inline const Connection* connection( ) const - { return( this->m_Connection ); } - inline bool hasConnection( ) const - { return( this->m_Connection != NULL ); } - - protected: - QVariant itemChange( GraphicsItemChange change, const QVariant& value ); - virtual void _updateLabels( ); - - protected: - Connection* m_Connection; - }; - - /** - */ - class OutputPort - : public Port - { - public: - typedef OutputPort Self; - typedef Port Superclass; - - enum { Type = Superclass::Type + 4 }; - - public: - OutputPort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); - virtual ~OutputPort( ); - - virtual void setExtend( bool extend ); - - virtual bool isConnected( Port* other ); - inline int type( ) const - { return( this->Type ); } - - inline QVector< Connection* >& connections( ) - { return( this->m_Connections ); } - inline const QVector< Connection* >& connections( ) const - { return( this->m_Connections ); } - - protected: - QVariant itemChange( GraphicsItemChange change, const QVariant& value ); - virtual void _updateLabels( ); - - virtual void contextMenuEvent( QGraphicsSceneContextMenuEvent* evt ); - - protected: - QVector< Connection* > m_Connections; - }; - -} // ecapseman - -#endif // __CPPIPELINEEDITOR__PORT__H__ - -// eof - $RCSfile$