1 #include <cpPlugins/Interface/ProcessObject.h>
3 // -------------------------------------------------------------------------
4 const cpPlugins::Interface::Parameters&
5 cpPlugins::Interface::ProcessObject::
6 GetDefaultParameters( ) const
8 return( this->m_DefaultParameters );
11 // -------------------------------------------------------------------------
12 void cpPlugins::Interface::ProcessObject::
13 SetParameters( const cpPlugins::Interface::Parameters& params )
15 this->m_Parameters = params;
19 // -------------------------------------------------------------------------
20 unsigned int cpPlugins::Interface::ProcessObject::
21 GetNumberOfInputs( ) const
23 return( this->m_Inputs.size( ) );
26 // -------------------------------------------------------------------------
27 unsigned int cpPlugins::Interface::ProcessObject::
28 GetNumberOfOutputs( ) const
30 return( this->m_Outputs.size( ) );
33 // -------------------------------------------------------------------------
34 void cpPlugins::Interface::ProcessObject::
35 SetNumberOfInputs( unsigned int n )
37 this->m_Inputs.clear( );
38 this->m_Inputs.resize( n );
42 // -------------------------------------------------------------------------
43 void cpPlugins::Interface::ProcessObject::
44 SetNumberOfOutputs( unsigned int n )
46 this->m_Outputs.clear( );
47 this->m_Outputs.resize( n );
51 // -------------------------------------------------------------------------
52 void cpPlugins::Interface::ProcessObject::
53 SetInput( unsigned int idx, cpPlugins::Interface::DataObject* dobj )
55 if( idx < this->m_Inputs.size( ) )
57 this->m_Inputs[ idx ] = dobj;
63 // -------------------------------------------------------------------------
64 cpPlugins::Interface::DataObject* cpPlugins::Interface::ProcessObject::
65 GetOutput( unsigned int idx )
67 if( idx < this->m_Outputs.size( ) )
68 return( this->m_Outputs[ idx ] );
73 // -------------------------------------------------------------------------
74 std::string cpPlugins::Interface::ProcessObject::
79 // Force upstream updates
80 for( unsigned int i = 0; i < this->m_Inputs.size( ) && r == ""; ++i )
82 Self* src = dynamic_cast< Self* >( this->m_Inputs[ i ]->GetSource( ) );
90 r = this->_GenerateData( );
92 // Return error description, if any
96 // -------------------------------------------------------------------------
97 void cpPlugins::Interface::ProcessObject::
100 for( unsigned int idx = 0; idx < this->m_Outputs.size( ); ++idx )
101 if( this->m_Outputs[ idx ].IsNotNull( ) )
102 this->m_Outputs[ idx ]->DisconnectPipeline( );
105 // -------------------------------------------------------------------------
106 cpPlugins::Interface::ProcessObject::
110 this->m_ClassName = "cpPlugins::Interface::ProcessObject";
111 this->m_ClassCategory = "BasicObject";
114 // -------------------------------------------------------------------------
115 cpPlugins::Interface::ProcessObject::