\r
// -------------------------------------------------------------------------\r
cpBaseQtApplication::InputPort::\r
-InputPort( QGraphicsItem* parent, QGraphicsScene* scene )\r
+InputPort( QGraphicsItem* parent, bool multiple, QGraphicsScene* scene )\r
: Superclass( parent, scene ),\r
- m_Connection( NULL )\r
+ m_IsMultiple( multiple )\r
{\r
}\r
\r
cpBaseQtApplication::InputPort::\r
~InputPort( )\r
{\r
- if( this->m_Connection != NULL )\r
- delete this->m_Connection;\r
+ this->m_Connection.clear( );\r
}\r
\r
// -------------------------------------------------------------------------\r
void cpBaseQtApplication::InputPort::\r
setExtend( bool extend )\r
{\r
- if( this->m_Connection == NULL )\r
+ if( this->m_Connection.size( ) == 0 )\r
{\r
this->m_IsExtended = extend;\r
this->m_ExtendedLabel->setVisible( extend );\r
bool cpBaseQtApplication::InputPort::\r
isConnected( Port* other )\r
{\r
- if( this->m_Connection != NULL )\r
- return(\r
- this->m_Connection->port1( ) == other &&\r
- this->m_Connection->port2( ) == this\r
- );\r
- else\r
- return( false );\r
+ bool conn = false;\r
+ auto i = this->m_Connection.begin( );\r
+ for( ; i != this->m_Connection.end( ); ++i )\r
+ conn |= ( ( *i )->port1( ) == other && ( *i )->port2( ) == this );\r
+ return( conn );\r
}\r
\r
// -------------------------------------------------------------------------\r
void cpBaseQtApplication::InputPort::\r
setConnection( Connection* c )\r
{\r
- this->m_Connection = c;\r
+ if( this->m_IsMultiple || this->m_Connection.size( ) == 0 )\r
+ this->m_Connection.push_back( c );\r
}\r
\r
// -------------------------------------------------------------------------\r
{\r
if( change == ItemScenePositionHasChanged )\r
{\r
- if( this->m_Connection != NULL )\r
+ for(\r
+ auto i = this->m_Connection.begin( );\r
+ i != this->m_Connection.end( );\r
+ ++i\r
+ )\r
{\r
- this->m_Connection->updatePosFromPorts( );\r
- this->m_Connection->updatePath( );\r
+ ( *i )->updatePosFromPorts( );\r
+ ( *i )->updatePath( );\r
\r
} // fi\r
\r