#include <cpBaseQtApplication/Port.h>\r
#include <cpBaseQtApplication/Connection.h>\r
#include <cpBaseQtApplication/Editor.h>\r
+#include <cpPlugins/BaseObjects/Widget.h>\r
\r
// -------------------------------------------------------------------------\r
cpBaseQtApplication::Block::\r
\r
// Configure names\r
this->setNamePort( name );\r
- this->_setTypeInfo( this->m_Filter->GetClassName( ) );\r
+ this->_setTypeInfo(\r
+ (\r
+ std::string( this->m_Filter->GetClassCategory( ) ) +\r
+ std::string( "::" ) +\r
+ std::string( this->m_Filter->GetClassName( ) )\r
+ ).c_str( )\r
+ );\r
\r
// Add input ports\r
auto inputs = this->m_Filter->GetInputsNames( );\r
for( auto iIt = inputs.begin( ); iIt != inputs.end( ); ++iIt )\r
- this->addInputPort( iIt->c_str( ) );\r
+ {\r
+ this->addInputPort(\r
+ iIt->c_str( ),\r
+ this->m_Filter->IsInputMultiple( iIt->c_str( ) )\r
+ );\r
+\r
+ } // rof\r
\r
// Add output ports\r
auto outputs = this->m_Filter->GetOutputsNames( );\r
\r
// -------------------------------------------------------------------------\r
cpBaseQtApplication::InputPort* cpBaseQtApplication::Block::\r
-addInputPort( const QString& txt )\r
+addInputPort( const QString& txt, bool multiple )\r
{\r
- InputPort* ip = new InputPort( this );\r
- ip->setExtendedName(\r
- (\r
- txt.toStdString( ) +\r
- std::string( "@" ) +\r
- this->namePort( ).toStdString( )\r
- ).c_str( )\r
- );\r
+ InputPort* ip = new InputPort( this, multiple );\r
+ ip->setExtendedName( "" );\r
ip->setName( txt );\r
this->m_InputPorts[ txt.toStdString( ) ] = ip;\r
this->_configPort( ip );\r
addOutputPort( const QString& txt )\r
{\r
OutputPort* op = new OutputPort( this );\r
- op->setExtendedName(\r
- (\r
- txt.toStdString( ) +\r
- std::string( "@" ) +\r
- this->namePort( ).toStdString( )\r
- ).c_str( )\r
- );\r
+ op->setExtendedName( "" );\r
op->setName( txt );\r
this->m_OutputPorts[ txt.toStdString( ) ] = op;\r
this->_configPort( op );\r
void cpBaseQtApplication::Block::\r
mouseReleaseEvent( QGraphicsSceneMouseEvent* evt )\r
{\r
- if( this->m_Filter != NULL )\r
+ if( this->m_Filter.IsNotNull( ) )\r
this->m_Filter->SetViewCoords(\r
this->scenePos( ).x( ), this->scenePos( ).y( )\r
);\r
QMenu menu;\r
QAction* configureAction = menu.addAction( "Configure" );\r
QAction* updateAction = menu.addAction( "Update" );\r
- QAction* selectedAction = menu.exec( evt->screenPos( ) );\r
+ auto widget =\r
+ dynamic_cast< cpPlugins::BaseObjects::Widget* >(\r
+ this->m_Filter.GetPointer( )\r
+ );\r
+ QAction* enableAction = NULL;\r
+ if( widget != NULL )\r
+ enableAction =\r
+ menu.addAction( ( widget->GetEnabled( ) )? "Disable": "Enable" );\r
\r
+ QAction* selectedAction = menu.exec( evt->screenPos( ) );\r
if( selectedAction == configureAction )\r
{\r
auto dlg = this->m_Filter->CreateQDialog( );\r
if( dlg != NULL )\r
dlg->exec( );\r
}\r
+ else if( selectedAction == enableAction )\r
+ {\r
+ if( widget != NULL )\r
+ widget->SetEnabled( !( widget->GetEnabled( ) ) );\r
+ }\r
else if( selectedAction == updateAction )\r
this->m_Editor->updateFilter( this->namePort( ).toStdString( ) );\r
}\r