]> Creatis software - cpPlugins.git/commitdiff
Some minor bugs crushed
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 9 Feb 2016 15:27:16 +0000 (10:27 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 9 Feb 2016 15:27:16 +0000 (10:27 -0500)
lib/cpPipelineEditor/Block.cxx
lib/cpPipelineEditor/Block.h
lib/cpPipelineEditor/Editor.cxx
lib/cpPipelineEditor/Editor.h
lib/cpPlugins/Interface/ProcessObject.cxx

index 3d3c0f8b76b750ba217ab4b3b2b852f965237b10..aecdb41041d247ddbe0616ff7c8a8d71c900e089 100644 (file)
 \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
@@ -38,7 +41,7 @@ Block( TFilter* filter, QGraphicsItem* parent, QGraphicsScene* scene )
   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
index bbdb0c61038a37d4c6c43576b8ffd801d0cefb78..6b2716fd295872eeb28d46c76d900abb0ce3d786 100644 (file)
@@ -27,7 +27,7 @@ namespace cpPipelineEditor
     enum { Type = QGraphicsItem::UserType + 6 };\r
 \r
     Block(\r
-      TFilter* filter,\r
+      TFilter* filter, const QString& name,\r
       QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL\r
       );\r
     virtual ~Block( );\r
index e15b68df827da2e33f9a7d2563d61986c36ac740..8388eddb123b3cbff209ed47542acab7ab7c67d4 100644 (file)
@@ -74,10 +74,16 @@ setWorkspace( TWorkspace* ws )
   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
@@ -120,7 +126,11 @@ createFilter( const std::string& filter, const QPointF& pnt )
     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
@@ -173,13 +183,13 @@ itemAt( const QPointF& pos )
 \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
@@ -221,8 +231,6 @@ _createBlock( TFilter* f, const QPointF& pnt )
 \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
index bceeecd2e5042ece89b34933493b94bc594e2ee6..908abf96d62b2bc6178918d1497f327957404908 100644 (file)
@@ -82,7 +82,9 @@ namespace cpPipelineEditor
   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
index 364816a4d094ae5c2df701dec48228ecc929ae05..809ef35c5dd91584beb59021dda536ea047ed088 100644 (file)
@@ -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( ) )
   {