\r
// -------------------------------------------------------------------------\r
cpPipelineEditor::Block::\r
-Block( TFilter* filter, QGraphicsItem* parent, QGraphicsScene* scene )\r
+Block(\r
+ TFilter* filter, const QString& name,\r
+ QGraphicsItem* parent, QGraphicsScene* scene\r
+ )\r
: Superclass( parent, scene ),\r
m_HorzMargin( 20 ),\r
m_VertMargin( 5 ),\r
this->m_Height = this->m_VertMargin;\r
\r
// Configure names\r
- this->setNamePort( this->m_Filter->GetClassName( ) ); // TODO\r
+ this->setNamePort( name );\r
this->_setTypeInfo( this->m_Filter->GetClassName( ) );\r
\r
// Add input ports\r
auto vIt = this->m_Workspace->GetGraph( )->BeginVertices( );\r
auto vIt_end = this->m_Workspace->GetGraph( )->EndVertices( );\r
for( ; vIt != vIt_end; ++vIt )\r
- this->_createBlock(\r
+ {\r
+ auto b = this->_createBlock(\r
dynamic_cast< TFilter* >( vIt->second.GetPointer( ) ),\r
+ vIt->first.c_str( ),\r
QPointF( vIt->second->GetViewX( ), vIt->second->GetViewY( ) )\r
);\r
+ if( b != NULL )\r
+ this->m_Graph->SetVertex( vIt->first, b );\r
+\r
+ } // rof\r
\r
// Add edges\r
auto rIt = this->m_Workspace->GetGraph( )->BeginEdgesRows( );\r
name += std::string( "_" );\r
if( this->m_Workspace->CreateFilter( filter, name ) )\r
{\r
- this->_createBlock( this->m_Workspace->GetFilter( name ), pnt );\r
+ auto b = this->_createBlock(\r
+ this->m_Workspace->GetFilter( name ),\r
+ name.c_str( ),\r
+ pnt\r
+ );\r
return( name );\r
}\r
else\r
\r
// -------------------------------------------------------------------------\r
cpPipelineEditor::Block* cpPipelineEditor::Editor::\r
-_createBlock( TFilter* f, const QPointF& pnt )\r
+_createBlock( TFilter* f, const QString& name, const QPointF& pnt )\r
{\r
if( f == NULL )\r
return( NULL );\r
\r
// Add block\r
- Block* b = new Block( f, 0, this->m_Scene );\r
+ Block* b = new Block( f, name, 0, this->m_Scene );\r
b->setEditor( this );\r
b->setPos( pnt );\r
\r
\r
} // rof\r
\r
- // Keep a trace of this visual graph\r
- // TODO: this->m_Graph->SetVertex( f->GetName( ), b );\r
return( b );\r
}\r
\r
private:\r
QGraphicsItem* itemAt( const QPointF& pos );\r
\r
- inline Block* _createBlock( TFilter* f, const QPointF& pnt );\r
+ inline Block* _createBlock(\r
+ TFilter* f, const QString& name, const QPointF& pnt\r
+ );\r
\r
protected:\r
typedef QGraphicsSceneDragDropEvent QGraphicsSceneDragEnterEvent;\r