SET(
EXAMPLES_PROGRAMS_WITH_PLUGINS
+ example_SphereSource
#example_ReadWriteImage
#example_MarchingCubes
#example_MPR
--- /dev/null
+#include <cstdlib>
+#include <iostream>
+#include <string>
+
+#include <cpPlugins/Interface/Interface.h>
+#include <cpPlugins/Interface/ProcessObject.h>
+
+// -------------------------------------------------------------------------
+typedef cpPlugins::Interface::Interface TInterface;
+typedef cpPlugins::Interface::ProcessObject TFilter;
+
+// -------------------------------------------------------------------------
+int main( int argc, char* argv[] )
+{
+ if( argc < 6 )
+ {
+ std::cerr
+ << "Usage: " << argv[ 0 ]
+ << " plugins_dir"
+ << " radius phi_res theta_res output_mesh" << std::endl;
+ return( 1 );
+
+ } // fi
+
+ // Create interface and load plugins
+ TInterface interface;
+ if( interface.LoadFromFolder( argv[ 1 ], true ) )
+ {
+ TFilter::Pointer source =
+ interface.CreateObject( "cpPlugins::BasicFilters::SphereMeshSource" );
+ TFilter::Pointer writer =
+ interface.CreateObject( "cpPlugins::IO::MeshWriter" );
+
+ // Configure source
+ source->GetParameters( )->SetString( "Radius", argv[ 2 ], true );
+ source->GetParameters( )->SetString( "PhiResolution", argv[ 3 ], true );
+ source->GetParameters( )->SetString( "ThetaResolution", argv[ 4 ], true );
+
+ // Configure writer
+ writer->GetParameters( )->SetString( "FileName", argv[ 5 ], true );
+
+ // Connect filters
+ writer->SetInput( "Input", source->GetOutput( "Output" ) );
+
+ // Execute pipeline
+ std::cout << "Error: \"" << writer->Update( ) << "\"" << std::endl;
+ }
+ else
+ std::cerr << "No plugins found." << std::endl;
+
+ return( 0 );
+}
+
+// eof - $RCSfile$
#include <QStyleOptionGraphicsItem>\r
#include <QGraphicsWidget>\r
\r
+#include <cpPlugins/Interface/ParametersQtDialog.h>\r
+\r
#include "Port.h"\r
#include "Connection.h"\r
#include "Editor.h"\r
QAction* selectedAction = menu.exec( evt->screenPos( ) );\r
\r
if( selectedAction == configureAction )\r
- auto res = this->m_Filter->ExecConfigurationDialog( NULL );\r
+ this->m_Filter->GetParametersDialog( )->exec( );\r
else if( selectedAction == updateAction )\r
this->m_Editor->updateFilter( this->namePort( ).toStdString( ) );\r
}\r
#include <cpPlugins/Interface/ProcessObject.h>
+#include <itkProcessObject.h>
#ifdef cpPlugins_Interface_QT4
#include <QApplication>
#include <cpPlugins/Interface/SimpleMPRWidget.h>
#endif // cpPlugins_Interface_QT4
-#include <vtkRenderWindowInteractor.h>
-
// -------------------------------------------------------------------------
std::set< std::string > cpPlugins::Interface::ProcessObject::
GetInputsNames( ) const
{
std::set< std::string > names;
- auto dIt = this->m_Inputs.begin( );
- for( ; dIt != this->m_Inputs.end( ); ++dIt )
- names.insert( dIt->first );
+ for( auto i = this->m_Inputs.begin( ); i != this->m_Inputs.end( ); ++i )
+ names.insert( i->first );
return( names );
}
GetOutputsNames( ) const
{
std::set< std::string > names;
- auto dIt = this->m_Outputs.begin( );
- for( ; dIt != this->m_Outputs.end( ); ++dIt )
- names.insert( dIt->first );
+ for( auto i = this->m_Outputs.begin( ); i != this->m_Outputs.end( ); ++i )
+ names.insert( i->first );
return( names );
}
return( this->m_Outputs.size( ) );
}
+// -------------------------------------------------------------------------
+cpPlugins::Interface::
+ProcessObjectPort& cpPlugins::Interface::ProcessObject::
+GetOutput( const std::string& id )
+{
+ static ProcessObjectPort null_port;
+ auto i = this->m_Outputs.find( id );
+ if( i == this->m_Outputs.end( ) )
+ {
+ null_port = NULL;
+ return( null_port );
+ }
+ else
+ return( i->second );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Interface::
+ProcessObjectPort& cpPlugins::Interface::ProcessObject::
+GetOutput( const std::string& id ) const
+{
+ static const ProcessObjectPort null_port;
+ auto i = this->m_Outputs.find( id );
+ if( i == this->m_Outputs.end( ) )
+ return( null_port );
+ else
+ return( i->second );
+}
+
// -------------------------------------------------------------------------
bool cpPlugins::Interface::ProcessObject::
-SetInput(
- const std::string& id, cpPlugins::Interface::DataObject::Pointer* dobj
- )
+SetInput( const std::string& id, const ProcessObjectPort& port )
{
- _TDataContainer::iterator i = this->m_Inputs.find( id );
+ auto i = this->m_Inputs.find( id );
if( i != this->m_Inputs.end( ) )
{
- i->second = dobj;
+ i->second = port;
this->Modified( );
return( true );
}
}
// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::ProcessObject::
-Update( )
+void cpPlugins::Interface::ProcessObject::
+DisconnectInputs( )
{
- std::string r = "";
-
- // Force upstream updates
- _TDataContainer::iterator i = this->m_Inputs.begin( );
- for( ; i != this->m_Inputs.end( ) && r == ""; ++i )
- {
- if( i->second->IsNotNull( ) )
- {
- Self* src = dynamic_cast< Self* >( ( *( i->second ) )->GetSource( ) );
- if( src != NULL )
- r = src->Update( );
- }
- else
- r = "cpPlugins::Interface::ProcessObject: No input connected.";
-
- } // rof
-
- // Current update
- if( r == "" )
- r = this->_GenerateData( );
-
- // Return error description, if any
- return( r );
+ auto i = this->m_Inputs.begin( );
+ for( ; i != this->m_Inputs.end( ); ++i )
+ i->second = NULL;
+ this->Modified( );
}
// -------------------------------------------------------------------------
void cpPlugins::Interface::ProcessObject::
DisconnectOutputs( )
{
- _TDataContainer::iterator i = this->m_Outputs.begin( );
+ auto i = this->m_Outputs.begin( );
for( ; i != this->m_Outputs.end( ); ++i )
- if( i->second->IsNotNull( ) )
- ( *( i->second ) )->DisconnectPipeline( );
+ if( i->second.IsValid( ) )
+ i->second->DisconnectPipeline( );
+ this->Modified( );
}
// -------------------------------------------------------------------------
-vtkRenderWindowInteractor* cpPlugins::Interface::ProcessObject::
-GetSingleInteractor( )
+void cpPlugins::Interface::ProcessObject::
+Disconnect( )
{
- return( this->m_SingleInteractor );
+ this->DisconnectInputs( );
+ this->DisconnectOutputs( );
}
// -------------------------------------------------------------------------
-const vtkRenderWindowInteractor* cpPlugins::Interface::ProcessObject::
-GetSingleInteractor( ) const
+itk::ModifiedTimeType cpPlugins::Interface::ProcessObject::
+GetMTime( ) const
{
- return( this->m_SingleInteractor );
+ auto params_time = this->m_Parameters->GetMTime( );
+ auto filter_time = this->Superclass::GetMTime( );
+ auto ipobj = this->GetITK< itk::ProcessObject >( );
+ if( ipobj == NULL )
+ {
+ auto vpobj = this->GetVTK< vtkAlgorithm >( );
+ if( vpobj != NULL )
+ filter_time = ( const_cast< vtkAlgorithm* >( vpobj ) )->GetMTime( );
+ }
+ else
+ filter_time = ipobj->GetMTime( );
+ return( ( params_time < filter_time )? filter_time: params_time );
}
// -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
-SetSingleInteractor( vtkRenderWindowInteractor* interactor )
+std::string cpPlugins::Interface::ProcessObject::
+Update( )
{
- this->m_SingleInteractor = interactor;
-}
+ static
+ std::string r = "";
-// -------------------------------------------------------------------------
-cpPlugins::Interface::
-SimpleMPRWidget* cpPlugins::Interface::ProcessObject::
-GetMPRViewer( )
-{
- return( this->m_MPRViewer );
-}
+ // Force upstream updates
+ _TDataContainer::iterator i = this->m_Inputs.begin( );
+ bool need_to_update = false;
+ for( ; i != this->m_Inputs.end( ) && r == ""; ++i )
+ {
+ if( i->second.IsValid( ) )
+ {
+ Self* src = dynamic_cast< Self* >( i->second->GetSource( ) );
+ if( src != NULL )
+ {
+ need_to_update |= ( this->m_LastExecutionTime < src->GetMTime( ) );
+ r = src->Update( );
-// -------------------------------------------------------------------------
-const cpPlugins::Interface::
-SimpleMPRWidget* cpPlugins::Interface::ProcessObject::
-GetMPRViewer( ) const
-{
- return( this->m_MPRViewer );
-}
+ } // fi
+ }
+ else
+ r = "cpPlugins::Interface::ProcessObject: No input connected.";
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
-SetMPRViewer( cpPlugins::Interface::SimpleMPRWidget* wdg )
-{
- this->m_MPRViewer = wdg;
-}
+ } // rof
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::ProcessObject::
-ExecConfigurationDialog( QWidget* parent )
-{
- bool r = false;
-#ifdef cpPlugins_Interface_QT4
- if( this->m_ParametersDialog != NULL )
+ // Current update
+ if( r == "" )
{
- this->m_ParametersDialog->setParent( NULL );
- this->m_ParametersDialog->setParameters( this->m_Parameters );
- r = ( this->m_ParametersDialog->exec( ) == 1 );
- }
- else
- r = false;
-#endif // cpPlugins_Interface_QT4
+ if( this->m_LastExecutionTime < this->GetMTime( ) || need_to_update )
+ {
+ r = this->_GenerateData( );
+ this->m_LastExecutionTime = this->GetMTime( );
+
+ } // fi
+
+ } // fi
+
+ // Return error description, if any
return( r );
}
cpPlugins::Interface::ProcessObject::
ProcessObject( )
: Superclass( ),
+ m_LastExecutionTime( 0 ),
m_ParametersDialog( NULL ),
m_MPRViewer( NULL )
{
#ifdef cpPlugins_Interface_QT4
if( QApplication::instance( ) != NULL )
+ {
this->m_ParametersDialog = new ParametersQtDialog( );
+ this->m_ParametersDialog->setParameters( this->m_Parameters );
+
+ } // fi
#endif // cpPlugins_Interface_QT4
}
cpPlugins::Interface::ProcessObject::
~ProcessObject( )
{
-#ifdef cpPlugins_Interface_QT4
+ this->Disconnect( );
if( this->m_ParametersDialog != NULL )
delete this->m_ParametersDialog;
-#endif // cpPlugins_Interface_QT4
-
- /*
- auto iIt = this->m_Inputs.begin( );
- for( ; iIt != this->m_Inputs.end( ); ++iIt )
- delete iIt->second;
- this->m_Inputs.clear( );
- */
-
- auto oIt = this->m_Outputs.begin( );
- for( ; oIt != this->m_Outputs.end( ); ++oIt )
- delete oIt->second;
- this->m_Outputs.clear( );
}
// -------------------------------------------------------------------------
void cpPlugins::Interface::ProcessObject::
_AddInput( const std::string& name )
{
+ typedef typename _TDataContainer::value_type _TValue;
auto i = this->m_Inputs.find( name );
if( i == this->m_Inputs.end( ) )
- {
- this->m_Inputs[ name ] = NULL;
- this->Modified( );
-
- } // fi
+ i = this->m_Inputs.insert( _TValue( name, NULL ) ).first;
}
// eof - $RCSfile$
#ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
#define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__
+#include <map>
#include <set>
#include <itkDataObject.h>
-
-#include <cpPlugins/Interface/DataObject.h>
+#include <cpPlugins/Interface/ProcessObjectPort.h>
#include <cpPlugins/Interface/Parameters.h>
// Some forward declarations
class vtkRenderWindowInteractor;
-#ifdef cpPlugins_Interface_QT4
-class QWidget;
-#else
-typedef char QWidget;
-#endif // cpPlugins_Interface_QT4
namespace cpPlugins
{
itkTypeMacro( ProcessObject, Object );
cpPlugins_Id_Macro( ProcessObject, BaseObject );
- itkBooleanMacro( Interactive );
- itkGetConstMacro( Interactive, bool );
- itkSetMacro( Interactive, bool );
-
itkGetConstObjectMacro( Parameters, TParameters );
+
itkGetObjectMacro( Parameters, TParameters );
+ itkGetMacro( ParametersDialog, ParametersQtDialog* );
+ itkGetMacro( SingleInteractor, vtkRenderWindowInteractor* );
+ itkGetMacro( MPRViewer, SimpleMPRWidget* );
+
+ itkSetObjectMacro( ParametersDialog, ParametersQtDialog );
+ itkSetObjectMacro( SingleInteractor, vtkRenderWindowInteractor );
+ itkSetObjectMacro( MPRViewer, SimpleMPRWidget );
public:
- virtual std::set< std::string > GetInputsNames( ) const;
- virtual std::set< std::string > GetOutputsNames( ) const;
+ // IO management
+ std::set< std::string > GetInputsNames( ) const;
+ std::set< std::string > GetOutputsNames( ) const;
unsigned int GetNumberOfInputs( ) const;
unsigned int GetNumberOfOutputs( ) const;
- virtual bool SetInput( const std::string& id, DataObject::Pointer* dobj );
-
- virtual std::string Update( );
- virtual void DisconnectOutputs( );
-
- // Widgets management
- vtkRenderWindowInteractor* GetSingleInteractor( );
- const vtkRenderWindowInteractor* GetSingleInteractor( ) const;
- void SetSingleInteractor( vtkRenderWindowInteractor* interactor );
- SimpleMPRWidget* GetMPRViewer( );
- const SimpleMPRWidget* GetMPRViewer( ) const;
- void SetMPRViewer( SimpleMPRWidget* wdg );
- virtual bool ExecConfigurationDialog( QWidget* parent );
+ ProcessObjectPort& GetOutput( const std::string& id );
+ const ProcessObjectPort& GetOutput( const std::string& id ) const;
template< class T >
inline T* GetInputData( const std::string& id );
-
template< class T >
inline const T* GetInputData( const std::string& id ) const;
-
template< class T >
inline T* GetOutputData( const std::string& id );
-
template< class T >
inline const T* GetOutputData( const std::string& id ) const;
- DataObject::Pointer* GetOutputPort( const std::string& id )
- {
- auto i = this->m_Outputs.find( id );
- if( i != this->m_Outputs.end( ) )
- return( i->second );
- else
- return( NULL );
- }
-
- const DataObject::Pointer* GetOutputPort( const std::string& id ) const
- {
- auto i = this->m_Outputs.find( id );
- if( i != this->m_Outputs.end( ) )
- return( i->second );
- else
- return( NULL );
- }
+ bool SetInput( const std::string& id, const ProcessObjectPort& port );
+
+ void DisconnectInputs( );
+ void DisconnectOutputs( );
+ void Disconnect( );
+
+ // Pipeline execution
+ virtual itk::ModifiedTimeType GetMTime( ) const;
+ virtual std::string Update( );
protected:
ProcessObject( );
virtual ~ProcessObject( );
- virtual void _AddInput( const std::string& name );
-
+ void _AddInput( const std::string& name );
template< class O >
- inline void _AddOutput( const std::string& id );
-
+ inline void _AddOutput( const std::string& name );
template< class F >
inline F* _CreateITK( );
-
template< class F >
inline F* _CreateVTK( );
Self& operator=( const Self& );
protected:
+ typedef std::map< std::string, ProcessObjectPort > _TDataContainer;
+ _TDataContainer m_Inputs;
+ _TDataContainer m_Outputs;
Parameters::Pointer m_Parameters;
- ParametersQtDialog* m_ParametersDialog;
- vtkSmartPointer< vtkRenderWindowInteractor > m_SingleInteractor;
- SimpleMPRWidget* m_MPRViewer;
- bool m_Interactive;
+ itk::ModifiedTimeType m_LastExecutionTime;
- typedef std::map< std::string, DataObject::Pointer* > _TDataContainer;
- _TDataContainer m_Inputs;
- _TDataContainer m_Outputs;
+ ParametersQtDialog* m_ParametersDialog;
+ vtkRenderWindowInteractor* m_SingleInteractor;
+ SimpleMPRWidget* m_MPRViewer;
};
} // ecapseman
T* cpPlugins::Interface::ProcessObject::
GetInputData( const std::string& id )
{
- _TDataContainer::iterator i = this->m_Inputs.find( id );
+ auto i = this->m_Inputs.find( id );
if( i != this->m_Inputs.end( ) )
- return( dynamic_cast< T* >( i->second->GetPointer( ) ) );
+ return( dynamic_cast< T* >( i->second.GetPointer( ) ) );
else
return( NULL );
}
const T* cpPlugins::Interface::ProcessObject::
GetInputData( const std::string& id ) const
{
- _TDataContainer::const_iterator i = this->m_Inputs.find( id );
+ auto i = this->m_Inputs.find( id );
if( i != this->m_Inputs.end( ) )
- return( dynamic_cast< const T* >( i->second->GetPointer( ) ) );
+ return( dynamic_cast< const T* >( i->second.GetPointer( ) ) );
else
return( NULL );
}
T* cpPlugins::Interface::ProcessObject::
GetOutputData( const std::string& id )
{
- _TDataContainer::iterator i = this->m_Outputs.find( id );
+ auto i = this->m_Outputs.find( id );
if( i != this->m_Outputs.end( ) )
- return( dynamic_cast< T* >( i->second->GetPointer( ) ) );
+ return( dynamic_cast< T* >( i->second.GetPointer( ) ) );
else
return( NULL );
}
const T* cpPlugins::Interface::ProcessObject::
GetOutputData( const std::string& id ) const
{
- _TDataContainer::const_iterator i = this->m_Outputs.find( id );
+ auto i = this->m_Outputs.find( id );
if( i != this->m_Outputs.end( ) )
- return( dynamic_cast< const T* >( i->second->GetPointer( ) ) );
+ return( dynamic_cast< const T* >( i->second.GetPointer( ) ) );
else
return( NULL );
}
// -------------------------------------------------------------------------
template< class O >
void cpPlugins::Interface::ProcessObject::
-_AddOutput( const std::string& id )
+_AddOutput( const std::string& name )
{
- auto oIt = this->m_Outputs.find( id );
- if( oIt == this->m_Outputs.end( ) )
+ typedef typename _TDataContainer::value_type _TValue;
+ auto i = this->m_Outputs.find( name );
+ if( i == this->m_Outputs.end( ) )
{
- this->m_Outputs[ id ] = new DataObject::Pointer( );
- oIt = this->m_Outputs.find( id );
+ typename O::Pointer o = O::New( );
+ o->SetSource( this );
+ this->m_Outputs[ name ] = o;
} // fi
- *( oIt->second ) = O::New( );
- ( *( oIt->second ) )->SetSource( this );
- this->Modified( );
}
// -------------------------------------------------------------------------
F* cpPlugins::Interface::ProcessObject::
_CreateITK( )
{
- F* filter = dynamic_cast< F* >( this->m_ITKObject.GetPointer( ) );
+ F* filter = this->GetITK< F >( );
if( filter == NULL )
{
- typename F::Pointer ptr = F::New( );
- this->m_ITKObject = ptr;
- filter = ptr.GetPointer( );
- this->m_VTKObject = NULL;
+ typename F::Pointer filter_ptr = F::New( );
+ this->SetITK( filter_ptr.GetPointer( ) );
+ this->SetVTK( NULL );
+ filter = filter_ptr.GetPointer( );
} // fi
return( filter );
F* cpPlugins::Interface::ProcessObject::
_CreateVTK( )
{
- F* filter = dynamic_cast< F* >( this->m_VTKObject.GetPointer( ) );
+ F* filter = this->GetVTK< F >( );
if( filter == NULL )
{
- filter = F::New( );
- this->m_VTKObject = filter;
- this->m_ITKObject = NULL;
+ vtkSmartPointer< F > filter_ptr = vtkSmartPointer< F >::New( );
+ this->SetITK( NULL );
+ this->SetVTK( filter_ptr );
+ filter = filter_ptr.GetPointer( );
} // fi
return( filter );
--- /dev/null
+#include <cpPlugins/Interface/ProcessObjectPort.h>
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ProcessObjectPort::
+ProcessObjectPort( )
+{
+ this->m_Data = NULL;
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ProcessObjectPort::
+ProcessObjectPort( DataObject* obj )
+{
+ this->m_Data = obj;
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ProcessObjectPort::
+ProcessObjectPort( const Self& other )
+{
+ this->m_Data = other.m_Data.GetPointer( );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ProcessObjectPort::
+~ProcessObjectPort( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ProcessObjectPort::
+Self& cpPlugins::Interface::ProcessObjectPort::
+operator=( DataObject* obj )
+{
+ this->m_Data = obj;
+ return( *this );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ProcessObjectPort::
+Self& cpPlugins::Interface::ProcessObjectPort::
+operator=( const Self& other )
+{
+ this->m_Data = other.m_Data.GetPointer( );
+ return( *this );
+}
+
+// -------------------------------------------------------------------------
+bool cpPlugins::Interface::ProcessObjectPort::
+IsValid( ) const
+{
+ return( this->m_Data.IsNotNull( ) );
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECTPORT__H__
+#define __CPPLUGINS__INTERFACE__PROCESSOBJECTPORT__H__
+
+#include <cpPlugins/Interface/DataObject.h>
+
+namespace cpPlugins
+{
+ namespace Interface
+ {
+ /**
+ */
+ class cpPlugins_Interface_EXPORT ProcessObjectPort
+ {
+ public:
+ typedef ProcessObjectPort Self;
+
+ public:
+ ProcessObjectPort( );
+ ProcessObjectPort( DataObject* obj );
+ ProcessObjectPort( const Self& other );
+ virtual ~ProcessObjectPort( );
+ Self& operator=( DataObject* obj );
+ Self& operator=( const Self& other );
+
+ bool IsValid( ) const;
+
+ // This could be seen as a pointer to DataObject's
+ DataObject* GetPointer( )
+ { return( this->m_Data.GetPointer( ) ); }
+ const DataObject* GetPointer( ) const
+ { return( this->m_Data.GetPointer( ) ); }
+ DataObject* operator->( ) const
+ { return( this->m_Data.GetPointer( ) ); }
+
+ protected:
+ cpPlugins::Interface::DataObject::Pointer m_Data;
+
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#endif // __CPPLUGINS__INTERFACE__PROCESSOBJECTPORT__H__
+
+// eof - $RCSfile$
return( false );
// Real connection
- dest->SetInput( input_name, orig->GetOutputPort( output_name ) );
- this->m_Graph->AddEdge(
- orig_filter, dest_filter,
- TConnection( output_name, input_name )
- );
- return( false );
+ if( dest->SetInput( input_name, orig->GetOutput( output_name ) ) )
+ {
+ this->m_Graph->AddEdge(
+ orig_filter, dest_filter,
+ TConnection( output_name, input_name )
+ );
+ return( true );
+ }
+ else
+ return( false );
}
// -------------------------------------------------------------------------
bool cpPlugins::Interface::Workspace::
-Connect( TData::Pointer* input_object, const std::string& input_name )
+Connect(
+ const ProcessObjectPort& input_port, const std::string& exposed_port
+ )
{
- auto port = this->m_ExposedInputPorts.find( input_name );
+ auto port = this->m_ExposedInputPorts.find( exposed_port );
if( port != this->m_ExposedInputPorts.end( ) )
{
TFilter* filter = this->GetFilter( port->second.first );
if( filter != NULL )
- {
- filter->SetInput( port->second.second, input_object );
- return( true );
- }
+ return( filter->SetInput( port->second.second, input_port ) );
else
return( false );
}
const std::string& output_name, const std::string& input_name
);
bool Connect(
- TData::Pointer* input_object, const std::string& exposed_port
+ const ProcessObjectPort& input_port, const std::string& exposed_port
);
void RemoveConnection(
const std::string& dest_filter, const std::string& input_name
return( "InputDataReproducer: No input/output ports." );
// Connect output
- *( o->second ) = *( i->second );
+ o->second = i->second;
return( "" );
}
SphereMeshSource( )
: Superclass( )
{
- this->_AddInput( "Center" );
+ // TODO: this->_AddInput( "Center" );
this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" );
this->m_Parameters->ConfigureAsReal( "Radius" );
#include <itkGDCMSeriesFileNames.h>
// -------------------------------------------------------------------------
+/*
bool cpPlugins::IO::DicomSeriesReader::
ExecConfigurationDialog( QWidget* parent )
{
return( r );
}
+*/
// -------------------------------------------------------------------------
cpPlugins::IO::DicomSeriesReader::
itkTypeMacro( DicomSeriesReader, ImageReader );
cpPlugins_Id_Macro( cpPlugins::IO::DicomSeriesReader, IO );
- public:
- virtual bool ExecConfigurationDialog( QWidget* parent );
+ /* TODO
+ public:
+ virtual bool ExecConfigurationDialog( QWidget* parent );
+ */
protected:
DicomSeriesReader( );
} // fi
// Single interactor
- _S* s = dynamic_cast< _S* >( this->m_SingleInteractor.GetPointer( ) );
+ _S* s = dynamic_cast< _S* >( this->m_SingleInteractor );
if( s != NULL )
{
if( this->m_Configured )