X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FcpPipelineEditor%2FQNEBlock.h;h=6b591ac726c15b8cae1016398d936289ff762bf6;hb=f4aeff15ebb41183d4b89f41b29ec26043848722;hp=524988aab73cb106c5e0cced727b0eb2f7a648d8;hpb=9c75dcecf566cc567583caf4687ce523a2af586d;p=cpPlugins.git diff --git a/appli/cpPipelineEditor/QNEBlock.h b/appli/cpPipelineEditor/QNEBlock.h index 524988a..6b591ac 100644 --- a/appli/cpPipelineEditor/QNEBlock.h +++ b/appli/cpPipelineEditor/QNEBlock.h @@ -32,6 +32,10 @@ namespace PipelineEditor { class QNEPort; + class QNENamePort; + class QNETypePort; + class QNEInputPort; + class QNEOutputPort; class QNEBlock : public QGraphicsPathItem @@ -41,37 +45,59 @@ namespace PipelineEditor typedef QGraphicsPathItem Superclass; public: - enum { Type = QGraphicsItem::UserType + 3 }; + enum { Type = QGraphicsItem::UserType + 6 }; QNEBlock( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); virtual ~QNEBlock( ); - QNEPort* addPort( - const QString& name, bool isOutput, int flags = 0, int ptr = 0 - ); - QNEPort* addInputPort( const QString& name ); - QNEPort* addOutputPort( const QString& name ); - void addInputPorts( const QStringList& names ); - void addOutputPorts( const QStringList& names ); + void setNamePort( const QString& txt ); + void setTypePort( const QString& txt ); + void addInputPort( const QString& txt ); + void addOutputPort( const QString& txt ); + QVector< QNEPort* > ports( ); + + inline QNENamePort* namePort( ) + { return( this->m_NamePort ); } + inline QNETypePort* typePort( ) + { return( this->m_TypePort ); } + inline QVector< QNEInputPort* >& inputPorts( ) + { return( this->m_InputPorts ); } + inline QVector< QNEOutputPort* >& outputPorts( ) + { return( this->m_OutputPorts ); } + + inline const QNENamePort* namePort( ) const + { return( this->m_NamePort ); } + inline const QNETypePort* typePort( ) const + { return( this->m_TypePort ); } + inline const QVector< QNEInputPort* >& inputPorts( ) const + { return( this->m_InputPorts ); } + inline const QVector< QNEOutputPort* >& outputPorts( ) const + { return( this->m_OutputPorts ); } + + QNEBlock* clone( ); + inline int type( ) const + { return( this->Type ); } + void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget ); - QNEBlock* clone( ); - QVector< QNEPort* > ports( ); - - int type( ) const - { return( this->Type ); } - + protected: QVariant itemChange( GraphicsItemChange change, const QVariant& value ); + void _configPort( QNEPort* port ); private: int m_HorzMargin; int m_VertMargin; int m_Width; int m_Height; + + QNENamePort* m_NamePort; + QNETypePort* m_TypePort; + QVector< QNEInputPort* > m_InputPorts; + QVector< QNEOutputPort* > m_OutputPorts; }; } // ecapseman