// Delete objects
delete this->m_UI;
delete this->m_MPR;
- if( this->m_InputImage != NULL ) delete this->m_InputImage;
}
// -------------------------------------------------------------------------
if( !( dialog.exec( ) ) )
return;
- if( this->m_InputImage != NULL )
- delete this->m_InputImage;
this->m_InputImage = NULL;
unsigned int nFiles = dialog.selectedFiles( ).size( );
if( nFiles == 1 )
{
std::string fname = dialog.selectedFiles( ).at( 0 ).toStdString( );
- TPlugin* reader =
- dynamic_cast< TPlugin* >(
- this->m_Plugins.CreateObject( this->m_BaseClasses[ "ImageReader" ] )
+ TPlugin::Pointer reader =
+ this->m_Plugins.CreateProcessObject(
+ this->m_BaseClasses[ "ImageReader" ]
);
TParameters reader_params = reader->GetDefaultParameters( );
tr( "Error reading single image" ),
tr( err.c_str( ) )
);
- delete reader;
}
else if( nFiles > 1 )
{
} // fi
- if( this->m_InputImage != NULL )
+ if( this->m_InputImage.IsNotNull( ) )
this->m_MPR->SetImage( this->m_InputImage->GetVTKImageData( ) );
}
TStringMap m_BaseClasses;
// Real data
- TPluginImage* m_InputImage;
+ TPluginImage::Pointer m_InputImage;
// Visualization stuff
TMPR* m_MPR;
TClasses::const_iterator cIt = plugins.GetClasses( ).begin( );
TClasses::const_iterator end_cIt = plugins.GetClasses( ).end( );
for( ; cIt != end_cIt; ++cIt )
- std::cout << "\t:= " << cIt->first << std::endl;
+ std::cout << " := " << cIt->first << std::endl;
std::cout << "---------------------------------------------" << std::endl;
return( 0 );
// Create objects
typedef cpPlugins::Interface::ProcessObject TProcessObject;
typedef TProcessObject::TParameters TParameters;
- cpPlugins::Interface::ProcessObject* reader;
+ cpPlugins::Interface::ProcessObject::Pointer reader;
- reader =
- dynamic_cast< TProcessObject* >(
- plugins.CreateObject( "cpPlugins::Plugins::ImageReader" )
- );
- if( reader == NULL )
+ reader = plugins.CreateProcessObject( "cpPlugins::Plugins::ImageReader" );
+ if( reader.IsNull( ) )
{
std::cerr << "No suitable reader found in plugins." << std::endl;
return( 1 );
window->Render( );
interactor->Start( );
- // Free memory
- delete reader;
-
return( 0 );
}
TInterface& plugins, const std::string& fname, TDataObject* image
)
{
- cpPlugins::Interface::ProcessObject* writer;
- writer =
- dynamic_cast< TProcessObject* >(
- plugins.CreateObject( "cpPlugins::Plugins::ImageWriter" )
- );
- if( writer == NULL )
+ TProcessObject::Pointer writer;
+ writer = plugins.CreateProcessObject( "cpPlugins::Plugins::ImageWriter" );
+ if( writer.IsNull( ) )
{
std::cerr << "No suitable writer found in plugins." << std::endl;
return;
std::string msg = writer->Update( );
if( msg != "" )
std::cerr << "ERROR: " << msg << std::endl;
- delete writer;
}
// -------------------------------------------------------------------------
plugins.Load( plugins_file );
// Create objects
- cpPlugins::Interface::ProcessObject* reader;
- cpPlugins::Interface::ProcessObject* filter;
-
- reader =
- dynamic_cast< TProcessObject* >(
- plugins.CreateObject( "cpPlugins::Plugins::ImageReader" )
- );
- if( reader == NULL )
+ TProcessObject::Pointer reader;
+ TProcessObject::Pointer filter;
+
+ reader = plugins.CreateProcessObject( "cpPlugins::Plugins::ImageReader" );
+ if( reader.IsNull( ) )
{
std::cerr << "No suitable reader found in plugins." << std::endl;
return( 1 );
} // fi
- filter =
- dynamic_cast< TProcessObject* >(
- plugins.CreateObject( "cpPlugins::Plugins::RGBImageToHSVChannelsFilter" )
- );
- if( filter == NULL )
+ filter = plugins.CreateProcessObject( "cpPlugins::Plugins::RGBImageToHSVChannelsFilter" );
+ if( filter.IsNull( ) )
{
std::cerr << "No suitable filter found in plugins." << std::endl;
return( 1 );
SaveImage( plugins, output_saturation_image_file, filter->GetOutput( 1 ) );
SaveImage( plugins, output_value_image_file, filter->GetOutput( 2 ) );
- // Free memory
- delete filter;
- delete reader;
-
return( 0 );
}
// Create objects
typedef cpPlugins::Interface::ProcessObject TProcessObject;
typedef TProcessObject::TParameters TParameters;
- cpPlugins::Interface::ProcessObject* reader;
- cpPlugins::Interface::ProcessObject* writer;
+ cpPlugins::Interface::ProcessObject::Pointer reader;
+ cpPlugins::Interface::ProcessObject::Pointer writer;
reader =
- dynamic_cast< TProcessObject* >(
- plugins.CreateObject( "cpPlugins::Plugins::ImageSeriesReader" )
- );
- if( reader == NULL )
+ plugins.CreateProcessObject( "cpPlugins::Plugins::ImageSeriesReader" );
+ if( reader.IsNull( ) )
{
std::cerr << "No suitable reader found in plugins." << std::endl;
return( 1 );
} // fi
- writer =
- dynamic_cast< TProcessObject* >(
- plugins.CreateObject( "cpPlugins::Plugins::ImageWriter" )
- );
- if( writer == NULL )
+ writer = plugins.CreateProcessObject( "cpPlugins::Plugins::ImageWriter" );
+ if( writer.IsNull( ) )
{
- delete reader;
std::cerr << "No suitable writer found in plugins." << std::endl;
return( 1 );
if( msg != "" )
std::cerr << "ERROR: " << msg << std::endl;
- // Free memory
- delete writer;
- delete reader;
-
return( 0 );
}
// Create objects
typedef cpPlugins::Interface::ProcessObject TProcessObject;
typedef TProcessObject::TParameters TParameters;
- cpPlugins::Interface::ProcessObject* reader;
+ cpPlugins::Interface::ProcessObject::Pointer reader;
- reader =
- dynamic_cast< TProcessObject* >(
- plugins.CreateObject( "cpPlugins::Plugins::MeshReader" )
- );
- if( reader == NULL )
+ reader = plugins.CreateProcessObject( "cpPlugins::Plugins::MeshReader" );
+ if( reader.IsNull( ) )
{
std::cerr << "No suitable reader found in plugins." << std::endl;
return( 1 );
if( msg != "" )
std::cerr << "ERROR: " << msg << std::endl;
- // Free memory
- delete reader;
-
return( 0 );
}
// Create objects
typedef cpPlugins::Interface::ProcessObject TProcessObject;
typedef TProcessObject::TParameters TParameters;
- cpPlugins::Interface::ProcessObject* reader;
- cpPlugins::Interface::ProcessObject* writer;
-
- reader =
- dynamic_cast< TProcessObject* >(
- plugins.CreateObject( "cpPlugins::Plugins::ImageReader" )
- );
- if( reader == NULL )
+ cpPlugins::Interface::ProcessObject::Pointer reader;
+ cpPlugins::Interface::ProcessObject::Pointer writer;
+
+ reader = plugins.CreateProcessObject( "cpPlugins::Plugins::ImageReader" );
+ if( reader.IsNull( ) )
{
std::cerr << "No suitable reader found in plugins." << std::endl;
return( 1 );
} // fi
- writer =
- dynamic_cast< TProcessObject* >(
- plugins.CreateObject( "cpPlugins::Plugins::ImageWriter" )
- );
- if( writer == NULL )
+ writer = plugins.CreateProcessObject( "cpPlugins::Plugins::ImageWriter" );
+ if( writer.IsNull( ) )
{
- delete reader;
std::cerr << "No suitable writer found in plugins." << std::endl;
return( 1 );
if( msg != "" )
std::cerr << "ERROR: " << msg << std::endl;
- // Free memory
- delete writer;
- delete reader;
-
return( 0 );
}
// Create objects
typedef cpPlugins::Interface::ProcessObject TProcessObject;
typedef TProcessObject::TParameters TParameters;
- cpPlugins::Interface::ProcessObject* reader;
+ cpPlugins::Interface::ProcessObject::Pointer reader;
- reader =
- dynamic_cast< TProcessObject* >(
- plugins.CreateObject( "cpPlugins::Plugins::MeshReader" )
- );
- if( reader == NULL )
+ reader = plugins.CreateProcessObject( "cpPlugins::Plugins::MeshReader" );
+ if( reader.IsNull( ) )
{
std::cerr << "No suitable reader found in plugins." << std::endl;
return( 1 );
window->Render( );
interactor->Start( );
- // Free memory
- delete reader;
-
return( 0 );
}
#include <cpPlugins/Interface/DataObject.h>
// -------------------------------------------------------------------------
-cpPlugins::Interface::DataObject::
-DataObject( )
- : Superclass( ),
- m_Source( NULL )
+std::string cpPlugins::Interface::DataObject::
+GetClassName( ) const
{
+ return( "cpPlugins::Interface::DataObject" );
}
// -------------------------------------------------------------------------
-cpPlugins::Interface::DataObject::
-~DataObject( )
+std::string cpPlugins::Interface::DataObject::
+GetClassType( ) const
{
+ return( "DataObject" );
}
// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::DataObject::
-GetClassName( ) const
+itk::DataObject* cpPlugins::Interface::DataObject::
+GetRealDataObject( ) const
{
- return( "cpPlugins::Interface::DataObject" );
+ return( this->m_RealDataObject );
}
// -------------------------------------------------------------------------
-itk::DataObject* cpPlugins::Interface::DataObject::
-GetDataObject( ) const
+void cpPlugins::Interface::DataObject::
+SetRealDataObject( itk::DataObject* dobj )
{
- return( this->m_DataObject );
+ this->m_RealDataObject = dobj;
}
// -------------------------------------------------------------------------
-void cpPlugins::Interface::DataObject::
-SetDataObject( itk::DataObject* dobj )
+cpPlugins::Interface::Object* cpPlugins::Interface::DataObject::
+GetSource( )
{
- this->m_DataObject = dobj;
+ return( this->m_Source );
}
// -------------------------------------------------------------------------
-cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject::
+const cpPlugins::Interface::Object* cpPlugins::Interface::DataObject::
GetSource( ) const
{
return( this->m_Source );
// -------------------------------------------------------------------------
void cpPlugins::Interface::DataObject::
-SetSource( cpPlugins::Interface::ProcessObject* src )
+SetSource( cpPlugins::Interface::Object* src )
{
this->m_Source = src;
}
void cpPlugins::Interface::DataObject::
DisconnectPipeline( )
{
- if( this->m_DataObject.IsNotNull( ) )
+ if( this->m_RealDataObject.IsNotNull( ) )
{
- this->m_DataObject->DisconnectPipeline( );
- this->m_Source = NULL;
+ this->m_RealDataObject->DisconnectPipeline( );
+ if( this->m_Source.IsNotNull( ) )
+ this->m_Source->Delete( );
+ this->Register( );
} // fi
}
+// -------------------------------------------------------------------------
+cpPlugins::Interface::DataObject::
+DataObject( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::DataObject::
+~DataObject( )
+{
+}
+
// eof - $RCSfile$
{
namespace Interface
{
- class ProcessObject;
-
/**
*/
class cpPlugins_Interface_EXPORT DataObject
: public Object
{
public:
- typedef DataObject Self;
- typedef Object Superclass;
+ typedef DataObject Self;
+ typedef Object Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
public:
- DataObject( );
- virtual ~DataObject( );
+ itkNewMacro( Self );
+ itkTypeMacro( DataObject, Object );
+ public:
virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
- itk::DataObject* GetDataObject( ) const;
- virtual void SetDataObject( itk::DataObject* dobj );
+ itk::DataObject* GetRealDataObject( ) const;
+ virtual void SetRealDataObject( itk::DataObject* dobj );
- ProcessObject* GetSource( ) const;
- void SetSource( ProcessObject* src );
+ Object* GetSource( );
+ const Object* GetSource( ) const;
+ void SetSource( Object* src );
void DisconnectPipeline( );
protected:
- itk::DataObject::Pointer m_DataObject;
- ProcessObject* m_Source;
+ DataObject( );
+ virtual ~DataObject( );
+
+ private:
+ // Purposely not implemented
+ DataObject( const Self& );
+ Self& operator=( const Self& );
+
+ protected:
+ itk::DataObject::Pointer m_RealDataObject;
+ Object::Pointer m_Source;
};
} // ecapseman
--- /dev/null
+#include <cpPlugins/Interface/FilterObject.h>
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::FilterObject::
+GetClassName( ) const
+{
+ return( "cpPlugins::Interface::FilterObject" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::FilterObject::
+GetClassType( ) const
+{
+ return( "FilterObject" );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::FilterObject::
+FilterObject( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::FilterObject::
+~FilterObject( )
+{
+}
+
+// eof - $RCSfile$
+#ifndef __CPPLUGINS__INTERFACE__FILTEROBJECT__H__
+#define __CPPLUGINS__INTERFACE__FILTEROBJECT__H__
+
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
+#include <cpPlugins/Interface/ProcessObject.h>
+
+namespace cpPlugins
+{
+ namespace Interface
+ {
+ /**
+ */
+ class cpPlugins_Interface_EXPORT FilterObject
+ : public ProcessObject
+ {
+ public:
+ typedef FilterObject Self;
+ typedef ProcessObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef Superclass::TParameter TParameter;
+ typedef Superclass::TParameters TParameters;
+
+ public:
+ itkTypeMacro( FilterObject, ProcessObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
+ FilterObject( );
+ virtual ~FilterObject( );
+
+ private:
+ // Purposely not implemented
+ FilterObject( const Self& );
+ Self& operator=( const Self& );
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#endif // __CPPLUGINS__INTERFACE__FILTEROBJECT__H__
+
+// eof - $RCSfile$
// -------------------------------------------------------------------------
#define cpPlugins_Image_RGB( p, d, o, f ) \
- if( \
- dynamic_cast< itk::Image< itk::RGBPixel< p >, d >* >( o ) != NULL \
- ) \
+ if( dynamic_cast< itk::Image< itk::RGBPixel< p >, d >* >( o ) != NULL ) \
this->f< itk::RGBPixel< p >, d >( )
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Image::
-Image( )
- : Superclass( ),
- m_VTKImageData( NULL )
-{
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Image::
-~Image( )
-{
-}
-
// -------------------------------------------------------------------------
std::string cpPlugins::Interface::Image::
GetClassName( ) const
// -------------------------------------------------------------------------
void cpPlugins::Interface::Image::
-SetDataObject( itk::DataObject* dobj )
+SetRealDataObject( itk::DataObject* dobj )
{
- this->Superclass::SetDataObject( dobj );
-
- // WARNING: Only 2 and 3 dimensions at this moment
- cpPlugins_Image_Dimension( 2, dobj, _ConnectToVTK_0 );
- else cpPlugins_Image_Dimension( 3, dobj, _ConnectToVTK_0 );
+ this->Superclass::SetRealDataObject( dobj );
+
+ // NOTE: Only 2 and 3 dimensions at this moment to connect with VTK
+ cpPlugins_Image_Dimension( 2, dobj, _VTK_0 );
+ else cpPlugins_Image_Dimension( 3, dobj, _VTK_0 );
}
// -------------------------------------------------------------------------
this->m_VTKImageData->Modified( );
}
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Image::
+Image( )
+ : Superclass( ),
+ m_VTKImageData( NULL )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Image::
+~Image( )
+{
+}
+
// -------------------------------------------------------------------------
template< unsigned int D >
void cpPlugins::Interface::Image::
-_ConnectToVTK_0( )
+_VTK_0( )
{
- itk::DataObject* dobj = this->Superclass::GetDataObject( );
-
- cpPlugins_Image_Pixel( char, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_Pixel( short, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_Pixel( int, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_Pixel( long, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_Pixel( unsigned char, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_Pixel( unsigned short, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_Pixel( unsigned int, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_Pixel( unsigned long, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_Pixel( float, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_Pixel( double, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_RGB( char, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_RGB( short, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_RGB( int, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_RGB( long, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_RGB( unsigned char, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_RGB( unsigned short, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_RGB( unsigned int, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_RGB( unsigned long, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_RGB( float, D, dobj, _ConnectToVTK_1 );
- else cpPlugins_Image_RGB( double, D, dobj, _ConnectToVTK_1 );
+ itk::DataObject* dobj = this->Superclass::GetRealDataObject( );
+
+ cpPlugins_Image_Pixel( char, D, dobj, _VTK_1 );
+ else cpPlugins_Image_Pixel( short, D, dobj, _VTK_1 );
+ else cpPlugins_Image_Pixel( int, D, dobj, _VTK_1 );
+ else cpPlugins_Image_Pixel( long, D, dobj, _VTK_1 );
+ else cpPlugins_Image_Pixel( unsigned char, D, dobj, _VTK_1 );
+ else cpPlugins_Image_Pixel( unsigned short, D, dobj, _VTK_1 );
+ else cpPlugins_Image_Pixel( unsigned int, D, dobj, _VTK_1 );
+ else cpPlugins_Image_Pixel( unsigned long, D, dobj, _VTK_1 );
+ else cpPlugins_Image_Pixel( float, D, dobj, _VTK_1 );
+ else cpPlugins_Image_Pixel( double, D, dobj, _VTK_1 );
+ else cpPlugins_Image_RGB( char, D, dobj, _VTK_1 );
+ else cpPlugins_Image_RGB( short, D, dobj, _VTK_1 );
+ else cpPlugins_Image_RGB( int, D, dobj, _VTK_1 );
+ else cpPlugins_Image_RGB( long, D, dobj, _VTK_1 );
+ else cpPlugins_Image_RGB( unsigned char, D, dobj, _VTK_1 );
+ else cpPlugins_Image_RGB( unsigned short, D, dobj, _VTK_1 );
+ else cpPlugins_Image_RGB( unsigned int, D, dobj, _VTK_1 );
+ else cpPlugins_Image_RGB( unsigned long, D, dobj, _VTK_1 );
+ else cpPlugins_Image_RGB( float, D, dobj, _VTK_1 );
+ else cpPlugins_Image_RGB( double, D, dobj, _VTK_1 );
}
// -------------------------------------------------------------------------
template< class P, unsigned int D >
void cpPlugins::Interface::Image::
-_ConnectToVTK_1( )
+_VTK_1( )
{
typedef itk::Image< P, D > _TImage;
typedef itk::ImageToVTKImageFilter< _TImage > _TFilter;
_TImage* img =
- dynamic_cast< _TImage* >( this->Superclass::GetDataObject( ) );
+ dynamic_cast< _TImage* >( this->Superclass::GetRealDataObject( ) );
typename _TFilter::Pointer filter = _TFilter::New( );
filter->SetInput( img );
filter->Update( );
: public DataObject
{
public:
- typedef Image Self;
- typedef DataObject Superclass;
+ typedef Image Self;
+ typedef DataObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
public:
- Image( );
- virtual ~Image( );
+ itkNewMacro( Self );
+ itkTypeMacro( Image, DataObject );
+ public:
virtual std::string GetClassName( ) const;
- virtual void SetDataObject( itk::DataObject* dobj );
+ virtual void SetRealDataObject( itk::DataObject* dobj );
vtkImageData* GetVTKImageData( ) const;
void UpdateVTKImageData( );
protected:
+ Image( );
+ virtual ~Image( );
+
template< unsigned int D >
- void _ConnectToVTK_0( );
+ void _VTK_0( );
template< class P, unsigned int D >
- void _ConnectToVTK_1( );
+ void _VTK_1( );
+
+ private:
+ // Purposely not implemented
+ Image( const Self& );
+ Self& operator=( const Self& );
protected:
itk::ProcessObject::Pointer m_Image2VTKImageData;
--- /dev/null
+#include <cpPlugins/Interface/ImageSink.h>
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::ImageSink::
+GetClassName( ) const
+{
+ return( "cpPlugins::Interface::ImageSink" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::ImageSink::
+GetClassType( ) const
+{
+ return( "ImageSink" );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ImageSink::
+ImageSink( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ImageSink::
+~ImageSink( )
+{
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __CPPLUGINS__INTERFACE__IMAGESINK__H__
+#define __CPPLUGINS__INTERFACE__IMAGESINK__H__
+
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
+#include <cpPlugins/Interface/SinkObject.h>
+
+namespace cpPlugins
+{
+ namespace Interface
+ {
+ /**
+ */
+ class cpPlugins_Interface_EXPORT ImageSink
+ : public SinkObject
+ {
+ public:
+ typedef ImageSink Self;
+ typedef SinkObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef Superclass::TParameter TParameter;
+ typedef Superclass::TParameters TParameters;
+
+ public:
+ itkTypeMacro( ImageSink, SinkObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
+ ImageSink( );
+ virtual ~ImageSink( );
+
+ private:
+ // Purposely not implemented
+ ImageSink( const Self& );
+ Self& operator=( const Self& );
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#endif // __CPPLUGINS__INTERFACE__IMAGESINK__H__
+
+// eof - $RCSfile$
--- /dev/null
+#include <cpPlugins/Interface/ImageSource.h>
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::ImageSource::
+GetClassName( ) const
+{
+ return( "cpPlugins::Interface::ImageSource" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::ImageSource::
+GetClassType( ) const
+{
+ return( "ImageSource" );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ImageSource::
+ImageSource( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ImageSource::
+~ImageSource( )
+{
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __CPPLUGINS__INTERFACE__IMAGESOURCE__H__
+#define __CPPLUGINS__INTERFACE__IMAGESOURCE__H__
+
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
+#include <cpPlugins/Interface/SourceObject.h>
+
+namespace cpPlugins
+{
+ namespace Interface
+ {
+ /**
+ */
+ class cpPlugins_Interface_EXPORT ImageSource
+ : public SourceObject
+ {
+ public:
+ typedef ImageSource Self;
+ typedef SourceObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef Superclass::TParameter TParameter;
+ typedef Superclass::TParameters TParameters;
+
+ public:
+ itkTypeMacro( ImageSource, SourceObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
+ ImageSource( );
+ virtual ~ImageSource( );
+
+ private:
+ // Purposely not implemented
+ ImageSource( const Self& );
+ Self& operator=( const Self& );
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#endif // __CPPLUGINS__INTERFACE__IMAGESOURCE__H__
+
+// eof - $RCSfile$
#include <cpPlugins/Interface/ImageToImageFilter.h>
// -------------------------------------------------------------------------
-cpPlugins::Interface::ImageToImageFilter::
-ImageToImageFilter( )
- : Superclass( )
+std::string cpPlugins::Interface::ImageToImageFilter::
+GetClassName( ) const
{
+ return( "cpPlugins::Interface::ImageToImageFilter" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::ImageToImageFilter::
+GetClassType( ) const
+{
+ return( "ImageToImageFilter" );
}
// -------------------------------------------------------------------------
cpPlugins::Interface::ImageToImageFilter::
-~ImageToImageFilter( )
+ImageToImageFilter( )
+ : Superclass( )
{
}
// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::ImageToImageFilter::
-GetClassName( ) const
+cpPlugins::Interface::ImageToImageFilter::
+~ImageToImageFilter( )
{
- return( "cpPlugins::Interface::ImageToImageFilter" );
}
// eof - $RCSfile$
#define __CPPLUGINS__INTERFACE__IMAGETOIMAGEFILTER__H__
#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
-#include <cpPlugins/Interface/ProcessObject.h>
+#include <cpPlugins/Interface/FilterObject.h>
namespace cpPlugins
{
/**
*/
class cpPlugins_Interface_EXPORT ImageToImageFilter
- : public ProcessObject
+ : public FilterObject
{
public:
- typedef ImageToImageFilter Self;
- typedef ProcessObject Superclass;
+ typedef ImageToImageFilter Self;
+ typedef FilterObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::TParameter TParameter;
typedef Superclass::TParameters TParameters;
public:
+ itkTypeMacro( ImageToImageFilter, FilterObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
ImageToImageFilter( );
virtual ~ImageToImageFilter( );
- virtual std::string GetClassName( ) const;
+ private:
+ // Purposely not implemented
+ ImageToImageFilter( const Self& );
+ Self& operator=( const Self& );
};
} // ecapseman
#include <cpPlugins/Interface/ImageToMeshFilter.h>
// -------------------------------------------------------------------------
-cpPlugins::Interface::ImageToMeshFilter::
-ImageToMeshFilter( )
- : Superclass( )
+std::string cpPlugins::Interface::ImageToMeshFilter::
+GetClassName( ) const
{
+ return( "cpPlugins::Interface::ImageToMeshFilter" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::ImageToMeshFilter::
+GetClassType( ) const
+{
+ return( "ImageToMeshFilter" );
}
// -------------------------------------------------------------------------
cpPlugins::Interface::ImageToMeshFilter::
-~ImageToMeshFilter( )
+ImageToMeshFilter( )
+ : Superclass( )
{
}
// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::ImageToMeshFilter::
-GetClassName( ) const
+cpPlugins::Interface::ImageToMeshFilter::
+~ImageToMeshFilter( )
{
- return( "cpPlugins::Interface::ImageToMeshFilter" );
}
// eof - $RCSfile$
#define __CPPLUGINS__INTERFACE__IMAGETOMESHFILTER__H__
#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
-#include <cpPlugins/Interface/ProcessObject.h>
+#include <cpPlugins/Interface/FilterObject.h>
namespace cpPlugins
{
/**
*/
class cpPlugins_Interface_EXPORT ImageToMeshFilter
- : public ProcessObject
+ : public FilterObject
{
public:
- typedef ImageToMeshFilter Self;
- typedef ProcessObject Superclass;
+ typedef ImageToMeshFilter Self;
+ typedef FilterObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::TParameter TParameter;
typedef Superclass::TParameters TParameters;
public:
+ itkTypeMacro( ImageToMeshFilter, FilterObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
ImageToMeshFilter( );
virtual ~ImageToMeshFilter( );
- virtual std::string GetClassName( ) const;
+ private:
+ // Purposely not implemented
+ ImageToMeshFilter( const Self& );
+ Self& operator=( const Self& );
};
} // ecapseman
#include <itkImageToVTKImageFilter.h>
// -------------------------------------------------------------------------
-#define cpPlugins_Interface_Instance_itkImage( t, d ) \
+#define cpPlugins_Instance_itkImage( t, d ) \
template class itk::Image< t, d >; \
template class itk::Image< itk::RGBPixel< t >, d >
// -------------------------------------------------------------------------
-#define cpPlugins_Interface_Instance_itkImage2vtkImage( t, d ) \
+#define cpPlugins_Instance_itkImage2vtkImage( t, d ) \
template class itk::ImageToVTKImageFilter< itk::Image< t, d > >; \
template class \
itk::ImageToVTKImageFilter< itk::Image< itk::RGBPixel< t >, d > >
// -------------------------------------------------------------------------
-#define cpPlugins_Interface_Instance_All_itkImage( t, d ) \
- cpPlugins_Interface_Instance_itkImage( t, d ); \
- cpPlugins_Interface_Instance_itkImage2vtkImage( t, d )
+#define cpPlugins_Instance_All_itkImage( t, d ) \
+ cpPlugins_Instance_itkImage( t, d ); \
+ cpPlugins_Instance_itkImage2vtkImage( t, d )
// -------------------------------------------------------------------------
// Images without vtk conversion
-cpPlugins_Interface_Instance_itkImage( char, 1 );
-cpPlugins_Interface_Instance_itkImage( short, 1 );
-cpPlugins_Interface_Instance_itkImage( int, 1 );
-cpPlugins_Interface_Instance_itkImage( long, 1 );
-cpPlugins_Interface_Instance_itkImage( unsigned char, 1 );
-cpPlugins_Interface_Instance_itkImage( unsigned short, 1 );
-cpPlugins_Interface_Instance_itkImage( unsigned int, 1 );
-cpPlugins_Interface_Instance_itkImage( unsigned long, 1 );
-cpPlugins_Interface_Instance_itkImage( float, 1 );
-cpPlugins_Interface_Instance_itkImage( double, 1 );
+cpPlugins_Instance_itkImage( char, 1 );
+cpPlugins_Instance_itkImage( short, 1 );
+cpPlugins_Instance_itkImage( int, 1 );
+cpPlugins_Instance_itkImage( long, 1 );
+cpPlugins_Instance_itkImage( unsigned char, 1 );
+cpPlugins_Instance_itkImage( unsigned short, 1 );
+cpPlugins_Instance_itkImage( unsigned int, 1 );
+cpPlugins_Instance_itkImage( unsigned long, 1 );
+cpPlugins_Instance_itkImage( float, 1 );
+cpPlugins_Instance_itkImage( double, 1 );
-cpPlugins_Interface_Instance_itkImage( char, 4 );
-cpPlugins_Interface_Instance_itkImage( short, 4 );
-cpPlugins_Interface_Instance_itkImage( int, 4 );
-cpPlugins_Interface_Instance_itkImage( long, 4 );
-cpPlugins_Interface_Instance_itkImage( unsigned char, 4 );
-cpPlugins_Interface_Instance_itkImage( unsigned short, 4 );
-cpPlugins_Interface_Instance_itkImage( unsigned int, 4 );
-cpPlugins_Interface_Instance_itkImage( unsigned long, 4 );
-cpPlugins_Interface_Instance_itkImage( float, 4 );
-cpPlugins_Interface_Instance_itkImage( double, 4 );
+cpPlugins_Instance_itkImage( char, 4 );
+cpPlugins_Instance_itkImage( short, 4 );
+cpPlugins_Instance_itkImage( int, 4 );
+cpPlugins_Instance_itkImage( long, 4 );
+cpPlugins_Instance_itkImage( unsigned char, 4 );
+cpPlugins_Instance_itkImage( unsigned short, 4 );
+cpPlugins_Instance_itkImage( unsigned int, 4 );
+cpPlugins_Instance_itkImage( unsigned long, 4 );
+cpPlugins_Instance_itkImage( float, 4 );
+cpPlugins_Instance_itkImage( double, 4 );
// -------------------------------------------------------------------------
// Images with vtk conversion
-cpPlugins_Interface_Instance_All_itkImage( char, 2 );
-cpPlugins_Interface_Instance_All_itkImage( short, 2 );
-cpPlugins_Interface_Instance_All_itkImage( int, 2 );
-cpPlugins_Interface_Instance_All_itkImage( long, 2 );
-cpPlugins_Interface_Instance_All_itkImage( unsigned char, 2 );
-cpPlugins_Interface_Instance_All_itkImage( unsigned short, 2 );
-cpPlugins_Interface_Instance_All_itkImage( unsigned int, 2 );
-cpPlugins_Interface_Instance_All_itkImage( unsigned long, 2 );
-cpPlugins_Interface_Instance_All_itkImage( float, 2 );
-cpPlugins_Interface_Instance_All_itkImage( double, 2 );
+cpPlugins_Instance_All_itkImage( char, 2 );
+cpPlugins_Instance_All_itkImage( short, 2 );
+cpPlugins_Instance_All_itkImage( int, 2 );
+cpPlugins_Instance_All_itkImage( long, 2 );
+cpPlugins_Instance_All_itkImage( unsigned char, 2 );
+cpPlugins_Instance_All_itkImage( unsigned short, 2 );
+cpPlugins_Instance_All_itkImage( unsigned int, 2 );
+cpPlugins_Instance_All_itkImage( unsigned long, 2 );
+cpPlugins_Instance_All_itkImage( float, 2 );
+cpPlugins_Instance_All_itkImage( double, 2 );
-cpPlugins_Interface_Instance_All_itkImage( char, 3 );
-cpPlugins_Interface_Instance_All_itkImage( short, 3 );
-cpPlugins_Interface_Instance_All_itkImage( int, 3 );
-cpPlugins_Interface_Instance_All_itkImage( long, 3 );
-cpPlugins_Interface_Instance_All_itkImage( unsigned char, 3 );
-cpPlugins_Interface_Instance_All_itkImage( unsigned short, 3 );
-cpPlugins_Interface_Instance_All_itkImage( unsigned int, 3 );
-cpPlugins_Interface_Instance_All_itkImage( unsigned long, 3 );
-cpPlugins_Interface_Instance_All_itkImage( float, 3 );
-cpPlugins_Interface_Instance_All_itkImage( double, 3 );
+cpPlugins_Instance_All_itkImage( char, 3 );
+cpPlugins_Instance_All_itkImage( short, 3 );
+cpPlugins_Instance_All_itkImage( int, 3 );
+cpPlugins_Instance_All_itkImage( long, 3 );
+cpPlugins_Instance_All_itkImage( unsigned char, 3 );
+cpPlugins_Instance_All_itkImage( unsigned short, 3 );
+cpPlugins_Instance_All_itkImage( unsigned int, 3 );
+cpPlugins_Instance_All_itkImage( unsigned long, 3 );
+cpPlugins_Instance_All_itkImage( float, 3 );
+cpPlugins_Instance_All_itkImage( double, 3 );
// eof - $RCSfile$
}
// -------------------------------------------------------------------------
-cpPlugins::Interface::Object* cpPlugins::Interface::Interface::
+cpPlugins::Interface::Object::Pointer cpPlugins::Interface::Interface::
CreateObject( const std::string& name ) const
{
TClassesIterator cIt = this->m_Classes.find( name );
ObjectProvider* provider =
dynamic_cast< ObjectProvider* >( this->m_Providers[ cIt->second ] );
if( provider != NULL )
- return( dynamic_cast< Object* >( provider->create( ) ) );
+ return( provider->create( ) );
} // fi
return( NULL );
}
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ProcessObject::Pointer
+cpPlugins::Interface::Interface::
+CreateProcessObject( const std::string& name ) const
+{
+ cpPlugins::Interface::Object::Pointer o = this->CreateObject( name );
+ cpPlugins::Interface::ProcessObject::Pointer p =
+ dynamic_cast< cpPlugins::Interface::ProcessObject* >( o.GetPointer( ) );
+ return( p );
+}
+
// -------------------------------------------------------------------------
bool cpPlugins::Interface::Interface::
Load( const std::string& path )
// Get reader provider
for( unsigned int i = 0; i < this->m_Providers.size( ); ++i )
{
- Object* dummy = this->m_Providers[ i ]->create( );
+ Object::Pointer dummy = this->m_Providers[ i ]->create( );
this->m_Classes[ dummy->GetClassName( ) ] = i;
- delete dummy;
} // rof
}
#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
#include <cpPlugins/Interface/Object.h>
+#include <cpPlugins/Interface/ProcessObject.h>
namespace cpPlugins
{
/// Plugin access
TClasses& GetClasses( );
const TClasses& GetClasses( ) const;
- Object* CreateObject( const std::string& name ) const;
+ Object::Pointer CreateObject( const std::string& name ) const;
+ ProcessObject::Pointer CreateProcessObject(
+ const std::string& name
+ ) const;
/// Interface to PLUMA
bool Load( const std::string& path );
#include <cpPlugins/Extensions/DataStructures/QuadEdgeMesh.h>
#include <cpPlugins/Extensions/Visualization/OpenGLMeshMapper.h>
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Mesh::
-Mesh( )
- : Superclass( ),
- m_Mapper( NULL )
-{
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Mesh::
-~Mesh( )
-{
- if( this->m_Mapper != NULL ) this->m_Mapper->Delete( );
-}
-
// -------------------------------------------------------------------------
std::string cpPlugins::Interface::Mesh::
GetClassName( ) const
// -------------------------------------------------------------------------
void cpPlugins::Interface::Mesh::
-SetDataObject( itk::DataObject* dobj )
+SetRealDataObject( itk::DataObject* dobj )
{
- this->Superclass::SetDataObject( dobj );
-
- // WARNING: Only 2 and 3 dimensions at this moment
+ this->Superclass::SetRealDataObject( dobj );
+
+ // NOTE: Only 2 and 3 dimensions at this moment
using namespace cpPlugins::Extensions;
typedef DataStructures::QuadEdgeMesh< float, 2 > _TF2;
typedef DataStructures::QuadEdgeMesh< double, 2 > _TD2;
return( this->m_Mapper );
}
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Mesh::
+Mesh( )
+ : Superclass( ),
+ m_Mapper( NULL )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Mesh::
+~Mesh( )
+{
+ if( this->m_Mapper != NULL ) this->m_Mapper->Delete( );
+}
+
// -------------------------------------------------------------------------
template< class M >
void cpPlugins::Interface::Mesh::
_TMapper;
if( this->m_Mapper != NULL ) this->m_Mapper->Delete( );
- M* mesh = dynamic_cast< M* >( this->Superclass::GetDataObject( ) );
+ M* mesh = dynamic_cast< M* >( this->Superclass::GetRealDataObject( ) );
_TMapper* mapper = _TMapper::New( );
mapper->SetInputData( mesh );
this->m_Mapper = mapper;
: public DataObject
{
public:
- typedef Mesh Self;
- typedef DataObject Superclass;
+ typedef Mesh Self;
+ typedef DataObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
public:
- Mesh( );
- virtual ~Mesh( );
+ itkNewMacro( Self );
+ itkTypeMacro( Mesh, DataObject );
+ public:
virtual std::string GetClassName( ) const;
- virtual void SetDataObject( itk::DataObject* dobj );
+ virtual void SetRealDataObject( itk::DataObject* dobj );
vtkMapper* GetVTKMapper( ) const;
protected:
+ Mesh( );
+ virtual ~Mesh( );
+
template< class M >
void _Map( );
+ private:
+ // Purposely not implemented
+ Mesh( const Self& );
+ Self& operator=( const Self& );
+
protected:
/*
itk::ProcessObject::Pointer m_Mesh2VTKMeshData;
--- /dev/null
+#include <cpPlugins/Interface/MeshSink.h>
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::MeshSink::
+GetClassName( ) const
+{
+ return( "cpPlugins::Interface::MeshSink" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::MeshSink::
+GetClassType( ) const
+{
+ return( "MeshSink" );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::MeshSink::
+MeshSink( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::MeshSink::
+~MeshSink( )
+{
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __CPPLUGINS__INTERFACE__MESHSINK__H__
+#define __CPPLUGINS__INTERFACE__MESHSINK__H__
+
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
+#include <cpPlugins/Interface/SinkObject.h>
+
+namespace cpPlugins
+{
+ namespace Interface
+ {
+ /**
+ */
+ class cpPlugins_Interface_EXPORT MeshSink
+ : public SinkObject
+ {
+ public:
+ typedef MeshSink Self;
+ typedef SinkObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef Superclass::TParameter TParameter;
+ typedef Superclass::TParameters TParameters;
+
+ public:
+ itkTypeMacro( MeshSink, SinkObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
+ MeshSink( );
+ virtual ~MeshSink( );
+
+ private:
+ // Purposely not implemented
+ MeshSink( const Self& );
+ Self& operator=( const Self& );
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#endif // __CPPLUGINS__INTERFACE__MESHSINK__H__
+
+// eof - $RCSfile$
--- /dev/null
+#include <cpPlugins/Interface/MeshSource.h>
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::MeshSource::
+GetClassName( ) const
+{
+ return( "cpPlugins::Interface::MeshSource" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::MeshSource::
+GetClassType( ) const
+{
+ return( "MeshSource" );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::MeshSource::
+MeshSource( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::MeshSource::
+~MeshSource( )
+{
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __CPPLUGINS__INTERFACE__MESHSOURCE__H__
+#define __CPPLUGINS__INTERFACE__MESHSOURCE__H__
+
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
+#include <cpPlugins/Interface/SourceObject.h>
+
+namespace cpPlugins
+{
+ namespace Interface
+ {
+ /**
+ */
+ class cpPlugins_Interface_EXPORT MeshSource
+ : public SourceObject
+ {
+ public:
+ typedef MeshSource Self;
+ typedef SourceObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef Superclass::TParameter TParameter;
+ typedef Superclass::TParameters TParameters;
+
+ public:
+ itkTypeMacro( MeshSource, SourceObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
+ MeshSource( );
+ virtual ~MeshSource( );
+
+ private:
+ // Purposely not implemented
+ MeshSource( const Self& );
+ Self& operator=( const Self& );
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#endif // __CPPLUGINS__INTERFACE__MESHSOURCE__H__
+
+// eof - $RCSfile$
--- /dev/null
+#include <cpPlugins/Interface/MeshToImageFilter.h>
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::MeshToImageFilter::
+GetClassName( ) const
+{
+ return( "cpPlugins::Interface::MeshToImageFilter" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::MeshToImageFilter::
+GetClassType( ) const
+{
+ return( "MeshToImageFilter" );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::MeshToImageFilter::
+MeshToImageFilter( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::MeshToImageFilter::
+~MeshToImageFilter( )
+{
+}
+
+// eof - $RCSfile$
+#ifndef __CPPLUGINS__INTERFACE__MESHTOIMAGEFILTER__H__
+#define __CPPLUGINS__INTERFACE__MESHTOIMAGEFILTER__H__
+
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
+#include <cpPlugins/Interface/FilterObject.h>
+
+namespace cpPlugins
+{
+ namespace Interface
+ {
+ /**
+ */
+ class cpPlugins_Interface_EXPORT MeshToImageFilter
+ : public FilterObject
+ {
+ public:
+ typedef MeshToImageFilter Self;
+ typedef FilterObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef Superclass::TParameter TParameter;
+ typedef Superclass::TParameters TParameters;
+
+ public:
+ itkTypeMacro( MeshToImageFilter, FilterObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
+ MeshToImageFilter( );
+ virtual ~MeshToImageFilter( );
+
+ private:
+ // Purposely not implemented
+ MeshToImageFilter( const Self& );
+ Self& operator=( const Self& );
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#endif // __CPPLUGINS__INTERFACE__MESHTOIMAGEFILTER__H__
+
+// eof - $RCSfile$
--- /dev/null
+#include <cpPlugins/Interface/MeshToMeshFilter.h>
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::MeshToMeshFilter::
+GetClassName( ) const
+{
+ return( "cpPlugins::Interface::MeshToMeshFilter" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::MeshToMeshFilter::
+GetClassType( ) const
+{
+ return( "MeshToMeshFilter" );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::MeshToMeshFilter::
+MeshToMeshFilter( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::MeshToMeshFilter::
+~MeshToMeshFilter( )
+{
+}
+
+// eof - $RCSfile$
+#ifndef __CPPLUGINS__INTERFACE__MESHTOMESHFILTER__H__
+#define __CPPLUGINS__INTERFACE__MESHTOMESHFILTER__H__
+
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
+#include <cpPlugins/Interface/FilterObject.h>
+
+namespace cpPlugins
+{
+ namespace Interface
+ {
+ /**
+ */
+ class cpPlugins_Interface_EXPORT MeshToMeshFilter
+ : public FilterObject
+ {
+ public:
+ typedef MeshToMeshFilter Self;
+ typedef FilterObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef Superclass::TParameter TParameter;
+ typedef Superclass::TParameters TParameters;
+
+ public:
+ itkTypeMacro( MeshToMeshFilter, FilterObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
+ MeshToMeshFilter( );
+ virtual ~MeshToMeshFilter( );
+
+ private:
+ // Purposely not implemented
+ MeshToMeshFilter( const Self& );
+ Self& operator=( const Self& );
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#endif // __CPPLUGINS__INTERFACE__MESHTOMESHFILTER__H__
+
+// eof - $RCSfile$
#include <cpPlugins/Interface/Object.h>
// -------------------------------------------------------------------------
-cpPlugins::Interface::Object::
-Object( )
+std::string cpPlugins::Interface::Object::
+GetClassName( ) const
{
+ return( "cpPlugins::Interface::Object" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::Object::
+GetClassType( ) const
+{
+ return( "Object" );
}
// -------------------------------------------------------------------------
cpPlugins::Interface::Object::
-~Object( )
+Object( )
+ : Superclass( )
{
}
// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::Object::
-GetClassName( ) const
+cpPlugins::Interface::Object::
+~Object( )
{
- return( "cpPlugins::Interface::Object" );
}
// -------------------------------------------------------------------------
#include <string>
#include <Pluma/Pluma.hpp>
+#include <itkObject.h>
+#include <itkObjectFactory.h>
#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
+// -------------------------------------------------------------------------
+#define PLUMA_PROVIDER_HEADER_CPPLUGINS( TYPE ) \
+ PLUMA_PROVIDER_HEADER_BEGIN( TYPE ) \
+ virtual TYPE::Pointer create( ) const = 0; \
+ PLUMA_PROVIDER_HEADER_END
+
+// -------------------------------------------------------------------------
+#define PLUMA_INHERIT_PROVIDER_CPPLUGINS( TYPE, SUPER ) \
+ class TYPE##Provider \
+ : public SUPER##Provider \
+ { \
+ public: \
+ SUPER::Pointer create( ) const \
+ { \
+ TYPE::Pointer a = TYPE::New( ); \
+ SUPER::Pointer b = a.GetPointer( ); \
+ return( b ); \
+ } \
+ };
+
namespace cpPlugins
{
namespace Interface
/**
*/
class cpPlugins_Interface_EXPORT Object
+ : public itk::Object
{
public:
+ typedef Object Self;
+ typedef itk::Object Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ public:
+ itkNewMacro( Self );
+ itkTypeMacro( Object, itkObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
Object( );
virtual ~Object( );
- virtual std::string GetClassName( ) const;
+ private:
+ // Purposely not implemented
+ Object( const Self& );
+ Self& operator=( const Self& );
};
// TODO: doc
- PLUMA_PROVIDER_HEADER( Object );
+ PLUMA_PROVIDER_HEADER_CPPLUGINS( Object );
} // ecapseman
#include <cpPlugins/Interface/ProcessObject.h>
// -------------------------------------------------------------------------
-cpPlugins::Interface::ProcessObject::
-ProcessObject( )
- : Superclass( ),
- m_OutputsDisconnected( false )
-{
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::ProcessObject::
-~ProcessObject( )
+std::string cpPlugins::Interface::ProcessObject::
+GetClassName( ) const
{
- this->_DeleteOutputs( );
+ return( "cpPlugins::Interface::ProcessObject" );
}
// -------------------------------------------------------------------------
std::string cpPlugins::Interface::ProcessObject::
-GetClassName( ) const
+GetClassType( ) const
{
- return( "cpPlugins::Interface::ProcessObject" );
+ return( "ProcessObject" );
}
// -------------------------------------------------------------------------
SetParameters( const TParameters& params )
{
this->m_Parameters = params;
+ this->Modified( );
}
// -------------------------------------------------------------------------
SetNumberOfInputs( unsigned int n )
{
this->m_Inputs.clear( );
- this->m_Inputs.resize( n, NULL );
+ this->m_Inputs.resize( n );
+ this->Modified( );
}
// -------------------------------------------------------------------------
void cpPlugins::Interface::ProcessObject::
SetNumberOfOutputs( unsigned int n )
{
- this->_DeleteOutputs( );
this->m_Outputs.clear( );
- this->m_Outputs.resize( n, NULL );
- this->m_OutputsDisconnected = false;
+ this->m_Outputs.resize( n );
+ this->Modified( );
}
// -------------------------------------------------------------------------
void cpPlugins::Interface::ProcessObject::
-SetInput(
- unsigned int idx, const cpPlugins::Interface::DataObject* dobj
- )
+SetInput( unsigned int idx, cpPlugins::Interface::DataObject* dobj )
{
if( idx < this->m_Inputs.size( ) )
+ {
this->m_Inputs[ idx ] = dobj;
+ this->Modified( );
+
+ } // fi
}
// -------------------------------------------------------------------------
std::string cpPlugins::Interface::ProcessObject::
Update( )
{
- // Force upstream updates
std::string r = "";
+
+ // Force upstream updates
for( unsigned int i = 0; i < this->m_Inputs.size( ) && r == ""; ++i )
{
- if( this->m_Inputs[ i ]->GetSource( ) != NULL )
- r = this->m_Inputs[ i ]->GetSource( )->Update( );
+ Self* src = dynamic_cast< Self* >( this->m_Inputs[ i ]->GetSource( ) );
+ if( src != NULL )
+ r = src->Update( );
} // rof
// Current update
if( r == "" )
- {
r = this->_GenerateData( );
- this->m_OutputsDisconnected = false;
-
- } // fi
// Return error description, if any
return( r );
void cpPlugins::Interface::ProcessObject::
DisconnectOutputs( )
{
- this->m_OutputsDisconnected = true;
for( unsigned int idx = 0; idx < this->m_Outputs.size( ); ++idx )
- if( this->m_Outputs[ idx ] != NULL )
+ if( this->m_Outputs[ idx ].IsNotNull( ) )
this->m_Outputs[ idx ]->DisconnectPipeline( );
}
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ProcessObject::
+ProcessObject( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::Interface::ProcessObject::
+~ProcessObject( )
+{
+}
+
// -------------------------------------------------------------------------
itk::DataObject* cpPlugins::Interface::ProcessObject::
_GetInput( unsigned int idx )
{
if( idx < this->m_Inputs.size( ) )
- return( this->m_Inputs[ idx ]->GetDataObject( ) );
+ return( this->m_Inputs[ idx ]->GetRealDataObject( ) );
else
return( NULL );
}
_SetOutput( unsigned int idx, itk::DataObject* dobj )
{
if( idx < this->m_Outputs.size( ) )
- if( this->m_Outputs[ idx ] != NULL )
- this->m_Outputs[ idx ]->SetDataObject( dobj );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
-_DeleteOutputs( )
-{
- if( !( this->m_OutputsDisconnected ) )
- for( unsigned int idx = 0; idx < this->m_Outputs.size( ); ++idx )
- if( this->m_Outputs[ idx ] != NULL )
- delete this->m_Outputs[ idx ];
+ if( this->m_Outputs[ idx ].IsNotNull( ) )
+ this->m_Outputs[ idx ]->SetRealDataObject( dobj );
}
// eof - $RCSfile$
#include <map>
#include <string>
-#include <itkDataObject.h>
#include <itkProcessObject.h>
#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
#include <cpPlugins/Interface/Object.h>
{
namespace Interface
{
- class DataObject;
-
/**
*/
class cpPlugins_Interface_EXPORT ProcessObject
: public Object
{
public:
- typedef ProcessObject Self;
- typedef Object Superclass;
+ typedef ProcessObject Self;
+ typedef Object Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef std::pair< std::string, std::string > TParameter;
typedef std::map< std::string, TParameter > TParameters;
public:
- ProcessObject( );
- virtual ~ProcessObject( );
+ itkTypeMacro( ProcessObject, Object );
+ public:
virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
virtual const TParameters& GetDefaultParameters( ) const;
virtual void SetParameters( const TParameters& params );
virtual void SetNumberOfInputs( unsigned int n );
virtual void SetNumberOfOutputs( unsigned int n );
- virtual void SetInput( unsigned int idx, const DataObject* dobj );
+ virtual void SetInput( unsigned int idx, DataObject* dobj );
virtual DataObject* GetOutput( unsigned int idx );
virtual std::string Update( );
virtual void DisconnectOutputs( );
protected:
+ ProcessObject( );
+ virtual ~ProcessObject( );
+
virtual itk::DataObject* _GetInput( unsigned int idx );
virtual void _SetOutput( unsigned int idx, itk::DataObject* dobj );
- virtual void _DeleteOutputs( );
template< class O >
void _MakeOutput( unsigned int idx )
{
if( idx >= this->m_Outputs.size( ) )
return;
-
- if( !( this->m_OutputsDisconnected ) )
- if( this->m_Outputs[ idx ] != NULL )
- delete this->m_Outputs[ idx ];
-
- this->m_Outputs[ idx ] = new O( );
+ this->m_Outputs[ idx ] = O::New( );
this->m_Outputs[ idx ]->SetSource( this );
}
virtual std::string _GenerateData( ) = 0;
+ private:
+ // Purposely not implemented
+ ProcessObject( const Self& );
+ Self& operator=( const Self& );
+
protected:
+ itk::ProcessObject::Pointer m_RealProcessObject;
TParameters m_DefaultParameters;
TParameters m_Parameters;
- std::vector< const DataObject* > m_Inputs;
- std::vector< DataObject* > m_Outputs;
- bool m_OutputsDisconnected;
+ std::vector< DataObject::Pointer > m_Inputs;
+ std::vector< DataObject::Pointer > m_Outputs;
};
} // ecapseman
#include <cpPlugins/Interface/SinkObject.h>
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::SinkObject::
+GetClassName( ) const
+{
+ return( "cpPlugins::Interface::SinkObject" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::SinkObject::
+GetClassType( ) const
+{
+ return( "SinkObject" );
+}
+
// -------------------------------------------------------------------------
cpPlugins::Interface::SinkObject::
SinkObject( )
{
}
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::SinkObject::
-GetClassName( ) const
-{
- return( "cpPlugins::Interface::SinkObject" );
-}
-
// eof - $RCSfile$
: public ProcessObject
{
public:
- typedef SinkObject Self;
- typedef ProcessObject Superclass;
+ typedef SinkObject Self;
+ typedef ProcessObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::TParameter TParameter;
typedef Superclass::TParameters TParameters;
public:
+ itkTypeMacro( SinkObject, ProcessObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
SinkObject( );
virtual ~SinkObject( );
- virtual std::string GetClassName( ) const;
+ private:
+ // Purposely not implemented
+ SinkObject( const Self& );
+ Self& operator=( const Self& );
};
} // ecapseman
#include <cpPlugins/Interface/SourceObject.h>
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::SourceObject::
+GetClassName( ) const
+{
+ return( "cpPlugins::Interface::SourceObject" );
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Interface::SourceObject::
+GetClassType( ) const
+{
+ return( "SourceObject" );
+}
+
// -------------------------------------------------------------------------
cpPlugins::Interface::SourceObject::
SourceObject( )
{
}
-// -------------------------------------------------------------------------
-std::string cpPlugins::Interface::SourceObject::
-GetClassName( ) const
-{
- return( "cpPlugins::Interface::SourceObject" );
-}
-
// eof - $RCSfile$
: public ProcessObject
{
public:
- typedef SourceObject Self;
- typedef ProcessObject Superclass;
+ typedef SourceObject Self;
+ typedef ProcessObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::TParameter TParameter;
typedef Superclass::TParameters TParameters;
public:
+ itkTypeMacro( SourceObject, ProcessObject );
+
+ public:
+ virtual std::string GetClassName( ) const;
+ virtual std::string GetClassType( ) const;
+
+ protected:
SourceObject( );
virtual ~SourceObject( );
- virtual std::string GetClassName( ) const;
+ private:
+ // Purposely not implemented
+ SourceObject( const Self& );
+ Self& operator=( const Self& );
};
} // ecapseman
#include <itkImage.h>
#include <itkRGBPixel.h>
+// -------------------------------------------------------------------------
+std::string cpPlugins::Plugins::ImageReader::
+GetClassName( ) const
+{
+ return( "cpPlugins::Plugins::ImageReader" );
+}
+
// -------------------------------------------------------------------------
cpPlugins::Plugins::ImageReader::
ImageReader( )
{
}
-// -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::ImageReader::
-GetClassName( ) const
-{
- return( "cpPlugins::Plugins::ImageReader" );
-}
-
// -------------------------------------------------------------------------
std::string cpPlugins::Plugins::ImageReader::
_GenerateData( )
typedef itk::ImageFileReader< _TImage > _TReader;
_TReader* reader =
- dynamic_cast< _TReader* >( this->m_Reader.GetPointer( ) );
+ dynamic_cast< _TReader* >( this->m_RealProcessObject.GetPointer( ) );
if( reader == NULL )
{
- this->m_Reader = _TReader::New( );
- reader = dynamic_cast< _TReader* >( this->m_Reader.GetPointer( ) );
+ this->m_RealProcessObject = _TReader::New( );
+ reader =
+ dynamic_cast< _TReader* >( this->m_RealProcessObject.GetPointer( ) );
} // fi
reader->SetFileName( fIt->second.second );
#define __CPPLUGINS__PLUGINS__IMAGEREADER__H__
#include <cpPlugins/Plugins/cpPlugins_Export.h>
-#include <cpPlugins/Interface/SourceObject.h>
+#include <cpPlugins/Interface/ImageSource.h>
#include <itkProcessObject.h>
namespace cpPlugins
/**
*/
class cpPlugins_EXPORT ImageReader
- : public cpPlugins::Interface::SourceObject
+ : public cpPlugins::Interface::ImageSource
{
public:
- typedef ImageReader Self;
- typedef cpPlugins::Interface::SourceObject Superclass;
+ typedef ImageReader Self;
+ typedef cpPlugins::Interface::ImageSource Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::TParameter TParameter;
typedef Superclass::TParameters TParameters;
public:
- ImageReader( );
- virtual ~ImageReader( );
+ itkNewMacro( Self );
+ itkTypeMacro( ImageReader, cpPluginsInterfaceImageSource );
+ public:
virtual std::string GetClassName( ) const;
protected:
+ ImageReader( );
+ virtual ~ImageReader( );
+
virtual std::string _GenerateData( );
template< unsigned int D >
template< class P, unsigned int D >
std::string _GD1( );
- protected:
- itk::ProcessObject::Pointer m_Reader;
+ private:
+ // Purposely not implemented
+ ImageReader( const Self& );
+ Self& operator=( const Self& );
};
// ---------------------------------------------------------------------
- PLUMA_INHERIT_PROVIDER( ImageReader, cpPlugins::Interface::Object );
+ PLUMA_INHERIT_PROVIDER_CPPLUGINS(
+ ImageReader,
+ cpPlugins::Interface::Object
+ );
} // ecapseman
#include <itkImage.h>
#include <itkRGBPixel.h>
+// -------------------------------------------------------------------------
+std::string cpPlugins::Plugins::ImageSeriesReader::
+GetClassName( ) const
+{
+ return( "cpPlugins::Plugins::ImageSeriesReader" );
+}
+
// -------------------------------------------------------------------------
cpPlugins::Plugins::ImageSeriesReader::
ImageSeriesReader( )
{
}
-// -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::ImageSeriesReader::
-GetClassName( ) const
-{
- return( "cpPlugins::Plugins::ImageSeriesReader" );
-}
-
// -------------------------------------------------------------------------
std::string cpPlugins::Plugins::ImageSeriesReader::
_GenerateData( )
typedef itk::ImageSeriesReader< _TImage > _TReader;
_TReader* reader =
- dynamic_cast< _TReader* >( this->m_Reader.GetPointer( ) );
+ dynamic_cast< _TReader* >( this->m_RealProcessObject.GetPointer( ) );
if( reader == NULL )
{
- this->m_Reader = _TReader::New( );
- reader = dynamic_cast< _TReader* >( this->m_Reader.GetPointer( ) );
+ this->m_RealProcessObject = _TReader::New( );
+ reader =
+ dynamic_cast< _TReader* >( this->m_RealProcessObject.GetPointer( ) );
} // fi
std::set< std::string >::const_iterator fnIt = filenames.begin( );
#define __CPPLUGINS__PLUGINS__IMAGESERIESREADER__H__
#include <cpPlugins/Plugins/cpPlugins_Export.h>
-#include <cpPlugins/Interface/SourceObject.h>
+#include <cpPlugins/Interface/ImageSource.h>
#include <itkProcessObject.h>
namespace cpPlugins
/**
*/
class cpPlugins_EXPORT ImageSeriesReader
- : public cpPlugins::Interface::SourceObject
+ : public cpPlugins::Interface::ImageSource
{
public:
- typedef ImageSeriesReader Self;
- typedef cpPlugins::Interface::SourceObject Superclass;
+ typedef ImageSeriesReader Self;
+ typedef cpPlugins::Interface::ImageSource Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::TParameter TParameter;
typedef Superclass::TParameters TParameters;
public:
- ImageSeriesReader( );
- virtual ~ImageSeriesReader( );
+ itkNewMacro( Self );
+ itkTypeMacro( ImageSeriesReader, cpPluginsInterfaceImageSource );
+ public:
virtual std::string GetClassName( ) const;
protected:
+ ImageSeriesReader( );
+ virtual ~ImageSeriesReader( );
virtual std::string _GenerateData( );
template< class P, unsigned int D >
std::string _GD1( );
- protected:
- itk::ProcessObject::Pointer m_Reader;
+ private:
+ // Purposely not implemented
+ ImageSeriesReader( const Self& );
+ Self& operator=( const Self& );
};
// ---------------------------------------------------------------------
- PLUMA_INHERIT_PROVIDER( ImageSeriesReader, cpPlugins::Interface::Object );
+ PLUMA_INHERIT_PROVIDER_CPPLUGINS(
+ ImageSeriesReader,
+ cpPlugins::Interface::Object
+ );
} // ecapseman
) \
r = this->f< itk::RGBPixel< p >, d >( )
+// -------------------------------------------------------------------------
+std::string cpPlugins::Plugins::ImageWriter::
+GetClassName( ) const
+{
+ return( "cpPlugins::Plugins::ImageWriter" );
+}
+
// -------------------------------------------------------------------------
cpPlugins::Plugins::ImageWriter::
ImageWriter( )
{
}
-// -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::ImageWriter::
-GetClassName( ) const
-{
- return( "cpPlugins::Plugins::ImageWriter" );
-}
-
// -------------------------------------------------------------------------
std::string cpPlugins::Plugins::ImageWriter::
_GenerateData( )
_GD1( )
{
typedef itk::Image< P, D > _TImage;
- typedef itk::ImageFileWriter< _TImage > _TImageWriter;
+ typedef itk::ImageFileWriter< _TImage > _TWriter;
TParameters::const_iterator fIt;
if( fIt == this->m_Parameters.end( ) )
fIt = this->m_DefaultParameters.find( "FileName" );
- _TImageWriter* writer =
- dynamic_cast< _TImageWriter* >( this->m_Writer.GetPointer( ) );
+ _TWriter* writer =
+ dynamic_cast< _TWriter* >( this->m_RealProcessObject.GetPointer( ) );
if( writer == NULL )
{
- this->m_Writer = _TImageWriter::New( );
- writer = dynamic_cast< _TImageWriter* >( this->m_Writer.GetPointer( ) );
+ this->m_RealProcessObject = _TWriter::New( );
+ writer =
+ dynamic_cast< _TWriter* >( this->m_RealProcessObject.GetPointer( ) );
} // fi
writer->SetFileName( fIt->second.second );
#define __CPPLUGINS__PLUGINS__IMAGEWRITER__H__
#include <cpPlugins/Plugins/cpPlugins_Export.h>
-#include <cpPlugins/Interface/SinkObject.h>
+#include <cpPlugins/Interface/ImageSink.h>
#include <itkProcessObject.h>
namespace cpPlugins
/**
*/
class cpPlugins_EXPORT ImageWriter
- : public cpPlugins::Interface::SinkObject
+ : public cpPlugins::Interface::ImageSink
{
public:
- typedef ImageWriter Self;
- typedef cpPlugins::Interface::SinkObject Superclass;
+ typedef ImageWriter Self;
+ typedef cpPlugins::Interface::ImageSink Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::TParameter TParameter;
typedef Superclass::TParameters TParameters;
public:
- ImageWriter( );
- virtual ~ImageWriter( );
+ itkNewMacro( Self );
+ itkTypeMacro( ImageWriter, cpPluginsInterfaceImageSink );
+ public:
virtual std::string GetClassName( ) const;
protected:
+ ImageWriter( );
+ virtual ~ImageWriter( );
+
virtual std::string _GenerateData( );
template< unsigned int D >
template< class P, unsigned int D >
std::string _GD1( );
- protected:
- itk::ProcessObject::Pointer m_Writer;
+ private:
+ // Purposely not implemented
+ ImageWriter( const Self& );
+ Self& operator=( const Self& );
};
// ---------------------------------------------------------------------
- PLUMA_INHERIT_PROVIDER( ImageWriter, cpPlugins::Interface::Object );
+ PLUMA_INHERIT_PROVIDER_CPPLUGINS(
+ ImageWriter,
+ cpPlugins::Interface::Object
+ );
} // ecapseman
#include <itkImage.h>
#include <itkRGBPixel.h>
+// -------------------------------------------------------------------------
+std::string cpPlugins::Plugins::MarchingCubes::
+GetClassName( ) const
+{
+ return( "cpPlugins::Plugins::MarchingCubes" );
+}
+
// -------------------------------------------------------------------------
cpPlugins::Plugins::MarchingCubes::
MarchingCubes( )
{
}
-// -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::MarchingCubes::
-GetClassName( ) const
-{
- return( "cpPlugins::Plugins::MarchingCubes" );
-}
-
// -------------------------------------------------------------------------
std::string cpPlugins::Plugins::MarchingCubes::
_GenerateData( )
public:
typedef MarchingCubes Self;
typedef cpPlugins::Interface::ImageToMeshFilter Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::TParameter TParameter;
typedef Superclass::TParameters TParameters;
public:
- MarchingCubes( );
- virtual ~MarchingCubes( );
+ itkNewMacro( Self );
+ itkTypeMacro( MarchingCubes, cpPluginsInterfaceImageToMeshFilter );
+ public:
virtual std::string GetClassName( ) const;
protected:
+ MarchingCubes( );
+ virtual ~MarchingCubes( );
+
virtual std::string _GenerateData( );
template< unsigned int D >
template< class P, unsigned int D >
std::string _GD1( );
- protected:
- /*
- itk::ProcessObject::Pointer m_Reader;
- */
+ private:
+ // Purposely not implemented
+ MarchingCubes( const Self& );
+ Self& operator=( const Self& );
};
// ---------------------------------------------------------------------
- PLUMA_INHERIT_PROVIDER( MarchingCubes, cpPlugins::Interface::Object );
+ PLUMA_INHERIT_PROVIDER_CPPLUGINS(
+ MarchingCubes,
+ cpPlugins::Interface::Object
+ );
} // ecapseman
#include <cpPlugins/Extensions/DataStructures/QuadEdgeMesh.h>
#include <cpPlugins/Extensions/IO/MeshReader.h>
+// -------------------------------------------------------------------------
+std::string cpPlugins::Plugins::MeshReader::
+GetClassName( ) const
+{
+ return( "cpPlugins::Plugins::MeshReader" );
+}
+
// -------------------------------------------------------------------------
cpPlugins::Plugins::MeshReader::
MeshReader( )
{
}
-// -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::MeshReader::
-GetClassName( ) const
-{
- return( "cpPlugins::Plugins::MeshReader" );
-}
-
// -------------------------------------------------------------------------
std::string cpPlugins::Plugins::MeshReader::
_GenerateData( )
typedef IO::MeshReader< _TMesh > _TReader;
_TReader* reader =
- dynamic_cast< _TReader* >( this->m_Reader.GetPointer( ) );
+ dynamic_cast< _TReader* >( this->m_RealProcessObject.GetPointer( ) );
if( reader == NULL )
{
- this->m_Reader = _TReader::New( );
- reader = dynamic_cast< _TReader* >( this->m_Reader.GetPointer( ) );
+ this->m_RealProcessObject = _TReader::New( );
+ reader =
+ dynamic_cast< _TReader* >( this->m_RealProcessObject.GetPointer( ) );
} // fi
reader->SetFileName( fIt->second.second );
#define __CPPLUGINS__PLUGINS__MESHREADER__H__
#include <cpPlugins/Plugins/cpPlugins_Export.h>
-#include <cpPlugins/Interface/SourceObject.h>
+#include <cpPlugins/Interface/MeshSource.h>
#include <itkProcessObject.h>
namespace cpPlugins
/**
*/
class cpPlugins_EXPORT MeshReader
- : public cpPlugins::Interface::SourceObject
+ : public cpPlugins::Interface::MeshSource
{
public:
- typedef MeshReader Self;
- typedef cpPlugins::Interface::SourceObject Superclass;
+ typedef MeshReader Self;
+ typedef cpPlugins::Interface::MeshSource Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::TParameter TParameter;
typedef Superclass::TParameters TParameters;
public:
- MeshReader( );
- virtual ~MeshReader( );
+ itkNewMacro( Self );
+ itkTypeMacro( MeshReader, cpPluginsInterfaceMeshSource );
+ public:
virtual std::string GetClassName( ) const;
protected:
+ MeshReader( );
+ virtual ~MeshReader( );
+
virtual std::string _GenerateData( );
template< unsigned int D >
template< class P, unsigned int D >
std::string _GD1( );
- protected:
- itk::ProcessObject::Pointer m_Reader;
+ private:
+ // Purposely not implemented
+ MeshReader( const Self& );
+ Self& operator=( const Self& );
};
// ---------------------------------------------------------------------
- PLUMA_INHERIT_PROVIDER( MeshReader, cpPlugins::Interface::Object );
+ PLUMA_INHERIT_PROVIDER_CPPLUGINS(
+ MeshReader,
+ cpPlugins::Interface::Object
+ );
} // ecapseman
#include <itkRGBPixel.h>
// -------------------------------------------------------------------------
-#define cpPlugins_RGBImageToHSVChannelsFilter_Dimension( r, d, o, f ) \
+#define cpPlugins_RGB2HSV_Dimension( r, d, o, f ) \
if( dynamic_cast< itk::ImageBase< d >* >( o ) != NULL ) \
r = this->f< d >( )
// -------------------------------------------------------------------------
-#define cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, p, d, o, f ) \
+#define cpPlugins_RGB2HSV_RGB( r, p, d, o, f ) \
if( \
dynamic_cast< itk::Image< itk::RGBPixel< p >, d >* >( o ) != NULL \
) \
r = this->f< p, d >( )
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::Plugins::RGBImageToHSVChannelsFilter::
+GetClassName( ) const
+{
+ return( "cpPlugins::Plugins::RGBImageToHSVChannelsFilter" );
+}
+
// -------------------------------------------------------------------------
cpPlugins::Plugins::RGBImageToHSVChannelsFilter::
RGBImageToHSVChannelsFilter( )
{
}
-// -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::RGBImageToHSVChannelsFilter::
-GetClassName( ) const
-{
- return( "cpPlugins::Plugins::RGBImageToHSVChannelsFilter" );
-}
-
// -------------------------------------------------------------------------
std::string cpPlugins::Plugins::RGBImageToHSVChannelsFilter::
_GenerateData( )
itk::DataObject* o = this->_GetInput( 0 );
std::string r = "cpPlugins::Plugins::RGBImageToHSVChannelsFilter: itk::Image dimension not supported.";
- cpPlugins_RGBImageToHSVChannelsFilter_Dimension( r, 1, o, _GD0 );
- else cpPlugins_RGBImageToHSVChannelsFilter_Dimension( r, 2, o, _GD0 );
- else cpPlugins_RGBImageToHSVChannelsFilter_Dimension( r, 3, o, _GD0 );
- else cpPlugins_RGBImageToHSVChannelsFilter_Dimension( r, 4, o, _GD0 );
+ cpPlugins_RGB2HSV_Dimension( r, 1, o, _GD0 );
+ else cpPlugins_RGB2HSV_Dimension( r, 2, o, _GD0 );
+ else cpPlugins_RGB2HSV_Dimension( r, 3, o, _GD0 );
+ else cpPlugins_RGB2HSV_Dimension( r, 4, o, _GD0 );
return( r );
}
dynamic_cast< itk::ImageBase< D >* >( this->_GetInput( 0 ) );
std::string r = "cpPlugins::Plugins::RGBImageToHSVChannelsFilter: itk::Image pixel type not supported";
- cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, char, D, i, _GD1 );
- else cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, short, D, i, _GD1 );
- else cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, int, D, i, _GD1 );
- else cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, long, D, i, _GD1 );
- else cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, unsigned char, D, i, _GD1 );
- else cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, unsigned short, D, i, _GD1 );
- else cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, unsigned int, D, i, _GD1 );
- else cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, unsigned long, D, i, _GD1 );
- else cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, float, D, i, _GD1 );
- else cpPlugins_RGBImageToHSVChannelsFilter_RGB( r, double, D, i, _GD1 );
+ cpPlugins_RGB2HSV_RGB( r, char, D, i, _GD1 );
+ else cpPlugins_RGB2HSV_RGB( r, short, D, i, _GD1 );
+ else cpPlugins_RGB2HSV_RGB( r, int, D, i, _GD1 );
+ else cpPlugins_RGB2HSV_RGB( r, long, D, i, _GD1 );
+ else cpPlugins_RGB2HSV_RGB( r, unsigned char, D, i, _GD1 );
+ else cpPlugins_RGB2HSV_RGB( r, unsigned short, D, i, _GD1 );
+ else cpPlugins_RGB2HSV_RGB( r, unsigned int, D, i, _GD1 );
+ else cpPlugins_RGB2HSV_RGB( r, unsigned long, D, i, _GD1 );
+ else cpPlugins_RGB2HSV_RGB( r, float, D, i, _GD1 );
+ else cpPlugins_RGB2HSV_RGB( r, double, D, i, _GD1 );
return( r );
}
// Filter creation
_TFilter* filter =
- dynamic_cast< _TFilter* >( this->m_Filter.GetPointer( ) );
+ dynamic_cast< _TFilter* >( this->m_RealProcessObject.GetPointer( ) );
if( filter == NULL )
{
- this->m_Filter = _TFilter::New( );
- filter = dynamic_cast< _TFilter* >( this->m_Filter.GetPointer( ) );
+ this->m_RealProcessObject = _TFilter::New( );
+ filter =
+ dynamic_cast< _TFilter* >( this->m_RealProcessObject.GetPointer( ) );
} // fi
filter->SetInput( dynamic_cast< _TImage* >( this->_GetInput( 0 ) ) );
#include <cpPlugins/Plugins/cpPlugins_Export.h>
#include <cpPlugins/Interface/ImageToImageFilter.h>
-#include <itkProcessObject.h>
namespace cpPlugins
{
public:
typedef RGBImageToHSVChannelsFilter Self;
typedef cpPlugins::Interface::ImageToImageFilter Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::TParameter TParameter;
typedef Superclass::TParameters TParameters;
public:
- RGBImageToHSVChannelsFilter( );
- virtual ~RGBImageToHSVChannelsFilter( );
+ itkNewMacro( Self );
+ itkTypeMacro(
+ RGBImageToHSVChannelsFilter,
+ cpPluginsInterfaceImageToImageFilter
+ );
+ public:
virtual std::string GetClassName( ) const;
protected:
+ RGBImageToHSVChannelsFilter( );
+ virtual ~RGBImageToHSVChannelsFilter( );
+
virtual std::string _GenerateData( );
template< unsigned int D >
template< class P, unsigned int D >
std::string _GD1( );
- protected:
- itk::ProcessObject::Pointer m_Filter;
+ private:
+ // Purposely not implemented
+ RGBImageToHSVChannelsFilter( const Self& );
+ Self& operator=( const Self& );
};
// ---------------------------------------------------------------------
- PLUMA_INHERIT_PROVIDER(
+ PLUMA_INHERIT_PROVIDER_CPPLUGINS(
RGBImageToHSVChannelsFilter,
cpPlugins::Interface::Object
);