#ifndef __CPBASEQTAPPLICATION__CONNECTION__H__ #define __CPBASEQTAPPLICATION__CONNECTION__H__ #include #include namespace cpBaseQtApplication { class InputPort; class OutputPort; /** */ class cpBaseQtApplication_EXPORT Connection : public QGraphicsPathItem { public: typedef Connection Self; typedef QGraphicsPathItem Superclass; public: enum { Type = QGraphicsItem::UserType + 5 }; Connection( QGraphicsItem* parent = 0, QGraphicsScene* scene = 0 ); virtual ~Connection( ); void setPos1( const QPointF& p ); void setPos2( const QPointF& p ); void setPort1( OutputPort* p ); void setPort2( InputPort* p ); void updatePosFromPorts( ); void updatePath( ); OutputPort* port1( ) const; InputPort* port2( ) const; inline int type( ) const { return( this->Type ); } virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget ); private: QPointF m_Pos1; QPointF m_Pos2; OutputPort* m_Port1; InputPort* m_Port2; }; } // ecapseman #endif // __CPBASEQTAPPLICATION__CONNECTION__H__ // eof - $RCSfile$