From 0d184ef7119178103610ad9e9fab83760cb89e06 Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Fri, 5 Feb 2016 17:37:25 -0500 Subject: [PATCH] ... --- lib/cpExtensions/DataStructures/Graph.h | 48 ++++-- lib/cpExtensions/DataStructures/Graph.hxx | 138 ------------------ lib/cpPlugins/Interface/DataObject.cxx | 22 ++- lib/cpPlugins/Interface/DataObject.h | 4 +- lib/cpPlugins/Interface/Object.cxx | 44 +++++- lib/cpPlugins/Interface/Object.h | 23 +-- lib/cpPlugins/Interface/ProcessObject.cxx | 18 +-- lib/cpPlugins/Interface/ProcessObject.h | 2 +- lib/cpPlugins/Interface/ProcessObjectPort.cxx | 107 ++++++++++++-- lib/cpPlugins/Interface/ProcessObjectPort.h | 47 +++++- 10 files changed, 241 insertions(+), 212 deletions(-) diff --git a/lib/cpExtensions/DataStructures/Graph.h b/lib/cpExtensions/DataStructures/Graph.h index db07f2e..75bdd68 100644 --- a/lib/cpExtensions/DataStructures/Graph.h +++ b/lib/cpExtensions/DataStructures/Graph.h @@ -56,10 +56,14 @@ namespace cpExtensions * vIt->second; --> this is the vertex's value <-- * } */ - typename TVertices::iterator BeginVertices( ); - typename TVertices::iterator EndVertices( ); - typename TVertices::const_iterator BeginVertices( ) const; - typename TVertices::const_iterator EndVertices( ) const; + inline typename TVertices::iterator BeginVertices( ) + { return( this->m_Vertices.begin( ) ); } + inline typename TVertices::iterator EndVertices( ) + { return( this->m_Vertices.end( ) ); } + inline typename TVertices::const_iterator BeginVertices( ) const + { return( this->m_Vertices.begin( ) ); } + inline typename TVertices::const_iterator EndVertices( ) const + { return( this->m_Vertices.end( ) ); } /*! \brief Iterators over edges. * These allow you to iterate over all of graph's edges. @@ -82,10 +86,14 @@ namespace cpExtensions * } * } */ - typename TMatrix::iterator BeginEdgesRows( ); - typename TMatrix::iterator EndEdgetsRows( ); - typename TMatrix::const_iterator BeginEdgesRows( ) const; - typename TMatrix::const_iterator EndEdgesRows( ) const; + inline typename TMatrix::iterator BeginEdgesRows( ) + { return( this->m_Matrix.begin( ) ); } + inline typename TMatrix::iterator EndEdgetsRows( ) + { return( this->m_Matrix.end( ) ); } + inline typename TMatrix::const_iterator BeginEdgesRows( ) const + { return( this->m_Matrix.begin( ) ); } + inline typename TMatrix::const_iterator EndEdgesRows( ) const + { return( this->m_Matrix.end( ) ); } /*! \brief Clear all vertices and edges. */ @@ -93,27 +101,35 @@ namespace cpExtensions /*! \brief Clear all edges. */ - void ClearEdges( ); + inline void ClearEdges( ) + { this->m_Matrix.clear( ); } /*! \brief Vertex manipulation methods. * Names are self-explanatory. */ - bool HasVertexIndex( const I& index ) const; - void SetVertex( const I& index, V& vertex ); + inline bool HasVertexIndex( const I& i ) const + { return( this->m_Vertices.find( i ) != this->m_Vertices.end( ) ); } + inline void SetVertex( const I& index, V& vertex ) + { this->m_Vertices[ index ] = vertex; } + inline V& GetVertex( const I& index ) + { return( this->m_Vertices[ index ] ); } + inline const V& GetVertex( const I& index ) const + { return( this->m_Vertices[ index ] ); } bool RenameVertex( const I& old_index, const I& new_index ); void RemoveVertex( const I& index ); - V& GetVertex( const I& index ); - const V& GetVertex( const I& index ) const; /*! \brief Edge manipulation methods. * Names are self-explanatory. */ + inline void AddEdge( const I& orig, const I& dest, const C& cost ) + { this->m_Matrix[ orig ][ dest ].push_back( cost ); } + inline TEdges& GetEdges( const I& orig, const I& dest ) + { return( this->m_Matrix[ orig ][ dest ] ); } + inline const TEdges& GetEdges( const I& orig, const I& dest ) const + { return( this->m_Matrix[ orig ][ dest ] ); } bool HasEdge( const I& orig, const I& dest ) const; - void AddEdge( const I& orig, const I& dest, const C& cost ); void RemoveEdge( const I& orig, const I& dest, const C& cost ); void RemoveEdges( const I& orig, const I& dest ); - TEdges& GetEdges( const I& orig, const I& dest ); - const TEdges& GetEdges( const I& orig, const I& dest ) const; /*! \brief Returns graph's sinks. * diff --git a/lib/cpExtensions/DataStructures/Graph.hxx b/lib/cpExtensions/DataStructures/Graph.hxx index 7ca6d88..b7b045c 100644 --- a/lib/cpExtensions/DataStructures/Graph.hxx +++ b/lib/cpExtensions/DataStructures/Graph.hxx @@ -1,78 +1,6 @@ #ifndef __CPEXTENSIONS__DATASTRUCTURES__GRAPH__HXX__ #define __CPEXTENSIONS__DATASTRUCTURES__GRAPH__HXX__ -// ------------------------------------------------------------------------- -template< class V, class C, class I > -typename cpExtensions::DataStructures::Graph< V, C, I >:: -TVertices::iterator cpExtensions::DataStructures::Graph< V, C, I >:: -BeginVertices( ) -{ - return( this->m_Vertices.begin( ) ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -typename cpExtensions::DataStructures::Graph< V, C, I >:: -TVertices::iterator cpExtensions::DataStructures::Graph< V, C, I >:: -EndVertices( ) -{ - return( this->m_Vertices.end( ) ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -typename cpExtensions::DataStructures::Graph< V, C, I >:: -TVertices::const_iterator cpExtensions::DataStructures::Graph< V, C, I >:: -BeginVertices( ) const -{ - return( this->m_Vertices.begin( ) ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -typename cpExtensions::DataStructures::Graph< V, C, I >:: -TVertices::const_iterator cpExtensions::DataStructures::Graph< V, C, I >:: -EndVertices( ) const -{ - return( this->m_Vertices.end( ) ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -typename cpExtensions::DataStructures::Graph< V, C, I >:: -TMatrix::iterator cpExtensions::DataStructures::Graph< V, C, I >:: -BeginEdgesRows( ) -{ - return( this->m_Matrix.begin( ) ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -typename cpExtensions::DataStructures::Graph< V, C, I >:: -TMatrix::iterator cpExtensions::DataStructures::Graph< V, C, I >:: -EndEdgetsRows( ) -{ - return( this->m_Matrix.end( ) ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -typename cpExtensions::DataStructures::Graph< V, C, I >:: -TMatrix::const_iterator cpExtensions::DataStructures::Graph< V, C, I >:: -BeginEdgesRows( ) const -{ - return( this->m_Matrix.begin( ) ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -typename cpExtensions::DataStructures::Graph< V, C, I >:: -TMatrix::const_iterator cpExtensions::DataStructures::Graph< V, C, I >:: -EndEdgesRows( ) const -{ - return( this->m_Matrix.end( ) ); -} - // ------------------------------------------------------------------------- template< class V, class C, class I > void cpExtensions::DataStructures::Graph< V, C, I >:: @@ -82,30 +10,6 @@ Clear( ) this->m_Matrix.clear( ); } -// ------------------------------------------------------------------------- -template< class V, class C, class I > -void cpExtensions::DataStructures::Graph< V, C, I >:: -ClearEdges( ) -{ - this->m_Matrix.clear( ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -bool cpExtensions::DataStructures::Graph< V, C, I >:: -HasVertexIndex( const I& index ) const -{ - return( this->m_Vertices.find( index ) != this->m_Vertices.end( ) ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -void cpExtensions::DataStructures::Graph< V, C, I >:: -SetVertex( const I& index, V& vertex ) -{ - this->m_Vertices[ index ] = vertex; -} - // ------------------------------------------------------------------------- template< class V, class C, class I > bool cpExtensions::DataStructures::Graph< V, C, I >:: @@ -206,22 +110,6 @@ RemoveVertex( const I& index ) return( false ); } -// ------------------------------------------------------------------------- -template< class V, class C, class I > -V& cpExtensions::DataStructures::Graph< V, C, I >:: -GetVertex( const I& index ) -{ - return( this->m_Vertices[ index ] ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -const V& cpExtensions::DataStructures::Graph< V, C, I >:: -GetVertex( const I& index ) const -{ - return( this->m_Vertices[ index ] ); -} - // ------------------------------------------------------------------------- template< class V, class C, class I > bool cpExtensions::DataStructures::Graph< V, C, I >:: @@ -234,14 +122,6 @@ HasEdge( const I& orig, const I& dest ) const return( false ); } -// ------------------------------------------------------------------------- -template< class V, class C, class I > -void cpExtensions::DataStructures::Graph< V, C, I >:: -AddEdge( const I& orig, const I& dest, const C& cost ) -{ - this->m_Matrix[ orig ][ dest ].push_back( cost ); -} - // ------------------------------------------------------------------------- template< class V, class C, class I > void cpExtensions::DataStructures::Graph< V, C, I >:: @@ -293,24 +173,6 @@ RemoveEdges( const I& orig, const I& dest ) } -// ------------------------------------------------------------------------- -template< class V, class C, class I > -typename cpExtensions::DataStructures::Graph< V, C, I >:: -TEdges& cpExtensions::DataStructures::Graph< V, C, I >:: -GetEdges( const I& orig, const I& dest ) -{ - return( this->m_Matrix[ orig ][ dest ] ); -} - -// ------------------------------------------------------------------------- -template< class V, class C, class I > -const typename cpExtensions::DataStructures::Graph< V, C, I >:: -TEdges& cpExtensions::DataStructures::Graph< V, C, I >:: -GetEdges( const I& orig, const I& dest ) const -{ - return( this->m_Matrix[ orig ][ dest ] ); -} - // ------------------------------------------------------------------------- template< class V, class C, class I > std::set< I > cpExtensions::DataStructures::Graph< V, C, I >:: diff --git a/lib/cpPlugins/Interface/DataObject.cxx b/lib/cpPlugins/Interface/DataObject.cxx index 2acc980..489392d 100644 --- a/lib/cpPlugins/Interface/DataObject.cxx +++ b/lib/cpPlugins/Interface/DataObject.cxx @@ -9,23 +9,26 @@ cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject:: GetSource( ) { - return( this->m_Source ); + auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); + return( ptr->GetPointer( ) ); } // ------------------------------------------------------------------------- const cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject:: GetSource( ) const { - return( this->m_Source ); + auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); + return( ptr->GetPointer( ) ); } // ------------------------------------------------------------------------- void cpPlugins::Interface::DataObject:: SetSource( cpPlugins::Interface::ProcessObject* src ) { - if( this->m_Source != src ) + auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); + if( ptr->GetPointer( ) != src ) { - this->m_Source = src; + *ptr = src; this->Modified( ); } // fi @@ -33,7 +36,7 @@ SetSource( cpPlugins::Interface::ProcessObject* src ) // ------------------------------------------------------------------------- void cpPlugins::Interface::DataObject:: -DisconnectPipeline( ) +DisconnectFromPipeline( ) { // Disconnect input pipelines (ITK) itk::DataObject* itk_obj = this->GetITK< itk::DataObject >( ); @@ -60,22 +63,25 @@ DisconnectPipeline( ) } // fi // Unbind source - this->m_Source = NULL; + auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); + *ptr = NULL; this->Modified( ); } // ------------------------------------------------------------------------- cpPlugins::Interface::DataObject:: DataObject( ) - : Superclass( ), - m_Source( NULL ) + : Superclass( ) { + this->m_Source = new ProcessObject::Pointer( ); } // ------------------------------------------------------------------------- cpPlugins::Interface::DataObject:: ~DataObject( ) { + auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); + delete ptr; } // eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/DataObject.h b/lib/cpPlugins/Interface/DataObject.h index e2d79ff..9293376 100644 --- a/lib/cpPlugins/Interface/DataObject.h +++ b/lib/cpPlugins/Interface/DataObject.h @@ -31,7 +31,7 @@ namespace cpPlugins const ProcessObject* GetSource( ) const; void SetSource( ProcessObject* src ); - void DisconnectPipeline( ); + void DisconnectFromPipeline( ); protected: DataObject( ); @@ -43,7 +43,7 @@ namespace cpPlugins Self& operator=( const Self& ); protected: - ProcessObject* m_Source; + void* m_Source; }; } // ecapseman diff --git a/lib/cpPlugins/Interface/Object.cxx b/lib/cpPlugins/Interface/Object.cxx index 3e25916..bef169d 100644 --- a/lib/cpPlugins/Interface/Object.cxx +++ b/lib/cpPlugins/Interface/Object.cxx @@ -3,6 +3,32 @@ #include #include +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Object:: +SetViewCoords( float x, float y ) +{ + this->m_ViewX = x; + this->m_ViewY = y; + // WARNING: do not call "this->Modified( )" -> It could lead to a + // re-execution of all pipeline +} + +#ifdef cpPlugins_Interface_QT4 +// ------------------------------------------------------------------------- +void cpPlugins::Interface::Object:: +SetViewCoords( const QPointF& coords ) +{ + this->SetViewCoords( coords.x( ), coords.y( ) ); +} + +// ------------------------------------------------------------------------- +QPointF cpPlugins::Interface::Object:: +GetViewCoords( ) const +{ + return( QPointF( this->m_ViewX, this->m_ViewY ) ); +} +#endif // cpPlugins_Interface_QT4 + // ------------------------------------------------------------------------- void cpPlugins::Interface::Object:: Modified( ) const @@ -15,11 +41,20 @@ Modified( ) const } // ------------------------------------------------------------------------- -void cpPlugins::Interface::Object:: -SetViewCoords( float x, float y ) +itk::ModifiedTimeType cpPlugins::Interface::Object:: +GetMTime( ) const { - this->SetViewX( x ); - this->SetViewY( y ); + unsigned long tTime = this->Superclass::GetMTime( ); + unsigned long iTime = tTime; + unsigned long vTime = tTime; + + const itk::Object* i = this->GetITK< itk::Object >( ); + vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) ); + if( i != NULL ) iTime = i->GetMTime( ); + if( v != NULL ) vTime = v->GetMTime( ); + + tTime = ( tTime < iTime )? tTime: iTime; + return( ( itk::ModifiedTimeType )( ( tTime < vTime )? tTime: vTime ) ); } // ------------------------------------------------------------------------- @@ -52,7 +87,6 @@ Object( ) : Superclass( ), m_ITKObject( NULL ), m_VTKObject( NULL ), - m_Name( "" ), m_ViewX( float( 0 ) ), m_ViewY( float( 0 ) ) { diff --git a/lib/cpPlugins/Interface/Object.h b/lib/cpPlugins/Interface/Object.h index dd7d9b6..34810d5 100644 --- a/lib/cpPlugins/Interface/Object.h +++ b/lib/cpPlugins/Interface/Object.h @@ -11,6 +11,10 @@ #include #include +#ifdef cpPlugins_Interface_QT4 +#include +#endif // cpPlugins_Interface_QT4 + namespace cpPlugins { namespace Interface @@ -31,20 +35,22 @@ namespace cpPlugins itkTypeMacro( Object, itkObject ); cpPlugins_Id_Macro( Object, BaseObject ); - itkGetStringMacro( Name ); itkGetConstMacro( ViewX, float ); itkGetConstMacro( ViewY, float ); - itkSetStringMacro( Name ); - itkSetMacro( ViewX, float ); - itkSetMacro( ViewY, float ); - public: - virtual void Modified( ) const; void SetViewCoords( float x, float y ); - void SetITK( itk::LightObject* o ); - void SetVTK( vtkObjectBase* o ); +#ifdef cpPlugins_Interface_QT4 + void SetViewCoords( const QPointF& coords ); + QPointF GetViewCoords( ) const; +#endif // cpPlugins_Interface_QT4 + + virtual void Modified( ) const; + virtual itk::ModifiedTimeType GetMTime( ) const; + + virtual void SetITK( itk::LightObject* o ); + virtual void SetVTK( vtkObjectBase* o ); template< class T > inline T* GetITK( ); @@ -70,7 +76,6 @@ namespace cpPlugins protected: itk::LightObject::Pointer m_ITKObject; vtkSmartPointer< vtkObjectBase > m_VTKObject; - std::string m_Name; float m_ViewX; float m_ViewY; diff --git a/lib/cpPlugins/Interface/ProcessObject.cxx b/lib/cpPlugins/Interface/ProcessObject.cxx index 17fe21b..f012f57 100644 --- a/lib/cpPlugins/Interface/ProcessObject.cxx +++ b/lib/cpPlugins/Interface/ProcessObject.cxx @@ -124,16 +124,7 @@ GetMTime( ) const { auto params_time = this->m_Parameters->GetMTime( ); auto filter_time = this->Superclass::GetMTime( ); - auto ipobj = this->GetITK< itk::ProcessObject >( ); - if( ipobj == NULL ) - { - auto vpobj = this->GetVTK< vtkAlgorithm >( ); - if( vpobj != NULL ) - filter_time = ( const_cast< vtkAlgorithm* >( vpobj ) )->GetMTime( ); - } - else - filter_time = ipobj->GetMTime( ); - return( ( params_time < filter_time )? filter_time: params_time ); + return( ( params_time < filter_time )? params_time: filter_time ); } // ------------------------------------------------------------------------- @@ -143,7 +134,7 @@ Update( ) std::string r = ""; // Force upstream updates - _TDataContainer::iterator i = this->m_Inputs.begin( ); + auto i = this->m_Inputs.begin( ); bool need_to_update = false; for( ; i != this->m_Inputs.end( ) && r == ""; ++i ) { @@ -156,9 +147,8 @@ Update( ) r = src->Update( ); } // fi - } - else - r = "cpPlugins::Interface::ProcessObject: No input connected."; + + } // fi } // rof diff --git a/lib/cpPlugins/Interface/ProcessObject.h b/lib/cpPlugins/Interface/ProcessObject.h index 862da18..e99e8fc 100644 --- a/lib/cpPlugins/Interface/ProcessObject.h +++ b/lib/cpPlugins/Interface/ProcessObject.h @@ -87,7 +87,7 @@ namespace cpPlugins ProcessObject( ); virtual ~ProcessObject( ); - void _AddInput( const std::string& name ); + void _AddInput( const std::string& name, bool required ); template< class O > inline void _AddOutput( const std::string& name ); template< class F > diff --git a/lib/cpPlugins/Interface/ProcessObjectPort.cxx b/lib/cpPlugins/Interface/ProcessObjectPort.cxx index cec8fac..6dd0282 100644 --- a/lib/cpPlugins/Interface/ProcessObjectPort.cxx +++ b/lib/cpPlugins/Interface/ProcessObjectPort.cxx @@ -7,20 +7,6 @@ ProcessObjectPort( ) this->m_Data = NULL; } -// ------------------------------------------------------------------------- -cpPlugins::Interface::ProcessObjectPort:: -ProcessObjectPort( DataObject* obj ) -{ - this->m_Data = obj; -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::ProcessObjectPort:: -ProcessObjectPort( const Self& other ) -{ - this->m_Data = other.m_Data.GetPointer( ); -} - // ------------------------------------------------------------------------- cpPlugins::Interface::ProcessObjectPort:: ~ProcessObjectPort( ) @@ -52,4 +38,97 @@ IsValid( ) const return( this->m_Data.IsNotNull( ) ); } +// ------------------------------------------------------------------------- +cpPlugins::Interface::InputProcessObjectPort:: +InputProcessObjectPort( bool required ) + : Superclass( ) +{ +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::InputProcessObjectPort:: +~InputProcessObjectPort( ) +{ +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::InputProcessObjectPort:: +Self& cpPlugins::Interface::InputProcessObjectPort:: +operator=( DataObject* obj ) +{ + this->Superclass::operator=( obj ); + return( *this ); +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::InputProcessObjectPort:: +Self& cpPlugins::Interface::InputProcessObjectPort:: +operator=( const Superclass& other ) +{ + auto i = dynamic_cast< const InputProcessObjectPort* >( &other ); + this->Superclass::operator=( other ); + if( i != NULL ) + this->m_Required = i->m_Required; + return( *this ); +} + +// ------------------------------------------------------------------------- +bool cpPlugins::Interface::InputProcessObjectPort:: +IsRequired( ) const +{ + return( this->m_Required ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::InputProcessObjectPort:: +RequiredOn( ) +{ + this->SetRequired( true ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::InputProcessObjectPort:: +RequiredOff( ) +{ + this->SetRequired( false ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::Interface::InputProcessObjectPort:: +SetRequired( bool required ) +{ + this->m_Required = required; +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::OutputProcessObjectPort:: +OutputProcessObjectPort( ) + : Superclass( ) +{ +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::OutputProcessObjectPort:: +~OutputProcessObjectPort( ) +{ +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::OutputProcessObjectPort:: +Self& cpPlugins::Interface::OutputProcessObjectPort:: +operator=( DataObject* obj ) +{ + this->Superclass::operator=( obj ); + return( *this ); +} + +// ------------------------------------------------------------------------- +cpPlugins::Interface::OutputProcessObjectPort:: +Self& cpPlugins::Interface::OutputProcessObjectPort:: +operator=( const Superclass& other ) +{ + this->Superclass::operator=( other ); + return( *this ); +} + // eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ProcessObjectPort.h b/lib/cpPlugins/Interface/ProcessObjectPort.h index 393fd53..67186e5 100644 --- a/lib/cpPlugins/Interface/ProcessObjectPort.h +++ b/lib/cpPlugins/Interface/ProcessObjectPort.h @@ -16,8 +16,6 @@ namespace cpPlugins public: ProcessObjectPort( ); - ProcessObjectPort( DataObject* obj ); - ProcessObjectPort( const Self& other ); virtual ~ProcessObjectPort( ); Self& operator=( DataObject* obj ); Self& operator=( const Self& other ); @@ -25,16 +23,55 @@ namespace cpPlugins bool IsValid( ) const; // This could be seen as a pointer to DataObject's - DataObject* GetPointer( ) + inline DataObject* GetPointer( ) { return( this->m_Data.GetPointer( ) ); } - const DataObject* GetPointer( ) const + inline const DataObject* GetPointer( ) const { return( this->m_Data.GetPointer( ) ); } - DataObject* operator->( ) const + inline DataObject* operator->( ) const { return( this->m_Data.GetPointer( ) ); } protected: cpPlugins::Interface::DataObject::Pointer m_Data; + }; + + /** + */ + class cpPlugins_Interface_EXPORT InputProcessObjectPort + : public ProcessObjectPort + { + public: + typedef InputProcessObjectPort Self; + typedef ProcessObjectPort Superclass; + + public: + InputProcessObjectPort( bool required = false ); + virtual ~InputProcessObjectPort( ); + Self& operator=( DataObject* obj ); + Self& operator=( const Superclass& other ); + + bool IsRequired( ) const; + void RequiredOn( ); + void RequiredOff( ); + void SetRequired( bool required ); + protected: + bool m_Required; + }; + + /** + */ + class cpPlugins_Interface_EXPORT OutputProcessObjectPort + : public ProcessObjectPort + { + public: + typedef OutputProcessObjectPort Self; + typedef ProcessObjectPort Superclass; + + public: + OutputProcessObjectPort( ); + virtual ~OutputProcessObjectPort( ); + Self& operator=( DataObject* obj ); + Self& operator=( const Superclass& other ); }; } // ecapseman -- 2.47.1