From: Leonardo Florez-Valencia Date: Tue, 9 Feb 2016 15:27:16 +0000 (-0500) Subject: Some minor bugs crushed X-Git-Tag: v0.1~247 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=bf4172934768034696b1c4b993b7e92e3808e083;p=cpPlugins.git Some minor bugs crushed --- diff --git a/lib/cpPipelineEditor/Block.cxx b/lib/cpPipelineEditor/Block.cxx index 3d3c0f8..aecdb41 100644 --- a/lib/cpPipelineEditor/Block.cxx +++ b/lib/cpPipelineEditor/Block.cxx @@ -17,7 +17,10 @@ // ------------------------------------------------------------------------- cpPipelineEditor::Block:: -Block( TFilter* filter, QGraphicsItem* parent, QGraphicsScene* scene ) +Block( + TFilter* filter, const QString& name, + QGraphicsItem* parent, QGraphicsScene* scene + ) : Superclass( parent, scene ), m_HorzMargin( 20 ), m_VertMargin( 5 ), @@ -38,7 +41,7 @@ Block( TFilter* filter, QGraphicsItem* parent, QGraphicsScene* scene ) this->m_Height = this->m_VertMargin; // Configure names - this->setNamePort( this->m_Filter->GetClassName( ) ); // TODO + this->setNamePort( name ); this->_setTypeInfo( this->m_Filter->GetClassName( ) ); // Add input ports diff --git a/lib/cpPipelineEditor/Block.h b/lib/cpPipelineEditor/Block.h index bbdb0c6..6b2716f 100644 --- a/lib/cpPipelineEditor/Block.h +++ b/lib/cpPipelineEditor/Block.h @@ -27,7 +27,7 @@ namespace cpPipelineEditor enum { Type = QGraphicsItem::UserType + 6 }; Block( - TFilter* filter, + TFilter* filter, const QString& name, QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL ); virtual ~Block( ); diff --git a/lib/cpPipelineEditor/Editor.cxx b/lib/cpPipelineEditor/Editor.cxx index e15b68d..8388edd 100644 --- a/lib/cpPipelineEditor/Editor.cxx +++ b/lib/cpPipelineEditor/Editor.cxx @@ -74,10 +74,16 @@ setWorkspace( TWorkspace* ws ) auto vIt = this->m_Workspace->GetGraph( )->BeginVertices( ); auto vIt_end = this->m_Workspace->GetGraph( )->EndVertices( ); for( ; vIt != vIt_end; ++vIt ) - this->_createBlock( + { + auto b = this->_createBlock( dynamic_cast< TFilter* >( vIt->second.GetPointer( ) ), + vIt->first.c_str( ), QPointF( vIt->second->GetViewX( ), vIt->second->GetViewY( ) ) ); + if( b != NULL ) + this->m_Graph->SetVertex( vIt->first, b ); + + } // rof // Add edges auto rIt = this->m_Workspace->GetGraph( )->BeginEdgesRows( ); @@ -120,7 +126,11 @@ createFilter( const std::string& filter, const QPointF& pnt ) name += std::string( "_" ); if( this->m_Workspace->CreateFilter( filter, name ) ) { - this->_createBlock( this->m_Workspace->GetFilter( name ), pnt ); + auto b = this->_createBlock( + this->m_Workspace->GetFilter( name ), + name.c_str( ), + pnt + ); return( name ); } else @@ -173,13 +183,13 @@ itemAt( const QPointF& pos ) // ------------------------------------------------------------------------- cpPipelineEditor::Block* cpPipelineEditor::Editor:: -_createBlock( TFilter* f, const QPointF& pnt ) +_createBlock( TFilter* f, const QString& name, const QPointF& pnt ) { if( f == NULL ) return( NULL ); // Add block - Block* b = new Block( f, 0, this->m_Scene ); + Block* b = new Block( f, name, 0, this->m_Scene ); b->setEditor( this ); b->setPos( pnt ); @@ -221,8 +231,6 @@ _createBlock( TFilter* f, const QPointF& pnt ) } // rof - // Keep a trace of this visual graph - // TODO: this->m_Graph->SetVertex( f->GetName( ), b ); return( b ); } diff --git a/lib/cpPipelineEditor/Editor.h b/lib/cpPipelineEditor/Editor.h index bceeecd..908abf9 100644 --- a/lib/cpPipelineEditor/Editor.h +++ b/lib/cpPipelineEditor/Editor.h @@ -82,7 +82,9 @@ namespace cpPipelineEditor private: QGraphicsItem* itemAt( const QPointF& pos ); - inline Block* _createBlock( TFilter* f, const QPointF& pnt ); + inline Block* _createBlock( + TFilter* f, const QString& name, const QPointF& pnt + ); protected: typedef QGraphicsSceneDragDropEvent QGraphicsSceneDragEnterEvent; diff --git a/lib/cpPlugins/Interface/ProcessObject.cxx b/lib/cpPlugins/Interface/ProcessObject.cxx index 364816a..809ef35 100644 --- a/lib/cpPlugins/Interface/ProcessObject.cxx +++ b/lib/cpPlugins/Interface/ProcessObject.cxx @@ -202,7 +202,6 @@ cpPlugins::Interface::ProcessObject:: void cpPlugins::Interface::ProcessObject:: _AddInput( const std::string& name, bool required ) { -// typedef typename _TInputs::value_type _TValue; auto i = this->m_Inputs.find( name ); if( i == this->m_Inputs.end( ) ) {