return( i->second );
}
+// -------------------------------------------------------------------------
+cpPlugins::Interface::
+DataObject* cpPlugins::Interface::ProcessObject::
+GetInputData( const std::string& id )
+{
+ auto i = this->m_Inputs.find( id );
+ if( i != this->m_Inputs.end( ) )
+ return( dynamic_cast< DataObject* >( i->second.GetPointer( ) ) );
+ else
+ return( NULL );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Interface::
+DataObject* cpPlugins::Interface::ProcessObject::
+GetInputData( const std::string& id ) const
+{
+ auto i = this->m_Inputs.find( id );
+ if( i != this->m_Inputs.end( ) )
+ return( dynamic_cast< const DataObject* >( i->second.GetPointer( ) ) );
+ else
+ return( NULL );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::
+DataObject* cpPlugins::Interface::ProcessObject::
+GetOutputData( const std::string& id )
+{
+ auto i = this->m_Outputs.find( id );
+ if( i != this->m_Outputs.end( ) )
+ return( dynamic_cast< DataObject* >( i->second.GetPointer( ) ) );
+ else
+ return( NULL );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Interface::
+DataObject* cpPlugins::Interface::ProcessObject::
+GetOutputData( const std::string& id ) const
+{
+ auto i = this->m_Outputs.find( id );
+ if( i != this->m_Outputs.end( ) )
+ return( dynamic_cast< const DataObject* >( i->second.GetPointer( ) ) );
+ else
+ return( NULL );
+}
+
// -------------------------------------------------------------------------
bool cpPlugins::Interface::ProcessObject::
SetInput( const std::string& id, const OutputProcessObjectPort& port )
OutputProcessObjectPort& GetOutput( const std::string& id );
const OutputProcessObjectPort& GetOutput( const std::string& id ) const;
- template< class T >
- inline T* GetInputData( const std::string& id );
- template< class T >
- inline const T* GetInputData( const std::string& id ) const;
- template< class T >
- inline T* GetOutputData( const std::string& id );
- template< class T >
- inline const T* GetOutputData( const std::string& id ) const;
+ /* TODO
+ template< class T >
+ inline T* GetInputData( const std::string& id );
+ template< class T >
+ inline const T* GetInputData( const std::string& id ) const;
+ template< class T >
+ inline T* GetOutputData( const std::string& id );
+ template< class T >
+ inline const T* GetOutputData( const std::string& id ) const;
+ */
+ DataObject* GetInputData( const std::string& id );
+ const DataObject* GetInputData( const std::string& id ) const;
+ DataObject* GetOutputData( const std::string& id );
+ const DataObject* GetOutputData( const std::string& id ) const;
bool SetInput(
const std::string& id, const OutputProcessObjectPort& port
#define __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__
// -------------------------------------------------------------------------
+/* TODO
template< class T >
T* cpPlugins::Interface::ProcessObject::
GetInputData( const std::string& id )
else
return( NULL );
}
+*/
// -------------------------------------------------------------------------
template< class O >
Self& cpPlugins::Interface::ProcessObjectPort::
operator=( const Self& other )
{
- this->m_Data = other.m_Data.GetPointer( );
+ this->m_Data = other.m_Data;
return( *this );
}
bool cpPlugins::Interface::ProcessObjectPort::
IsValid( ) const
{
- return( this->m_Data.IsNotNull( ) );
+ return( this->m_Data.GetPointer( ) != NULL );
}
// -------------------------------------------------------------------------
inline DataObject* operator->( ) const
{ return( this->m_Data.GetPointer( ) ); }
+ inline void SetPointer( DataObject* ptr )
+ { this->m_Data = ptr; }
+
protected:
cpPlugins::Interface::DataObject::Pointer m_Data;
};
#include "InputDataReproducer.h"
+#include <cpPlugins/Interface/Image.h>
+#include <cpPlugins/Interface/PointList.h>
+
// -------------------------------------------------------------------------
cpPlugins::BasicFilters::InputDataReproducer::
InputDataReproducer( )
auto o = this->m_Outputs.find( "Output" );
if( i == this->m_Inputs.end( ) || o == this->m_Outputs.end( ) )
return( "InputDataReproducer: No input/output ports." );
-
- // Connect output
- o->second = i->second;
+ o->second->SetITK( i->second->GetITK< itk::LightObject >( ) );
+ o->second->SetVTK( i->second->GetVTK< vtkObjectBase >( ) );
return( "" );
}