\r
// -------------------------------------------------------------------------\r
PipelineEditor::QNEBlock::\r
-QNEBlock( QGraphicsItem* parent, QGraphicsScene* scene )\r
+QNEBlock( TFilter* filter, QGraphicsItem* parent, QGraphicsScene* scene )\r
: Superclass( parent, scene ),\r
m_HorzMargin( 20 ),\r
m_VertMargin( 5 ),\r
m_NamePort( NULL ),\r
- m_TypePort( NULL )\r
+ m_TypePort( NULL ),\r
+ m_Filter( filter )\r
{\r
QPainterPath p;\r
p.addRoundedRect( -50, -15, 100, 30, 5, 5 );\r
if( this->m_NamePort == NULL )\r
this->m_NamePort = new QNENamePort( this );\r
this->m_NamePort->setName( txt );\r
+ this->m_Filter->SetName( txt.toStdString( ) );\r
this->_configPort( this->m_NamePort );\r
}\r
\r
PipelineEditor::QNEBlock* PipelineEditor::QNEBlock::\r
clone( )\r
{\r
- QNEBlock* b = new QNEBlock( 0, this->scene( ) );\r
+ QNEBlock* b = new QNEBlock( this->m_Filter, 0, this->scene( ) );\r
foreach( QGraphicsItem* i, this->childItems( ) )\r
{\r
QNENamePort* np = dynamic_cast< QNENamePort* >( i );\r
#define __PIPELINEEDITOR__QNEBLOCK__H__\r
\r
#include <QGraphicsPathItem>\r
+#include <cpPlugins/Interface/ProcessObject.h>\r
\r
namespace PipelineEditor\r
{\r
public:\r
typedef QNEBlock Self;\r
typedef QGraphicsPathItem Superclass;\r
+ typedef cpPlugins::Interface::ProcessObject TFilter;\r
\r
public:\r
enum { Type = QGraphicsItem::UserType + 6 };\r
\r
- QNEBlock( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
+ QNEBlock(\r
+ TFilter* filter,\r
+ QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL\r
+ );\r
virtual ~QNEBlock( );\r
\r
void setNamePort( const QString& txt );\r
QNETypePort* m_TypePort;\r
QVector< QNEInputPort* > m_InputPorts;\r
QVector< QNEOutputPort* > m_OutputPorts;\r
+\r
+ TFilter::Pointer m_Filter;\r
};\r
\r
} // ecapseman\r
return;\r
\r
// Add block\r
- QNEBlock* b = new QNEBlock( 0, this->m_Scene );\r
+ QNEBlock* b = new QNEBlock( f, 0, this->m_Scene );\r
b->setNamePort( f->GetName( ) );\r
b->setTypePort( f->GetClassName( ) );\r
b->setPos( pnt );\r
);\r
if( ok )\r
{\r
- block->namePort( )->setName( new_name );\r
+ block->setNamePort( new_name );\r
this->m_Workspace->GetGraph( )->RenameVertex(\r
old_name.toStdString( ),\r
new_name.toStdString( )\r
bool HasVertexIndex( const I& index ) const;
void SetVertex( const I& index, V& vertex );
bool RenameVertex( const I& old_index, const I& new_index );
+ void RemoveVertex( const I& index );
V& GetVertex( const I& index );
const V& GetVertex( const I& index ) const;
void AddConnection( const I& orig, const I& dest, const C& cost );
+ void RemoveConnection( const I& orig, const I& dest, const C& cost );
std::set< I > GetSinks( ) const;
return( false );
}
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+void cpExtensions::DataStructures::Graph< V, C, I >::
+RemoveVertex( const I& index )
+{
+#error REMOVE
+}
+
// -------------------------------------------------------------------------
template< class V, class C, class I >
V& cpExtensions::DataStructures::Graph< V, C, I >::
this->m_Matrix[ orig ][ dest ].push_back( cost );
}
+// -------------------------------------------------------------------------
+template< class V, class C, class I >
+void cpExtensions::DataStructures::Graph< V, C, I >::
+RemoveConnection( const I& orig, const I& dest, const C& cost )
+{
+#error remove connection
+}
+
// -------------------------------------------------------------------------
template< class V, class C, class I >
std::set< I > cpExtensions::DataStructures::Graph< V, C, I >::