]> Creatis software - cpPlugins.git/blobdiff - appli/cpPipelineEditor/QNodesEditorCanvas.cxx
...
[cpPlugins.git] / appli / cpPipelineEditor / QNodesEditorCanvas.cxx
index 6d970adb25a9fcd385f28a8ddf27269d4a7dcf7d..afb5b62bd653ec6ce5e61993ee4a07191aa954eb 100644 (file)
@@ -52,11 +52,10 @@ setWorkspace( TWorkspace* ws )
   if( this->m_Workspace == ws )
     return;
   this->m_Workspace = ws;
-  QGraphicsScene* scene = this->scene( );
-
-  // Create graph
   this->m_Graph = TGraph::New( );
 
+  /* TODO
+  QGraphicsScene* scene = this->scene( );
   // Add vertices and keep track of ports
   std::map< std::string, std::map< std::string, QNEPort* > >
     in_ports, out_ports;
@@ -65,32 +64,9 @@ setWorkspace( TWorkspace* ws )
   for( ; vIt != vIt_end; ++vIt )
   {
     this->_createBlock( dynamic_cast< TFilter* >( vIt->second.GetPointer( ) ) );
-#error ACA VOY
-    // Add block
-    QNEBlock* b = new QNEBlock( 0, scene );
-    b->addPort( vIt->second->GetName( ), 0, QNEPort::NamePort );
-    b->addPort( vIt->second->GetClassName( ).c_str( ), 0, QNEPort::TypePort );
-
-    // Get filter
-    if( f == NULL )
-      continue;
-
-    // Add input ports
-    std::set< std::string > inputs;
-    f->GetInputsNames( inputs );
-    for( auto iIt = inputs.begin( ); iIt != inputs.end( ); ++iIt )
-      in_ports[ vIt->first ][ *iIt ] = b->addInputPort( iIt->c_str( ) );
-
-    // Add output ports
-    std::set< std::string > outputs;
-    f->GetOutputsNames( outputs );
-    for( auto oIt = outputs.begin( ); oIt != outputs.end( ); ++oIt )
-      out_ports[ vIt->first ][ *oIt ] = b->addOutputPort( oIt->c_str( ) );
-
-    // Keep a trace of this visual graph
-    this->m_Graph->InsertVertex( vIt->first, b );
 
   } // rof
+  */
 
   // Add edges
   /* TODO
@@ -187,11 +163,10 @@ dropEvent( QDropEvent* event )
   {
     std::string filter = ( *iIt )->text( 0 ).toStdString( );
     std::string name = filter;
-    if( this->m_Workspace->GetFilter( name ) != NULL )
+    while( this->m_Workspace->HasFilter( name ) )
       name += std::string( "_" );
     if( this->m_Workspace->CreateFilter( filter, name ) )
-    {
-    } // fi
+      this->_createBlock( this->m_Workspace->GetFilter( name ) );
 
   } // rof
 }