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( ) )
+ 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;
+ this->Modified( );
} // 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( );
+ typename F::Pointer filter_ptr = F::New( );
+ this->m_ITKObject = filter_ptr;
this->m_VTKObject = NULL;
+ filter = filter_ptr.GetPointer( );
+ this->Modified( );
} // 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;
+ vtkSmartPointer< F > filter_ptr = vtkSmartPointer< F >::New( );
this->m_ITKObject = NULL;
+ this->m_VTKObject = filter_ptr;
+ filter = filter_ptr.GetPointer( );
+ this->Modified( );
} // fi
return( filter );