1 #include <cpPlugins/Interface/ProcessObject.h>
3 #ifdef cpPlugins_Interface_QT4
4 #include <cpPlugins/Interface/ParametersQtDialog.h>
5 #endif // cpPlugins_Interface_QT4
7 // -------------------------------------------------------------------------
8 const cpPlugins::Interface::Parameters&
9 cpPlugins::Interface::ProcessObject::
10 GetDefaultParameters( ) const
12 return( this->m_DefaultParameters );
15 // -------------------------------------------------------------------------
16 void cpPlugins::Interface::ProcessObject::
17 SetParameters( const cpPlugins::Interface::Parameters& params )
19 this->m_Parameters = params;
23 // -------------------------------------------------------------------------
24 unsigned int cpPlugins::Interface::ProcessObject::
25 GetNumberOfInputs( ) const
27 return( this->m_Inputs.size( ) );
30 // -------------------------------------------------------------------------
31 unsigned int cpPlugins::Interface::ProcessObject::
32 GetNumberOfOutputs( ) const
34 return( this->m_Outputs.size( ) );
37 // -------------------------------------------------------------------------
38 void cpPlugins::Interface::ProcessObject::
39 SetNumberOfInputs( unsigned int n )
41 this->m_Inputs.clear( );
42 this->m_Inputs.resize( n );
46 // -------------------------------------------------------------------------
47 void cpPlugins::Interface::ProcessObject::
48 SetNumberOfOutputs( unsigned int n )
50 this->m_Outputs.clear( );
51 this->m_Outputs.resize( n );
55 // -------------------------------------------------------------------------
56 void cpPlugins::Interface::ProcessObject::
57 SetInput( unsigned int idx, cpPlugins::Interface::DataObject* dobj )
59 if( idx < this->m_Inputs.size( ) )
61 this->m_Inputs[ idx ] = dobj;
67 // -------------------------------------------------------------------------
68 std::string cpPlugins::Interface::ProcessObject::
73 // Force upstream updates
74 for( unsigned int i = 0; i < this->m_Inputs.size( ) && r == ""; ++i )
76 Self* src = dynamic_cast< Self* >( this->m_Inputs[ i ]->GetSource( ) );
84 r = this->_GenerateData( );
86 // Return error description, if any
90 // -------------------------------------------------------------------------
91 void cpPlugins::Interface::ProcessObject::
94 for( unsigned int idx = 0; idx < this->m_Outputs.size( ); ++idx )
95 if( this->m_Outputs[ idx ].IsNotNull( ) )
96 this->m_Outputs[ idx ]->DisconnectPipeline( );
99 // -------------------------------------------------------------------------
100 bool cpPlugins::Interface::ProcessObject::
101 ExecConfigurationDialog( QWidget* parent )
105 #ifdef cpPlugins_Interface_QT4
107 Parameters parameters = this->m_DefaultParameters;
108 r = cpPlugins::Interface::ParametersQtDialog(
110 this->m_ClassName + std::string( " basic configuration" ),
114 this->m_Parameters = parameters;
116 #endif // cpPlugins_Interface_QT4
121 // -------------------------------------------------------------------------
122 cpPlugins::Interface::ProcessObject::
126 this->m_ClassName = "cpPlugins::Interface::ProcessObject";
127 this->m_ClassCategory = "BasicObject";
130 // -------------------------------------------------------------------------
131 cpPlugins::Interface::ProcessObject::