namespace PipelineEditor\r
{\r
class QNEPort;\r
+ class QNENamePort;\r
+ class QNETypePort;\r
+ class QNEInputPort;\r
+ class QNEOutputPort;\r
\r
class QNEBlock\r
: public QGraphicsPathItem\r
typedef QGraphicsPathItem Superclass;\r
\r
public:\r
- enum { Type = QGraphicsItem::UserType + 3 };\r
+ enum { Type = QGraphicsItem::UserType + 6 };\r
\r
QNEBlock( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
virtual ~QNEBlock( );\r
\r
- QNEPort* addPort(\r
- const QString& name, bool isOutput, int flags = 0, int ptr = 0\r
- );\r
- QNEPort* addInputPort( const QString& name );\r
- QNEPort* addOutputPort( const QString& name );\r
- void addInputPorts( const QStringList& names );\r
- void addOutputPorts( const QStringList& names );\r
+ void setNamePort( const QString& txt );\r
+ void setTypePort( const QString& txt );\r
+ void addInputPort( const QString& txt );\r
+ void addOutputPort( const QString& txt );\r
+ QVector< QNEPort* > ports( );\r
+\r
+ inline QNENamePort* namePort( )\r
+ { return( this->m_NamePort ); }\r
+ inline QNETypePort* typePort( )\r
+ { return( this->m_TypePort ); }\r
+ inline QVector< QNEInputPort* >& inputPorts( )\r
+ { return( this->m_InputPorts ); }\r
+ inline QVector< QNEOutputPort* >& outputPorts( )\r
+ { return( this->m_OutputPorts ); }\r
+\r
+ inline const QNENamePort* namePort( ) const\r
+ { return( this->m_NamePort ); }\r
+ inline const QNETypePort* typePort( ) const\r
+ { return( this->m_TypePort ); }\r
+ inline const QVector< QNEInputPort* >& inputPorts( ) const\r
+ { return( this->m_InputPorts ); }\r
+ inline const QVector< QNEOutputPort* >& outputPorts( ) const\r
+ { return( this->m_OutputPorts ); }\r
+\r
+ QNEBlock* clone( );\r
+ inline int type( ) const\r
+ { return( this->Type ); }\r
+\r
void paint(\r
QPainter* painter,\r
const QStyleOptionGraphicsItem* option,\r
QWidget* widget\r
);\r
- QNEBlock* clone( );\r
- QVector< QNEPort* > ports( );\r
-\r
- int type( ) const\r
- { return( this->Type ); }\r
-\r
+ \r
protected:\r
QVariant itemChange( GraphicsItemChange change, const QVariant& value );\r
+ void _configPort( QNEPort* port );\r
\r
private:\r
int m_HorzMargin;\r
int m_VertMargin;\r
int m_Width;\r
int m_Height;\r
+\r
+ QNENamePort* m_NamePort;\r
+ QNETypePort* m_TypePort;\r
+ QVector< QNEInputPort* > m_InputPorts;\r
+ QVector< QNEOutputPort* > m_OutputPorts;\r
};\r
\r
} // ecapseman\r