1 #include <cpPlugins/Interface/ProcessObject.h>
3 #ifdef cpPlugins_Interface_QT4
4 #include <cpPlugins/Interface/ParametersQtDialog.h>
5 #endif // cpPlugins_Interface_QT4
7 // -------------------------------------------------------------------------
8 void cpPlugins::Interface::ProcessObject::
11 if( this->m_ITKObject.IsNotNull( ) )
12 this->m_ITKObject->Modified( );
13 if( this->m_VTKObject.GetPointer( ) != NULL )
14 this->m_VTKObject->Modified( );
15 this->Superclass::Modified( );
18 // -------------------------------------------------------------------------
19 cpPlugins::Interface::ProcessObject::
20 TParameters* cpPlugins::Interface::ProcessObject::
23 return( this->m_Parameters.GetPointer( ) );
26 // -------------------------------------------------------------------------
27 const cpPlugins::Interface::ProcessObject::
28 TParameters* cpPlugins::Interface::ProcessObject::
29 GetParameters( ) const
31 return( this->m_Parameters.GetPointer( ) );
34 // -------------------------------------------------------------------------
35 unsigned int cpPlugins::Interface::ProcessObject::
36 GetNumberOfInputs( ) const
38 return( this->m_Inputs.size( ) );
41 // -------------------------------------------------------------------------
42 unsigned int cpPlugins::Interface::ProcessObject::
43 GetNumberOfOutputs( ) const
45 return( this->m_Outputs.size( ) );
48 // -------------------------------------------------------------------------
49 void cpPlugins::Interface::ProcessObject::
50 SetInput( const std::string& id, cpPlugins::Interface::DataObject* dobj )
52 _TDataContainer::iterator i = this->m_Inputs.find( id );
53 if( i != this->m_Inputs.end( ) )
61 // -------------------------------------------------------------------------
62 std::string cpPlugins::Interface::ProcessObject::
67 // Force upstream updates
68 _TDataContainer::iterator i = this->m_Inputs.begin( );
69 for( ; i != this->m_Inputs.end( ) && r == ""; ++i )
71 Self* src = dynamic_cast< Self* >( i->second->GetSource( ) );
79 r = this->_GenerateData( );
81 // Return error description, if any
85 // -------------------------------------------------------------------------
86 void cpPlugins::Interface::ProcessObject::
89 _TDataContainer::iterator i = this->m_Outputs.begin( );
90 for( ; i != this->m_Outputs.end( ); ++i )
91 if( i->second.IsNotNull( ) )
92 i->second->DisconnectPipeline( );
95 // -------------------------------------------------------------------------
96 bool cpPlugins::Interface::ProcessObject::
97 ExecConfigurationDialog( QWidget* parent )
101 #ifdef cpPlugins_Interface_QT4
103 r = cpPlugins::Interface::ParametersQtDialog(
105 this->GetClassName( ) + std::string( " basic configuration" ),
110 // TODO: !!! this->m_Parameters = parameters;
113 #endif // cpPlugins_Interface_QT4
118 // -------------------------------------------------------------------------
119 cpPlugins::Interface::ProcessObject::
125 this->m_Parameters = TParameters::New( );
128 // -------------------------------------------------------------------------
129 cpPlugins::Interface::ProcessObject::
134 // -------------------------------------------------------------------------
135 void cpPlugins::Interface::ProcessObject::
136 _AddInput( const std::string& name )
138 this->m_Inputs[ name ] = NULL;