X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FcpPipelineEditor%2FQNEConnection.cxx;h=df84c8186102373ffdbd5ee5777280bc06a3d947;hb=f8c546490b7168b5c75d877bf66d27f83aa9412c;hp=eb0f3bb36691cfd2c6f3598282d6b149f723438d;hpb=f4aeff15ebb41183d4b89f41b29ec26043848722;p=cpPlugins.git diff --git a/appli/cpPipelineEditor/QNEConnection.cxx b/appli/cpPipelineEditor/QNEConnection.cxx index eb0f3bb..df84c81 100644 --- a/appli/cpPipelineEditor/QNEConnection.cxx +++ b/appli/cpPipelineEditor/QNEConnection.cxx @@ -47,13 +47,12 @@ QNEConnection( QGraphicsItem* parent, QGraphicsScene* scene ) PipelineEditor::QNEConnection:: ~QNEConnection( ) { - QNEOutputPort* op = dynamic_cast< QNEOutputPort* >( this->m_Port1 ); - if( op != NULL ) - op->connections( ).remove( op->connections( ).indexOf( this ) ); + if( this->m_Port1 != NULL ) + this->m_Port1->connections( ). + remove( this->m_Port1->connections( ).indexOf( this ) ); - QNEInputPort* ip = dynamic_cast< QNEInputPort* >( this->m_Port2 ); - if( ip != NULL ) - ip->setConnection( NULL ); + if( this->m_Port2 != NULL ) + this->m_Port2->setConnection( NULL ); } // ------------------------------------------------------------------------- @@ -72,28 +71,26 @@ setPos2( const QPointF& p ) // ------------------------------------------------------------------------- void PipelineEditor::QNEConnection:: -setPort1( QNEPort* p ) +setPort1( QNEOutputPort* p ) { - QNEOutputPort* op = dynamic_cast< QNEOutputPort* >( p ); - if( op != NULL ) + if( p != NULL ) { - op->connections( ).append( this ); - this->m_Port1 = op; + p->connections( ).append( this ); + this->m_Port1 = p; } // fi } // ------------------------------------------------------------------------- void PipelineEditor::QNEConnection:: -setPort2( QNEPort* p ) +setPort2( QNEInputPort* p ) { - QNEInputPort* ip = dynamic_cast< QNEInputPort* >( p ); - if( ip != NULL ) + if( p != NULL ) { - if( ip->connection( ) == NULL ) + if( p->connection( ) == NULL ) { - ip->setConnection( this ); - this->m_Port2 = ip; + p->setConnection( this ); + this->m_Port2 = p; } // fi @@ -125,14 +122,14 @@ updatePath( ) } // ------------------------------------------------------------------------- -PipelineEditor::QNEPort* PipelineEditor::QNEConnection:: +PipelineEditor::QNEOutputPort* PipelineEditor::QNEConnection:: port1( ) const { return( this->m_Port1 ); } // ------------------------------------------------------------------------- -PipelineEditor::QNEPort* PipelineEditor::QNEConnection:: +PipelineEditor::QNEInputPort* PipelineEditor::QNEConnection:: port2( ) const { return( this->m_Port2 );