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 if( this->m_ParametersDialog == NULL )
105 this->m_ParametersDialog = new ParametersQtDialog( parent );
106 this->m_ParametersDialog->setTitle(
107 this->GetClassName( ) + std::string( " basic configuration" )
109 this->m_ParametersDialog->setParameters( this->m_Parameters );
113 if( !( this->m_ParametersDialog->IsModal( ) ) )
115 this->m_ParametersDialog->show( );
119 r = ( this->m_ParametersDialog->exec( ) == 1 );
122 r = cpPlugins::Interface::ParametersQtDialog(
124 this->GetClassName( ) + std::string( " basic configuration" ),
130 #endif // cpPlugins_Interface_QT4
135 // -------------------------------------------------------------------------
136 cpPlugins::Interface::ProcessObject::
141 m_ParametersDialog( NULL )
143 this->m_Parameters = TParameters::New( );
146 // -------------------------------------------------------------------------
147 cpPlugins::Interface::ProcessObject::
150 if( this->m_ParametersDialog == NULL )
151 delete this->m_ParametersDialog;
154 // -------------------------------------------------------------------------
155 void cpPlugins::Interface::ProcessObject::
156 _AddInput( const std::string& name )
158 this->m_Inputs[ name ] = NULL;